Skip to the content
PCBKitNew board
2 layers64.1 × 31.8 mmHEDC B002, the printed circuit board in 3D

An ESP32-based alarm clock with a dot matrix LED display, rotary encoder interface, MP3 audio playback, and a web configuration UI.

Size
64.1 × 31.8 mm
Copper layers
2
Thickness
1.6 mm
Parts
34
Nets
76
Pads
215
Tracks, vias
265, 36
Pours
3
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
26 Mar 2026
Updated
17 Apr 2026

Overview

HEDC B002 is an open-source printed circuit board by Thaddeus-Maximus, from the Thaddeus-Maximus/dotclock repository on GitHub. It is a 2-layer board of 64.1 × 31.8 mm with 34 parts on 76 nets, routed with 265 tracks and 36 vias.

It is built around the CH340C, ESP32-WROOM-32 and PAM8403DR, with the AMS1117-3.3, CM315D32768DZFT and PEC09-2320F-S0015 among its other parts. Its parts include 11 resistors, 10 capacitors, 5 ICs, 2 connectors and 1 transistor. It belongs with the lEDs and displays boards and the ESP32 boards of this library.

Main components

7

README

README.md

dotclock

An ESP32-based alarm clock with a dot matrix LED display, rotary encoder interface, MP3 audio playback, and a web configuration UI.

Features

  • 32x8 dot matrix display (4x FC-16 / MAX7219 modules) with custom 3x6 pixel font
  • Rotary encoder for all on-device interaction (press to cycle modes, turn to adjust)
  • MP3 alarm tones stored on-chip (LittleFS, ~12MB available)
  • Web UI for settings, time sync, WiFi config, and file management
  • 25-step brightness (8 software PWM + 16 hardware levels)
  • Persistent settings via NVS

User Interface

The encoder button cycles through modes. The knob adjusts the value for the current mode. After 15 seconds of inactivity, the display returns to time mode.

ModeIconKnob ActionNotes
Time(none, full-width HH:MM)Dismisses alarm if ringingDefault mode
VolumeSpeaker icon0-16Plays alarm tone as preview while adjusting
BrightnessBulb icon1-24
AlarmBell iconAdjusts alarm time by 1min (fast: 15min)Scroll below 00:00 for OFF; defaults to OFF
Set TimeClock iconAdjusts system clock by 1min (fast: 15min)

When the alarm is ringing, the display flashes inverted at ~1.4Hz. Press button or turn knob to dismiss.

Web Interface

WiFi AP: dotclock / password dotclock1 / IP 192.168.4.1

  • Sync time from phone/browser (with timezone)
  • Set alarm time, enable/disable, select alarm sound
  • Adjust brightness and volume
  • Connect to a WiFi network (AP+STA mode, enables SNTP)
  • Upload, rename, and delete MP3 files

Audio

  • MP3 files, decoded via libhelix-mp3
  • 8-bit DAC output on GPIO25 through a PAM8403 class-D amplifier
  • GPIO25 driven low when idle to minimize speaker static

Project Structure

  • HEDC-F001/ — Firmware (ESP-IDF v5.3.1 project)
  • HEDC-B002/ — Hardware (board schematic, see hardware reference below)

TODO

  • Read encoder (debouncing, velocity detection)
  • Set display (writing, brightness control)
  • Custom 3x6 pixel font with 8x8 mode icons
  • MP3 audio playback
  • Alarm system with looping playback
  • Web interface (settings, file management, time sync)
  • Persistent settings (NVS)
  • WiFi AP + STA with SNTP
  • Fine-tune font glyphs
  • RC filter on DAC output for cleaner audio

HEDC-B002 Hardware Reference

Board Overview

The HEDC-B002 is an ESP32-based controller board with USB-C programming, SPI LED output (5V level-shifted), a rotary encoder with push button, an audio amplifier, and a 32.768kHz RTC crystal. The crystal, however, doesn't work right, it seems.

Power

RailSourceRegulator
+5VUSB-C (J1)Direct from VBUS
+3.3V+5V railU4 AMS1117-3.3 (SOT-223)

ESP32 GPIO Map

Used GPIOs

GPIODirectionNet LabelFunctionNotes
IO0-UART_~BOOTBoot mode selectAuto-reset circuit via Q1. Do not use at runtime.
IO1TXUART_TXDSerial TX to CH340CUSB serial. Directly to J3 header pin alternate.
IO3RXUART_RXDSerial RX from CH340CUSB serial.
IO14InputES1Rotary encoder push switch5.1kΩ pull-up to 3.3V. Active LOW.
IO17OutputCSSPI chip select3.3V → 5V via U1 74HCT244 → J3 pin 4 (CS_5V)
IO18OutputCLKSPI clock3.3V → 5V via U1 74HCT244 → J3 pin 5 (CLK_5V)
IO23OutputDINSPI data out3.3V → 5V via U1 74HCT244 → J3 pin 3 (DIN_5V)
IO25OutputINLAudio output to amplifierAC-coupled into PAM8403 left channel input
IO26InputEA1Rotary encoder channel A5.1kΩ pull-up to 3.3V
IO27InputEB1Rotary encoder channel B5.1kΩ pull-up to 3.3V
IO32-CRYSTAL_132.768kHz crystal (XIN)Y1 CM315D32768DZFT, 22pF load caps (C7, C8)
IO33-CRYSTAL_232.768kHz crystal (XOUT)Y1 CM315D32768DZFT, 22pF load caps (C7, C8)
EN-UART_ENChip enableAuto-reset circuit via Q1 + RC timing cap

