-
GREEN BMS CONTROL UNIT
10/01/2021 at 17:01 • 0 commentsCONTROL UNIT DESCRIPTION
Control Unit is the BMS main unit, it is based on Opensource Microcontroller Arduino Mega. Control Unit functions are:
- Communicating by I2c with all the cell modules of the battery pack
- To receive from cell modules the values of: cell voltage, cell pole temperature, balancing resistor temperature for battery pack management system
- Sending to cell modules the balancing command
- To perform the following safety functions by relays:
- Charge ok: open two relays contact when just one cell of the pack reach the high value or I2C communication with Cell modules is loss
- Discharge ok: open a relay contact when just one cell of the pack goes down the minimum value or I2C communication with Cell modules is loss
- Alarm led: close a contact to supply a led in case of alarm
- Balancing: close a contact when just one cell of the pack is balancing: Green BMS System uses this signal to reduce the charging current (see Green BMS Limiter)
- System OK: closes the contact when the Control Unit has to switch off to avoid unnecessary consumption. Green BMS System uses this signal to drive an external power stop circuit to the Control Unit.
- To communicate with an Android device by a Bluetooth module. (see Green BMS Android app)
Through the android application it is possible to perform the BMS calibrations: System stores all the parameters in the Eeprom memory of the Arduino Mega Microcontroller inside Control Unit.
CONTROL UNIT HARDWARE
The picture above shows the main components of the Control Unit. Arduino Mega is the backplane of Control Unit, it must supplied at 12vdc by the relevant connector.
To supply Arduino Mega and all the Control Unit functions, You must use a DC-DC converter to convert the total battery pack to 12vdc.
Arduino Mega is a commercially available Opensource card.
The Interface board is inserted above the Arduino Mega.
The interface board includes the control unit input / output connectors. The interface board includes a watchdog circuit that de-energizes the relays in the event of a software crash. The mini output relays (12vdc coil) are driven by a driver IC.
IMPORTANT: the maximum current supported by the relay contacts is 1A, do not use these contacts directly in the battery charge-discharge circuits, but use them to drive power relays!
The control unit has an average consumption of 5.5 watts. If you always leave it powered, even when it is not needed, it can discharge the battery pack in a few days! For this reason it is absolutely necessary that the 12v power supply circuit be designed so as to switch off the Control Unit when the discharge or charge operations are not active. In any case, it is advisable to keep the battery pack charged after each discharge and in case of prolonged periods of inactivity of the battery, provide for a weekly charge.
Interface Board PCB was designed with Kicad Opensource application.
Control Unit transparent plexiglass Case cut-out drawing, was designed with Opensource 2D cad Librecad.
All project files are available in the Github repository
CONTROL UNIT SOFTWARE
The software present in the Arduino Mega was developed using the Opensource Arduino IDE application
The software is loaded using a standard USB cable (generally provided with Arduino Mega), connected on the relevant port.
You can download it in the Github repository.
-
GREEN BMS LIMITER
09/30/2021 at 17:18 • 0 commentsThe BMS Battery Management System Limiter activates or deactivates the charging, according to Control Unit command.
When BMS balances just one cell of the pack, Control Unit commands the limiter relay, that forces the charging current to 1A, in order to stop charging the cells that have reached the balancing voltage (and are balancing) while continuing to charge the others.
Current limiter circuits includes a Mosfet IRFZ44N, a NPN transistor BD139 and a 0,68 ohm power resistors that can reach high temperature, for this reason you must choose a metal limiter case in order to dissipate the temperature and you must fix the aforementioned components by means of a special insulation kit.
Furthermore, the limiter is equipped with a safety thermostat, which opens the circuit if the critical temperature is reached.
The Green BMS limiter uses 12vdc power relays and it is recommended for charging currents not exceeding 20A
The Green BMS limiter is for 16s Lifepo4 48v: it could be used for higher voltage charging, but the voltage between the "IN" and "OUT" terminals must not exceed 10V, and in any case you must proceed with caution, verifying that the system is safe!
The electrical diagram of the limiter was created with the QElectroTech opensource CAD application.
All project files are available in the Github repository
-
GREEN BMS ANDROID APP
09/30/2021 at 17:14 • 0 commentsUsing the "Green BMS" Android app it is possible to connect to the BMS Control Unit to have a complete diagnostics on the system status and to be able to configure the battery pack and the behavior of the BMS according to your needs.
Upon opening, the application displays the following page:
By pressing the "Demo version" button, you can test the application offline to discover its functions.
Pressing the "connect to device" button, the smartphone screen shows all the available bluetooth connections. Select the one related to the HC-05 module. When the connection is active, the Login window appears.
To be able to connect to the device it is necessary to enter the 4-digit numeric password, which upon first use is "1234".
It is possible to change the password in the "settings" page. The password remains stored in the Eeprom of the Control Unit. In case of forgetfulness, the system offers the possibility to do a "password reset" by pressing the "SW2" button on the Local Control Unit for 5 seconds.
In case of successful login, the display shows the "Overview" page:
The top part is common to all 3 pages that make up the system and shows the status of the Bluetooth communication (green = OK red = communication lost) and of the BMS system (green = no alarm red = just one alarm).
In the lower part of the page the animated values related to the battery pack are shown:
- Capacity (Ah) according to user settings
- Number of cells in series, according to user settings
- Total voltage (V)
- Current (A) = actual current measured by current sensor, Positive value is for charging current, Negative value is for discharging current.
- SOC (%) = state of charge in percentage calculated to capacity setting
- Cell max (V) = Highest cell voltage value
- Cell min (V) = Lowest cell voltage value
Pressing the "cells" button, a page appears showing the data of each single cell. By scrolling the page, all the cells of the pack set by the user are displayed. For each cell, the following read-only data is displayed:
- Voltage (V) = text in blue color is for voltage in normal range, orange color means that the cell is balancing, red is for voltage over Very high voltage threshold or under Low voltage threshold
- Cell pole temperature (°C) = it shows the temperature measured by the sensor attached to the cell pole. Blue text is for temperature in normal range, red is for value over the High temperature setting
- Cell pole temperature (°C) = it shows the temperature measured by the sensor attached to the cell pole. Blue text is for temperature in normal range, red is for value over the High temperature setting
- Balance resistors temperature (°C) = it shows the temperature measured by the sensor attached to the balance resistors. Blue text is for temperature in normal range, red is for value over the High temperature setting
- Cell module communication fault = this event is shown by the red animation of reset button
For each cell, the following functions are available:
- Balancing test push button = pressing it you can check the balancing circuit of each madule. This test is also important to verify the correct cell module address
- Cell module reset button = pressing it you can reset the cell module
Clicking on settings the following page appears:
The "Settings" screen shows all the parameters loaded into the Control Unit memory and modifiable by the User.
When using the BMS for the first time, or in case of "Parameter reset" (SW2 for 10 sec.), the system loads the default parameters relating to a Lifepo4 48V pack.
By clicking on the "Change enable" switch it is possible to modify all the parameters adapting them to your battery pack.
To modify a parameter, click on the "Mod" button alongside and type in the desired value.
Here is a summary of all the parameters:
BATTERY SETTINGS:
- Battery capacity (Ah) = Total capacity of the battery pack used for SOC calculation
- N. of cells = The number of the cells (in series) that compose the battery pack. This choice automatically affects the number of cells displayed in the "Cells" page!
CURRENT SENSOR SETTINGS:
- Max Current at 5V (A) = Maximum current value corresponding to the 5v output from the sensor.
- Min Current at 0V (A) = Minimum current value corresponding to the 0v output from the sensor
- Gain = Gain compensation value (1000 = gain 1)
- Offset (mA) = Offset compensation value
CELLS SETTINGS:
Each state that is activated on the basis of a threshold, both increasing and decreasing, is managed and parameterized according to the graph below
- Very High Voltage (mV) = very high voltage threshold, which causes alarm
- Very High Voltage reset (mV) = reset threshold (falling) of the very high voltage alarm.
- High Voltage (mV) = high voltage threshold, which causes the stop of charging if one of the cells reaches this threshold.
- High Voltage reset (mV) = reset threshold (falling) of the high voltage alarm
- Balance Voltage (mV) = When a cell reaches this threshold, in the event of an unbalanced pack (see "difference to start balancing" parameter), the cell starts to balance.. When all the cells reach this threshold, the battery pack is considered charged and the charge is stopped.
- Balance Voltage reset (mV) = reset threshold (falling) of the high voltage alarm
- Low voltage (mV) = Low voltage threshold, which causes alarm and opening of the discharge consent relay
- Low voltage reset (mV) = reset threshold (rising) of the Low voltage alarm
- Status Timer (msec) = State activation time (valid for all states)
- Communication Timeout (msec) = Communication error time with the cell, after which a "communication error" is generated and a reset command is sent to the cell module
- High Pole temperature (°C) = high temperature threshold detected by the sensor placed on the cell pole. In addition to generating the relative alarm, this condition causes the opening of the charge and discharge consent relays
- High Pole temperature reset (°C) = reset threshold (falling) of the High Pole temperature alarm
- High Balance temperature (°C) = high temperature threshold detected by the sensor placed on the balancing resistors. In addition to generating the relative alarm, this condition causes the cell balancing to stop
- High Balance temperature reset (°C) = reset threshold (falling) of the High Balance temperature alarm
- Difference to start balancing (mV) = It is the parameter that determines the cell balance, in this way: when a cell reaches the "balance" status, if the difference between its voltage value and the lowest voltage value of the pack exceeds this threshold, the cell starts to balance
- Difference to stop balancing (mV) = during cell balancing, if the difference between its voltage value and the lowest voltage value of the pack is less than this threshold, the cell stops to balance
- Balancing current (%) = It is the parameter with which the balancing currentis set, which depends on the balancing resistance. For example: if you decide to balance at 3400 mV and the balance resistance is 3 Ohm, the maximum balance current corresponds more or less to 1 A. If you set this parameter to 100% you decide to balance at 1 A, at the 75% will be 0.75A, at 50% 0.5A...
- Voltage charge offset (mV) = This parameter was introduced to compensate for the voltage difference of the cells during charging, with respect to their no-load value. This offset is very useful if the Limiter is used, because it avoids the continuous alternation of start and stop balancing due to the aforementioned voltage differences.
It is possible to download the application for free from the Google Play store:
DEVELOPMENT TOOL
The application was created using the online opensource development tool: "Mit App Inventor"
The project file is available on the Github repository
-
GREEN BMS CELL MODULE
09/30/2021 at 17:11 • 0 commentsCELL MODULE DESCRIPTION
Cell module is connected directly to the cell, from which it takes own power supply.
Cell module Microcontroller (Attiny84) receives the cell voltage, cell pole temperature, balancing resistance temperature signals and, using the logics contained in its software, performs the following functions :
- It communicates by I2C serial protocol with the Master Unit called "Control Unit"
- It sends to Control Unit the values of: cell voltage, cell pole temperature, balancing resistor temperature for battery pack management system
- It executes the cell balancing (by a mosfet) according to Control Unit command.
The cell modules all communicate in parallel with the control unit via an isolated 4-wires I2c bus.
Each cell module I2C address can be programmed by the user, by push buttons, checking tens and units values by the blinking of two leds (see Tutorial: "Cell Module address setting"). It is possible to set address from 1 to 99 (*).
The address of the modules is independent of their connection along the I2c bus
Address is stored on Attiny EEPROM.
Another important function allowed by the cell module is the voltage compensation calibration using the buttons on the board. The procedure is described in the Tutorial: "Cell voltage calibration"
The cell module has an average consumption of 15 mA.
(*) Important: this may not be the maximum number of cells that can be managed by the BMS, which depends on the Control Unit limitations and the experimental tests carried out
CELL MODULE HARDWARE
The picture above shows the main components of the cell module. When the 7-pole programming connectors are connected, the microcontroller takes power from the cell, when the connectors are absent, the microcontroller is separated from the cell: in this situation it is possible to load the software by connecting the "Arduino as isp" cable.
Cell module PCB was designed with Kicad Opensource application.
All project files are available in the Github repository
CELL MODULE SOFTWARE
The software present in the Attiny84 microcontroller was developed using the Opensource Arduino IDE application.
The software is loaded using the "Arduino as isp" tool, a special configuration that uses an Arduino Uno controller as a programmer for the Attiny microcontrollers.
The software is available in the Github repository