Skip to the content
PCBKitNew board
2 layers160 × 100 mmControler, the printed circuit board in 3D

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

5

README

README.md

Base-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):

SignalGPIOPurpose
iopin_charger_15Relay for PSU 1, 200 W charging
iopin_charger_24Relay for PSU 2, 750 W charging
iopin_feeder_112Relay for Inverter 1, 300 W
iopin_feeder_213Relay for Inverter 2, 300 W
iopin_feeder_314Relay for Inverter 3, 300 W
iopin_LED2Status LED (active-low)

Getting started

Prerequisites

Build & flash

bash
# First flash, over USB
pio run -e esp12e -t upload

# Subsequent updates, over WiFi (OTA)
pio run -e esp12e_ota -t upload

Before 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

FileResponsibility
main.cppSetup/loop wiring, timing, heartbeat logging
config.h / config.cppPersisted settings (NTP, hostname, timers)
wifi.h / wifi.cppWiFiManager captive portal, connection handling
logging.h / logging.cppLog ring buffers, syslog streaming
battery.h / battery.cppVoltage/SoC measurement, battery FSM
controller.h / controller.cppRelay/GPIO control, operation-mode FSM
webserver.h / webserver.cppHTTP API and page serving
website.hEmbedded single-page web UI (HTML/CSS/JS)
read_energy_meter.h / read_energy_meter.cppShelly 3EM async polling

Further design notes and requirements live in documentation/.

License

MIT — see LICENSE.txt.

Acknowledgments

Parts

79
QtyValueFootprintReferences
20RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R2, R3, R4, R5, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20 +4
8C_PolarizedCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC1, C2, C3, C4, C5, C6, C7, C8
6LEDLED_THT:LED_D5.0mmD2, D5, D8, D11, D100, D102
5Conn_01x03_PinConnector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_VerticalJ1, J2, J3, J101, J102
41k2Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR101, R102, R105, R106
4D_ZenerDiode_THT:D_A-405_P7.62mm_HorizontalD3, D6, D9, D10
4MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
3BC237Package_TO_SOT_THT:TO-92_HandSolderQ5, Q100, Q101
3FuseLibrary_Tims:Fuse_Reichelt_IMAXX_H1120_44x7x28mm_1F1, F2, F3
3IRLB8721PBFLibrary_Tims:TO-220-3_Vertical_wHS_FK239AS32Q1, Q2, Q3
3ZPDxxDiode_THT:D_DO-35_SOD27_P10.16mm_HorizontalD1, D4, D7
212kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR103, R107
21N4148Diode_THT:D_DO-35_SOD27_P7.62mm_HorizontalD101, D103
2820Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR100, R104
2FINDER-40.51Relay_THT:Relay_SPDT_Finder_40.51K100, K101
2ILD74Package_DIP:DIP-8_W7.62mm_LongPadsU1, U2
1BC327Package_TO_SOT_THT:TO-92_HandSolderQ4
1Conn_01x06TerminalBlock_MetzConnect:TerminalBlock_MetzConnect_Type205_RT04506UBLC_1x06_P5.00mm_45DegreeJ100
1Conn_01x12_PinLibrary_Tims:Metz_RT04512UBLC_2x6pol_5mmRMJ4
1R_Potentiometer_TrimLibrary_Tims:SpindeltrimmerRV1
1WEMOS_D1_miniRF_Module:WEMOS_D1_mini_lightU4
1eBay 60V to 5V DCDCLibrary_Tims:eBay-DCDCU3

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

    Weisse cpu

    stonedDiscord/weisse_cpu

    Die Weiße CPU

    480 parts1
  • 2 layers85.1 × 35.6 mmSmartTherm, the printed circuit board in 3D

    SmartTherm

    Strooom/SmartTherm

    Controlling a Junkers heating (Eurostar ZWE24) with an IoT thermostat

    22 parts33
  • 2 layers98.8 × 69.9 mmCameraTriggerSensorNodeOnly, the printed circuit board in 3D

    CameraTriggerSensorNodeOnly

    chrocket/RocketTrig

    A camera controller for photographing high poweed model rockets

    65 parts3GPL-3.0
  • 2 layers149.9 × 103 mmUnifiedBreakout, the printed circuit board in 3D

    UnifiedBreakout

    jamwaffles/CNCMachine

    LinuxCNC config and scripts for my DIY CNC machine

    50 parts3
  • 2 layers121.9 × 87.6 mmSmartDimmer, the printed circuit board in 3D

    SmartDimmer

    dsankouski/SmartDimmerHardware

    Schematic and pcb data for dimmer

    93 parts
  • 2 layers202.2 × 131 mmNew system, the printed circuit board in 3D

    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 mmShades and relais, the printed circuit board in 3D

    Shades and relais

    gkiefer/home2l

    The Home2Ls - Smart Tools for a Private Home

    20 parts21
  • 2 layers158.8 × 159.8 mm1d coinctrl r2, the printed circuit board in 3D

    1d coinctrl r2

    kitspace-test-repos/kicad6-file-collection

    100 partsMIT