Unused GPIOs

GPIOPin #Notes
IO224Explicitly no-connect on schematic
IO426Available
IO529Available (outputs PWM at boot)
IO1214Available (boot fail if pulled high)
IO1316Available
IO1523Available (outputs PWM at boot)
IO1627Available
IO1931Available
IO2133Available
IO2236Available
IO346Available (input only, no pull-up/down)
IO357Available (input only, no pull-up/down)
SENSOR_VP (IO36)4Available (input only)
SENSOR_VN (IO39)5Available (input only)

Components

U3 — CH340C (USB-to-Serial)

SOIC-16 USB-UART bridge. Internal oscillator (no external crystal). Connected to USB-C connector J1.

CH340C PinNetConnects To
TXDUART_TXDESP32 IO1 (RXD0)
RXDUART_RXDESP32 IO3 (TXD0)
~DTRDTRQ1 auto-reset circuit
~RTSRTSQ1 auto-reset circuit
UD+/UD-USB D+/D-J1 USB-C connector
V3-100nF decoupling cap (C6) to GND

Q1 — MMDT3904-7-F (Auto-Reset)

Dual NPN transistor (SOT-363) implementing the standard ESP32 auto-programming circuit. Cross-coupled: RTS drives IO0 (BOOT), DTR drives EN, so a DTR/RTS sequence enters the bootloader automatically.

U1 — 74HCT244 (Level Shifter)

TSSOP-20 octal buffer. Powered from +5V. Converts 3.3V ESP32 SPI signals to 5V for J3 output. Bank 1 active (OE tied to GND), bank 2 active but unused.

Input (3.3V)Output (5V)Signal
1A0 ← CS (IO17)1Y0 → CS_5VChip select
1A1 ← CLK (IO18)1Y1 → CLK_5VClock
1A2 ← DIN (IO23)1Y2 → DIN_5VData

J3 — 5-Pin LED Output Connector (FC-16 footprint)

PinSignal
1+5V
2GND
3DIN_5V
4CS_5V
5CLK_5V

This is the SPI output for driving an LED matrix or display panel.

SW1 — PEC09-2320F-S0015 (Rotary Encoder)

Bourns horizontal-mount rotary encoder with push button. All signals pulled up to 3.3V with 5.1kΩ resistors.

FunctionNetGPIOActive State
Encoder AEA1IO26LOW pulses
Encoder BEB1IO27LOW pulses
Push switchES1IO14LOW when pressed

U2 — PAM8403DR (Audio Amplifier)

SOP-16 class-D stereo amplifier, powered from +5V. Left channel input (INL) driven from ESP32 IO25 through a coupling capacitor. Speaker output on SPK1 header (marked DNP — do not populate).

ConnectionDetail
InputIO25 → coupling cap → INL (pin 7)
OutputLOUT+/LOUT- → SPK1 (2-pin header)
Power+5V / GND

Y1 — CM315D32768DZFT (RTC Crystal)

32.768kHz crystal connected to IO32/IO33 with 22pF load capacitors (C7, C8). Provides a precise timebase for RTC functionality.

J1 — USB-C Connector (UJ20-C-V-C-1-SMT-TR)

USB 2.0 Type-C receptacle (14-pin). CC1/CC2 have 5.1kΩ pull-downs (R6, R7) for device identification.

Code Quick-Reference

cpp
// --- Pin Definitions ---

// SPI LED output (directly usable with hardware SPI: VSPI)
#define PIN_LED_CS    17  // SPI chip select
#define PIN_LED_CLK   18  // SPI clock (VSPI CLK)
#define PIN_LED_DIN   23  // SPI MOSI (VSPI MOSI)

// Rotary encoder (active LOW, external 5.1k pull-ups)
#define PIN_ENC_A     26  // Encoder channel A
#define PIN_ENC_B     27  // Encoder channel B
#define PIN_ENC_SW    14  // Encoder push switch

// Audio output (PWM/DAC → PAM8403 amplifier)
#define PIN_AUDIO     25  // DAC1 output (IO25 is DAC channel 1)

// UART (directly to CH340C — used by USB serial, avoid reassigning)
// #define PIN_TXD0    1
// #define PIN_RXD0    3

// RTC crystal (do not use as GPIO)
// IO32 — XTAL 32.768kHz XIN
// IO33 — XTAL 32.768kHz XOUT

