
TM1637 7-Segment Display Library for Proteus V1.0 (4-Digit Module)

Hello friends, I hope you all are doing great. Today, I am going to share the new TM1637 7-Segment Display Library for Proteus V1.0. The small blue board with a red "88:88" display is the cheapest way to put a clock, a timer or a counter on an Arduino: four digits, a colon, only two wires and one line of code with the TM1637Display library. Now this TM1637 4-digit display module is ready for your Proteus simulations too, every segment glowing as on the real board.
Behind the digits sits our own model of the TM1637, written from the Titan Micro datasheet: the 2-wire bus with its START, STOP and ACK, the data, address and display-control commands, the eight brightness steps, the open-drain lines with the board's pull-ups, and the digit order of the real module, where the first address is the leftmost digit and the colon is a bit of the second one. You get two devices, a Simple one with a live STATUS panel and an Advance one with a pop-up window and four test tools, and the demo runs TM1637Display on our Arduino UNO V4.0 with its serial monitor built into the board.
NOTICE: the TM1637 is famous for one surprise: the wiring is right, the code compiles, and the display stays dark. We built this model so you can see why on the screen, and we checked it against the real TM1637Display library, frame by frame. It took our team a lot of hard work. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the LCD Library board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the TM1637 7-Segment Display Library for Proteus V1.0:
What is a TM1637 4-Digit 7-Segment Display Module?
The TM1637 is an LED driver from Titan Micro Electronics. It multiplexes up to six digits of a common-anode 7-segment display, sets their brightness in eight steps and even scans a small keypad. It talks over two lines, CLK and DIO. The bus looks a little like I2C: a frame starts when DIO falls while CLK is high (START) and ends when DIO rises while CLK is high (STOP), and the chip acknowledges each byte by pulling DIO low for one clock. But it has no address and it sends the bits LSB first, so it is not I2C and the Wire library cannot talk to it.
The module everybody buys is a blue board of about 42 x 24 mm with a 0.36" red "88:88" clock display, the TM1637 and two 10 kohm pull-up resistors on the back, and a 4-pin header on the left edge: CLK, DIO, VCC and GND.
| TM1637 4-digit display module | |
|---|---|
| Driver | TM1637 (on the back) |
| Display | 0.36" 4-digit, red, with the colon (88:88) |
| Board | about 42 x 24 mm, four M2 mounting holes |
| Digit order | address C0H = the LEFTMOST digit, C3H = the rightmost |
| Segments | A-G = bits 0-6; bit 7 of the second digit = the colon |
| Header | CLK, DIO, VCC, GND (left edge) |
| Devices in this library | TM1637TEP (Simple) / TM1637ADVTEP (Advance) |
The TM1637 Commands
| First byte | Command | What it does |
|---|---|---|
| 40 | DATA (write, auto-increment) | The next display bytes go to consecutive addresses |
| 44 | DATA (write, fixed address) | Every byte needs its own address command |
| 42 | DATA (read keys) | The chip sends its key scan (no keys on this module) |
| C0 - C5 | ADDRESS | Followed by the display bytes, starting at this digit |
| 88 - 8F | DISPLAY CONTROL, on | Display on, brightness 0 - 7 (pulse width 1/16 ... 14/16) |
| 80 - 87 | DISPLAY CONTROL, off | Display off; the digits stay in the RAM |
How TM1637Display Drives the Two Wires
Both lines are open-drain: nobody ever drives them high. The library sets the pin's output latch to LOW once, and from then on it only switches the pin between OUTPUT, which pulls the line low, and INPUT, which lets the module's 10 kohm pull-up raise it. A START is "DIO to OUTPUT while CLK is released"; a STOP is "CLK released, then DIO released". Every bit takes three steps of 100 us (CLK low, set DIO, CLK released), so the bus runs at a few kHz, far below the 500 kHz the TM1637 accepts.
After the eighth bit the library releases DIO and clocks once more. If the TM1637 heard the byte, it holds DIO low during that clock: the ACK. In our model the board's pull-ups are a weak high on both lines and the ACK is a strong low, so the simulated ATmega328P reads exactly what it reads on a real module, and a bus where nobody answers stays high.
What's New in TM1637 7-Segment Display Library for Proteus V1.0
- The real module: the blue board with the "88:88" display, the header on the left and the four mounting holes, drawn at 2 x its real size.
- Our TM1637 model from the datasheet: START, STOP, the bytes LSB first with the ACK, the data, address and display-control commands, auto-increment and fixed addressing, the power-up state.
- Open-drain lines: the board's pull-ups on CLK and DIO, exactly as TM1637Display expects them.
- Real digits: slanted segments and the colon, as bright as the eight pulse widths make them, in red, green, blue, yellow or white.
- The classic mistakes on screen: a dark display when setBrightness() is missing, CLK and DIO swapped, a key read on a module without keys.
- Four test tools on the Advance device: Init check, 2-wire bus, Digits and Power.
- A TM1637Display demo on our Arduino UNO V4.0: a counter, a clock with a blinking colon, numbers, text and commands for every setting.
- A compact package: about 1.23 MB, without the C++ source code.
Two Devices: Simple and Advance
| Simple | Advance | |
|---|---|---|
| Device | TM1637TEP | TM1637ADVTEP |
| On the schematic | The module + the STATUS panel | The module only |
| Status | Banner, 10 readouts, the last 6 frames | A pop-up window: Display, Bus log, Tests |
| Test tools | - | Init check, 2-wire bus, Digits, Power |
Download TM1637 7-Segment Display Library for Proteus
Click the button below to download TM1637-7-Segment-Display-Library-for-Proteus-v1.0.zip (about 1.23 MB, without the C++ source code):
TM1637 7-Segment Display Library for Proteus V1.0- README.txt: the devices, installation, the demo, wiring, the test tools and real hardware.
- Proteus Library Files:
TEPTM1637.LIBandArduinoV4TEP.LIBfrom our Arduino Library for Proteus V4.0. - Proteus Model Files:
TEPTM1637.DLLandTEPARDUINO.DLL. - Proteus Simulation:
TM1637-Display-ArduinoUnoV4.pdsprj,TM1637_Demo.hexand copies of both DLLs. - Arduino Code:
TM1637_Demo.ino(needs "TM1637" by Avishay Orpaz from the Library Manager).
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install TM1637 7-Segment Display Library for Proteus
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the two files from Proteus Library Files into the LIBRARY folder of Proteus (usually
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY). - Copy
TEPTM1637.DLLandTEPARDUINO.DLLfrom Proteus Model Files into the MODELS folder. - Delete
TEPTM1637.IDXfrom the LIBRARY folder if there is one. - Start Proteus, press P and search for TM1637: the two devices show up.
Tip: keep the Proteus Simulation folder together, because the project needs its .hex file and the DLLs beside it. The library is tested in Proteus 8.5; Proteus 7 is not supported.
The TM1637 Module in Proteus
The module is drawn at 2 x its real size, which keeps its header pins on the Proteus grid. While the simulation runs, each segment and the colon glow on their own, slanted like the real 0.36" digits. Under the board, a TEP strip holds the SIMPLE / ADVANCE badge, a PWR LED, a DATA LED that flashes on every frame, the LED COLOUR selector and the panel button. The strip, its LEDs and the panels are TEP additions; a real module has none of them.
Pinout
| Pin | Function | Arduino UNO (demo) |
|---|---|---|
| CLK | The clock: open-drain, pulled up on the board | D2 |
| DIO | Data in and out: open-drain, pulled up on the board; the TM1637 pulls it low for the ACK | D3 |
| VCC | The supply, 3.3 - 5 V | 5V |
| GND | Ground | GND |
| Property | Values | What it does |
|---|---|---|
| PANEL | OPEN (default), CLOSED | Simple device only: the STATUS panel at the start |
| COLOUR | RED (default), GREEN, BLUE, YELLOW, WHITE | The digit colour; the selector on the strip changes it at Run |
Digits, Colon and Text: How the TM1637 Shows Them
The TM1637 has six bytes of display RAM, one per digit, starting at address C0H. On this module C0H is the leftmost digit and C3H the rightmost; C4H and C5H are there for 6-digit boards but not wired here. Each byte lights one segment per bit: bit 0 is segment A, bit 6 is segment G. Bit 7 of the second digit is the colon.
TM1637Display does the encoding for you. A whole update is three frames: the data command 40, the address C0 with the four digit bytes, and the display control with the brightness. Numbers are right-aligned:
display.showNumberDec(counter); // right-aligned, no leading zeros
For anything else, the demo builds the segments itself with the library's SEG_A to SEG_G names and sends them with setSegments():
case 'H': return SEG_B | SEG_C | SEG_E | SEG_F | SEG_G;
The colon is bit 7 of the second digit, so showNumberDecEx() takes it as the "dots" argument 0b01000000. The demo's clock switches it every second:
display.showNumberDecEx(hhmm, colon ? 0b01000000 : 0, true); // 0b01000000 = the colon
Brightness and Display On / Off
The display control byte carries two things: the on / off bit and the brightness, a pulse width from 1/16 to 14/16 in eight steps. TM1637Display stores both with setBrightness() and sends them with the next digits:
display.setBrightness(brightness, displayOn); // stored, sent with the next digits
The Dark TM1637: setBrightness() Is Not Optional
Here is the trap. TM1637Display sends its brightness byte with every update, and that byte starts at 0, which means "display off". A sketch that never calls setBrightness() writes the digits perfectly and still shows nothing. The demo's start-up therefore begins with it:
display.setBrightness(brightness); // without this the display stays dark
The demo's NOBRIGHT command shows the mistake with a second TM1637Display object that never got a brightness:
static TM1637Display forgot(CLK_PIN, DIO_PIN); // no setBrightness(): its brightness byte stays 0 = display off
CLK and DIO Swapped
Swap the two wires, or the two pins in the constructor, and every frame turns into nonsense for the TM1637: STARTs and STOPs in the wrong places and bytes cut in half. The demo's SWAP command uses a TM1637Display made the wrong way round:
static TM1637Display swapped(DIO_PIN, CLK_PIN); // CLK and DIO the wrong way round
TM1637 Simple: The STATUS Panel
Under the Simple device a live TM1637 STATUS panel shows the banner (READY with what the digits read, or the problem in amber or red), ten readouts - DISPLAY, BRIGHTNESS, MODE, ADDRESS, COLON, VCC, CLOCK, FRAMES, SEGMENTS ON and CURRENT - and the last six frames. The red X closes the panel; PANEL on the strip opens it again.
TM1637 Advance: The Pop-Up Window
The Advance device opens a TEP pop-up window at Run with three pages. The Display page (above) shows the digits in large with their addresses, eight tiles - display, brightness, mode, colon, segments lit, current, colour and what the digits read - the display RAM and the latest frames.
The Bus Log Page
In normal use you see the same three frames every update: DATA 40, ADDRESS C0 with the four digit bytes, and DISPLAY 8F (on, 14/16). Filter it to the digit writes, the control frames or the problems only; Pause freezes the list.
Four Test Tools for the TM1637
1. Init Check
The start-up against the datasheet: the frames, the display control, the brightness, the data command and the digits written, a verdict, then the first frames as the sketch sent them.
2. 2-Wire Bus
Good for a dark or garbled display: the clock against the TM1637's 500 kHz, bytes cut by a START or STOP, frames that do not start with a TM1637 command, clocks outside frames and key reads. TM1637Display waits 100 us between the steps of every bit, so its clock is only a few kHz, which the TM1637 handles easily.
3. Digits
Good for wrong characters, digits in the wrong place or a missing colon: which address drives each position, the segments as letters and a note when bit 7 is set on a digit without a point.
4. Power
Each lit segment gets about 20 mA while its grid is on, and the TM1637 scans six grids, so a segment averages the pulse width / 6 of that. "88:88" at brightness 7 draws about 90 mA, easy for an Arduino.
TM1637 Display with Arduino in Proteus
Open TM1637-Display-ArduinoUnoV4.pdsprj. Two Arduino UNO V4.0 boards from our Arduino UNO Library for Proteus V4.0 run the same sketch: with D4 open it counts, with D4 tied to GND (ARD2) it starts as a clock. The monitors are built into the boards; our Introduction to Arduino UNO explains the pins.
Wiring
TM1637Display drives the pins itself, so any two pins work; the demo uses D2 for CLK and D3 for DIO, as most TM1637 examples do. VCC goes to 5V. The pull-ups are on the module, so nothing else is needed.
The Arduino Code
The sketch uses the TM1637Display library 1.2.0 by Avishay Orpaz:
#include <TM1637Display.h>
One object for the module, with the CLK and DIO pins:
TM1637Display display(CLK_PIN, DIO_PIN); // CLK, DIO
D4 decides what the sketch starts with:
if (digitalRead(MODE_PIN) == LOW) { mode = CLOCK; colon = true; }
The loop counts every 100 ms and refreshes the clock once a second. A full update of the four digits takes about 20 ms of bus time at TM1637Display's pace, so the counter keeps up easily:
if (mode == COUNT && millis() - lastTick >= 100) {
The colon of the clock simply follows the seconds:
colon = !(lastSecond % 2); // the colon blinks: on in the even seconds
To change the sketch, export a new HEX and load it into the UNO; see How to get the HEX file from Arduino. New to Arduino? Start with our Arduino Tutorial for Beginners.
Serial Monitor Commands
| Command | What it does |
|---|---|
| HELP / STATUS | The command list / the mode, the display, the brightness, on / off |
| COUNT / CLOCK [hh:mm] | The counter 0 - 9999 / the clock HH:MM with the colon blinking |
| NUMBER <n> / TEXT <text> | A number right-aligned / four characters |
| BRIGHT <0-7> / OFF / ON | The brightness / display off and on |
| COLON ON|OFF | The colon |
| NOBRIGHT / SWAP | The two classic mistakes: no setBrightness(), CLK and DIO swapped |
How to Run the Demo
- Press Run; move the monitor windows and TM2's pop-up aside.
- In ARD1's monitor type STATUS, NUMBER -123, TEXT HELP, NUMBER 1234, COLON ON, BRIGHT 1 and BRIGHT 7.
- Try the mistakes: NOBRIGHT (then BRIGHT 7) and SWAP (then BRIGHT 7).
- In ARD2's monitor type CLOCK 23:59 and watch midnight; on TM2 open Tests and look at every tool.
TM1637 Proteus Simulation Results
The Built-in Serial Monitor in Its Simple Interface
Each Arduino UNO V4.0 carries our TEP Serial Monitor Advance, wired inside the board to D0 / D1. The screenshots show its Simple interface (Ctrl+Shift+U; Esc for the full view). Read all about it in TEP Serial Monitor Advance for Proteus.
ARD1: STATUS
TM1637 4-Digit Display V1.0 demo - The Engineering Projects
TM1637 ready, counter
Type HELP for the commands
STATUS
Mode: count
Display: 78
Brightness 7, display on
ARD1: The Settings and the Mistakes
COLON ON
OK - colon on
OFF
OK - display off
ON
OK - display on
NOBRIGHT
OK - 1234, no setBrightness(): dark (BRIGHT 7 fixes it)
BRIGHT 7
OK - brightness 7
SWAP
OK - 1234 with CLK and DIO swapped: nothing a TM1637 understands
ARD2: The Clock
TM1637 ready, clock
Type HELP for the commands
NOBRIGHT
OK - 1234, no setBrightness(): dark (BRIGHT 7 fixes it)
BRIGHT 7
OK - brightness 7
SWAP
OK - 1234 with CLK and DIO swapped: nothing a TM1637 understands
BRIGHT 7
OK - brightness 7
CLOCK 23:59
OK - clock 23:59
The Simulation Log
Each module writes a few lines to the simulation log: which board it is, the power-up state (display off), the first reading with the brightness and the mode, and one line the first time each classic mistake happens. Nothing repeats, so the log stays readable in a long run.
Troubleshooting
- Dark digits with the PWR LED off: no power - check VCC and GND.
- DARK - NOTHING ON THE BUS YET: check CLK on D2 and DIO on D3, and the pins in
TM1637Display display(CLK, DIO). - DARK - DISPLAY OFF: CALL setBrightness(): the sketch never set a brightness, or set the display off.
- BAD FRAMES - CLK AND DIO SWAPPED?: swap the wires or the pins in the sketch.
- No colon: it is bit 7 of the SECOND digit -
showNumberDecEx(n, 0b01000000). - A Wire / I2C scanner finds nothing: the TM1637 is not I2C - use TM1637Display.
- No part or no monitor: TEPTM1637.DLL or TEPARDUINO.DLL is missing from MODELS and the project folder; a closed monitor opens again with a click on the UNO's USB port.
Things to Know Before Using a Real TM1637 Module
- setBrightness(): call it once before showing anything, or the display stays dark.
- Open-drain: the module has the pull-ups; TM1637Display switches the pins between OUTPUT (low) and INPUT (released). Do not drive CLK or DIO from anything else.
- Power: "88:88" at full brightness draws about 90 mA, fine from an UNO; the module also runs at 3.3 V.
- Not I2C: no address, LSB first.
- Memory: the demo needs 12,046 bytes of flash and 607 bytes of RAM.
Limitations of the Simulation
- Not modelled: the key scan (this module has no keys: a key read gets FF), the test mode's effect on the display, the multiplex itself (the segments show the average), the exact timing limits of the bus (only the clock rate is checked), 6-digit modules, and damage from a reversed supply.
- The strip, its LEDs and the panels are TEP additions.
- The model is our own, written from the TM1637 datasheet; TM1637 is a part of Titan Micro Electronics. This library is not made or endorsed by Titan Micro, the TM1637Display author or Labcenter.
- Licences: TM1637Display 1.2.0 (LGPL-3.0) and the Arduino AVR core 1.8.6 with LGPL-licensed code are in the HEX file; the sketch is included so you can rebuild it with modified libraries.
- Tested in Proteus 8.5 in October 2026 (the demo as shipped on two Arduino UNO V4.0 boards with their built-in monitors: the counter and the clock, STATUS, BRIGHT, NUMBER, TEXT, COLON, OFF / ON, NOBRIGHT, SWAP and CLOCK over midnight, the panel, the pop-up and the four tools; about 0.5 x real time with the pop-up and both monitors open). Proteus 7 is not supported.
Need more digits? Our MAX7219 7-Segment Display Library for Proteus V1.0 drives the 8-digit MAX7219 board, and our MAX7219 LED Matrix Library for Proteus V1.0 the 8x8 and 4-in-1 LED matrices.
So, that was all about the TM1637 7-Segment Display Library for Proteus V1.0. I hope the bus, the commands and the setBrightness() trap are clear now, so your clock or counter lights up on the first real module you plug in. If you use the TM1637 7-Segment Display Library for Proteus in a project, please share it in the comments or in our forum, and if you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!
























Comments
0