ESP32 C3 Super Mini - TM1637 4-Digit 7-Segment Display
Learn how to connect a TM1637 4-digit 7-segment display to your ESP32 C3 Super Mini for displaying numbers, text, temperature, and time. This tutorial shows you how to control brightness, blink patterns, and individual digits using the simple 2-wire interface.
In this tutorial you will learn:
- What the TM1637 display module is and how it works with ESP32
- How to wire the TM1637 to the ESP32 C3 Super Mini
- How to display integers, text, temperature, and time
- How to control brightness and individual digits
- How to create blinking effects and animations

Hardware Preparation
| 1 | × | ESP32 C3 Super Mini | |
| 1 | × | USB Cable Type-A to Type-C (for USB-A PC) | |
| 1 | × | USB Cable Type-C to Type-C (for USB-C PC) | |
| 1 | × | TM1637 4-digit 7-segment Display (colon-separated) | |
| 1 | × | Jumper Wires |
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of the TM1637 Display Module
The TM1637 is an LED driver chip that controls four 7-segment digits using a simple 2-wire interface.
Key features and specifications:
- 4 digits with 7 segments plus decimal point each
- Built-in colon separator (between digits 1 and 2)
- 8 adjustable brightness levels (0-7)
- 2-wire serial interface (CLK and DIO)
- Works with both 3.3V and 5V logic levels
- Displays stay lit without constant refresh from microcontroller
- Perfect for clock displays, counters, and temperature readings
- Beginner-friendly with only two data pins to connect
TM1637 Pinout
The TM1637 module has four connection pins for power and communication.
- CLK: Clock signal input for synchronizing data
- DIO: Bidirectional data input/output pin
- VCC: Power supply (3.3V or 5V)
- GND: Ground connection
Wiring Diagram
Connect the TM1637 4-digit display to your ESP32 C3 Super Mini following this diagram.
- Note: Use 3.3V power output to match the ESP32 logic levels
| TM1637 Pin | ESP32 C3 Super Mini Pin |
|---|---|
| CLK | D8 |
| DIO | D9 |
| VCC | 3.3V |
| GND | GND |

This image is created using Fritzing. Click to enlarge image
Installing the TM1637 Library
Before uploading code, install the required library for the TM1637 display module.
- Open Arduino IDE: Launch the Arduino IDE on your computer
- Select Board: Choose ESP32 C3 Super Mini from the board list
- Open Library Manager: Click the Libraries icon in the left sidebar
- Search Library: Type "DIYables_4Digit7Segment_TM1637" in the search box
- Install: Click Install on the DIYables entry
- Verify: Library should appear in your installed libraries list
- Pro Tip: No additional dependencies needed - this library works standalone

