Projects / Pomodoro desk timer

Pomodoro desk timer

Beginner1.5 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. NANO12.6 mA

    Wire the LEDs

    D4 and D5 through 220 ohm, cathodes to GND.

  2. NANO

    Wire the display

    CLK to D6, DIO to D7, power from 5V and GND.

  3. NANO

    Wire the buttons

    D2 and D3 each to GND.

  4. NANO

    Wire the buzzer

    D8 and GND.

  5. NANO12:45

    Install the library

    TM1637Display from the Library Manager.

  6. NANO

    Test fast

    Set TICK to 16 and upload.

  7. NANO

    Run the states

    Start, pause, resume, reset.

  8. NANO

    Set TICK back to 1000

    Upload for real use.

In short

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

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Red LED anode (long leg)Nano D4 through 220 ohmWork light
Green LED anode (long leg)Nano D5 through 220 ohmBreak light
Both LED cathodes (short legs)Nano GNDCommon ground
TM1637 CLKNano D6Display clock
TM1637 DIONano D7Display data
TM1637 VCC and GNDNano 5V and GNDPower
Start buttonNano D2 to GNDStart, pause and resume
Reset buttonNano D3 to GNDBack to idle
Buzzer positiveNano D8Alert tone
Buzzer negativeNano GNDCommon 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.

CheckExpected
Power onDisplay shows 0 and both LEDs are off
Press startRed LED on, display counts down from 25:00
Press start againCountdown pauses, press again to resume
Work period endsThree beeps, green LED, 05:00 countdown
Press resetBack 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 →

Ask Lark AI

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.