Wiring guide

How to wire a TM1637 display to an Arduino Uno

To wire a TM1637 display to an Arduino Uno, 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 Uno’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
Arduino Uno · TM1637 displaylive0.000 s 0.00x
Click to open it in the editor
The circuit itself, running on the simulator with the sketch below. Press what can be pressed; click anything else to open it in the editor.
Pin to pin

TM1637 display to Arduino Uno 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 pinArduino Uno pinWire colorWhy
VCC5VredThe TM1637 runs from 3.3 to 5 V; brighter at 5 V.
GNDGNDblueCommon ground.
CLKpin 2cyanClock. Any digital pin: it is not I2C, despite looking like it.
DIOpin 3violetData, both directions.
Voltage

Power and logic levels for TM1637 display and Arduino Uno

Logic level

The Arduino Uno’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 Uno’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 Uno’s own level.

Pins to leave alone

Pins 0 and 1 are the USB serial port on a real Uno, so anything wired there fights the upload and the serial monitor. Pin 13 carries the onboard LED.

The sketch

The working code for the Arduino Uno

Library: TM1637Display (TM1637Display.h). This is the sketch the circuit above runs.

TM1637 clock on Arduino Uno
#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);
}
Output

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:

Counting
Pitfalls

Common mistakes wiring a TM1637 display to an Arduino Uno

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.

Using pins 0 and 1

Pins 0 and 1 carry the USB serial port on a real Uno. CLK or DIO wired there fights every upload and every Serial.print(). Start at pin 2.

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.