How to wire a TM1637 display to an Arduino Nano
To wire a TM1637 display to an Arduino Nano, connect VCC to 5V, GND to GND, CLK to pin 2 and DIO to pin 3. The module runs from 5 V and its CLK and DIO lines idle at 5 V through the module’s pull-ups, the Arduino Nano’s own level. The sketch below uses the TM1637Display (TM1637Display.h) library. It counts up on the four digits of the display.
- 5 V logic
- Library: TM1637Display.h
- 4 wires
TM1637 display to Arduino Nano wiring table
Every wire in the circuit above, with the part’s pin names and the board’s own labels. The wire colors are the ones the circuit uses; on a real bench any colors work.
| TM1637 display pin | Arduino Nano pin | Wire color | Why |
|---|---|---|---|
| VCC | 5V | red | The TM1637 runs from 3.3 to 5 V; brighter at 5 V. |
| GND | GND | blue | Common ground. |
| CLK | pin 2 | cyan | Clock. Any digital pin: it is not I2C, despite looking like it. |
| DIO | pin 3 | violet | Data, both directions. |
Power and logic levels for TM1637 display and Arduino Nano
Logic level
The Arduino Nano’s pins are 5 V logic. A 5 V part can drive them directly; a part whose signal pins are limited to 3.3 V needs a level shifter.
Supply
The TM1637 display takes 5 V from 5V. That is the Arduino Nano’s 5 V rail, so the part shares the current the board can supply.
This pair
The module runs from 5V and its CLK and DIO lines idle at 5 V through the module’s pull-ups, the Arduino Nano’s own level.
Pins to leave alone
A6 and A7 are analog only: pinMode(A6, OUTPUT) does nothing and digitalRead(A7) is not there to call. D0 and D1 are the USB serial port.
The working code for the Arduino Nano
Library: TM1637Display (TM1637Display.h). This is the sketch the circuit above runs.
#include <TM1637Display.h>
const int CLK_PIN = 2; // pin 2
const int DIO_PIN = 3; // pin 3
TM1637Display display(CLK_PIN, DIO_PIN);
void setup() {
Serial.begin(9600);
display.setBrightness(4); // 0 to 7
Serial.println("Counting");
}
void loop() {
// Minutes and seconds since reset, with the colon on.
unsigned long s = millis() / 1000;
int mmss = (s / 60) % 100 * 100 + s % 60;
display.showNumberDecEx(mmss, 0b01000000, true);
delay(200);
}
What you should see
The four digits count up. The serial monitor, at 9600 baud, prints Counting once. The module takes two data pins, CLK and DIO, and these are not I2C even though there are two of them.
A dark display with the supply connected usually means CLK and DIO are swapped or on pins other than the ones the sketch names.
The serial monitor prints this, recorded from the circuit above running:
CountingCommon mistakes wiring a TM1637 display to an Arduino Nano
Wiring CLK and DIO to the I2C pins
The protocol looks like I2C but is not; it has no address and the Wire library cannot talk to it. Any two digital pins work, and leaving pin A4 and pin A5 free keeps them for a real I2C part.
Expecting decimal points
Most TM1637 clock modules wire only the colon, not the dots under each digit. The dots argument lights them on modules that have them, and the colon on these.
Picking A6 or A7
A6 and A7 look like the other analog pins but are inputs to the ADC and nothing else. CLK or DIO on either of them never sees a digital level. Any of D2 to D13 or A0 to A5 works.
Build your own TM1637 display project
Open this circuit in the editor, change the wiring or the code, and keep your version in a free account.