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
| Qty | Part | What it does |
|---|---|---|
| 1 | Arduino Uno | the microcontroller board |
| 1 | TM1637 4-digit display | Four 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
| # | From | To |
|---|---|---|
| 1 | Arduino Uno pin 2 | TM1637 4-digit display CLK |
| 2 | Arduino Uno pin 3 | TM1637 4-digit display DIO |
| 3 | Arduino Uno 5V | TM1637 4-digit display VCC |
| 4 | Arduino Uno GND | TM1637 4-digit display GND |
Step by step
- Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the Arduino Uno. No install or account is needed.
- Add the parts. Add a TM1637 4-digit display from the parts palette.
- Wire 1. Connect Arduino Uno pin 2 to TM1637 4-digit display CLK.
- Wire 2. Connect Arduino Uno pin 3 to TM1637 4-digit display DIO.
- Wire 3. Connect Arduino Uno 5V to TM1637 4-digit display VCC.
- Wire 4. Connect Arduino Uno GND to TM1637 4-digit display GND.
- Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
- 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
- Arduino LED Blink: Wiring, Code and Simulator
- Arduino LDR Light Sensor: Wiring, Code and Simulator
- Arduino NTC Thermistor Thermometer: Wiring, Code and Simulator
- Arduino PWM to Analog RC Filter: Wiring, Code and Simulator
- Arduino Capacitance Meter: Wiring, Code and Simulator
- Arduino DC Motor PWM Speed Control with MOSFET: Wiring, Code and Simulator