Basic TM1637 Code Structure
Here's the minimum code needed to initialize and use the TM1637 display with your ESP32 C3 Super Mini.
This code demonstrates:
- Including the TM1637 library
- Defining CLK and DIO pins
- Creating a display object
- Initializing the display
- Showing a simple 4-digit number
Tutorial 1: Display Integer Numbers
Learn how to display various integer values on the TM1637, including positive numbers, negative numbers, and zero-padded values.
Quick Steps to Display Integers
- New to ESP32 C3 Mini? Complete our Getting Started with ESP32 C3 Mini tutorial first to set up your development environment.
- Wire the Module: Connect TM1637 to ESP32 C3 Super Mini following the wiring diagram above
- Connect USB: Plug your ESP32 C3 Super Mini into your computer using USB-C cable
- Open Arduino IDE: Launch Arduino IDE and select the correct board and port
- Copy Code: Paste the integer display sketch into Arduino IDE
- Upload: Click the Upload button to flash the code to your board
- Watch Display: Observe the different numbers appearing on the 7-segment display
- Open Serial Monitor: Set baud rate to 9600 to see status messages
- Pro Tip: Use print(number, true) to display numbers with leading zeros like "0042"
Serial Monitor Output
Integer Display Methods
| Method | Action | Syntax |
|---|---|---|
| print(int) | Display an integer (-999 to 9999) | display.print(1234) |
| print(int, true) | Display with leading zeros | display.print(42, true) |
| clear() | Clear all digits | display.clear() |
Tutorial 2: Display Text and Temperature
Display text strings and temperature values with degree symbols on your ESP32 C3 Super Mini TM1637 display.
Quick Steps to Display Text and Temperature
- Wire Module: Ensure TM1637 connections are secure
- Upload Sketch: Flash the text and temperature code to ESP32 C3 Super Mini
- Open Serial Monitor: Set baud rate to 9600
- Watch Messages: The display cycles through text and temperature readings
- Try Custom Text: Modify the code to display your own 4-character messages
- Pro Tip: The TM1637 can display letters like H, E, L, P, C, o, n, e - experiment with different words
Serial Monitor Output
Text and Temperature Methods
| Method | Action | Syntax |
|---|---|---|
| print(const char*) | Display text (up to 4 chars) | display.print("HELP") |
| printTemperature(int, char) | Display temperature with degree/unit | display.printTemperature(25, 'C') |
| DEGREE | Degree symbol constant | display.DEGREE |
Tutorial 3: Display Time with Blinking Colon
Create a digital clock display on your ESP32 C3 Super Mini with hours, minutes, and a blinking colon separator.
Quick Steps to Display Time
- Upload Code: Flash the time display sketch to your ESP32 C3 Super Mini
- Watch Display: Observe "12:30" with the colon blinking every 500 milliseconds
- Modify Time: Change the hour and minute values in the code
- Control Colon: Use the third parameter to manually control colon state
- Pro Tip: Use millis() and modulo arithmetic to create smooth 1-second blink intervals
Serial Monitor Output
Time Display Methods
| Method | Action | Syntax | |
|---|---|---|---|
| printTime(int, int) | Display time HH | MM with colon | display.printTime(12, 30) |
| printTime(int, int, bool) | Display time, control colon state | display.printTime(12, 30, false) |
Tutorial 4: Blink the Display
Create attention-grabbing blinking effects by turning the ESP32 C3 Super Mini TM1637 display on and off while preserving the content.
Quick Steps to Blink Display
- Upload Sketch: Flash the blink demo code to your board
- Watch Pattern: "1234" blinks five times, then "HELP" blinks five times
- Adjust Speed: Change the delay values to control blink rate
- Try Brightness: Combine blinking with different brightness levels
- Pro Tip: The display content stays in memory when you call off() - no need to resend data
Serial Monitor Output
Blink and Brightness Methods
| Method | Action | Syntax |
|---|---|---|
| off() | Turn display off (data preserved) | display.off() |
| on() | Turn display back on | display.on() |
| setBrightness(int) | Set brightness 0-7 | display.setBrightness(4) |
Tutorial 5: Individual Digit Control
Control each digit position independently on your ESP32 C3 Super Mini TM1637 display for custom animations and patterns.
Quick Steps for Individual Digit Control
- Upload Code: Flash the individual digit control sketch
- Watch Patterns: Observe different combinations appearing on each digit
- Try Custom Patterns: Use setSegments() for complete control over each segment
- Create Animations: Update individual digits in sequence for scrolling effects
- Pro Tip: Digit positions are 0-3 from left to right - use loops to create smooth animations
Serial Monitor Output
Individual Digit Control Methods
| Method | Action | Syntax |
|---|---|---|
| setNumber(int, int) | Set digit 0-9 at position 0-3 | display.setNumber(0, 1) |
| setChar(int, char) | Set character at position 0-3 | display.setChar(0, 'H') |
| setColon(bool) | Control colon on/off | display.setColon(true) |
| setSegments(int, uint8_t) | Set raw segments at position 0-3 | display.setSegments(0, 0x76) |
Troubleshooting TM1637 Display Issues
Common problems when using the TM1637 4-digit display with ESP32 C3 Super Mini and their solutions.
| Issue | Possible Cause | Resolution |
|---|---|---|
| Display is blank | Wrong wiring or pin numbers | Verify CLK/DIO connections match code and VCC goes to 3.3V |
| Wrong characters | CLK and DIO swapped | Switch the two signal wires |
| Display too dim | Low brightness setting | Call setBrightness(7) for maximum |
| Library not found | Not installed | Install DIYables_4Digit7Segment_TM1637 from Library Manager |
| Upload fails | Board in wrong mode | Hold the BOOT button while pressing RESET, then retry upload |
| Flickering display | Loose connections | Check all wire connections and reseat jumper wires |
| Random characters | Electrical noise | Add 100nF capacitor between VCC and GND near module |
Real-World Applications
Use your ESP32 C3 Super Mini TM1637 display project in these practical applications.
- Build a digital countdown timer for cooking or workouts
- Create a temperature monitor that displays current room temperature
- Make a lap timer for races or gaming sessions
- Design a visitor counter for your home or office
- Build a voltage/current display for power monitoring projects
- Create a score keeper for games and competitions
- Make a real-time clock with WiFi time synchronization using ESP32
Video Tutorial
Watch the video below for a visual walkthrough of this project.
...VIDEO ...VIDEO
Challenge Yourself
Take your ESP32 C3 Super Mini TM1637 skills to the next level with these project challenges.
- Easy: Add a button to cycle through different display modes (time, temperature, counter)
- Easy: Create a stopwatch with start/stop button control
- Medium: Build a countdown timer that beeps when reaching zero using a buzzer
- Medium: Display WiFi signal strength as a number using ESP32 wireless capabilities
- Advanced: Create a scrolling text display that shows messages longer than 4 characters
- Advanced: Build a thermometer using DHT22 sensor with ESP32 C3 Super Mini and TM1637 display
- Advanced: Make a real-time clock that syncs with NTP servers over WiFi
Platform Compatibility
The DIYables_4Digit7Segment_TM1637 library works across all Arduino-compatible platforms including ESP32, ESP8266, Arduino Uno, Nano, Mega, and more (architectures=*).