This project builds a countdown timer with a 4-digit 7-segment display, three push buttons for control, and an LED indicator that lights up when time expires. The timer counts down from a preset value and can be started, paused, and reset using the tactile buttons.
The guide includes a complete wiring diagram showing how to connect the TM1637 display module to the Arduino Uno, wire up the three control buttons with pull-up resistors, and integrate the status LED. Assembly steps cover breadboard layout, firmware upload, and testing each button function to ensure the timer operates correctly.
Wiring diagram

Gather all the parts
Assemble it in 3 steps
1. Connect the number display
With USB unplugged, connect VCC to 5V, GND to GND, CLK to D2 (clock), and DIO to D3 (data). Follow the printed labels, not the order of the pins.
2. Add the three buttons
Place each button across the breadboard center gap. Connect one switch contact to GND and the other to D4 for Start, D5 for Pause/Resume, or D6 for Clear. Use contacts that only connect when pressed; two legs on the same contact are already joined.
3. Add the red time-up light
Connect D7 to one lead of the 330 ohm resistor. Connect the other resistor lead to the long leg of the LED, and connect the short leg to GND.
Review all connections
1. Connections between "display" and "Arduino"
2. Connections between "start" and "Arduino"
3. Connections between "pause" and "Arduino"
4. Connections between "clear" and "Arduino"
5. Connections between "limit" and "Arduino"
6. Connections between "done" and "Arduino"
Deploy the firmware
#include <Arduino.h>
constexpr uint8_t CLK=2, DIO=3, DONE=7, PRESET=24;
// Open-drain signalling: the display module supplies pull-ups.
void line(uint8_t p,bool high) {
digitalWrite(p,LOW);
pinMode(p, high ? INPUT : OUTPUT);
delayMicroseconds(8);
}
void beginFrame(){line(DIO,true);line(CLK,true);line(DIO,false);line(CLK,false);}
void endFrame(){line(CLK,false);line(DIO,false);line(CLK,true);line(DIO,true);}
void send(uint8_t b){
for(uint8_t i=0;i<8;++i,b>>=1){line(DIO,b&1);line(CLK,true);line(CLK,false);}
line(DIO,true);line(CLK,true);line(CLK,false); // ACK clock
}
void command(uint8_t b){beginFrame();send(b);endFrame();}
void show(uint8_t n){
static const uint8_t digit[]={0x3f,6,0x5b,0x4f,0x66,0x6d,0x7d,7,0x7f,0x6f};
command(0x40); beginFrame();send(0xc0);send(0);send(digit[n/10]);send(digit[n%10]);send(0);endFrame();
}
struct Button {
uint8_t pin; bool raw=false, stable=false; uint32_t changed=0;
explicit Button(uint8_t p):pin(p){}
bool pressed(uint32_t now){
bool down=digitalRead(pin)==LOW;
if(down!=raw){raw=down;changed=now;}
if(raw!=stable && now-changed>=25){stable=raw;return stable;}
return false;
}
};
Button start(4),pauseButton(5),clearButton(6);
uint32_t remaining=0,last=0;
bool running=false, expired=false;
void setup(){
for(uint8_t p=4;p<=6;++p)pinMode(p,INPUT_PULLUP);
pinMode(DONE,OUTPUT);digitalWrite(DONE,LOW);
show(0);command(0x8b);
}
void loop(){
uint32_t now=millis(), elapsed=now-last;last=now;
bool s=start.pressed(now),p=pauseButton.pressed(now),c=clearButton.pressed(now);
if(running){
if(elapsed>=remaining){remaining=0;running=false;expired=true;}
else remaining-=elapsed;
}
if(c){remaining=0;running=false;expired=false;}
else if(s){remaining=1000UL*PRESET;running=true;expired=false;}
else if(p && remaining)running=!running;
uint8_t seconds=(remaining+999)/1000;
static uint8_t shown=0;
if(seconds!=shown){show(seconds);shown=seconds;}
digitalWrite(DONE,expired?HIGH:LOW);
}Remix this project
Make it yours in one click
Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.




