HLP Data BMS4S User manual

1
1
BMS4S user manual 1.4
Valid for software version 1.4.55
BMS4S DIY kit: ......................................................................................................................................... 1
Introduction ............................................................................................................................................ 2
Normal usage .......................................................................................................................................... 2
Basic configuration .................................................................................................................................. 3
Additional Commands ............................................................................................................................. 9
System Commands ................................................................................................................................ 13
Installation ............................................................................................................................................ 14
Equipment connection description ....................................................................................................... 16
Testing ................................................................................................................................................... 19
4SBalancer............................................................................................................................................. 20
I/O description ...................................................................................................................................... 22
BMS4S DIY kit:
The basic kit contains: 1: a BMS4S PCB, 2: and a box to mount it a in. Beside this you might also need
3: three temperature sensitive resistors, 4: a push-button for temporary charging level setting, 5: a
12 V LED for low SoC early warning, 6: a Bluetooth radio for communication with BMS4S, 7: an
adapter for serial to USB connection to BMS4S, and 8: a buzzer/alarm.

2
2
There is also an automatic balancer available, 4Sbalancer:
However, we do not think this is a necessity. Most installation will work fine if the battery bank is
manually balanced once or twice a year with a 3.6 V LiFePO4 charger.
Introduction
BMS4S is versatile battery management system that can be used in many different configurations. It
is designed to supervise four LiFePO4 cells and automatically control that they are kept within
specified boundaries. It can be used with default configuration straight out of the box, but can also
easily be changed and used in a completely different setup. There are few limitations built into it.
You will find a description on how to install the BMS4S in chapter “Installation”, with more details on
exactly how to connect all wires in chapter “Equipment connection description”. After installation
you should test that it is working as expected. This is described in chapter “Testing”.
During normal usage there is not much you need to do, but there are some things that can be of
interest for most users. This is described in chapter “Normal usage”.
How you use your cellular phone to connect to BMS4S is described in chapter “Normal usage”.
Available commands are described in three places: “Basic configuration”, “Additional commands”
and “System commands”. All commands are built from one or two small letters, so in the Basic
configuration chapter the commands can be derived from the printout, the capitals in each line is
the command to use to change that setting. To give any commands that changes any settings you
must first unlock the device with command du=1234. Default PIN is 1234, but you should change this
after installation to your own one, command dp=nnnn. All system commands are protected by
another level of protection since you can make BMS4S completely useless by a single bad system
command. To unlock system commands, use command: fu=1632. Do not use any system command if
you have not read the user manual carefully first. But there is always a way to get back to the
original settings from factory, see command: fr.
And you can always get a command summary when connected to BMS4S with command: h.
Normal usage
BMS4S is switched on as long as it has power on terminal +12V. Normal usage is to take a look at the
LED every now and then. If it is blinking twice, then there is less than 20% energy left in the
batteries. If it is blinking once, it is less than 10%. You can change this to start the blinking at any
level of charge. Command sl=nn.

