TM1637 4Digit Display

Z2M Part: EMA-00007-A

Display numbers on TM1637 4-digit 7-segment module.

Circuit Diagram
Circuit diagram for TM1637 4Digit Display
Wire Connections & Pin Configuration

Wire Color Connections:

Blue → Pin 2 to TM1637 CLK
Green → Pin 3 to TM1637 DIO
Red → 5V to TM1637 VCC
Black → GND to TM1637 GND

Pin Configuration:

Arduino Digital Pin 2 → TM1637 CLK
Arduino Digital Pin 3 → TM1637 DIO
Arduino 5V → TM1637 VCC
Arduino GND → TM1637 GND
Arduino Code
Edit
#include <TM1637Display.h>

/* Define the connection pins */
#define CLK 2
#define DIO 3

/* Create display object */
TM1637Display display = TM1637Display(CLK, DIO);

/* Create degree Celsius symbol */
const uint8_t celsius[] = {
  SEG_A | SEG_B | SEG_F | SEG_G,  // Circle for degree symbol
  SEG_A | SEG_D | SEG_E | SEG_F   // C
};

void setup() {
  /* Clear the display */
  display.clear();
  delay(1000);
}

void loop() {
  /* Set brightness (0–7) */
  display.setBrightness(4);

  /* Show counter from 0 to 100 */
  for (int i = 0; i <= 100; i++) {
    display.showNumberDec(i);
    delay(50);
  }

  delay(1000);
  display.clear();

  /* Display temperature as example */
  int temperature = 24;

  /*
    display.showNumberDec(arg_1, arg_2, arg_3, arg_4)
      arg_1 -> Number of type integer (up to 9999)
      arg_2 -> True/false: Display leading zeroes
      arg_3 -> Number of digits to display
      arg_4 -> Position of the least significant digit (0 = leftmost)
  */
  display.showNumberDec(temperature, false, 2, 0);

  /*
    display.setSegments(arg_1, arg_2, arg_3)
      arg_1 -> Segment information
      arg_2 -> Number of digits to modify (0–4)
      arg_3 -> Position from which to print (0 = leftmost)
  */
  display.setSegments(celsius, 2, 2);

  delay(1000);

  /* Stop program */
  while (1);
}

Instruction Details

Wiring: Connect TM1637 CLK to Digital Pin 2, DIO to Digital Pin 3. Connect VCC to 5V and GND to GND.
Library: Sketch → Include Library → Manage Libraries → search "TM1637" → Install.
Upload Code: Tools → Board → Arduino Uno. Tools → Port → select your COM port. Click Upload button.
View Output: 4-digit display shows count and temperature. Supports custom characters and clock format.

How to Use

  1. Connect the required components as per the Pin Configuration above
  2. Open Arduino IDE and create a new sketch
  3. Copy and paste the code above
  4. Select your Arduino board and COM port from Tools menu
  5. Click the Upload button to upload the code to your Arduino
  6. Open Serial Monitor (if applicable) to see the output

Components Required

  • Arduino Uno
  • TM1637 4-Digit 7-Segment Display Module
  • Breadboard
  • Jumper Wires

Category: LEDs & Display