

Controler
glb
- Size
- 160 × 100 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 79
- Nets
- 61
- Pads
- 215
- Tracks, vias
- 487, 102
- Pours
- 4
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 28 Jul 2026
- Updated
- 12 Aug 2026
Overview
Controler is an open-source printed circuit board by TimW2022, from the TimW2022/Base-Load-Battery repository on GitHub, published under the MIT licence. It is a 2-layer board of 160 × 100 mm with 79 parts on 61 nets, routed with 487 tracks and 102 vias.
It is built around the WEMOS D1 MINI, ILD74 and BC237, with the IRLB8721PBF and BC327 among its other parts. Its parts include 28 resistors, 15 diodes, 8 capacitors, 7 transistors and 7 connectors. It belongs with the ESP8266 boards of this library.
Main components
5WEMOS D1 MINI
A mini wifi board with 4MB flash based on ESP-8266EX, hardware version 4.0.0.LolinUncategorisedILD74
DIP-8-55℃~+100℃ 1.3V 12.5% 2 20V 300mV@2mA,16mA 35% 3V 3us 4.42kV 400mW 60mA DC Phototransistor DIP-8 Transistor, Photovoltaic Output Optoisolators ROHSVishay IntertechnologyTransistor, Photovoltaic Output OptoisolatorsBC237
TO-92-55℃~+150℃ 1 NPN 150MHz 15nA 350mW 45V 5A 6V 800mV 90 NPN TO-92 Bipolar (BJT) ROHSJiangsu Changjing Electronics Technology (CJ)Bipolar (BJT)IRLB8721PBF
TO-220AB-55℃~+175℃ 1 N-channel 1.077nF 110pF 13nC@4.5V 16mΩ@4.5V 2.35V 30V 360pF 62A 65W N-Channel ±20V TO-220AB MOSFETs ROHSInfineon TechnologiesMOSFETsBC327
TO-921 PNP 100MHz 45V 5V 625mW 630 700mV 800mA PNP TO-92 Bipolar (BJT) ROHSDDFBipolar (BJT)
README
README.mdBase-Load Storage System (Meine Grundlast-Batterie)
The GLB (Grundlast-Batterie) is a smart battery system concept that is connected to your home grid and charges on cheap energy from home PV and feeds the home grid later. The concept is ideated some time ago when PV materials and solutions were very rare and expensive and less functional. Meanwhile commercial solutions for PV-Systems and stand-alone Base-Load storage batteries are available of the shelf for low cost and in case you need one a purchase is best option. This concept here is informational and educational purposes and does not generate a safe system you want to run live or un-supervised, please read the disclaimer and take it serious.
The repo contains: (10_System-Concept) System Notes and Drawings, Electrical Concepts, Datasheets (20_Battery) Just photos from my batteries, my notes are all on paper, but you find several good guides on homemade LeFePo4 Systems including BMS (30_EE-Design) place to collect EE design decisions, mostly also on paper and not digitalized (40_Controller-PCB) KiCad files for schematic and PCB (50_Controller-SW) Full software for the ESP8266-ESP12 using the Arduino Framework (60_Logging-Visualization) A setup to use a 24/7 home PC to store logs and visualize them with InfluxDB
The concept presented here covers the full system, means hardware and software. The central piece is the ESP8266 controller with power peripherals to drive to drive 2 chargers (AC-DC power supply units, PSUs) and 3 feeders (PV Inverters). The software switches the charging PSUs and grid-feed inverters, reads power levels from a Shelly3EM monitor, estimates and counts battery state of charge, and exposes a built-in web dashboard for status, configuration, and manual or timer-based control.
Disclaimer
This repository is a hobbyist project shared for informational and educational purposes only. It is not an official guide, does not constitute professional, electrical, or safety advice, and has not been certified or approved by any regulatory body.
Working with mains voltage, high-current batteries (e.g. LiFePO4 packs), chargers, and inverters is inherently dangerous and can result in electric shock, fire, injury, or death, as well as damage to property and equipment. By using, building, or adapting anything described in this repository, you do so entirely at your own risk.
- The author(s) and contributors provide this project "as is", without warranty of any kind, express or implied, including but not limited to fitness for a particular purpose, safety, or compliance with any code, standard, or regulation.
- The author(s) and contributors accept no liability or responsibility for any damage, injury, loss, or other consequence arising directly or indirectly from the use, misuse, or inability to use this project, its hardware designs, or its software.
- It is your responsibility to ensure that any build complies with the electrical codes, safety standards, and legal requirements applicable in your country/region, and to have any high-voltage or battery work reviewed/performed by a qualified professional where required.
- If you are not confident working with high voltage or high-energy battery systems, do not attempt to build or operate this system or similar derived systems.
- Any industrial and save product require much more design effort like functional safety assessments, failure analysis, deep testing, validation and much more. All this is neither done nor present in this repository material.
Features
- Relay control for 2 charger PSUs to provide different charging levels
- FET control of 3 feeding PV inverters to provide 3 power levels
- Battery state-of-charge estimation (voltage-based and coulomb-counting)
- Operation-mode state machine: deactivated, battery check, standby, charging (3 levels), feeding (3 levels)
- Web dashboard (served from flash, no external assets):
- Header: uptime, date/time, heap usage, CPU load, operation mode, battery status, voltage, SoC, reboot button
- Tabs: WLAN, Boot-Log, Error-Log, Running-Log, Clock, Manual Status, Timer Events, Rule Events
- WiFiManager captive portal for first-time WiFi setup — no WiFi credentials hardcoded in firmware
- OTA firmware updates via ArduinoOTA
- UDP syslog streaming for remote/centralized logging, in addition to the on-device log buffers
- Optional Shelly 3EM energy-meter polling for grid / inverter / charger power readings
- Timer-based operation events (up to 16 daily triggers)
- Config persisted to flash (LittleFS); exportable/importable as plain text via the web UI
Hardware / GPIO pinout
Target board: ESP12E (ESP8266). Pin assignments (see controller.cpp):
| Signal | GPIO | Purpose |
|---|---|---|
iopin_charger_1 | 5 | Relay for PSU 1, 200 W charging |
iopin_charger_2 | 4 | Relay for PSU 2, 750 W charging |
iopin_feeder_1 | 12 | Relay for Inverter 1, 300 W |
iopin_feeder_2 | 13 | Relay for Inverter 2, 300 W |
iopin_feeder_3 | 14 | Relay for Inverter 3, 300 W |
iopin_LED | 2 | Status LED (active-low) |
Getting started
Prerequisites
- PlatformIO (VS Code extension or CLI)
Build & flash
# First flash, over USB
pio run -e esp12e -t upload
# Subsequent updates, over WiFi (OTA)
pio run -e esp12e_ota -t uploadBefore using the esp12e_ota environment, edit platformio.ini and set
upload_port to your device's actual IP address, and change the --auth password to match the
OTA password you configure in firmware (see Security notes below).
First boot / WiFi setup
On first boot (or after a WiFi reset), the device starts an access point named GLBattery. Connect
to it with a phone or laptop, and a captive-portal page will let you pick your home WiFi network and
enter its password. Credentials are saved by the ESP8266 SDK and reused automatically on subsequent boots.
To force the portal to reappear (e.g. to switch networks), use the reset button in the web UI's WLAN tab, which clears saved credentials and reboots.
Using the web UI
Once connected, find the device's IP from your router's DHCP client list (hostname defaults to
GLB-2026, configurable), and open it in a browser. The dashboard header shows live status; the
tabs give access to:
- WLAN — connection status, SSID, reset/reconfigure
- Boot-Log / Error-Log / Running-Log — on-device log buffers, refreshable
- Clock — NTP mode, server, and timezone offset
- Manual Status — direct operation-mode/level control
- Timer Events — up to 16 scheduled daily mode changes
- Rule Events — condition-based automation (see documentation)
Logging
Every log line is sent to Serial and, once WiFi is up, broadcast as UDP syslog
(255.255.255.255:514) so it can be collected centrally (e.g. with rsyslog). See
reqs_loging.md for details.
Security notes
- The web UI and its
/api/...endpoints have no authentication. This project is intended for use on a trusted local network only — do not port-forward its port to the internet. - Change the default OTA password and WiFiManager portal password in the firmware (main.cpp, wifi.cpp) before deploying, and avoid committing your real passwords if you fork/publish your own copy.
Secrets and IP setting
You need to set a few values before deployment (a few might be added later to the flash-config)
file | line | info platform.ini | 28 | upload_port = 192.168.x.x >>> set here the IP-addr of your ESP device platform.ini | 29 | upload_flags = --auth=CHANGE_ME_OTA_PASSWORD <<< set the OTA password similar to main.cpp main.cpp | 31 | ArduinoOTA.setPassword("CHANGE_ME_OTA_PASSWORD"); <<< set the OTA password similar to platform.ini read_energy_meter.cpp | 24 | SHELLY_IP = "192.168.x.x"; <<< set here the IP-addr of your Shelly-3EM device wifi.cpp | 17 | wm.autoConnect("GLBattery", "CHANGE_ME_PORTAL_PASSWORD") <<< see or change the wifi landing portal password
Project structure
| File | Responsibility |
|---|---|
| main.cpp | Setup/loop wiring, timing, heartbeat logging |
| config.h / config.cpp | Persisted settings (NTP, hostname, timers) |
| wifi.h / wifi.cpp | WiFiManager captive portal, connection handling |
| logging.h / logging.cpp | Log ring buffers, syslog streaming |
| battery.h / battery.cpp | Voltage/SoC measurement, battery FSM |
| controller.h / controller.cpp | Relay/GPIO control, operation-mode FSM |
| webserver.h / webserver.cpp | HTTP API and page serving |
| website.h | Embedded single-page web UI (HTML/CSS/JS) |
| read_energy_meter.h / read_energy_meter.cpp | Shelly 3EM async polling |
Further design notes and requirements live in documentation/.
License
MIT — see LICENSE.txt.
Acknowledgments
- WiFiManager by tzapu
- ESPAsyncTCP by me-no-dev
Parts
79| Qty | Value | Footprint | References |
|---|---|---|---|
| 20 | R | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1, R2, R3, R4, R5, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20 +4 |
| 8 | C_Polarized | Capacitor_THT:CP_Radial_D8.0mm_P5.00mm | C1, C2, C3, C4, C5, C6, C7, C8 |
| 6 | LED | LED_THT:LED_D5.0mm | D2, D5, D8, D11, D100, D102 |
| 5 | Conn_01x03_Pin | Connector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_Vertical | J1, J2, J3, J101, J102 |
| 4 | 1k2 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R101, R102, R105, R106 |
| 4 | D_Zener | Diode_THT:D_A-405_P7.62mm_Horizontal | D3, D6, D9, D10 |
| 4 | MountingHole | MountingHole:MountingHole_3.2mm_M3 | H1, H2, H3, H4 |
| 3 | BC237 | Package_TO_SOT_THT:TO-92_HandSolder | Q5, Q100, Q101 |
| 3 | Fuse | Library_Tims:Fuse_Reichelt_IMAXX_H1120_44x7x28mm_1 | F1, F2, F3 |
| 3 | IRLB8721PBF | Library_Tims:TO-220-3_Vertical_wHS_FK239AS32 | Q1, Q2, Q3 |
| 3 | ZPDxx | Diode_THT:D_DO-35_SOD27_P10.16mm_Horizontal | D1, D4, D7 |
| 2 | 12k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R103, R107 |
| 2 | 1N4148 | Diode_THT:D_DO-35_SOD27_P7.62mm_Horizontal | D101, D103 |
| 2 | 820 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R100, R104 |
| 2 | FINDER-40.51 | Relay_THT:Relay_SPDT_Finder_40.51 | K100, K101 |
| 2 | ILD74 | Package_DIP:DIP-8_W7.62mm_LongPads | U1, U2 |
| 1 | BC327 | Package_TO_SOT_THT:TO-92_HandSolder | Q4 |
| 1 | Conn_01x06 | TerminalBlock_MetzConnect:TerminalBlock_MetzConnect_Type205_RT04506UBLC_1x06_P5.00mm_45Degree | J100 |
| 1 | Conn_01x12_Pin | Library_Tims:Metz_RT04512UBLC_2x6pol_5mmRM | J4 |
| 1 | R_Potentiometer_Trim | Library_Tims:Spindeltrimmer | RV1 |
| 1 | WEMOS_D1_mini | RF_Module:WEMOS_D1_mini_light | U4 |
| 1 | eBay 60V to 5V DCDC | Library_Tims:eBay-DCDC | U3 |
Questions
How big is the Controler PCB?
It measures 160 × 100 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Controler use?
79 parts, built around the WEMOS D1 MINI, ILD74, BC237 and IRLB8721PBF. 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 Controler KiCad files?
From the TimW2022/Base-Load-Battery repository on GitHub, at the commit this page was made from: the board is 40_Controller-PCB/controler.kicad_pcb and its schematic 40_Controller-PCB/ESP8266-D1-mini.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Controler 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 layers310 × 260 mm

- 2 layers85.1 × 35.6 mm

SmartTherm
Strooom/SmartTherm
Controlling a Junkers heating (Eurostar ZWE24) with an IoT thermostat
22 parts33 - 2 layers98.8 × 69.9 mm

CameraTriggerSensorNodeOnly
chrocket/RocketTrig
A camera controller for photographing high poweed model rockets
65 parts3GPL-3.0 - 2 layers149.9 × 103 mm

- 2 layers121.9 × 87.6 mm

- 2 layers202.2 × 131 mm

New system
MadsRudolph/62768-energy-system
Team project for 62768 Electrical Energy Systems (DTU, June 2026, 3-week course). We design and build a complete electrical energy system per the course requirement spec (Kravspecifikation), from idea to a working…
131 parts - 2 layers70 × 60 mm

- 2 layers158.8 × 159.8 mm
