

LEDDs
PCB and enclosure design of a trailing edge light bulbs dimmer
- Size
- 95 × 46 mm
- Copper layers
- 2
- Thickness
- 1.1 mm
- Parts
- 91
- Nets
- 59
- Pads
- 252
- Tracks, vias
- 460, 92
- Pours
- 66
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 22 Feb 2025
- Updated
- 7 Mar 2026
Overview
LEDDs is an open-source printed circuit board by VasilKalchev, from the VasilKalchev/LEDDs repository on GitHub, published under the MIT licence. It is a 2-layer board of 95 × 46 mm with 91 parts on 59 nets, routed with 460 tracks and 92 vias.
It is built around the HLK-PM03, AP2112K-3.3 and ESP32-C3-12F, with the H11L1SR2M, 1N4148W and MMBT3904 among its other parts. Its parts include 31 resistors, 16 capacitors, 13 diodes, 6 transistors and 5 ICs. It belongs with the home automation and IoT boards and the ESP32 and RISC-V boards of this library.
Main components
10HLK-PM03
插件0.1W 1 100mVp-p 15mm 1A 20mm 3.3V 34mm 3W 3kV 70V~350V 72% 85VAC~265VAC AC/DC-DC Short Circuit Protection、Over Current Protection ±0.2% 插件 AC-DC Power Modules ROHSHI-LINKAC-DC Power ModulesAP2112K-3.3
SOT253.3V 600mA CMOS Low Dropout Linear Regulator with EnableDiodes IncorporatedUncategorisedESP32-C3-12F
SMD-22_16.0X24.0X2.00PSMD-22P New Arrivals ROHSAi-ThinkerUncategorisedH11L1SR2M
SOP-6-2.54mm-40℃~+85℃ 0.4V 1 1.2V 1.6mA 1Mbit/s 250mW 30mA 3V~15V 4.17kV 4us 4us 50mA 6V DC SOP-6-2.54mm Logic Output Optoisolators ROHSonsemiLogic Output Optoisolators1N4148W
SOD-123150mA 1A 1V@50mA 1uA@75V 400mW 4ns 75V Independent SOD-123 Switching Diodes ROHSSTMicroelectronicsSwitching DiodesMMBT3904
SOT-23-55℃~+150℃ 1 NPN 100 100nA 200mA 200mW 300MHz 300mV 40V 6V NPN SOT-23 Bipolar (BJT) ROHSJiangsu Changjing Electronics Technology (CJ)Bipolar (BJT)IPN80R900P7
SOT-223-2SOT-223-3 MOSFETs ROHSInfineon TechnologiesMOSFETsUF4004
DO-41-55℃~+175℃ 10uA@400V 1A 1V@1A 30A 400V Independent DO-41 Diodes - General Purpose ROHSLGEDiodes - General PurposeBZV55C15
LL-34-65℃~+200℃ 1 Independent 100nA@11V 110Ω 13.8V~16.6V 14.7V 30Ω 500mW LL-34 Zener Diodes ROHSLGEZener DiodesMMBT3906
SOT-23-55℃~+150℃ 1 PNP 100 100nA 200mA 200mW 300MHz 300mV 40V 5V PNP SOT-23 Bipolar (BJT) ROHSTWGMCBipolar (BJT)
README
readme.md
trailing-edge dimmer for LED bulbs
LEDDs is an open-source hardware, DIY, smart dimmer for 230 V LED bulbs. It is built around the ESP32-C3-12F and is designed to sit on a desk or table, replacing standard inline cord switches.
The project consists of a PCB, a 3D-printable chassis, and a top plate designed as a PCB. It runs ESPHome for integration with Home Assistant and features a rotary encoder so it can be controlled easily or used as a standalone device.
[!CAUTION] MAINS VOLTAGE: This device operates at 230 VAC. Touching live components can result in serious injury or death.
- Only build if you have relevant experience with high-voltage electronics.
- Always unplug before opening!
- While the design includes safety features (fuse, MOVs), it is not a certified design and should be treated with caution.
Table of contents
- Is this project for you?
- Why trailing-edge?
- Features
- Specifications
- Release/fabrication of version 2.0
- Repository structure
- Bill of materials
- Build
- Usage
- Versions, releases and compatibility
- Contributing
- License
Is this project for you?
This project is suitable if you:
- have experience with mains-powered electronics
- want a LED bulbs dimmer for a desk
This project is NOT suitable if you:
- are new to electronics
- need a certified wall dimmer
Why trailing-edge?
Most dimmers use leading-edge (TRIAC) dimming (designed for incandescent bulbs). They modulate power to the load by cutting the beginning of the AC half cycle. This creates a voltage spike that can cause buzzing and reduced lifespan in the capacitive power supplies found in LED bulbs.
LEDDs uses trailing-edge dimming. By using MOSFETs to cut the waveform at the end of the AC cycle, there isn't a positive voltage spike. This results in:
- reduced electrical noise and buzzing
- smoother dimming with reduced flicker
- lower minimum brightness levels
The schematic and PCB can be viewed in KiCanvas.
:star: Features
- ESP32-C3 based with ESPHome firmware for integration with Home Assistant
- Standalone operation, doesn't require Home Assistant
- Rotary encoder control: rotate to dim, press+rotate for effects, press for on/off
- LEDs: red (rotation feedback), blue (status indicator), white (ambient)
- Included enclosure design: 100 mm × 51 mm × 25 mm - ideal for desk lamp modifications
- Low idle power: ~0.3 W
- Open source: MIT licensed
:straight_ruler: Specifications
| Parameter | Value |
|---|---|
| Input voltage | 230 VAC |
| Maximum output power | 100 W |
| Idle power draw | ~0.3 W |
| Protections | fuse and MOVs |
| Microcontroller module | ESP32-C3-12F 1 |
| Dimensions | 100 × 51 × 25 mm (W × D × H) |
| Connectivity | Wi-Fi, USB-C (programming) |
[!IMPORTANT] Designed for 230 VAC at 50 Hz.
Usage with 120 VAC at 60 Hz will probably require adjusting the component values of the zero-cross and the voltage regulator circuits.
Release/fabrication of v2.0
Status: Verified working. The fabricated board from this release is fully functional. Minor issues may exist but do not affect operation: /doc/releaselog.md v2.0.
:memo: Recommended for fabrication.
:open_file_folder: Repository structure
├── hw/ # main PCB design (KiCad project)
│ ├── lib/ # symbols and footprints
│ ├── assets/ # fonts and graphics
│ └── export/ # scripts for exporting gerbers, BOM and schematics/PCB PDFs
├── fw/ # ESPHome YAML configurations and firmware binaries
├── doc/ # additional documentation
│ ├── releaselog.md # main PCB release log
│ ├── changelog.md # main PCB change log
├── enclosure/
│ ├── chassis/ # 3D printable chassis
│ │ ├── releaselog.md # chassis release log
│ │ ├── changelog.md # chassis change log
│ │ ├── vX.Y-variant_a/
│ │ └── vX.Y-variant_b/
│ └── top_plate/ # top plate design (KiCad project)
│ ├── releaselog.md # top plate release log
│ ├── changelog.md # top plate change log
│ ├── vX.Y-variant_a/
│ └── vX.Y-variant_b/
└── img/ # photos and renders:euro: Bill of materials
- components: ~€15
- PCB: €4 (ordered as prototype board)
- top plate: €0-4 (can be combined with the main PCB)
- chassis: €4-10 (when ordered)
Check out the BOM provided in the release bundle for complete components list.
:hammer: Build
Overview
Building LEDDs consists of four main steps:
- Ordering the PCB, the chassis and the components.
- Assembling the PCB.
- Flashing and configuring the firmware.
- Wiring and final assembly.
Prerequisites
- skills: soldering 2, experience with mains electricity
- tools: soldering iron, hot air gun (recommended), 3D printer or access to 3D printing service, multimeter
Download the release bundle.
1. Ordering the components
- PCBs: order the main PCB and the top plate PCB from your preferred fabricator
- gerbers for JLCPCB: available in the bundle
- for other fabricators - use KiCad to generate gerbers according to the manufacturer's instructions
- chassis: choose a variant from the provided STL files
2. PCB assembly instructions
[!TIP] Use the provided interactive BOM ("ibom.html") as a soldering guide.
Microcontroller module
ESP32-C3-12F (recommended)
- solder R13
ESP8266 ESP-12F (not recommended)
- insulate pins 12 and 13 from the PCB pads using kapton/electrical tape
- solder JP2
- don't solder R13
- don't solder R6 and D3 ("led_1")
- don't solder R8 and D5 ("led_3")
ESP8266 doesn't support native USB and requires an external USB to serial adapter for programming.
Zero-cross optoisolator
The PCB has footprints for a choice between 2 optoisolators that connect the zero-cross signal to the MCU.
H11L1SR2M
- solder the optoisolator on footprint U4
- solder C13
PC817XI (not recommended)
- solder the optoisolator on footprint U3
- no need to solder C13
This optoisolator is the same as the one used for controlling the MOSFET's gate, but didn't work well for the zero-cross circuit.
Skipping the relay
The relay is used to power off the mains part of the circuit when the load is turned off. This is intended as a peace of mind feature and can be omitted.
- use a wire to short pin 11 to 14
- use a wire to short pin 21 to 24
- no need to solder C3, D2, R2 and Q1
Skipping the rotary encoder
If the rotary encoder is not required - solder a push button (SW2) so boot mode can be entered manually.
- no need to solder R3, R4, C4, C5 and C6
A modified top plate (without a hole in the middle) is recommended for safety reasons (not currently available).
Using the UART header instead of the USB for programming (not tested)
- solder R12
- solder header J4
- no need to solder R9 and R10
Use a USB to serial adapter.
3. Flashing the firmware
- Connect to the board via USB-C.
- Use ESPHome's web flasher to upload one of the provided firmware binaries.
- hass.bin: Home Assistant + rotary encoder
- web_server.bin: self hosted web server + rotary encoder
- standalone: rotary encoder only
- Set your Wi-Fi credentials using the ESPHome web flasher.
- Test before wiring.
[!TIP] The YAML configurations of the provided binaries are available under /fw/esphome/yaml/.
4. Preparing the enclosure
- plastic chassis: install the heat-set threaded inserts in the holes using a soldering iron
- resin chassis: no preparation needed
5. Final assembly
- Mount a knob to the rotary encoder.
- Place the PCB inside the chassis.
- Screw the mains power cable to the terminal on the left (marked with a power plug). Don't connect power until fully assembled.
- Screw the lamp socket cable to the terminal on the right (marked with a bulb).
- Pass the screws through the top plate and place the spacers on the screws.
- Screw the top plate through the PCB into the chassis.
:bulb: Usage
Control
Directly (possible with all firmware variants):
- press: on/off
- rotate: brightness adjustment
- press + rotate: cycle lighting effects
Home Assistant (included in hass.bin):
Integrating the device in Home Assistant: https://esphome.io/guides/getting_started_hassio/#connecting-your-device-to-home-assistant.

