Clockbox: WiFi-Connected Alarm Clock
A WiFi-enabled alarm clock and weather display built around a custom ESP32 PCB that I designed, had fabricated, assembled, and programmed.
Overview
Clockbox is a network-connected alarm clock built around an ESP32-WROOM-32E and a 64x32 HUB75 RGB LED matrix. I designed the custom PCB, sent it out for fabrication, assembled the board, and developed the firmware that turns it into a configurable clock, alarm, and weather display.
The current version runs on ESP-IDF 5.5 and is a ground-up port of the original Arduino-based firmware. Moving to ESP-IDF gave the project a more structured architecture and made room for features such as robust WiFi provisioning, over-the-air updates, persistent configuration, and a full browser-based control panel.
Custom hardware
The PCB brings the complete device together in a purpose-built design instead of relying on a collection of development boards. The ESP32 directly controls the matrix panel and the clock's local inputs and indicators.
- ESP32-WROOM-32E module with 16 MB of flash
- 64x32 HUB75 RGB LED matrix interface
- Three physical buttons for display mode, brightness, and status controls
- Passive piezo buzzer for boot feedback and alarm tones
- Status LED and dedicated on-screen connection indicators
- I2C connection to a DS3231 or PCF8523 real-time clock
Display and controls
The LED matrix supports three layouts: time with scrolling weather, a large time-only view, and time with the current date. Physical buttons provide the most common controls without requiring a phone, while the web interface exposes deeper configuration.
- Adjustable display brightness and configurable RGB color
- Selectable weather fields including temperature, conditions, humidity, wind, visibility, sunrise, and sunset
- Up to seven weekly alarms with independent day-of-week schedules and custom scrolling messages
- Four saved presets for color, brightness, display mode, and status visibility
- Alarm dismissal from any physical button, with normal button actions suppressed during dismissal
Connected setup and configuration
Clockbox is designed to be configured after installation without rebuilding or reflashing firmware. Once connected, its single-page web interface is available on the local network through mDNS and provides controls for the display, alarms, presets, weather, WiFi, location, and firmware updates.
- Stores up to four WiFi networks and automatically reconnects to known access points
- Falls back to a SoftAP captive setup page when no saved network is reachable
- Synchronizes time with SNTP and applies daylight-saving-aware POSIX time zones
- Fetches current conditions from OpenWeatherMap over HTTPS
- Can automatically determine its time zone and weather location from IP geolocation
- Supports authenticated firmware updates through a browser-based OTA workflow
- Provides remote reboot and guarded factory-reset controls
Firmware architecture
The firmware is divided into focused modules for display rendering, settings, alarms, networking, time synchronization, weather, geolocation, buttons, audio feedback, RTC access, and the web API. The display loop runs independently from network activity so weather requests and browser traffic do not interrupt animation or scrolling text.
A thin C++ wrapper integrates the HUB75 DMA driver with an otherwise C-focused ESP-IDF application. Custom text rendering supports Adafruit-GFX font data without pulling in the Arduino framework, keeping the firmware native to ESP-IDF while retaining a useful font ecosystem.
Persistence and recovery
Runtime settings are stored in a versioned NVS blob protected by a CRC32. Writes are debounced for five seconds so rapid button presses or web edits are coalesced into a single flash operation. Explicit migration paths preserve existing alarms, presets, network credentials, and display settings as the configuration format evolves.
- External RTC fallback seeds the system clock before WiFi is available and is refreshed after SNTP synchronization
- A physical recovery shortcut forces provisioning mode at boot when saved networks are unavailable
- Dual OTA partitions allow firmware updates without overwriting the currently running image
- Factory reset clears persistent state and restores compile-time defaults for a clean recovery path
Outcome
Clockbox has grown from an Arduino prototype into a complete embedded product built on hardware and firmware I control end to end. The project combines PCB design, board assembly, real-time display work, network services, persistent configuration, and a web-based user experience in one device that I use as a practical clock and information display.