3
3
Beside the LED you have the push-button. When you are on your way home and the boat will be
unused for a while, then your batteries lifetime will increase if they are not left fully charged. Then
press it until you see 3 long blinks on the LED. This will decrease the voltage when BMS4S will stop
charging with 0.10 V, which equals approx. 80% SoC when using default settings. Or keep in pressed
until 4 long blinks on the LED. This to achieve approx. 60% SoC (decreases the stop-voltage with 0.15
V).
When you press the push-button for a single long blink, three things will happen: the charging
voltage will be reset, if an alarm is beeping it will be rest and you will wake up the Bluetooth radio
(if you set it to switch it off instead of sleep, see command wm) that you can connect your cellular
phone to. BMS4S has two ways of communication: a socket to plug in a FTDI adapter and a socket to
plug in a bluetooth module of type HM-10 or equivalent. You connect with e.g. “Serial Bluetooth” on
an android phone and with “BLE Terminal” on an I-phone. These are available for free on Google
play and Apple appstore. When installed, scan, find and connect to the Bluetooth device.
If you give the command p (print) you will get a printout looking like this:
U=3.264 3.268 3.262 3.266 13.060 I=-1.335 SoC=35
This (U=…) means that all four cells have 3.26 V each, adding up to 13.06 V. Next, I=…, means that
right now there are 1.335 A leaving the batteries (this only works if you have connected BMS4S to a
current shunt, but that is not necessary for it to work). And SoC=… means that BMS4S estimates
current state of charge to 35 % based on the last 15 minutes (can be changed with te=nnn). Using
voltage and load gives a very rough estimate on higher SoC levels, but to use it as an early warning
system when SoC is getting low works well. And it does not require regular synchronizations like a
coulomb-counter based meter does.
Another thing that is good to check every now and then is command pe (print extreme point log).
See the description of it in chapter “Additional commands”. It will give you information about hoe
your batteries are performing.
Basic configuration
The starting point before changing anything is to take a look at current configuration. You do the
with command ps (print setup):
WorkMode= 1
BatterySize= 100 Ah
BatteryUse= 30 Ah
BatteryCharging= 250 A
TimeEstimate= 900 s
TimeBeep= 200 ms
TimeRelay= 300 ms
TimeprecharGe= 0 s
VoltBalance= 3.500 V
VoltDifference= 0.000 V
BalanceInit= 0.000 Ah
BalanceAmount= 0 %

4
4
StartLedblinking= 20 %
VoltWarn= 3.100 V
VoltLow= 3.050 V
VoltVerylow= 3.000 V
VoltswitchOnagain= 3.100 V
TimeLow= 15 s
VoltswitchOnagain= 3.100 V
VoltAbsorb= 3.500 V
TimeAbsorb= 1200 s
VoltHigh= 3.600 V
TimeHigh= 5 s
TimeChargeoff= 14400 s
VoltResumecharge= 3.250 V
TimeWarning= 120 s
Templow1= 5 C
Tempwarn2= 50 C
Temphi3= 60 C
Temptarget4= 95 C
Temphi5= 100 C
Tempres6= 90 C
Limit-start0= 25
Limit-step1= 25
Limit-step2= 10
Limit-step3= 2
TimePrintout= 0 s
TimeMemlog= 315/600 s
The first block of lines describes some basic setup of BMS4S:
WorkMode= 1: this means that a current shunt is connected.
The value to set is calculated by adding the values for the following features:
0 workmode normal
+1 there is shunt connected
+2 measures 12V only
+4 supervised and supervising another BMS4S
+8 xtemp is used to supervise a battery
+16 xtemp is used to supervise an alternator
+32 switch off Bluetooth instead of sleep, will save some 3 mA
+64 Swedish CSV (comma separated values in printouts for import into Swedish excel)
+128 always count coulomb even if balancing is ongoing, reports might be biased
+256 only p at tp= instead of both p and po, useful at certain test-cases
+512 power off when high bat temp, normally only charging will be stopped
+1024 all off port = charge on for bistable charging relay (no very low volt relay available)

