Ceban.dev

Build a Pomodoro Desk Clock with ESP32-C3 and MAX7219

October 19, 2026 esp32diypomodoromqttplatformio

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.

The finished clock on ESP32-C3 and four MAX7219 matrices

Supplies

PartNotes
ESP32-C3 boardI use an ESP32-C3 Mini with 4 MB flash (PlatformIO board esp32-c3-devkitm-1)
4× MAX7219 8×8 LED moduleschained into one 32×8 display; mine are red
2 push buttonswired 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 cablethe 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

SignalGPIOGoes to
Matrix DIN6DIN of the first module
Matrix CS7CS
Matrix CLK4CLK
Matrix power5V / GNDVCC / GND
Button 1 (modes)3button → GND
Button 2 (action)10button → GND
Buzzer5buzzer (+), (−) → 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.

Wiring: ESP32-C3, four chained MAX7219 modules, two buttons and a buzzer

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? or NoNet.
  • Calendar: add up to three ICS links (Google: the secret iCal address; Outlook: publish the calendar as ICS), or upload an .ics file. 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:

ActionResult
Button 1, short pressnext mode (Clock, Meeting, Pomodoro, Weather, Busy/Free, Message)
Button 1, hold 1.5 sset the alarm on the clock
Button 2action of the current mode
Both buttons, 3 sshow the IP address
Both buttons, 6 ssetup 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.

TopicPayload
cmd/messagetext
cmd/modeclock, meeting, pomodoro, weather, busy, message
cmd/busyon, off, toggle
cmd/pomodorostart, pause, reset
cmd/brightness0–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 .ics goes 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:

SignalGPIOWhy
Matrix DIN11hardware FSPI MOSI
Matrix CLK12hardware FSPI SCK
Matrix CS10hardware FSPI CS
Button 14touch channel T4
Button 25touch channel T5
Buzzer6any PWM pin