How green-bms/smartbms works
Project type and purpose
• This is an open-source, hardware-software Battery Management System (BMS) for Li-ion/LiFePO4 packs.
• It combines multiple PCB modules (Cell Module, Interface Board, Limiter), embedded firmware (Attiny, Arduino Mega) and a mobile UI (Android app).
File structure
• Top‐level directories:
– 01_Documentation: datasheets, KiCad libraries
– 02_Cell Module: KiCad hardware + Attiny Arduino code
– 03_Control Unit: Arduino Mega firmware
– 04_Interface board: KiCad hardware for bus connection to Mega
– 05_Control Unit case: mechanical CAD
– 06_Android app: MIT App Inventor project
– 07_Limiter: QElectroTech schematic for power-relay circuit
• Pattern:
– Multiple small embedded-sensor modules (02_Cell Module)
– A central “brain” (03_Control Unit)
– A power-relay stage (07_Limiter)
– A physical connection board (04_Interface board)
– A user-interface mobile app (06_Android app)
Extract architectural insights from README
• The Cell Modules measure voltage & temperature and speak I2C to the Control Unit.
• The Control Unit (Arduino Mega) aggregates cell data, drives the Limiter (charging/discharging relays), and speaks Bluetooth to the Android app.
• Limiter contains the main charging relay plus current-limit circuitry.
• Interface board PCB hosts sockets/headers to plug all Cell Modules and the Mega together on the same I2C bus.
Main components & their interactions
a. Components
• Cell Modules (Attiny-based PCBs, one per cell)
• I2C Bus (shared serial data line)
• Interface Board (PCB backplane with sockets for Cell Mods + headers to Mega)
• Control Unit (Arduino Mega + Bluetooth module)
• Limiter Board (power relay + current-limit circuit)
• Android App (MIT App Inventor)
• Battery pack (Li-ion/LiFePO4 cells)
b. Relationships / Data Flows
• Each Cell Module → measures cell voltage/temperature → sends readings over I2C → to Control Unit.
• Control Unit → sends balance commands (via I2C) back to Cell Modules.
• Control Unit → drives Limiter relay/coils via digital I/O → to open/close charging/discharging paths.
• Control Unit → current-limit command to Limiter when balancing.
• Control Unit ←→ Bluetooth serial link ←→ Android App (status & settings).
• All Cell Modules and Control Unit share Vcc/GND on the Interface Board.
c. Architectural patterns
• Master/slave multi-drop I2C network
• Distributed sensing/actuation (one Attiny per cell)
• Central orchestration (Arduino Mega)
• Event-driven control loops (charging, discharging, balancing)
• Mobile UI over Bluetooth serial
d. Key technologies
• KiCad (PCB design for Cell Module & Interface Board)
• QElectroTech (Limiter schematic)
• Arduino IDE (C/C++ firmware for Attiny & Mega)
• MIT App Inventor (Android .aia project)
• Bluetooth module (e.g., HC-05)