5
5
+2048 precharge on port BC1 (no automatic balancing possible), use if supervised mode
So, if you e.g. have connected a current shunt and have two BMS4S supervising each other
you shall give the command wm=5.
BatterySize= 100 Ah: size of installed LFP bank. Change with bs=nnn as implied by the capital letters.
But before you can start changing anything you must unlock the device by command (device
unlock) du=1234. You should change this to your own PIN by command (device pin) dp=nnnn. If you
have forgotten your PIN, you can set a new one within 30 seconds after you have switched on the
power to BMS4S. You can remove the PIN by command dp=0 (not recommended). (note, all
commands are given with small letters)
BatteryUse= 30 Ah: You use 30 Ah every 24 hour which means that you get out of power after 3
days without charging. Used to estimate SoC if no current shunt is connected. Change with
command bu=nnn. The same applies to all commands below, the capital letters in the printout imply
the command to use when changing the setting. If BatteryUse is set too high, SoC estimates will also
be too high.
BatteryCharging= 50 A: the most common charging method will charge with 50 A. Used to estimate
unbalance between cells if no current shunt is connected. If you are using automatic balancing using
coulomb-counting, you should also install a shunt to ensure that the unbalance-estimates are as
good as possible (see chapter “Equipment connection description” below).
TimeEstimate= 900 s: The Soc estimate is based on the last 900 seconds (15 minutes).
TimeBeep= 300 ms: each beep will be 300 ms long. If you have a really loud beeper you might want
to shorten this to achieve a bearable sound level.
TimeRelay= 300 ms: when the bi-stable relay is operated it is done with a 300 ms long pulse
TimeprecharGe= 0 s: if you have equipment with high start-up current you might want to pre-charge
them before operating the relay. If you set this timer between 1 and 10 s you will get a pulse to use
for a small relay with a resistor parallel to the real relay that will soft-start the equipment. This pulse
comes on either the port “Osup” or “BC1”, see command wm=nnnn.
The second block of lines describes how balancing will be handled.
VoltBalance= 3.500 V: There are two ways to use the connected 4sbalancer (sold separately). Both
uses this value as the starting point when the balancing procedures are initiated. This value shall
normally not be set below 3.4 V. If you do not have a 4sbalancer these settings will be used to
calculate how big the unbalance is.
VoltDifference= 0.000 V: This is the first and simplest balancing alternative. If this value is set
(recommended value: 0.050 V) then when the first cell has passed the BalanceVolt-value (during
charging) and the voltage difference between two cells exceeds the VoltDifference-value the
balancing will start and proceed as long as the BalanceVolt-value is exceeded and the unbalance
remains. But since the balancing current is low (0.2 A) and that balancing is done only while
charging, this method only works when the battery bank is reasonable well matched (all cells have
close capacity values). Otherwise, the second method is recommended. (Or you can replace the

6
6
resistors in the 4sbalancer with ones with lower resistance (the ones installed are on 33 ohm each)
to increase the current to be able to handle larger unbalances. But then ensure that the produced
heat can be ventilated away)
BalanceInit= 0.000 Ah: This is the second balancing alternative. When the first cell passes
BalanceVolt-value during charging (and VoltDifference is set to 0.000) coulomb counting starts and
continues until the last cell passes it. If the difference between the best and the worse cell then
exceeds the BalanceInit-value (recommended value: 0.5% of the total battery capacity, i.e. 0.500 Ah
for a 100 Ah battery bank) the balancing will start and continue until the calculated balancing value
is balanced away. It is recommended that you have installed a way to measure the current if you use
this method. See chapter “Equipment connection description” how to do that. Note: VoltDifference
must be set to 0 (vd=0) to activate this balancing alternative.
You can see the coulomb counters with the sort Coulomb (As) with command po, and all calculated
results presented in Ah with command pe. You can use this information to manually balance the
cells with a 3.6 V charger.
BalanceAmount= 0 %: when balancing starts, it will aim to reduce the difference with the
percentage stated here. The recommended start value 25% is to ensure that it does not overshoot
the target. This is especially important if no shunt is connected, since it then bases the coulomb
counting on what value is set for BatteryCharging. If you find multiple similar entries in the “extreme
point log” (command pe) before an unbalance is cured, you can increase this with e.g. 25% to speed
up the process.
The third block of lines describes how and when a low voltage event shall be handled, i.e. when
shall the loads be disconnected.
StartLedblinking= 20 %: when SoC gets below 20% the LED will start blinking as an early warning, 2
blink for 10-19 % and 1 blink for 0-9 %.
VoltWarn= 3.100 V: this is the first level of protection. At 3.100 V the buzzer/alarm will start beeping
“low voltage”. It is now time to start the engine and start charging to prevent that any loads get
disconnected.
VoltLow= 3.050 V: this is when the “not necessary” loads will be disconnected via the bi-stable relay.
VoltVerylow= 3.000 V: this is when all loads will be disconnected. You can use this e.g. if you have a
second bi-stable relay isolating the batteries completely. If BMS4S is not disconnected it will go into
low power mode and only do the most important tasks in a slow paste, like switching on the system
again once charging has brought the voltage up to VoltswitchOnagain.
TimeLow= 15 s: the above voltages must be below the values for 15 seconds before the action is
taken. If you use high power things like thrusters and starters for longer continues time than this you
might want to extend this time, command tl=nn.
VoltswitchOnagain= 3.100 V: when the voltage har reached this level after a low-voltage event the
system will go back to normal again.
The fourth block of lines describes when charging shall be discontinued.

