Arduino TM1637Display Library: Wiring, Code and Simulator

To build this Arduino TM1637Display Library project you need an Arduino Uno and a TM1637 4-digit display. Two pins drive a 4-digit display with the TM1637 library. Make the 4 connections in the wiring table, upload the Arduino C++ code, and show millis() / 1000 in the loop to make a seconds counter.

Open this circuit in the free Arduino Uno simulator

Parts list

QtyPartWhat it does
1Arduino Unothe microcontroller board
1TM1637 4-digit displayFour digits on two wires, CLK and DIO (LSB first, ACK after each byte). 0x40, then 0xC0 and four segment bytes, then 0x8F to switch on.

Wiring

#FromTo
1Arduino Uno pin 2TM1637 4-digit display CLK
2Arduino Uno pin 3TM1637 4-digit display DIO
3Arduino Uno 5VTM1637 4-digit display VCC
4Arduino Uno GNDTM1637 4-digit display GND

Step by step

  1. Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the Arduino Uno. No install or account is needed.
  2. Add the parts. Add a TM1637 4-digit display from the parts palette.
  3. Wire 1. Connect Arduino Uno pin 2 to TM1637 4-digit display CLK.
  4. Wire 2. Connect Arduino Uno pin 3 to TM1637 4-digit display DIO.
  5. Wire 3. Connect Arduino Uno 5V to TM1637 4-digit display VCC.
  6. Wire 4. Connect Arduino Uno GND to TM1637 4-digit display GND.
  7. Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
  8. Run it. Press Run. Show millis() / 1000 in the loop to make a seconds counter.

Arduino C++ code

// TM1637 (Avishay Orpaz): a 4-digit display on two pins, CLK 2 and DIO 3.
#include <TM1637Display.h>

TM1637Display display(2, 3);

void setup() {
  display.setBrightness(7);
  display.showNumberDec(1234);
}

void loop() {}

What to try

Show millis() / 1000 in the loop to make a seconds counter.

Frequently asked questions

How do I wire the TM1637Display Library project on an Arduino Uno?

Make 4 connections: Arduino Uno pin 2 to TM1637 4-digit display CLK; Arduino Uno pin 3 to TM1637 4-digit display DIO; Arduino Uno 5V to TM1637 4-digit display VCC; Arduino Uno GND to TM1637 4-digit display GND.

What parts do I need for this Arduino project?

An Arduino Uno and a TM1637 4-digit display.

Can I simulate this Arduino project online for free?

Yes. The BitForBytes Embedded Lab runs this exact circuit and Arduino C++ code in your browser for free, with no install and no hardware. The sketch is compiled with the real Arduino toolchain and runs on an emulated ATmega328P.

What does the code do?

Two pins drive a 4-digit display with the TM1637 library.

More Arduino Uno projects