

Pomodoro
A Pomodoro timer built on an ESP32: 25 min focus, 5 min short break, and a 10 min long break every 4th cycle. Progress is shown on a TM1637 MM:SS display, a focus/break LED pair, a single 7-segment digit showing the…
- Size
- 71.5 × 73.5 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 11
- Nets
- 40
- Pads
- 70
- Tracks, vias
- 141, 0
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 23 Jul 2026
- Updated
- 23 Aug 2026
Overview
Pomodoro is an open-source printed circuit board by oguzmum, from the oguzmum/esp32-pomodoro repository on GitHub. It is a 2-layer board of 71.5 × 73.5 mm with 11 parts on 40 nets, routed with 141 tracks and 0 vias.
It is built around the KCSC02-105. Its parts include 2 resistors and 1 IC.
Main components
1README
README.mdESP32 Pomodoro Timer
A Pomodoro timer built on an ESP32: 25 min focus, 5 min short break, and a 10 min long break every 4th cycle. Progress is shown on a TM1637 MM:SS display, a focus/break LED pair, a single 7-segment digit showing the current cycle (1-4), and a passive buzzer on phase changes.

Features
- Centisecond-resolution countdown per phase, displayed as
MM:SS - Standard Pomodoro cycle:
FOCUS (25min) -> SHORT_BREAK (5min), repeating; every 4thFOCUSis followed by aLONG_BREAK (10min)instead, then the cycle count wraps back to 1 - Start/Stop button toggles between running and paused
- Reset button returns to
FOCUS, cycle 1 (only while stopped) - No auto-advance: when a phase's countdown hits zero, it pauses in the next phase and waits for Start/Stop to be pressed again
- Phase LED pair shows focus vs. break at a glance
- A single common-cathode 7-segment digit shows the current cycle (1-4) in decimal
- Passive passive buzzer beeps on every phase change: 2 short beeps when focus ends (break starting), 1 longer beep when a break ends (focus starting)
- Timekeeping runs on a hardware timer interrupt (
esp_timer, ~10 ms tick), notmillis()polling inloop(), so display refresh or button handling can never skew the measured time - Both buttons are read via GPIO interrupts (
attachInterrupt) with timestamp-based debouncing done inside the ISR
StopwatchCore (the original count-up stopwatch) is still in the repo under lib/StopwatchCore/ but is no longer wired up in main.cpp -- PomodoroCore replaced it as the active timer.
Hardware
| Component | Notes |
|---|---|
| ESP32 DevKit (generic) | Any generic ESP32 dev board |
| TM1637 4-digit display | 2-wire protocol (CLK/DIO), not I²C |
| 2x momentary push button | Wired to GND, using internal pull-ups |
| 2x LED + 330Ω resistor | Focus / Break phase indicator |
| 1x 7-segment digit (common cathode, e.g. 5161AS) | Cycle number (1-4) |
| 1x passive passive buzzer | Phase-change beep, driven via tone() |
Wiring
| Signal | ESP32 GPIO | Notes |
|---|---|---|
TM1637 CLK | 22 | PIN_TM1637_CLK in include/PinConfig.h |
TM1637 DIO | 23 | PIN_TM1637_DIO in include/PinConfig.h |
TM1637 VCC | 3V3 | |
TM1637 GND | GND | |
| Start/Stop button | 18 | PIN_BTN_START_STOP; other leg to GND |
| Reset button | 4 | PIN_BTN_RESET; other leg to GND |
| LED Focus | 2 | PIN_LED_FOCUS; short leg to GND via resistor |
| LED Break | 15 | PIN_LED_BREAK; short leg to GND via resistor |
| 7-seg segment a | 5 | PIN_SEG_A |
| 7-seg segment b | 16 | PIN_SEG_B |
| 7-seg segment c | 32 | PIN_SEG_C |
| 7-seg segment d | 26 | PIN_SEG_D |
| 7-seg segment e | 25 | PIN_SEG_E |
| 7-seg segment f | 19 | PIN_SEG_F |
| 7-seg segment g | 21 | PIN_SEG_G |
| 7-seg segment dp | 33 | PIN_SEG_DP |
| 7-seg COM (both) | GND | common cathode, not a GPIO |
Buzzer + | 27 | PIN_BUZZER; - leg to GND |
Buttons need no external resistors, both are configured with the ESP32's internal pull-ups (INPUT_PULLUP), so they read HIGH when idle and LOW when pressed. Avoid GPIO34-39 for buttons (and for anything else that needs to be an output, like the 7-segment segments): those pins are input-only and have no internal pull-up/output driver on the ESP32.
The 2 discrete LEDs: short leg (cathode) to GND, long leg (anode) through a 330Ω resistor to the GPIO pin. For yellow I removed the resistor, as the LED didn't lit up. But you can also go lower (150-220Ω) if a color looks too dim.
7-segment digit: it's common cathode, so both COM pins go straight to GND; each segment pin (a-g, dp) goes through its own ~330Ω resistor to its GPIO, driven HIGH to light up.
All pin numbers live in one place: include/PinConfig.h.
Architecture
PomodoroCore owns an esp_timer periodic callback (~10 ms) that decrements a centisecond countdown, plus the phase/cycle state machine:
stateDiagram-v2
[*] --> IDLE
IDLE --> RUNNING: start
RUNNING --> PAUSED: stop
PAUSED --> RUNNING: start
RUNNING --> PAUSED: countdown hits 0 (auto, advances phase)
PAUSED --> IDLE: resetPhase transitions themselves:
stateDiagram-v2
FOCUS --> SHORT_BREAK: focus ends, cycle < 4
FOCUS --> LONG_BREAK: focus ends, cycle == 4
SHORT_BREAK --> FOCUS: break ends, cycle += 1
LONG_BREAK --> FOCUS: break ends, cycle = 1The timer callback does the absolute minimum (decrement the countdown) and is the only writer of the countdown value, so plain volatile is enough there without a mutex. Phase/cycle/state changes, however, are only ever applied from PomodoroCore::update(), which must be called once per loop() iteration -- this keeps those fields single-writer from the main loop's perspective, same as toggleStartStop()/reset().
ButtonHandler wraps one GPIO pin each: attachInterrupt fires on the falling edge, and the ISR itself only compares timestamps and sets a volatile flag, with no debounce delays or business logic running in interrupt context. main.cpp polls consumePress() once per loop iteration and forwards debounced presses to PomodoroCore.
PomodoroIndicators drives the focus/break LED pair and owns a CycleSevenSegment (raw GPIO-per-segment driver for the common-cathode digit) to show the cycle number. It has no knowledge of PomodoroCore's internals beyond the PomodoroPhase enum and the current cycle number -- main.cpp detects phase changes (comparing the current phase against the last one shown) and pushes updates to it.
Buzzer wraps tone() for two short blocking beep patterns (focus-end vs. break-end). Only called on phase transitions, a few times per hour, so the brief blocking delay for the beep pattern doesn't affect responsiveness elsewhere.
Display is accessed only through the abstract IDisplay interface (showTime(uint32_t centiseconds), begin(), setBrightness(), clear()). Tm1637SegmentDisplay is the only concrete implementation today; adding e.g. an OledDisplay means writing one new class, PomodoroCore and main.cpp's control flow don't change. showTime() works unchanged for a countdown -- it just renders whatever centisecond value it's given as MM:SS.
Program Flow (loop())
flowchart TD
Start([loop iteration]) --> BtnStart{Start/Stop pressed?}
BtnStart -- yes --> Toggle[pomodoro.toggleStartStop]
BtnStart -- no --> BtnReset
Toggle --> BtnReset{Reset pressed?}
BtnReset -- yes --> DoReset[pomodoro.reset]
DoReset --> SyncLeds["sync lastPhase + LEDs immediately (no beep)"]
SyncLeds --> Update
BtnReset -- no --> Update[pomodoro.update]
Update --> ReadPhase[phase = pomodoro.getPhase]
ReadPhase --> Changed{phase != lastPhase?}
Changed -- yes --> IsFocus{phase == FOCUS?}
IsFocus -- yes --> BeepBreakEnd[buzzer.beepBreakEnd]
IsFocus -- no --> BeepFocusEnd[buzzer.beepFocusEnd]
BeepBreakEnd --> ShowLeds["indicators.showPhase + showCycle"]
BeepFocusEnd --> ShowLeds
ShowLeds --> UpdateLast[lastPhase = phase]
UpdateLast --> ShowTime
Changed -- no --> ShowTime["display.showTime(remaining)"]
ShowTime --> Delay["delay(50ms)"]
Delay --> Startpomodoro.update() is what actually drives auto-pausing at the end of a phase (see the state diagram above); the phase-change check right after it is only there to trigger the LEDs/buzzer exactly once per transition, whether that transition came from update() (countdown hit 0) or from a manual reset.
Building
This is a PlatformIO project.
# Build
pio run
# Build and upload
pio run --target upload
# Serial monitor
pio device monitorParts
11| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | Conn_01x19 | Connector_PinSocket_2.54mm:PinSocket_1x19_P2.54mm_Vertical | Esp32, Esp3222 |
| 2 | R | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R5, R6 |
| 2 | SW_Push | Button_Switch_THT:SW_PUSH_6mm | Reset1, Start/Stop1 |
| 1 | Buzzer | Buzzer_Beeper:Buzzer_12x9.5RM7.6 | BZ1 |
| 1 | Conn_01x04 | Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_Vertical | TM167Timer1 |
| 1 | KCSC02-105 | Display_7Segment:5161as | U2 |
| 1 | LED_Green | LED_THT:LED_D5.0mm | Fokus1 |
| 1 | LED_Red | LED_THT:LED_D5.0mm | Pause1 |
Similar boards
- 2 layers482.6 × 35.6 mm

- 2 layers152.9 × 74.9 mm

- 2 layers196.7 × 31.5 mm

- 2 layers76.2 × 50.8 mm

- 4 layers

EXWatch retrodigital
bsastudio601/RetroDigitalWristWatchO1
A Retro Futuristic wrist watch inspired from nixie tube wrist watch.
18 parts - 4 layers109.8 × 145 mm

- 4 layers51.9 × 108.5 mm

ESP 32 Battle 4h
samcwitte/PCB-Design-Battle
This is a repository containing my PCB designs for a 2-hour PCB battle I participated in with Predictable Designs on YouTube.
70 partsMIT - 2 layers75 × 52 mm

Questions
How big is the Pomodoro PCB?
It measures 71.5 × 73.5 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Pomodoro use?
11 parts, built around the KCSC02-105. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Pomodoro KiCad files?
From the oguzmum/esp32-pomodoro repository on GitHub, at the commit this page was made from: the board is PCB-Design-pomodoro/pomodoro.kicad_pcb and its schematic PCB-Design-pomodoro/pomodoro.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Pomodoro design in my own project?
Its repository states no licence, so its author keeps all rights: ask oguzmum before reusing the design.