TM1637 4-Digit 7-Segment Clock Display

Drive four bright 7-segment digits with just two MCU pins thanks to the TM1637 — the same chip behind dollar-store digital clocks, scoreboards, and timer modules.

Difficulty: Breadboard. Estimated build time: about 25 minutes. Estimated parts cost: about US$4.50. 4-line bill of materials. Compare supplier offers when available. A 4-digit numeric display that reads anything from a clock (with the famous flashing colon) to a temperature, lap counter, voltage reading, or score tally — and only costs two GPIO pins on your MCU.

Wire CLK and DIO

Connect VCC to 5 V (or 3.3 V — most modules tolerate both), GND to ground, CLK to any GPIO on your MCU, and DIO to any other GPIO. There is no MISO/MOSI here — DIO is bi-directional, but you'll only ever write to it for this project. The TM1637 modules already have current-limit resistors and decoupling capacitors built in, so no extra parts are needed on the breadboard.

Push the digit bytes

The TM1637 expects: a START condition (DIO falls while CLK is high), a command byte, eight data bytes (one per digit, then padding), and a STOP. Each digit byte is a 7-segment bitmap — bit 0 = segment a, bit 1 = b, etc., bit 7 = the colon dot. For a colon-on display of '12:34' you write 0x06, 0x5B, 0xCF (the 0x80 bit on the second digit turns the colon on), 0x66, 0x6D. Use the TM1637 library from your Arduino IDE — it does all the bit-banging for you and exposes a friendly displayInt() / showNumberDecEx() interface.

Animate the colon

For the classic clock-radio look, toggle the colon bit on and off every 500 ms while the digits update once a second. The chip also exposes a brightness register from 0 (off) through 8 (full) — call setBrightness() to dim the display for nighttime use. If you have a DS3231 RTC handy, read the hours and minutes from it instead of using millis() and you have a complete standalone clock that survives power loss.