Build a Pomodoro Desk Clock with ESP32-C3 and MAX7219
I wanted a physical focus timer on my desk, away from the computer screen, so I built one from an ESP32-C3 and four LED matrices. It shows the time, runs a Pomodoro timer and switches to BUSY when I am in a meeting. This guide takes you from wiring to the first boot.

Supplies
| Part | Notes |
|---|---|
| ESP32-C3 board | I use an ESP32-C3 Mini with 4 MB flash (PlatformIO board esp32-c3-devkitm-1) |
| 4× MAX7219 8×8 LED modules | chained into one 32×8 display; mine are red |
| 2 push buttons | wired to GND, the firmware uses the internal pull-ups |
| Passive buzzer (optional) | driven by PWM; not connected on mine yet, everything works without it |
| USB cable | the matrices take 5 V from the board’s 5V pin |
You will also need a soldering iron, some wire, and PlatformIO (VS Code or the command line).
Step 1: chain the matrices
MAX7219 modules daisy-chain, so one set of wires drives all four. Connect the DOUT of each module to the DIN of the next one. VCC, GND, CLK and CS are shared by all four modules. The DIN of the first module is the input of the whole chain.
One detail to know before you mount anything: the firmware always rotates the image by 180°. This is hard-coded and has no setting. My matrices sit upside down in the enclosure for exactly that reason. If yours are mounted the usual way, change the rotation in the source.
Step 2: wire it to the ESP32-C3
| Signal | GPIO | Goes to |
|---|---|---|
| Matrix DIN | 6 | DIN of the first module |
| Matrix CS | 7 | CS |
| Matrix CLK | 4 | CLK |
| Matrix power | 5V / GND | VCC / GND |
| Button 1 (modes) | 3 | button → GND |
| Button 2 (action) | 10 | button → GND |
| Buzzer | 5 | buzzer (+), (−) → GND |
GPIO6→DIN GPIO7→CS GPIO4→CLK 5V→VCC GND→GND
GPIO3←BTN1→GND GPIO10←BTN2→GND GPIO5→Buzzer(+) Buzzer(−)→GND
The matrices run on 5 V, while the ESP32-C3 outputs 3.3 V logic. In my build the 3.3 V signals drive the MAX7219 directly, with no level shifter.
Pins to avoid on the ESP32-C3: GPIO 18 and 19 are used by USB, and 2, 8 and 9 have strapping functions (9 is also the BOOT button). GPIO 0, 1, 20 and 21 stay free if you want to add something.

Illustration, not a photo: the pin order on the board is schematic, the pin labels and wire colors match the table above. The chain input is on the right end.
Step 3: flash the firmware
The project is a PlatformIO (Arduino) project. This is the platformio.ini I use:
[env:esp32c3]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
monitor_speed = 115200
build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
lib_deps =
knolleary/PubSubClient@^2.8
board_upload.flash_size = 4MB
board_build.partitions = min_spiffs.csv
The two ARDUINO_USB_* flags make the serial monitor work over the C3’s native USB. PubSubClient handles MQTT. The min_spiffs.csv partition table keeps two application slots, which the over-the-air updates need on a 4 MB chip.
Flash it over USB:
pio run -t upload
Step 4: first boot and Wi-Fi
When no Wi-Fi is configured, the clock starts its own access point called MatrixClock with a captive portal, and the setup page opens by itself (or go to http://192.168.4.1). Pick your network there. After connecting, the clock shows its IP address on the display. From then on the panel is at http://<IP>/.
Two shortcuts to remember: hold both buttons for 3 seconds to show the IP again, and for 6 seconds to open the setup page.
Step 5: time, weather and calendar
- Time: NTP plus a software clock that keeps running without Wi-Fi. Set your time zone and daylight saving in the panel.
- Weather: needs an OpenWeatherMap API key and a city. If something is wrong, the display tells you:
NoKey,Key?,City?orNoNet. - Calendar: add up to three ICS links (Google: the secret iCal address; Outlook: publish the calendar as ICS), or upload an
.icsfile. Recurring meetings are supported. During a meeting the clock switches to BUSY by itself and reminds you 5 minutes and 1 minute before it starts.
A heads-up about uploaded files: only the next 14 days are stored, and the file does not refresh itself. Export a new one every week or two.
Step 6: install the desktop agent
The clock cannot see your video calls, so a small Python agent on the computer watches Zoom, Teams, Meet and Slack and switches the clock to BUSY while you talk.
cd agent && pip install -r requirements.txt
python agent.py --host <IP> # watch calls, switch to BUSY
python agent.py --msg "Hello" # send a message to the clock
python agent.py --busy on # set BUSY manually
python agent.py --status # show the status
Step 7: use it
Two buttons do everything:
| Action | Result |
|---|---|
| Button 1, short press | next mode (Clock, Meeting, Pomodoro, Weather, Busy/Free, Message) |
| Button 1, hold 1.5 s | set the alarm on the clock |
| Button 2 | action of the current mode |
| Both buttons, 3 s | show the IP address |
| Both buttons, 6 s | setup page |
In Pomodoro mode the display counts down from 25:00. Button 2 starts and pauses, and a long press resets the timer. Breaks are marked with the letters B and L.
Step 8 (optional): integrations
MQTT. In the panel, open MQTT and enter your broker address, port 1883 and credentials. The clock listens to commands under matrixclock/cmd/... and publishes its state, which is enough for Home Assistant or Node-RED.
| Topic | Payload |
|---|---|
cmd/message | text |
cmd/mode | clock, meeting, pomodoro, weather, busy, message |
cmd/busy | on, off, toggle |
cmd/pomodoro | start, pause, reset |
cmd/brightness | 0–15 |
Webhook. Send a message from any script:
curl -X POST "http://IP/api/webhook?secret=TOKEN" --data-urlencode "text=Build is ready"
The secret is only needed if you set a token in the settings. Messages support Cyrillic through a built-in 5×7 font.
Updates. After the first USB flash the clock updates over the network (hostname matrix-clock), or you can upload a .bin through the panel.
Pitfalls
- Touch buttons. TTP223 modules work instead of push buttons, but by default they output HIGH on touch while the firmware waits for LOW. Solder jumper A on the module.
- Home Assistant in Docker. It often cannot resolve
clock.local. Use the clock’s IP address and reserve it in your router. - The calendar file. An uploaded
.icsgoes stale. Re-export it regularly.
Limits and options
The ESP32-C3 has no touch pins and only 4 MB of flash, which is not enough for Matter together with OTA. If you want more room, an ESP32-S3 works. Change the board in platformio.ini (for example esp32-s3-devkitc-1) and the pin constants PIN_DIN, PIN_CS, PIN_CLK, PIN_BTN1, PIN_BTN2 and PIN_BUZZER in src/main.cpp. For an ESP32-S3-DevKitC-1 N16R8 the pins are:
| Signal | GPIO | Why |
|---|---|---|
| Matrix DIN | 11 | hardware FSPI MOSI |
| Matrix CLK | 12 | hardware FSPI SCK |
| Matrix CS | 10 | hardware FSPI CS |
| Button 1 | 4 | touch channel T4 |
| Button 2 | 5 | touch channel T5 |
| Buzzer | 6 | any PWM pin |