7
7
VoltAbsorb= 3.500 V: Normally LFP cells are fully charged at 3.6-3.65 V. Some chargers miss settings
adopted for LFP, so they will not manage to get the voltage that high. Then you can set an
“absorption” level that it can reach, and the let it stay there for a time. Here this time starts at 3.5 V.
TimeAbsorb= 1200 s: and this timer will keep the charger on for 1200 s (20 min) before charging is
stopped
VoltHigh= 3.600 V: All charging sources that can achieve 3.6 V will be stopped at that voltage. 3.6 V
corresponds to approximately 90 % SoC when charging is done with 0.4 C, and is a good compromise
between battery usage and battery life length.
TimeHigh= 5 s: but the first cell must exceed the set voltage in more than 5 s before the action is
taken.
TimeChargeoff= 280/14400 s: the total time it will be switched off is 14400 s (4 hours) and so far it
has been switched off for 280 s. If it is set to 65500 it means it will never switch on charging, then it
is only VoltResumecharg that will do that.
VoltResumecharg= 3.200 V: if the voltage drops down to this level, charging will resume even if
TimeChargeoff has not elapsed.
TimeWarning= 120 s: if the voltage has not gone down below the set high voltage 120 s after
charging has been switched off, BMS4S will start beeping “high voltage”.
The fifth block of lines describes battery temperature limits.
Templow1= 5 C: if charging is started with battery temperature lower that this a “low temperature
charging” will start beeping, and charging will be stopped for a preset time (see command tc). If you
do not have any temperature sensors installed on the batteries, their temperature will be reported
as 20 degrees.
Tempwarn2= 50 C: if battery temperature exceeds 50 degrees Celsius a “high battery temperature”
will start beeping.
Temphi3= 60 C: if battery temperature exceeds 60 degrees Celsius a charging will be switched off for
a preset time (see command tc).
The sixth block of lines describes when and what to do when the alternators temperature is
getting high.
Temptarget4= 95 C: when the alternator exceeds 95 degrees Celsius, BMS4S will regulate down
charging current and keep the temperature around 95. However, the temperature is a slow feedback
on how much power the alternator generates, so the temperature will fluctuate a bit around the set
value. Therefore, it is important to set a max-value (Temphi5) where charging will pause if the
regulation is too slow. This regulation will only work if your alternator has a voltage sense cable, and
you have installed a temperature sensor on the alternator.
Temphi5= 100 C: when the alternator temperature exceeds 100 degrees Celsius, all charging will
pause. This will only work if you have installed a temperature sensor on the alternator.