Notes for Firmware

  • SPI: IO17/IO18/IO23 map to the default VSPI bus (CLK=18, MOSI=23). IO17 is used as CS but is not the default VSPI CS0 (IO5), so configure it manually.
  • Audio: IO25 is one of the ESP32's two DAC outputs (DAC1). You can use dacWrite(25, value) for simple waveforms, or configure I2S for higher quality audio output to the PAM8403.
  • Rotary encoder: Use interrupt-driven decoding on IO26/IO27. The push button on IO14 should be debounced in software.
  • RTC crystal: IO32/IO33 are dedicated to the 32.768kHz crystal. Use the ESP32's internal RTC with this external crystal for accurate timekeeping. Configure via rtc_clk_32k_enable() or the ESP-IDF RTC API.
  • Boot strapping: IO0 is used for boot mode (auto-reset handles this). IO2 is NC. IO12/IO15 affect boot — if using them, ensure they're not pulled to unexpected states at power-on.

Parts

34
QtyValueFootprintReferences
105.1kResistor_SMD:R_0805_2012MetricR1, R2, R3, R4, R6, R7, R8, R9, R10, R11
3100nFCapacitor_SMD:C_0603_1608MetricC1, C6, C9
31uFCapacitor_SMD:C_0603_1608MetricC4, C5, C10
222pFCapacitor_SMD:C_0603_1608MetricC7, C8
2470nFCapacitor_SMD:C_0603_1608MetricC2, C3
12.7kResistor_SMD:R_0805_2012MetricR5
174HCT04T14-13Package_SO:TSSOP-20_4.4x6.5mm_P0.65mmU1
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U4
1CH340CPackage_SO:SOIC-16_3.9x9.9mm_P1.27mmU3
1CM315D32768DZFTfootprints:XTAL_CM315D32768DZFTY1
1Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalSPK1
1Conn_01x05footprints:FC-16J3
1ESP32-WROOM-32RF_Module:ESP32-WROOM-32U5
1MMDT3904-7-FPackage_TO_SOT_SMD:SOT-363_SC-70-6Q1
1PAM8403DRPackage_SO:SOP-16_3.9x9.9mm_P1.27mmU2
1PEC09-2320F-S0015Rotary_Encoder:RotaryEncoder_Bourns_Horizontal_PEC09-2xxxF-SxxxxSW1
1UJ20-C-V-C-1-SMT-TRConnector_USB:USB_C_Receptacle_GCT_USB4115-03-CJ1

The 32 most common of 34 parts.

Questions

How big is the HEDC B002 PCB?

It measures 64.1 × 31.8 mm and has 2 copper layers, 1.6 mm thick.

What parts does the HEDC B002 use?

34 parts, built around the CH340C, ESP32-WROOM-32, PAM8403DR and AMS1117-3.3. 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 HEDC B002 KiCad files?

From the Thaddeus-Maximus/dotclock repository on GitHub, at the commit this page was made from: the board is HEDC-B002/HEDC-B002.kicad_pcb and its schematic HEDC-B001/HEDC-B001.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the HEDC B002 design in my own project?

Its repository states no licence, so its author keeps all rights: ask Thaddeus-Maximus before reusing the design.

More from Thaddeus-Maximus/dotclock

1
  • 2 layers131.1 × 149.9 mmHEDC B001, the printed circuit board in 3D

    HEDC B001

    Thaddeus-Maximus/dotclock

    An ESP32-based alarm clock with a dot matrix LED display, rotary encoder interface, MP3 audio playback, and a web configuration UI.

    70 parts

Similar boards

  • 4 layers38.4 × 128.5 mmPlantpal, the printed circuit board in 3D

    Plantpal

    teapotlaboratories/plantpal

    Your pal in plant care

    121 parts98MIT
  • 4 layers38.4 × 128.5 mmPlantpal, the printed circuit board in 3D

    Plantpal

    rajeev2705/PROJECTS

    Welcome to my PCB projects repository! This space is dedicated to documenting my journey in designing, creating, and improving printed circuit boards (PCBs).

    127 parts
  • 2 layers44.2 × 2.2 mmHead phone proj, the printed circuit board in 3D

    Head phone proj

    Teja-Pavan30/Headphone_design

    pcb design of head phone and CAD

    79 partsMIT
  • 4 layers109.5 × 79 mmAirQuality, the printed circuit board in 3D

    AirQuality

    Tsquash/AirQualityMonitor

    AQM is an ESP32-C6-based, Matter compatible, indoor air-quality monitor. It measures carbon dioxide, temperature, humidity, VOC, and NOx, displays the latest readings on an e-paper display, and publishes its…

    47 partsApache-2.0
  • 2 layers65 × 56 mmAMS Dongle, the printed circuit board in 3D

    AMS Dongle

    EOSCogniton/ELIZ-2022

    Le Git Artemiz de l'EPSA. Contient le Catia, ainsi que la documentation en cours et quelques modèles.

    46 parts4
  • 2 layers85 × 56 mmHB RF ETH, the printed circuit board in 3D

    HB RF ETH

    alexreinert/PCB

    Some of my PCBs

    96 parts104
  • 2 layers139.7 × 88.9 mmCharge Controller, the printed circuit board in 3D

    Charge Controller

    jharvey/Charge_Controller

    MPPT hardware which uses FUGU firmware

    163 parts24