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.

Top view of the ESP Smart Home main board
Bottom view of the ESP Smart Home main board, where the factory places the small parts
All 52 small parts sit underneath, because the low-cost assembly service places one side only. The bulky through-hole parts are on top, where I solder them by hand.

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

    J12
    F2
    C15

    Q3 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

    J10
    J1
    J5
    F1
    F3
    L2
    C13
    L1

    F1 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

    J9
    J8

    Q11 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

    SW1

    R9/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

    U2
    J7
    J6
    J2
    J11
    U1

    DHT11 (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

    U1

    WEMOS 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

    Q3
    R2
    R8
    D7

    AO3401A 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

    L2
    U4
    C13
    C15
    D9

    XL1509-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

    U3
    L1
    R6
    R7

    TLV62569 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

    F1
    F2
    F3

    Bourns 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

    D21
    D22
    D23
    D24

    0805 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

Build notes

  1. Trim every through-hole lead under the board to 2 mm or less. The board sits 3.5 mm above the case floor.
  2. The DHT11's leads are 6 mm long; trim them too.
  3. Fit the single M3x6 self-tapping screw at H4 under the D1 mini before you plug the D1 mini in.
  4. Put the lid on and fasten it with three M3x25 self-tapping screws through H1, H2 and H3. The lid posts clamp the board.
  5. 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.