8
8
Tempres6= 90 C: when the alternator temperature has come down to 90 degrees Celsius, charging
will resume if it has been paused.
Limit-start0= 25: When Temptarget4 is reached, the first step is to find the state where regulation
kicks in.
This indicates the starting point. Values between 20 and 100 is normally ok. This, and the following
limit-steps are available only to be able to tune the algorithm to your alternator if the default does
not work properly. If the regulation starts too slow (Temphi4 pauses charging) then decrease Limit-
start0 and Limit-step1 with steps around 10% until it works ok. If the temperature oscillates with
increasing amplitude until Temphi4 pauses charging, then decrease Limit-step2 with around 10%.
And if the temperature oscillates but stays below Temphi4, then decrease Limit-step3 with one (but
never to 0) until the oscillation is slow. It will never be possible to get an absolute stable
temperature since the temperature is a feedback on how much current that has been produced the
last seconds, not on what is produced right now. If you need help, run the engine until the alternator
is hot, connect to bms4s and give command ps, and then tp=10 and collect the printouts for 10
minutes. Send these then to [email protected] and we will take a look and return
recommendations on regulation-settings.
Limit-step1= 25: This is how fast BMS4S shall look for the kick-in point. Values between 20 and 50 is
normally ok.
Limit-step2= 10: This is how fast BMS4S shall react when the alternators temperature differs more
than 3 degrees Celsius from target.
Limit-step3= 2: This is how fast BMS4S shall react when the alternators temperature differs less than
3 degrees Celsius from target.
And the last block contains features useful to understand how your system is performing.
TimePrintout= 0 s: if e.g. command tp=5 is given, then the command p and po will automatically be
given every 5 s. This is useful when testing, and will prevent that the Bluetooth interface is powered
off. So, if you want the Bluetooth interface to stay on all the time, tp=65500 can be given. This will
however increase the power consumption with around 10 mA.
TimeMemlog= 315/600 s: this means that voltage and current will be logged every 600 s (10 min).
The log is started by command tm and can be printed with command pm. 315 is the time since last
log entry was saved.
A command summary and description of blinks and beeps are always available with command h:
h help
l print settings
p print voltage
ba= balance amount (%)
bi= balance initiate diff (A/100)
bs= battery size (Ah)
bu= battery usage (Ah)
bt= bluetooth 0=off, 1=sleep, 2=on
ce clear extreme points log
cm clear memory log
dl device lock
dp= set device pin
du= device unlock
fr factory reset
fu= factory settings unlock
pd print debug
pe print extreme-point log
pm print memory log
po print other info
ps print settings

9
9
pv print version
rb reboot
rp reprogram
sl= set led blink-level (%)
wm= set work mode
t1= temp low charging (C)
t2= temp high battery warn (C)
t3= temp high battery (C)
t4= temp target (C)
t5= temp high pause charging (C)
t6= temp resume charging (C)
ta= time absorb (s)
tb= time beep (ms)
tc= time of charging pause (s)
te= time for soc estimate (s)
th= time high (s)
tl= time low (s)
tm= time memory log (s)
tp= time print volt (s)
tr= time relay (ms)
tw= time before warning beep (s)
va= volt absorb (V)
vb= volt balance (V)
vh= volt high (V)
vo= volt power on again (V)
vr= volt resume charging (V)
vw= volt warning (V)
vl= volt low (V)
vv= volt very low (V)
AT AT command
a1-4= adjust battery volt
l0= initial value
l1= initial search step for charge limit
l2= second search step for charge limit
l3= third search step for charge limit
s1-4= set battery volt
sc= set current (A)
sf= save factory data
sm= set missing current
ss= set float size
sv= set verbose
wm=0 workmode normal
+1 shunt connected
+2 12V only
+4 supervised
+8 x is bat temp
+16 x is alt temp
+32 BT hard off
+64 Swedish CSV
+128 always count coulomb
+256 only p at tp=
+512 power off when high bat temp
+1024 all off port = charge on
+2048 precharge on port BC1
1 blink SoC 0-9
2 blink SoC 10-19
...
10 blink SoC 90-99
2 beep low temp charging
3 beep high battery temp
4 beep low voltage
5 beep high voltage
6 beep device failure
Additional Commands
What you normally do is described chapter “normal usage” and chapter “basic configuration”, so
you have the explanation of the important commands there. Here you have a few more commands
that can be of use.
AT AT-command
This is the exception to the statement “all commands are written with small letters”.
The Bluetooth radio this device was designed for entered AT-mode (mode where it accepts
commands) when no device is connected over the radio. So, if you want to change
something in the Bluetooth-radio you can give it e.g. a command like this: AT+NAMEMyBMS.
As soon as this is sent you will be disconnected which will get the Bluetooth device into AT

