Skip to the content
PCBKitNew board
2 layers48.3 × 83.8 mmSmartswitch, the printed circuit board in 3D

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

5

README

README.md

Sonnen 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

Sonnen SmartSwitch UI, best viewed in dark mode

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

bash
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 outdated

Hardware

the reference implementation (at my home) uses the following components

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.

Sonnen SmartSwitch wihin ArduiBox, Power Supply and Relais (Schütz) mounted on DIN rail Sonnen SmartSwitch wihin ArduiBox, Power Supply and Relais (Schütz) mounted on DIN rail

Housing

Housing Sonnen SmartSwitch wihin ArduiBox, Power Supply and Relais (Schütz) mounted on DIN rail Sonnen SmartSwitch installed in fuse box

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.

bash
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

Parts

35
QtyValueFootprintReferences
239Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR5, R9
24,7kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R3
2~Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmP5, P6
10,01µCapacitor_THT:C_Disc_D7.5mm_W2.5mm_P5.00mmC1
110kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR2
1120Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR4
1150Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR11
11N914Diode_THT:D_DO-35_SOD27_P10.16mm_HorizontalD2
11kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR8
1330Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR7
1360Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR6
1390kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR10
1BC550Package_TO_SOT_THT:TO-92_InlineQ3
1BC557Package_TO_SOT_THT:TO-92_InlineQ1
1BT136Package_TO_SOT_THT:TO-220-3_VerticalQ2
1DBConnector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmP1
1G16Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmH4
1G17Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmH2
1G21Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmH3
1G22Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmH1
1G23Connector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmH5
1GNDConnector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmH6
1LConnector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmP4
1LEDLED_THT:LED_D4.0mmD1
1MBConnector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmP2
1MB110Package_DIP:DIP-6_W7.62mmU3
1MB133Package_DIP:DIP-6_W7.62mmU2
1MOC3042MPackage_DIP:DIP-6_W7.62mmU1
1PConnector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmP3
1RX_JmpConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJP2
1TX_JmpConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJP1
1VDDConnector_Wire:SolderWire-0.1sqmm_1x01_D0.4mm_OD1mmH7

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 layersEv driver, the printed circuit board in 3D

    Ev driver

    aceleste/ev-driver

    12 parts
  • 2 layers70.2 × 33 mmLazy door mk2, the printed circuit board in 3D

    Lazy door mk2

    CarloMara/lazy_door

    A simple smarthome power controller based on the esp8266

    28 parts
  • 2 layers127.6 × 76.4 mm4ch relay-1fan pcb, the printed circuit board in 3D

    4ch relay-1fan pcb

    ashloverscn/4ch-relay-1fan-pcb

    4ch-relay-1fan-pcb

    57 parts1
  • 2 layers107.9 × 62.8 mm4ch spdt relay-1fan pcb, the printed circuit board in 3D

    4ch spdt relay-1fan pcb

    ashloverscn/4ch-spdt-relay-1fan-pcb

    4ch-spdt-relay-1fan-pcb

    49 parts1
  • 2 layers58.3 × 29.5 mmDimmer pcb, the printed circuit board in 3D

    Dimmer pcb

    ashloverscn/dimmer-pcb

    dimmer-pcb

    13 parts1
  • 2 layers190 × 109 mmIOB v3.2.1, the printed circuit board in 3D

    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