Build it step by step
0 of 8 doneWire the LEDs
D4 and D5 through 220 ohm, cathodes to GND.
Wire the display
CLK to D6, DIO to D7, power from 5V and GND.
Wire the buttons
D2 and D3 each to GND.
Wire the buzzer
D8 and GND.
Install the library
TM1637Display from the Library Manager.
Test fast
Set TICK to 16 and upload.
Run the states
Start, pause, resume, reset.
Set TICK back to 1000
Upload for real use.
How do you build a pomodoro desk timer?
A desk gadget runs 25 minute work and 5 minute break periods with LEDs, a countdown display and a buzzer. You need Arduino Nano, LED 5 mm red, LED 5 mm green, Tactile push button 6 mm × 2, Passive buzzer, Resistor 220 Ω × 2, TM1637 4-digit display, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points. It takes 8 steps and about 90 minutes.
- Level
- Beginner
- Time
- About 90 min
- Parts
- 9
Parts list
- Development BoardsBuyArduino Nano × 1
- SemiconductorsBuyLED 5 mm red × 1
- SemiconductorsBuyLED 5 mm green × 1
- SwitchesBuy
- Motors & ActuatorsBuyPassive buzzer × 1
- PassivesBuyResistor 220 Ω × 2
- DisplaysBuy
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Red LED anode (long leg) | Nano D4 through 220 ohm | Work light |
| Green LED anode (long leg) | Nano D5 through 220 ohm | Break light |
| Both LED cathodes (short legs) | Nano GND | Common ground |
| TM1637 CLK | Nano D6 | Display clock |
| TM1637 DIO | Nano D7 | Display data |
| TM1637 VCC and GND | Nano 5V and GND | Power |
| Start button | Nano D2 to GND | Start, pause and resume |
| Reset button | Nano D3 to GND | Back to idle |
| Buzzer positive | Nano D8 | Alert tone |
| Buzzer negative | Nano GND | Common ground |
Code
A Pomodoro timer works in short, fixed blocks: 25 minutes of work, then 5 minutes of rest. This build is a small state machine with four states: idle, work, break and paused. The start button moves from idle to work, pauses a running period and resumes a paused one, and the reset button always goes back to idle. The countdown uses millis instead of delay, so the buttons are still read every pass through the loop, and the line lastTick += TICK keeps the clock from drifting because it adds exactly one second each time instead of restarting from the current time. A red LED shows work, a green one shows break, and the TM1637 display counts down in minutes and seconds with its colon lit. When a period ends the buzzer beeps three times, and a finished work period is added to a session count shown while idle and printed on the serial monitor. To test without waiting, change TICK from 1000 to 16 and a whole work block takes about 24 seconds. Install the TM1637Display library by Avishay Orpaz from the Library Manager. The buttons use the internal pull-up resistors, so no extra resistors are needed.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <TM1637Display.h>
const int LED_WORK = 4, LED_BREAK = 5, BTN_START = 2, BTN_RESET = 3, BUZZ = 8;
TM1637Display disp(6, 7); // CLK, DIO
const unsigned long TICK = 1000; // ms per timer second, use 16 to test about 60 times faster
const int WORK_S = 25 * 60, BREAK_S = 5 * 60;
enum State { IDLE, WORK, BREAK, PAUSED };
State state = IDLE, resumeState = IDLE;
int remaining = 0, sessions = 0;
unsigned long lastTick = 0;
bool startWas = false, resetWas = false;
void showTime() {
disp.showNumberDecEx((remaining / 60) * 100 + remaining % 60, 0b01000000, true); // mm:ss with colon
}
void showIdle() {
digitalWrite(LED_WORK, LOW); digitalWrite(LED_BREAK, LOW);
disp.showNumberDec(sessions, false); // finished sessions
}
void begin(State s) {
state = s;
remaining = (s == WORK) ? WORK_S : BREAK_S;
digitalWrite(LED_WORK, s == WORK);
digitalWrite(LED_BREAK, s == BREAK);
lastTick = millis();
showTime();
}
void beeps() {
for (int i = 0; i < 3; i++) { tone(BUZZ, 1000, 250); delay(400); }
}
void setup() {
pinMode(LED_WORK, OUTPUT); pinMode(LED_BREAK, OUTPUT);
pinMode(BTN_START, INPUT_PULLUP); pinMode(BTN_RESET, INPUT_PULLUP);
Serial.begin(9600);
disp.setBrightness(3);
showIdle();
}
void loop() {
bool s = (digitalRead(BTN_START) == LOW);
bool r = (digitalRead(BTN_RESET) == LOW);
if (s && !startWas) {
if (state == IDLE) begin(WORK);
else if (state == PAUSED) { state = resumeState; lastTick = millis(); }
else { resumeState = state; state = PAUSED; }
delay(30);
}
if (r && !resetWas) { state = IDLE; showIdle(); delay(30); }
startWas = s; resetWas = r;
if ((state == WORK || state == BREAK) && millis() - lastTick >= TICK) {
lastTick += TICK;
remaining--;
showTime();
if (remaining <= 0) {
beeps();
if (state == WORK) {
sessions++;
Serial.print("Sessions done: "); Serial.println(sessions);
begin(BREAK);
} else {
state = IDLE; showIdle(); // wait for the next press
}
}
}
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Power on | Display shows 0 and both LEDs are off |
| Press start | Red LED on, display counts down from 25:00 |
| Press start again | Countdown pauses, press again to resume |
| Work period ends | Three beeps, green LED, 05:00 countdown |
| Press reset | Back to idle with the session count shown |
If it does not work
Display blank
Check CLK and DIO and the library.
Countdown too fast or slow
Check TICK is 1000.
Button seems to double press
Keep the 30 ms delay after a press.
No sound
Check buzzer polarity and the D8 wire.
LED stays dim
Check the 220 ohm resistor and LED direction.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the pomodoro desk timer?
Arduino Nano, LED 5 mm red, LED 5 mm green, Tactile push button 6 mm × 2, Passive buzzer, Resistor 220 Ω × 2, TM1637 4-digit display, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points.
How long does the pomodoro desk timer take to build?
About 90 minutes for a beginner maker, in 8 steps.
How do I know the pomodoro desk timer works?
Power on: Display shows 0 and both LEDs are off. Press start: Red LED on, display counts down from 25:00. Press start again: Countdown pauses, press again to resume.
Display blank: what should I check?
Check CLK and DIO and the library.
Countdown too fast or slow: what should I check?
Check TICK is 1000.
Button seems to double press: what should I check?
Keep the 30 ms delay after a press.
No sound: what should I check?
Check buzzer polarity and the D8 wire.