10
10
mode. Half a second after you have given the command, BMS4S will sent it to the radio.
When this is done you will see a blink on the LED. After that you have 10 seconds to
reconnect to get the response that the radio gave to your command. Unfortunately, not all
bluetooth devices work exactly the same. If this does not work, check the manual for the
bluetooth device you have and see if there are any other way to change its settings. But you
do not have to change anything, it will work fine anyway.
ce Clear Extremepointlog
will clear all entries from the log.
cm Clear Memorylog
will clear all entries from the log. You can add a text with 12 characters e.g. to state when
the logging was started. Example:
cm=24/12-09:30
p Print
will produce a printout of cell-voltage, total voltage, current and estimated SoC. Example:
U=3.283 3.283 3.283 3.284 13.133 I=0.000 SoC=41
pe Print Extremepointlog
Command pe will give a printout like this:
HVE , 3.599 , 3.600 , 3.598 , 3.599 , 14.396 , 77.130 ,
HVA , 3.517 , 3.520 , 3.518 , 3.520 , 14.074 , 14.970 ,
LVE , 2.997 , 2.996 , 2.996 , 2.997 , 11.986 , -1.663 ,
UBC , 3.563 , 3.564 , 3.563 , 3.555 , 14.264 , 75.622 , 0.720 , 0.720 , 0.810 , 0.010 ,
UBI , 3.563 , 3.564 , 3.563 , 3.565 , 14.254 , 75.622 , 0.720 , 0.720 , 0.810 , 0.010
UBE , 3.277 , 3.277 , 3.277 , 3.277 , 13.109 , -1.204 ,
VBI , 3.480 , 3.500 , 3.499 , 3.497 , 13.976 , 75.622,
This time the log contained six entries, can store around 50 entries. The log is cleared by
command ce. The first four numbers in all lines are the voltage of each cell when the event
happened. The fifth is the total voltage, and the sixth is the current at the event.
HVE means “high voltage event”, HVA “high voltage absorption event” (timeout has
happened in VoltAbsorbtion phase, see command va), LVE “low voltage event”.
UBC means “unbalance calculation” and the four last numbers are the amount of energy
that were charged into each cell at the latest cell balance measurement (done by coulomb
counting), with the sort Ah. This counting starts when the voltage passes VoltBalance . So
right now, there is an unbalance of 0.8 Ah (0.810-0.010) between cell 3 and cell 4, where cell
3 is the best charged one. UBI means “unbalance calculation and balancing initiated”
(balancing will only work if a balancing board has been installed). UBE then means that the
initiated balancing has ended. If an UBE is missing after an UBI then the system has been
switched off before the balancing ended, which is nothing to worry about. If there are
enough remining unbalance the process will restart at the next unbalance-calculation. If
there are multiple UBI in sequence with the same order of unbalance this indicates that you
can increase how much of the unbalance you try to remove each time. Then you can
Other manuals for BMS4S
1
Table of contents
Popular Microcontroller manuals by other brands

AMS
AMS AS7261 Demo Kit user guide

Novatek
Novatek NT6861 manual

Espressif Systems
Espressif Systems ESP8266 SDK AT Instruction Set

Nuvoton
Nuvoton ISD61S00 ChipCorder Design guide

STMicrolectronics
STMicrolectronics ST7 Assembler Linker user manual

Texas Instruments
Texas Instruments Chipcon CC2420DK user manual

Texas Instruments
Texas Instruments TMS320F2837 D Series Workshop Guide and Lab Manual

CYPRES
CYPRES CY14NVSRAMKIT-001 user guide

Texas Instruments
Texas Instruments INA-DUAL-2AMP-EVM user guide

Espressif Systems
Espressif Systems ESP8266EX Programming guide

Abov
Abov AC33M8128L user manual

Laird
Laird BL654PA user guide