The "Configuration" section allows customization of the device:
- Bulb power rating: input the power rating of the bulb, this is used for the power estimation sensor ("Power [est]").
- Gamma correct: Adjust the dimming curve to appear linear to the human eye.
- Minimum level: The lowest level at which the bulb emits light. Note: this value needs to be updated every time gamma correction is changed.
- Restore mode: Initial state of the bulb when powered.
- Transition length: How fast the bulb changes brightness in milliseconds.
- LED: red/blue/white: set the ambient brightness of the LEDs.
Web server (included in web_server.bin):
This is useful if you don't have Home Assistant, but want to control the device remotely.

LED indicators
There are three LEDs on the board:
- red (top, led_1): ambient / rotation feedback
- blue (top, led_2): ambient / status indicator
- white (bottom, led_3): ambient
Default light effects
Light effects can be cycled with the rotary encoder or chosen directly from a UI.
- Pulse (low, fast)
- Pulse (low, slow)
- Pulse (high, fast)
- Pulse (high, slow)
- Pulse (full, fast)
- Pulse (full, slow)
- Flicker (soft)
- Flicker (intense)
:page_with_curl: Versions, releases and compatibility
Each fabrication run results in a GitHub release.
- Semantic versioning (major.minor), no patch versions.
- PCB, chassis, and top plate are versioned independently.
- Same major versions fit together.
:coffee: Contributing
Every type of contribution is welcome, like improvements or corrections to the:
- schematic/PCB design
- documentation
- enclosure (chassis and top panel) design
- ESPHome configuration
Contributions can be made as improvements or as variants (e.g. different enclosure design, ESPHome configuration, etc.).
gitGraph
commit tag: "v1.0"
branch improve_x
checkout improve_x
commit id: "Improve x"
commit id: "Re-generate exports"
commit id: "Update board documentation"
checkout main
merge improve_x tag: "v1.1"
branch replace_y
checkout replace_y
commit id: "Replace y"
commit id: "Generate exports"
commit id: "Compile binaries"
commit id: "Update all documentation"
checkout main
merge replace_y tag: "v2.0"You're welcome to post your builds in Discussions: Show and tell.
License
This project is licensed under the MIT License.
Disclaimer: This project involves mains voltage electricity. The author assumes no liability for injury, damage, or regulatory violations. Build and use at your own risk. Ensure compliance with local electrical codes and regulations.
Footnotes
Parts
91| Qty | Value | Footprint | References |
|---|---|---|---|
| 8 | 20k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R3, R4, R5, R11, R12, R13, R23, R25 |
| 7 | 100n | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C3, C4, C5, C6, C10, C13, C14 |
| 6 | 1N4148W | Diode_SMD:D_SOD-123 | D2, D6, D7, D8, D9, D10 |
| 4 | 20k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R28, R29, R30, R31 |
| 4 | 91k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R16, R17, R18, R19 |
| 3 | 1u | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C7, C8, C9 |
| 3 | 20mm | MountingHole:MountingHole_3.2mm_M3_DIN965_Pad_TopBottom | H1, H2, H3 |
| 3 | 240 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R6, R8, R22 |
| 3 | MMBT3904 | Package_TO_SOT_SMD:SOT-23 | Q1, Q2, Q3 |
| 2 | 0 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R14, R15 |
| 2 | 100n | Capacitor_THT:C_Rect_L13.0mm_W6.0mm_P10.00mm_FKS3_FKP3_MKS4 | C1, C15 |
| 2 | 275V | Varistor:RV_Disc_D9mm_W3.5mm_P5mm | RV1, RV2 |
| 2 | 30 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R24, R26 |
| 2 | 330 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R1, R2 |
| 2 | 5k1 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R9, R10 |
| 2 | IPN80R900P7 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | Q5, Q6 |
| 2 | PC817XI | PC817XI:SOIC254P975X460-4N | U3, U5 |
| 2 | Screw_Terminal_01x02 | TerminalBlock:TerminalBlock_bornier-2_P5.08mm | J1, J5 |
| 2 | UF4004 | UF4004:DIOAD1055W87L533D272 | D11, D12 |
| 2 | ~ | Button_Switch_SMD:SW_Push_SPST_NO_Alps_SKRK | SW1, SW2 |
| 1 | 100k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R21 |
| 1 | 10u | Capacitor_SMD:CP_Elec_5x5.7 | C12 |
| 1 | 120 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R7 |
| 1 | 220 | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R27 |
| 1 | 220u | Capacitor_SMD:CP_Elec_8x6.5 | C2 |
| 1 | 330u | Capacitor_SMD:CP_Elec_8x10 | C16 |
| 1 | 4.7n | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C11 |
| 1 | 500mA | Fuse:Fuse_Schurter_UMZ250 | XF1 |
| 1 | 56k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R20 |
| 1 | AP2112K-3.3 | Package_TO_SOT_SMD:SOT-23-5 | U1 |
| 1 | BZV55C15 | Diode_THT:D_DO-41_SOD81_P7.62mm_Horizontal | D13 |
| 1 | Conn_01x02_Pin | Connector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_Vertical | J2 |
| 1 | Conn_01x06 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J4 |
| 1 | ESP32-C3-12F | ESP32-C3-12F:ESP32-C3-12F_RFS | U2 |
| 1 | GNDD | TestPoint:TestPoint_Pad_D1.0mm | TP1 |
| 1 | H11L1SR2M | H11L1SR2M:IC_H11L1SR2M | U4 |
| 1 | HLK-PM03 | Converter_ACDC:Converter_ACDC_Hi-Link_HLK-PMxx | A1 |
| 1 | MMBT3906 | Package_TO_SOT_SMD:SOT-23 | Q4 |
| 1 | Relay_DPDT | Relay:HK19F | K1 |
| 1 | RotaryEncoder_Switch | Rotary_Encoder:RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm | RE1 |
| 1 | SolderJumper_2_Bridged | Jumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mm | JP1 |
| 1 | SolderJumper_2_Open | Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm | JP2 |
| 1 | USB_C_Receptacle_USB2.0_14P | Connector_USB:USB_C_Receptacle_GCT_USB4110 | J3 |
| 1 | blue | LED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder | D4 |
| 1 | high voltage sign | LOGO | SS1 |
| 1 | red | LED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder | D3 |
| 1 | white | LED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder | D1 |
| 1 | ~ | LED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder | D5 |
Questions
How big is the LEDDs PCB?
It measures 95 × 46 mm and has 2 copper layers, 1.1 mm thick.
What parts does the LEDDs use?
91 parts, built around the HLK-PM03, AP2112K-3.3, ESP32-C3-12F and H11L1SR2M. 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 LEDDs KiCad files?
From the VasilKalchev/LEDDs repository on GitHub, at the commit this page was made from: the board is hw/LEDDs.kicad_pcb and its schematic enclosure/top_plate/v2.0-bicycle/hw/top_plate.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the LEDDs design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).
Similar boards
- 2 layers96.5 × 53.3 mm

- 2 layers24.5 × 15.2 mm

- 4 layers100 × 60 mm

Pikocore gamepad
sebasdv/pikocore_gamepad
Fork of pikocore ported to run on the Waveshare RP2350-PiZero + GamePi13 handheld — full-color LCD dashboard, 12-button menu, and save/load state on a lo-fi sampler that was originally knob-only.
76 partsMIT - 2 layers105.5 × 81.1 mm

Buck
almondsun/DynamicSystemsAndControl
Dynamic Systems and Control coursework: Buck converter modeling, reports, KiCad PCB and STM32 firmware
57 parts - 2 layers124.5 × 99.1 mm

Vetrnik power
ondras12345/vetrnik
Electronics for heating water with power from a 2 kW wind turbine
138 parts - 2 layers60 × 43 mm

- 4 layers42.4 × 66.1 mm

NB IoT PCB rev 1 1
JurCag/NB_IoT_app
Project utilizes NB-IoT technology to transmit sensory data to the cloud, while simultaneously enabling local communication through BLE mesh.
58 parts3 - 2 layers146.6 × 112.5 mm

Body Control Module
Mustafa614/Body-Control-Module-Mini
This Module are controlling wipers,baclights,door statues and comminicates with another ecu's via can bus
74 parts


