Skip to content
Home > Components > Displays > TM1637 Display

TM1637 4-Digit Display

A classic 7-segment display module containing four digits and a center colon, perfect for digital clocks and counters.

Component Preview

TM1637 4-Digit DisplayTM1637 Module

Driving four 7-segment digits directly would require 12+ pins on a microcontroller. The TM1637 driver chip simplifies this by handling all the LED multiplexing internally, allowing you to control the entire display using just two standard digital pins (CLK and DIO).

Displays7-SegmentI2C-Like

Overview

While the protocol looks similar to I2C (using a clock and data line), it is actually a proprietary serial protocol. You cannot connect it to a standard I2C bus with other I2C devices; you must use dedicated digital pins.

Pin Reference

PinTypeDescription
CLKdigitalClock Input. Connect to any digital pin.
DIOdigitalData I/O. Connect to any digital pin.
VCCpower5V Power Supply.
GNDpowerGround.

Configurable Attributes

AttributeTypeDefaultDescription
colorstring"red"Color of the LED segments (e.g., "red", "green", "blue").

Wiring Diagram

Connect the TM1637 display to the Arduino using two digital pins.

Wiring Diagram

Example Arduino Code

This code uses the popular TM1637Display library to show numbers and toggle the center colon.

cpp
#include <TM1637Display.h>

// Module connection pins (Digital Pins)
#define CLK 2
#define DIO 3

TM1637Display display(CLK, DIO);

void setup() {
  Serial.begin(9600);
  
  // Set the brightness (0 = min, 7 = max)
  display.setBrightness(0x0f);
  
  Serial.println("TM1637 Display Ready.");
}

void loop() {
  // Display a number without the center colon
  display.showNumberDec(1234, false); // Expect: "1234"
  delay(1000);
  
  // Display a time-like number with the center colon ON
  // The second parameter 'true' enables leading zeros
  // The third parameter '2' is the length, fourth is the position
  // To simply turn on the colon (0x40 is the colon bitmask in some libraries)
  display.showNumberDecEx(1234, 0b01000000, true); // Expect "12:34"
  delay(1000);
  
  // Clear the display
  display.clear();
  delay(500);
}

Simulation Notes

  • The OpenHW Simulator fully models the TM1637 internal registers. It behaves exactly like the real hardware when driven by standard Arduino libraries.

Released under the MIT License.