

An over-engineered light switch
- Size
- 67.4 × 28.6 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 26
- Nets
- 34
- Pads
- 95
- Tracks, vias
- 0, 0
- Routed
- Not yet
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 9 Jun 2025
- Updated
- 28 Feb 2026
Overview
Lamp is an open-source printed circuit board by PaulBone, from the PaulBone/lamp-smartener repository on GitHub. It is a 2-layer board of 67.4 × 28.6 mm with 26 parts on 34 nets.
It is built around the LM393, AO3401A and AO3400A. Its parts include 11 resistors, 5 transistors, 2 capacitors, 2 ICs and 2 connectors. It belongs with the lEDs and displays boards and the ESP32 and RISC-V boards of this library.
Main components
3LM393
SOP-8-16V~16V 0℃~+70℃ 2 2.5mA 250nA 2V~36V 36V 5mV 5nA Fail-safe function Open-drain SOP-8 Comparators ROHSMSKSEMIComparatorsAO3401A
SOT-231 P-Channel 14nC@10V 30V 47mΩ@10V、60mΩ@4.5V、85mΩ@2.5V 4A 55pF 645pF 80pF 900mV SOT-23 MOSFETs ROHSAlpha & Omega SemiconductorMOSFETsAO3400A
SOT-23-55℃~+150℃ 1 N-channel 1.45V 1.4W 30V 48mΩ@2.5V 5.7A 50pF 630pF 75pF 7nC@10V N-Channel SOT-23 MOSFETs ROHSAlpha & Omega SemiconductorMOSFETs
README
README.mdLamp Smartener
This is the "Lamp Smartener" or "Overengineered Light Switch" it works on USB powered LED lights.
WIP
Component selection
- the NE7000 can be substituted for any N-type with a Vth around 1-2 V. and can switch 5V,
- The AO3400 can be substituted for any N-type that can handle 600mA of current, and switch 5V. And disipate 1.25W of heat.
- Likewise AO3401 can be substituted for any P-type that can handle 600mA of current and switch 5V.
- TODO resistor tollerance
- TODO current limiter advice.
Assembly notes
Solder the small SMD components first, it's easier to reach them before you put the big ones in.
Solder the switches before mounting the USB ports, the usb port shield pin will interfere with switch soldering.
Do not confuse the mosfet types. They're different for good reasons. p-type and n-type just arnt' compatible. However, the NE7000 can be substituted with more AO3400 units (probably), but not the other way around.
TODO: Add alterantive 2 and 1 port versions with the current limiter.
Mount the uC with either pin headers or directly. for direct soldering try holding it in place with pins/wires in the through-holes then solder the edges.
Firmware
Firmware uses the esphome framework and can be compiled with, replace lamp-smartener.yaml with the name of the .yaml file to match your lamp smartener, single-lamp.yaml or double-lamp.yaml. If you're using single-lamp.yaml check the pin names in the file match what you've soldered on the board.
$ mkdir /tmp/esphome $ docker run --rm --privileged -v "${PWD}":/config -v "/tmp/esphome:/config/.esphome" --device=/dev/ttyACM0 -it ghcr.io/esphome/esphome run lamp-smartener.yaml
Assuming you have pluged the ESP32 module into your PC and it is connected at /dev/ttyACM0
Alternatlvely you can build and flash it in separete steps, this will erase any wifi credentials that may be on the device, the above method does not:
$ mkdir /tmp/esphome $ docker run --rm --privileged -v "${PWD}":/config -v "/tmp/esphome:/config/.esphome" -it ghcr.io/esphome/esphome compile lamp-smartener.yaml $ cp /tmp/esphome/build/lamp-smartener/.pioenvs/lamp-smartener/firmware.factory.bin . $ esptool.py write_flash 0x0 firmware.factory.bin
The device will reboot and create a new Wifi network with "Lamp Smartener" in its name. The password is "Overengineered Light Switch". Connect to it with something like your phone then visit http://192.168.4.1 Tell the page there what wifi network you'd like it to join.
Home assistant will be able to discover it, if you use (or would like to use) esphome's dashboard to maintain firmware updates (which is available as a HA addon) you can adopt the device there as well.
Using the device
Each button will twoggle it's lamp (if installed) or drive automations in Home Assistant. In the single lamp version by default the 2nd button does nothing directly, but it can be used to run automations in home assistant.
Pressing and holding both buttons together for 10 seconds will initiate a factory reset, the status light will glow orange and any lamps will flash, keep holding the buttons for another 5s to conform the factory reset, otherwise release buttons to cancel.
Each button can be "disconnected" from its light by turning the "direct" control switch off for that switch and lamp. Eg if the button should run a home assistant automation instead (which may turn on the lamp to 50% brightness if you touch the button after midnight, and full brightness otherwise). The "direct" setting will persisted across reboots.
Parts
26| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 10K | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R1, R2, R3, R4, R6, R11 |
| 2 | 100 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R8, R10 |
| 2 | 2N7002 | Package_TO_SOT_SMD:SOT-23_Handsoldering | Q1, Q3 |
| 2 | AO3401A | Package_TO_SOT_SMD:SOT-23_Handsoldering | Q2, Q4 |
| 2 | SW_Push | My footprints:SW_SMD_Tact_6mm | SW1, SW2 |
| 2 | USB_A | Connector_USB:USB_A_Receptacle_GCT_USB1046 | J1, J2 |
| 1 | 0 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R7 |
| 1 | 0.1 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R5 |
| 1 | 0.1uF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C2 |
| 1 | 100uF | Capacitor_SMD:CP_Elec_5x5.7 | C1 |
| 1 | 4.7K | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R9 |
| 1 | AO3400A | Package_TO_SOT_SMD:SOT-23_Handsoldering | Q5 |
| 1 | ESP32-C6_SUPERMINI_SMD | My footprints:MODULE_ESP32-C3_SUPERMINI | U1 |
| 1 | LM393 | Package_SO:SOP-8_3.9x4.9mm_P1.27mm | U2 |
The 24 most common of 26 parts.
Questions
How big is the Lamp PCB?
It measures 67.4 × 28.6 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Lamp use?
26 parts, built around the LM393, AO3401A and AO3400A. 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 Lamp KiCad files?
From the PaulBone/lamp-smartener repository on GitHub, at the commit this page was made from: the board is electronics/Lamp.kicad_pcb and its schematic electronics/Lamp.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Lamp design in my own project?
Its repository states no licence, so its author keeps all rights: ask PaulBone before reusing the design.
Similar boards
- 4 layers189.4 × 59.1 mm

- 2 layers37 × 70.9 mm

Opendiag
maximus64/opendiag-hardware
OpenDIAG - Open Source OBD2 Interface (Hardware)
148 parts5CERN-OHL-S-2.0 - 2 layers57 × 50 mm

- 4 layers72.4 × 44.4 mm

Btmdpcb v04 eval
17o2/bluetooth-minidisc
Adding built-in bluetooth connectivity to a 20-year-old Mindisc player
115 parts45 - 4 layers90 × 90 mm

- 4 layers39 × 67.3 mm

Neptune
jackbrad1ey/water_jet_tvc
A water-propelled thrust vector control (TVC) testbed vehicle aiming to decrease the cost and time factors associated with developing TVC control algorithms
69 parts1 - 4 layers68.1 × 75 mm

- 2 layers140 × 218 mm

Helio-485
GrizJW/helio-485
Helio-485 KiCad board: ESP32-C5, 2S 18650, solar input, 3.3 V, 12 V 2 A, RS-485 Modbus.
106 parts