

Smartswitch
sonnen battery controller based on ESP8266/ESP32 to drive a 3.3kW heater (Heißwasserspeicher-Einbauheizung) and integrates with the local hot water system.
- Size
- 48.3 × 83.8 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 35
- Nets
- 33
- Pads
- 74
- Tracks, vias
- 115, 8
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 6 Sep 2023
- Updated
- 8 Oct 2026
Overview
Smartswitch is an open-source printed circuit board by mlauke, from the mlauke/smartswitch repository on GitHub, published under the MIT licence. It is a 2-layer board of 48.3 × 83.8 mm with 35 parts on 33 nets, routed with 115 tracks and 8 vias.
It is built around the BT136, MOC3042M and BC550, with the BC557 and G17 among its other parts. Its parts include 11 resistors, 6 connectors, 3 ICs, 3 transistors and 2 diodes. It belongs with the ESP32 and ESP8266 boards of this library.
Main components
5BT136
TO-220-3L-40℃~+125℃ 1 TRIAC 1.45V 1.7V 10mA 20mA 25A 500mW 600V 6A TO-220-3L Thyristors (SCR)/Modules ROHSJiangsu Changjing Electronics Technology (CJ)Thyristors (SCR)/ModulesMOC3042M
DIP-6-40℃~+85℃ 1 1.5V 1000V/us 1A 250mW 4.17kV 400V 6 60mA TRIAC Yes DIP-6 Triac, SCR Output Optoisolators ROHSonsemiTriac, SCR Output OptoisolatorsBC550
TO-92-31 NPN 100mA 110 15nA 300MHz 45V 500mW 600mV 6V NPN Standalone TO-92-3 Bipolar (BJT) ROHSonsemiBipolar (BJT)BC557
TO-921 PNP 100mA 100nA 150MHz 45V 500mW 6V 800 90mV、250mV PNP TO-92 Bipolar (BJT) ROHSDDFBipolar (BJT)G17
SOT-23-3SOT-23-3 MOSFETs ROHSGOFORDMOSFETs
README
README.mdSonnen SmartSwitch
DIY sonnen battery controller based on ESP8266/ESP32 to drive a 3.3kW heater (Heißwasserspeicher-Einbauheizung) and integrates with the local hot water system.
Features
- accesses the local hot water system (boiler system) via LPB to get the hot water system data - e.g. hot water temparature
- calculate battery capacity and surplus from solar forecast to optimize the self consumption
- local web interface to customize system parameters
UI
Software / Releases
the software supports ESP8266 and ESP32 modules, which can be build for the appropriate target platform. releases can be found at https://github.com/mlauke/smartswitch/releases/
Build
Install uv (https://docs.astral.sh/uv/concepts/tools/) and run proceed to source folder
cd smartswitch.espxx
# run tests
uv run pio test -e native
# run build
uv run pio run -e esp32 -e esp8266
# run check for outdated packages
uv run pio pkg outdatedHardware
the reference implementation (at my home) uses the following components
- Heater - https://www.austria-email.at/produkte/zubehoer/elektro-einbauheizung/reu-18-33/
- Hot Water Tank - https://www.austria-email.at/produkte/indirekt-beheizte-speicher/standspeicher/standspeicher-hr/hr-160/
- Sonnen Battery https://sonnen.de/stromspeicher/sonnenbatterie-10/
- Boiler System - Siemens RVD250 attached and connected to the ESP controller via the Local Process Bus (LPB)
- ESP8266/ESP32 controller modules
- ArduiBox housing https://www.az-delivery.de/en/products/arduibox-nodemcu-hutschienen-montage-und-anschluss-set
- DIN Rail Power supply +12V
- AC mains Triac cicuit to drive a 1NO Relay
- 1NO Relay (Schütz) https://www.reichelt.de/de/de/shop/produkt/schaltrelais_1_s_230_v_ac_16_a-155592
Schematics
The schematics and pcb is drawn with KiCad. The pcb uses a special layout which exactly matches the usable part of the ArduiBox's circuit board. KiCad files can be found here.
Housing
Thoughts
Why not using a TRIAC only solution?
Although Triacs have very low Rs_on values in nowadays, they become very hot depending on the load to drive. Using a 3.3kW heater will require a big heatsink as can be seen in the calculation below.
Pmax = (Tj,max - Tamb,max) / Rth
I = P / U = 3300W / 230 V = 14,35A
Rs_on (BTA25) = 0,16 Ohm
P_loss = U * I = Rs_on * I * I
P_loss = 0,16 Ohm * (14,35 A)²
P_loss = 32,95W
R_max = (T_max - T_env) / P_loss
R_max = (120°C - 40°C) / 33W
R_max = 2,42K/W
R_heatsink = R_max - R_jc = 2,42K/W - 1,7K/W
R_heatsink = 0,7K/W !!!... heatsink with <=0,7K/W makes no sense, because we will waste too much power wasted just for heating the environment and maybe would "blow up" the overall system design in terms of size and housing the components. therefore i decided to use a triac as switching device for a simple NO1 relais ("Schütz") which in turn will drive the load. the NO1 relais can directly placed next to the arduino case on our din rail.
Why not using a SSR?
as mentioned above, a SSR which can drive the 3,3kW load will become very hot if the load is switched on for longer heating periods. too hot to put the SSR together with the ESP controller board on a din rail inside of my houses fuse box.
Vision
- hardware
- build a GaN (HEMT) AC Power Converter to dynamically control the "waste" of surplus power based on a bidirection GaN (HEMT) device => https://www.infineon.com/products/power/gallium-nitride/gan-bidirectional-switches/high-voltage-gan-bidirectional-switches e.g. https://www.infineon.com/part/IGLT65R055B2
Parts
35| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | 39 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R5, R9 |
| 2 | 4,7k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1, R3 |
| 2 | ~ | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | P5, P6 |
| 1 | 0,01µ | Capacitor_THT:C_Disc_D7.5mm_W2.5mm_P5.00mm | C1 |
| 1 | 10k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R2 |
| 1 | 120 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R4 |
| 1 | 150 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R11 |
| 1 | 1N914 | Diode_THT:D_DO-35_SOD27_P10.16mm_Horizontal | D2 |
| 1 | 1k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R8 |
| 1 | 330 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R7 |
| 1 | 360 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R6 |
| 1 | 390k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R10 |
| 1 | BC550 | Package_TO_SOT_THT:TO-92_Inline | Q3 |
| 1 | BC557 | Package_TO_SOT_THT:TO-92_Inline | Q1 |
| 1 | BT136 | Package_TO_SOT_THT:TO-220-3_Vertical | Q2 |
| 1 | DB | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | P1 |
| 1 | G16 | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | H4 |
| 1 | G17 | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | H2 |
| 1 | G21 | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | H3 |
| 1 | G22 | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | H1 |
| 1 | G23 | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | H5 |
| 1 | GND | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | H6 |
| 1 | L | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | P4 |
| 1 | LED | LED_THT:LED_D4.0mm | D1 |
| 1 | MB | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | P2 |
| 1 | MB110 | Package_DIP:DIP-6_W7.62mm | U3 |
| 1 | MB133 | Package_DIP:DIP-6_W7.62mm | U2 |
| 1 | MOC3042M | Package_DIP:DIP-6_W7.62mm | U1 |
| 1 | P | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | P3 |
| 1 | RX_Jmp | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | JP2 |
| 1 | TX_Jmp | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | JP1 |
| 1 | VDD | Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mm | H7 |
Questions
How big is the Smartswitch PCB?
It measures 48.3 × 83.8 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Smartswitch use?
35 parts, built around the BT136, MOC3042M, BC550 and BC557. 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 Smartswitch KiCad files?
From the mlauke/smartswitch repository on GitHub, at the commit this page was made from: the board is kicad/SmartSwitch.kicad_pcb and its schematic kicad/SmartSwitch.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Smartswitch 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 layers

- 2 layers70.2 × 33 mm

- 2 layers144.3 × 112.6 mm

4ch relay-1fan arduino nano pcb
ashloverscn/4ch-relay-1fan-arduino-nano-pcb
4ch-relay-1fan-arduino-nano-pcb
62 parts1 - 2 layers127.6 × 76.4 mm

- 2 layers144.3 × 96.3 mm

4ch spdt relay-1fan arduino nano pcb
ashloverscn/4ch-spdt-relay-1fan-arduino-nano-pcb
4ch-spdt-relay-1fan-arduino-nano-pcb
59 parts1 - 2 layers107.9 × 62.8 mm

- 2 layers58.3 × 29.5 mm

- 2 layers190 × 109 mm

IOB v3.2.1
ADFTech/xtec-uc-ip-main-pcb
KiCad hardware repo for the UC-IP main PCB (currently: IOB board family). This README documents the review-and-release process used to get a schematic/PCB change from an engineer's desk to fabrication.
538 parts