hardware · esp-smart-home
ESP Smart Home main board
One cased board that switches five loads at 3, 5 or 12 V, from USB-C, a 12 V supply or AA cells, and puts the small things in my house into Home Assistant.


The main board of my smart-home setup: an 81 x 63 mm KiCad PCB that takes 12 V, USB or four NiMH cells, makes 5 V and 3.0 V rails, and switches five load channels from a Wemos D1 mini. It ships in a 3D-printed wall-mount case.
Specs
Wire 12 V backwards and nothing burns
J12F2C15Q3 AO3401A high side, gate held at half the input by R2/R8 100k · D7 SMBJ15A · F2 3 A PTC
A P-channel MOSFET in the 12 V line only conducts when the wires go the right way round, and a TVS diode clamps spikes. Its 3 A fuse also covers the 12 V loads.
Three sources, one 5 V rail
J10J1J5F1F3L2C13L1F1 2 A USB · F3 2 A battery · D3/D5/D8 SS34 diode-OR · XL1509 to 5 V · TLV62569 to 3.0 V
USB-C, 12 V through a buck, or four NiMH cells, each behind its own fuse. Schottky diodes merge them onto 5 V, so the highest source wins and none back-feeds another.
3 V, 5 V or 12 V, per wire
J9J8Q11 to Q15 AO3400A low side · 100 Ω gate, 10k pull-down · 1N5819W flyback
Each channel switches the load's ground, so its + wire can sit on any rail. A 10k pull-down keeps loads off while the ESP boots, and a diode across each channel catches the kick from a motor or pump.
Know when the cells are tired
SW1R9/R10 100k/100k from the pack to BAT_SENSE · SW1-2 to A0 · SW1-1 status LEDs on/off
Two 100k resistors halve the pack voltage so it fits the ESP's only analog pin. DIP switch 2 hands that pin to the battery or to a sensor on the header.
A sensor that reads the room
U2J7J6J2J11U1DHT11 (DHT22 compatible), 10k pull-up · J7 I2C · J6 GPIO · D1 mini antenna over a board cutout
The DHT sits at the board edge, about 40 mm from the nearest buck, behind its own lid window, so it reads the room. Headers beside it take I2C or GPIO sensors.
D1 mini
U1WEMOS D1 mini (ESP8266) on female headers
Sits on two 1x8 female headers, so it stands 8.5 mm above the board and its micro-USB lines up with the slot in the back wall. Its antenna end hangs over a cutout with no copper under it.
12 V input protection
Q3R2R8D7AO3401A reverse-polarity guard · SMBJ15A TVS
Q3 is a P-channel MOSFET on the high side of the 12 V input. R2/R8 hold its gate at half the input, so it turns on only with the right polarity. D7 clamps surges.
12 V to 5 V buck
L2U4C13C15D9XL1509-5.0 with 68 uH 2.5 A+ inductor
XL1509-5.0 steps 12 V down to 5 V with an SS34 catch diode. The 68 uH inductor and two 220 uF 25 V low-ESR caps are hand-soldered. The case floor has vents under it.
5 V to 3.0 V buck
U3L1R6R7TLV62569 with 2.2 uH 2 A+ inductor
TLV62569 makes the 3.0 V load rail from 5 V. The 300k/75k feedback divider sets 3.0 V; the 2.2 uH inductor is hand-soldered.
PTC fuses
F1F2F3Bourns MF-RHT200 (2 A) and MF-RHT300 (3 A) resettable fuses
F1 (USB) and F3 (battery) are 2 A, F2 (12 V) is 3 A. The lid has vents above them because PTC hold current drops about 20 % at 50 °C.
Status LEDs
D21D22D23D240805 LEDs, switched by SW1-1
Four LEDs for 12V, 5V, 3V0 and BAT shine through labelled holes in the case floor. DIP switch 1 turns them off.
Downloads
- STLCase base1.9 MB
- STLCase lid995 KB
- PDFSchematicComing soon
- ZIPGerbersComing soon
Build notes
- Trim every through-hole lead under the board to 2 mm or less. The board sits 3.5 mm above the case floor.
- The DHT11's leads are 6 mm long; trim them too.
- Fit the single M3x6 self-tapping screw at H4 under the D1 mini before you plug the D1 mini in.
- Put the lid on and fasten it with three M3x25 self-tapping screws through H1, H2 and H3. The lid posts clamp the board.
- Print in PETG with a 0.4 mm nozzle, 0.2 mm layers, 3 walls and 20 % infill, no supports. Print the base upright and the lid top face down.
