Workshop: repairs and experiments

A DIY 8S 280 Ah LiFePO4 battery: assembly, BMS, temperature sensors and compression

Published 10.11.2026

How to build a 24 V (8S) LiFePO4 battery yourself from eight 280 Ah prismatic cells. This article covers:

  • a calculator: how many cells, which BMS, fuse and cable for your battery, and the order of work;
  • choosing and checking the cells, and balancing them before assembly;
  • busbars, insulation, and the order for connecting the BMS;
  • the essentials: what connects where, 15 questions to check and what happens if you skip them; safety;
  • which fuse to fit so that it blows before the cable does;
  • what to do if the difference between cell voltages grows under current;
  • what the BMS can do and which thresholds we recommend for LiFePO4;
  • where to put the BMS temperature sensors, for a heated room and for frost;
  • how to control the BMS from the command line, Python or a microcontroller: the protocol, ready-made commands, libraries;
  • whether the cells need compressing, why not with clamps, and whether it extends service life;
  • whether the battery lasts longer if you do not charge or discharge it fully, and what happens to it if it just sits (tables and a chart);
  • voltages of common pack sizes: 1S, 4S, 8S, 16S and up.

Connecting such a battery to an APC Smart-UPS and setting up the UPS is covered in a separate article.

draft — under discussion and being expanded

⚠ Before you start. Eight 280 Ah cells hold more than 7 kWh. A short circuit across this battery means thousands of amps: a dropped spanner across the terminals will melt, and a cable without a fuse will catch fire. Use insulated tools, take off rings and your watch, and cover any terminals you are not working on. Fit the fuse on the positive lead, close to the battery, before you connect any load for the first time.

What we have

ItemOurs
cells8 EVE LiFePO4 prismatic cells, 280 Ah [TO ADD: model, e.g. LF280K, and batch year]
layout8S: eight cells in series, 25.6 V nominal, ≈ 7.2 kWh
BMSJBD 8S "smart" board (board ID AP21S001), rated 50 A, two external temperature sensors plus the board sensor
balancinga separate active balancer board [TO ADD: model and current]; the BMS's own balancing is off
chargingan external charger (fast) and the UPSes themselves (slow, at a slightly lower voltage)
loadstwo APC Smart-UPS units (1000 and 1500) on one battery
link to the BMSUART → USB cable to a server, which reads voltages, current and temperatures every few seconds

LiFePO4 8S voltages

A LiFePO4 cell is 3.2 V nominal, so eight in series give 25.6 V. That is close to the working range of a 24 V lead-acid battery (two 12 V blocks), which is why LiFePO4 8S replaces it in UPSes, inverters and solar systems.

StateCell8S battery
datasheet charge limit3.65 V29.2 V
everyday charge (longer life)3.45–3.55 V27.6–28.4 V
full, after resting≈ 3.35 V≈ 26.8 V
plateau: from ~90 to ~20 % charge3.25–3.30 V26.0–26.4 V
nearly empty3.0 V24.0 V
where we recommend cutting off discharge2.8 V22.4 V
datasheet discharge limit2.5 V20.0 V

⚠ On the plateau the voltage barely moves: between 70 and 30 % the difference is a few hundredths of a volt. So you cannot read the state of charge from the voltage. The BMS works it out by adding up the current that goes in and out.

Voltages of common pack sizes

A pack is named by how many cells are connected in series: 4S is four, 16S is sixteen. The voltages are multiplied by that number; the capacity in amp-hours does not depend on it.

PackNominal, VCharge limit (3.65 V), VEveryday charge (3.45 V), VCut-off (2.8 V), VDischarge limit (2.5 V), VReplaces lead-acid
1S3.23.653.452.82.5—
2S6.47.36.95.65.06 V
4S12.814.613.811.210.012 V
8S25.629.227.622.420.024 V
15S48.054.7551.7542.037.548 V
16S51.258.455.244.840.048 V
24S76.887.682.867.260.072 V
32S102.4116.8110.489.680.096 V
  • "48 V" comes in two kinds. 16S (51.2 V) is the most common battery for home systems and solar inverters. 15S (48.0 V) is closer to a 48 V lead-acid battery in its full-charge voltage. Before choosing, compare the input voltage limits of your inverter or UPS with the "charge limit" and "cut-off" columns.
  • 4S in place of a 12 V lead-acid battery. An ordinary lead-acid charger is mostly fine, but in equalisation or desulphation mode it goes above 15 V, which is over the 14.6 V limit. Turn that mode off for LiFePO4.
  • The "everyday charge" column is the voltage to charge to when the battery sits full on standby (a UPS, backup power). Why it lasts longer that way is explained under Service life.

Calculator: building a battery for your own job

The calculator works out a battery from any prismatic LiFePO4 cells, not just our 280 Ah 8S. Enter the cell and the layout: either as a cell count (S in series, P in parallel), or as the voltage, capacity, energy or runtime you need. The calculator shows:

  • how many cells to buy and what the battery will weigh;
  • voltages for the charger and the BMS thresholds;
  • the battery current at its lowest voltage, and from it the BMS continuous current, the fuse rating and the cable size;
  • how long top balancing will take;
  • what not to forget for that particular build.

The calculator runs in the browser and needs JavaScript.

Reading S and P. "8S" is eight cells in series (24 V). "8S2P" is sixteen cells: first pairs are connected in parallel into groups, then the eight groups go in series. That battery has twice the capacity and current at the same voltage. It needs one 8S BMS; its current is chosen for the load (the calculator works it out), not multiplied by P. The other route is two separate 8S batteries, each with its own BMS and fuse, connected in parallel at a busbar.

Why the current is worked out at the cut-off. An inverter or UPS draws the same power whatever the battery voltage. When the battery is nearly empty and the voltage is lowest, the current is highest. That is the current the BMS, fuse and cable are chosen for.

Why the cable is sized for the fuse, not for the load. The fuse protects the cable. If the cable is rated for less current than the fuse, an overload will burn the cable before the fuse opens.

What not to forget: the order of work

StepWhat to doDetails
1work out S and P, the BMS, fuse and cablecalculator
2buy cells from one batch; a BMS for the required current with temperature sensors; a DC-rated fuse; flexible copper cable; tinned lugscells, cables
3get the tools ready: bench power supply, multimeter, torque wrench, lug crimperbalancing
4check every cell: voltage, case, threadscells
5balance all cells in parallel at 3.65 Vbalancing
6stand the cells in a row with insulation between them, compress them with plates, rods and springsassembly, compression
7busbars and BMS sense wires under the bolt, tightened to the datasheet torqueassembly
8check the sense connector with a multimeter, connect the BMS in the right order, set the thresholdsconnection order, thresholds
9fix the temperature sensors (on a terminal only with intact insulation)temperature sensors
10fuse on the positive at the battery, cables with lugs, a load switchcables and lugs, fuse
11before first connecting an inverter or UPS, pre-charge its capacitors through a resistorUPS article
12set the charger to the voltage from the calculator; watch the first chargechecks
13after a week, check the bolt torque, terminal heating and the spread of cell voltageschecks, spread under current

The essentials: what connects where, what to check, safety

What connects where

WhatWhereHow
BMS B−negative of the first cellpower cable of the same size as the rest: the whole current flows through it
BMS P−negative of the load (UPS, inverter) and of the chargernever connect B− and P− directly
positive of the load and chargerpositive of the eighth cellthrough the fuse at the terminal, then a switch
BMS sense wiresthe first to the negative of the first cell, then in turn to each joint between cells, the last to the positive of the eighthunder the terminal bolt; check with a multimeter before plugging the connector into the board
active balancer wiresthe same points as the sense wiresalso under the terminal bolt
external temperature sensorsthe middle cell and the positive terminal; if frost is possible, the middle cell and an end cellwith intact insulation, not under a bolt (temperature sensors)
BMS link (UART)a USB adapter on the computer, or a microcontrollerone adapter per battery, no shared ground between batteries
frame, plates, rodsnot connected to anythinginsulated from terminals, busbars and cell cases; rods sleeved in tubing

The key questions, and what happens if you skip them

No.QuestionWhat happens if not
1Are the cells from one batch, with equal voltages?the whole battery is limited by the weakest cell, and the BMS keeps stopping charge or discharge because of it
2Has the battery been top balanced?one cell reaches the top first, the BMS stops charging, and the battery stays undercharged while the balancer spends weeks evening it out
3Has the sense connector been checked with a multimeter: even steps of ~3.3 V?a swapped wire puts the wrong voltage on the board input, and the BMS burns out
4Does all the current go through the BMS, with B− and P− not joined directly?the BMS still shows the cell voltages but protects the battery neither from overcharge nor from a short circuit
5Is the fuse on the positive at the terminal, and can the cable carry more than the fuse rating?in a short circuit the cable gets red-hot and its insulation burns; that is how fires start
6Are the BMS continuous current and its thresholds above the load current at cut-off?the BMS shuts the UPS or inverter down under load, exactly when the battery is needed
7Are the bolts tightened with a torque wrench and checked again after a week?a loose contact heats up, the cell spread grows under current, and the terminal may melt (spread under current)
8Is there no washer between terminal and lug, and is the lug crimped with a press tool?the current flows through the steel bolt or a poorly crimped cable, and the joint heats up
9Are the cell cases insulated from each other, from the frame and from the rods?worn film connects the cases: leakage current, heat, sparks
10Are the temperature sensors fitted, and is low-temperature charge protection on?charging below freezing permanently takes away capacity, and at worst causes a short circuit inside the cell
11Is the charger voltage no higher than 3.65 V × S, better 3.45–3.55 V × S?only the BMS stands between the cells and overcharge; if it fails, the cells swell and vent gas
12Is the discharge cut-off no lower than 2.5 V per cell, better 2.8 V?discharging below the datasheet limit damages the cell: capacity drops, and it has to be tested on its own before going back in
13Are the UPS or inverter capacitors pre-charged through a resistor?the first connection gives a big spark and burnt contacts, the BMS trips as if on a short, and its MOSFETs may be damaged
14Are the terminals and busbars covered with an insulating lid?a dropped spanner or cable shorts the battery
15Do you connect in parallel (cells for balancing, or several batteries) only at equal voltages?a large current flows between them: sparks, burnt terminals, the protection trips

Safety

  • Insulated tools. A spanner touching two terminals gets red-hot and welds itself on within seconds. Work on one joint at a time and cover the other terminals.
  • Take off rings, watch, bracelet and chain. A ring that shorts the terminals turns red-hot in seconds and burns the finger.
  • Safety glasses. A short-circuit spark throws molten metal.
  • Put nothing on the battery: no tools, bolts or multimeter.
  • Fuse first, load second. Fit the fuse before the load is connected for the first time. Before working on the battery, switch off the load and the charger, and only then undo the cables.
  • Never charge without a BMS or below freezing. Overcharge protection and the below-0 °C charge cut-off must always be on.
  • Do not drill, bend or solder the terminals. Bending or overheating a terminal can damage the cell seal.
  • Where the battery stands: a non-combustible base, away from anything flammable, with air around it; not in a closed cabinet next to paper or cloth.
  • LiFePO4 is safer than other lithium cells, but it is not fireproof. An overcharged, punctured or overheated cell swells and vents harmful, flammable gas. If a cell has swollen, is getting hot or is smoking: switch off the charger and the load, ventilate the room, do not breathe the smoke.
  • Keep an extinguisher nearby: dry powder or CO₂, to put out the cables and anything that has caught fire around the battery.
  • For the first few weeks, check for heat: after an hour at high current, feel the terminals and busbars or look at them with a thermal camera.

Cells: choosing and checking

Buy all eight cells from one batch. In a series battery the same current flows through every cell, and the battery is empty when its weakest cell is. One 260 Ah cell among seven 285 Ah cells makes the whole battery a 260 Ah battery.

What to check as soon as the cells arrive:

CheckHowGood
voltage of each cellmultimeterwithin ~0.01 V of each other (usually 3.25–3.30 V)
internal resistancean internal resistance tester (1 kHz AC), not a multimeteras in the datasheet (tenths of a milliohm), the same on all cells
caselook, and hold a straight edge against the wide facesno bulging, dents or signs of leakage
terminal threadsscrew a bolt in by handgoes in easily, thread not stripped
markingsQR code or printing on the casesimilar manufacturing dates

You can also measure each cell's capacity: charge to 3.65 V and discharge to 2.5 V at a known current. For 280 Ah that takes a day per cell. If you cannot do that, the checks above plus the first full cycle of the assembled battery are enough: a weak cell shows up straight away, because it reaches the top and the bottom first.

Balancing before assembly (top balancing)

Before you connect the cells in series, bring them to the same state of charge. Then in the assembled battery they all reach "full" together, and the BMS does not stop charging because one cell has run ahead.

  1. Connect all eight cells in parallel: all positives together, all negatives together. Before you do, make sure their voltages are within 0.05 V of each other; otherwise a large current will flow between them the moment you connect them.
  2. Connect a bench power supply set to 3.65 V, with the current as high as the supply allows (10–30 A). Use short, thick leads, and set the voltage by a multimeter on the cell terminals, not by the supply's display.
  3. Charge until the current drops almost to zero (below about 1 A).
  4. Disconnect the supply, let the cells rest for a few hours, then take the parallel connection apart.

How long it takes: eight 280 Ah cells at about 40 % need roughly 1,300 Ah to top up. At 10 A that is five and a half days; at 30 A, nearly two.

An active balancer in the finished battery also evens the cells out, but it only moves charge when the voltages differ noticeably, and on the plateau the difference is a few millivolts. So it takes a long time to even out a large starting difference, a few minutes at the end of each charge; top balancing removes it in one go.

Assembly: layout, busbars, insulation

Layout. The eight cells go in one row or in two rows of four. Series connection: the positive of the first cell to the negative of the second, and so on. The battery's negative output (to the BMS) comes from the negative of cell 1, and the positive output (through the fuse) from the positive of cell 8.

Insulation between cells. The blue film on the case is thin and wears through easily. A cell's case may be at a voltage relative to its terminals, so put insulating sheets (1–2 mm FR4 or ready-made spacers for prismatic cells) over the whole face between neighbouring cells, and an insulating sheet underneath as well. Once assembled, cover the terminals with a non-conductive lid.

Busbars. Flexible ones (many thin copper strips) or plates with a loop-shaped bend are better: the cells "breathe" a little as they charge and discharge, and a rigid busbar pulls the terminal upwards. The terminals are aluminium: before tightening, clean the contact surface of oxide with a fine abrasive or a brush, and wipe it with alcohol.

Tightening. Use the torque from the cell datasheet and a torque wrench. An overtightened bolt strips the thread in the aluminium terminal, and such a terminal is hard to repair. A loose contact heats up under current. Check the torque again after a week of use.

BMS sense wires (thin, one to each point between cells) go under the terminal bolt together with the busbar, with a ring terminal, and not onto the middle of the busbar. Otherwise the BMS also measures the voltage drop across the busbar, and under current one cell looks higher and another lower than it really is.

LiFePO4 8S battery, top view: busbars, BMS, fuse, compression and temperature sensors1−+2+−3−+4+−5−+6+−7−+8+−threaded rod + springend plateBMSB− · P−fuseto the UPS and charger122Tsensor 1 — side face of a middle cell (hottest spot)sensor 2 — the “+” output terminal with the heavy cable (bad contact)T — the BMS board’s own sensor, already in placeif frost is possible: sensor 2 goes on the side face of an end cell (dashed)BMS and balancer sense wires — under the bolt of every terminalinsulating sheets over the full face between cells

Power cables and lugs

How many amps a cable can carry

For example, 16 mm² of copper carries 100 A in free air and 85 A in conduit continuously, according to the PUE tables (the electrical installation rules used in Ukraine). Aluminium of the same cross-section carries 75 and 60 A. These figures are for PVC or rubber insulation at +25 °C. Flexible cable with silicone insulation withstands 180–200 °C, so on paper it can carry more, roughly 120–150 A. But on a 24 V battery the limit is usually set not by heating but by voltage drop: two metres of 16 mm² cable (there and back) is ≈ 2.2 mΩ, and at 100 A it loses ≈ 0.22 V and ≈ 22 W of heat.

What the columns mean:

  • Cross-section, mm² — the area of the conductor (all strands together), not of the cable with its insulation;
  • Conductor diameter, mm — for a solid conductor. A stranded conductor of the same cross-section is about 10–20 % thicker because of the air between strands;
  • Copper / aluminium in free air, in conduit, A — the largest continuous current per the PUE (tables 1.3.4 and 1.3.5): PVC or rubber insulation, air at +25 °C; "in conduit" means two single-core cables in one conduit; "—" means the PUE table has no value;
  • AWG — the nearest AWG size, its actual cross-section, and the nearest commonly sold size that is not thinner than the metric one (AWG);
  • Resistance, mΩ per 1 m — the resistance of one metre of conductor at +20 °C (copper 0.0175, aluminium 0.028 Ω·mm²/m). The same number is the voltage drop in millivolts per amp per metre of cable.
Cross-section, mm²Conductor diameter, mmCopper in free air, ACopper in conduit, AAluminium in free air, AAluminium in conduit, A
0.50.811———
0.750.9815———
11.131716——
1.51.382319——
2.51.7830272420
42.2641383228
62.7650463936
103.5780706050
164.51100857560
255.6414011510585
356.68170135130100
507.98215185165140
709.44270225210175
9511330275255215
12012.36385315295245
15013.82440360340275
18515.35510—390—
24017.48605—465—
30019.54695—535—

AWG and resistance for the same sizes:

Cross-section, mm²Nearest AWGThat AWG's cross-section, mm²Nearest common AWG, not thinnerCopper resistance, mΩ per 1 mAluminium resistance, mΩ per 1 m
0.5200.52203556
0.75180.821823.33337.333
1171.041617.528
1.5151.651411.66718.667
2.5132.6212711.2
4114.17104.3757
696.6382.9174.667
10710.5561.752.8
16516.7741.0941.75
25326.6720.71.12
35233.631/00.50.8
501/053.481/00.350.56
702/067.433/00.250.4
953/085.034/00.1840.295
120250 kcmil126.68250 kcmil0.1460.233
150300 kcmil152.01300 kcmil0.1170.187
185350 kcmil177.35400 kcmil0.0950.151
240500 kcmil253.35500 kcmil0.0730.117
300600 kcmil304.02600 kcmil0.0580.093

Voltage drop and run length

The run here is the distance from the battery to the load, one way. The cable goes there and back, so resistance is counted over twice the length: drop = current × 2 × run length × resistance of 1 m. The current in both tables is the largest continuous one per the PUE (free air). At a lower current the drop is smaller, and the allowed run is longer by the same factor.

The "run at 3 %" columns give the longest distance at which the cable, at that current, loses no more than 3 % of the system voltage: 0.36 V on 12 V, 0.72 V on 24 V, 1.44 V on 48 V. For batteries and UPSes I recommend no more than 2–3 %. For 230 V lighting, 3–5 % is usually accepted.

Copper:

Cross-section, mm²Max continuous current in free air, ADrop per 1 m of run at this current, VRun at 3 % on 12 V, mRun at 3 % on 24 V, mRun at 3 % on 48 V, m
0.5110.770.50.91.9
0.75150.70.512.1
1170.5950.61.22.4
1.5230.5370.71.32.7
2.5300.420.91.73.4
4410.359124
6500.2921.22.54.9
10800.281.32.65.1
161000.2191.63.36.6
251400.1961.83.77.3
351700.172.14.28.5
502150.1512.44.89.6
702700.1352.75.310.7
953300.12235.911.8
1203850.1123.26.412.8
1504400.1033.5714
1855100.0963.77.514.9
2406050.0884.18.216.3
3006950.0814.48.917.8

Aluminium:

Cross-section, mm²Max continuous current in free air, ADrop per 1 m of run at this current, VRun at 3 % on 12 V, mRun at 3 % on 24 V, mRun at 3 % on 48 V, m
0.5—————
0.75—————
1—————
1.5—————
2.5240.5380.71.32.7
4320.4480.81.63.2
6390.364124
10600.3361.12.14.3
16750.2631.42.75.5
251050.2351.53.16.1
351300.2081.73.56.9
501650.1851.93.97.8
702100.1682.14.38.6
952550.152.44.89.6
1202950.1382.65.210.5
1503400.1272.85.711.3
1853900.11836.112.2
2404650.1093.36.613.3
3005350.13.67.214.4

AWG: one size, several names

AWG (the American scale) works the opposite way to mm²: the smaller the number, the thicker the wire. Beyond AWG 1 come 1/0, 2/0, 3/0 and 4/0, and after that sizes are given in kcmil. The same size is written differently in different countries and by different sellers:

How it is writtenWhat it means
10 AWG, 10 ga, 10 gauge, #10all the same: AWG 10. "ga" and "gauge" just mean "size"
B&S 10Brown & Sharpe, the old name of the same AWG scale
1/0, 0, 0 AWG, 1/0 AWGAWG "one aught", thicker than AWG 1
2/0 = 00, 3/0 = 000, 4/0 = 0000thicker still; the number of zeros = the number before "/0"
250 kcmil, 250 MCM, 250 kcm250 thousand circular mils ≈ 127 mm². MCM is the old name for kcmil
SWG 10⚠ a different, British scale: SWG 10 is 3.25 mm in diameter, AWG 10 is 2.59 mm
4 Ga in car audio⚠ often thinner than a real AWG 4 and made of copper-clad aluminium (CCA)
12AWG 680/0.08AWG 12 made of 680 strands of 0.08 mm; an honesty check: 680 × 0.005 mm² ≈ 3.4 mm²

How to check a cable labelled in AWG: work out the cross-section from the strands (as in the example above) and compare it with the table below. Scrape the conductor with a knife: there must be no grey aluminium under the copper (CCA). CCA has about 1.5 times the resistance of copper and is no good for batteries.

AWGAlso written asConductor diameter, mmCross-section, mm²Nearest metric size, mm²
2424 AWG, 24 ga, #240.510.210.5
2323 AWG, 23 ga, #230.570.260.5
2222 AWG, 22 ga, #220.640.330.5
2121 AWG, 21 ga, #210.720.410.5
2020 AWG, 20 ga, #200.810.520.5
1919 AWG, 19 ga, #190.910.650.75
1818 AWG, 18 ga, #181.020.820.75
1717 AWG, 17 ga, #171.151.041
1616 AWG, 16 ga, #161.291.311.5
1515 AWG, 15 ga, #151.451.651.5
1414 AWG, 14 ga, #141.632.082.5
1313 AWG, 13 ga, #131.832.622.5
1212 AWG, 12 ga, #122.053.314
1111 AWG, 11 ga, #112.314.174
1010 AWG, 10 ga, #102.595.266
99 AWG, 9 ga, #92.916.636
88 AWG, 8 ga, #83.268.3710
77 AWG, 7 ga, #73.6710.5510
66 AWG, 6 ga, #64.1213.316
55 AWG, 5 ga, #54.6216.7716
44 AWG, 4 ga, #45.1921.1525
33 AWG, 3 ga, #35.8326.6725
22 AWG, 2 ga, #26.5433.6335
11 AWG, 1 ga, #17.3542.4150
1/00, 0 AWG, 1/0 AWG8.2553.4850
2/000, 00 AWG, 2/0 AWG9.2767.4370
3/0000, 000 AWG, 3/0 AWG10.4185.0395
4/00000, 0000 AWG, 4/0 AWG11.68107.22120
250 kcmil250 MCM, 250 kcm12.7126.68120
300 kcmil300 MCM, 300 kcm13.91152.01150
350 kcmil350 MCM, 350 kcm15.03177.35185
400 kcmil400 MCM, 400 kcm16.06202.68185
500 kcmil500 MCM, 500 kcm17.96253.35240
600 kcmil600 MCM, 600 kcm19.68304.02300
750 kcmil750 MCM, 750 kcm22380.03300

Cable size calculator

Type a number into any field and the rest are recalculated. Cross-section, diameter and AWG are linked: change one and the others follow. If you enter the voltage drop you want (in volts or per cent), the calculator picks the cross-section; if you enter the cross-section, it works out the drop.

The calculator runs in the browser and needs JavaScript; the same numbers are in the tables above.

The fuse: it must blow before the cable does

The BMS protects the cells, not the cable. It stops a short circuit by switching off its MOSFETs, but a MOSFET can fail shorted, and then nothing stands between the battery and the short. That is why a separate fuse goes on the battery positive. It is the deliberately weakest point of the circuit: on overload or a short it melts before the cable has time to get red-hot.

RequirementWhy
on the positive, as close to the battery terminal as possible (~20 cm at most)all the cable after the fuse is protected; the piece before it is protected by nothing, so keep it short and well secured
rating at least 1.25 × the highest load currentso the fuse does not blow in normal use; the highest current is at cut-off, and the calculator works it out
rating no higher than the cable can carry continuouslyotherwise the cable overheats before the fuse opens; that is why the cable is sized for the fuse, not for the load
DC-rated, for 32 V or morea DC arc does not go out by itself the way an AC one does; a fuse or breaker rated only for 230 V AC may fail to break it
breaking capacity above the battery's short-circuit currentfor an 8S 280 Ah battery that is around 10 kA or even more. A fuse that cannot break it keeps arcing. Class T fuses are the safest (up to 20 kA); ANL and MEGA often break only a few thousand amps, so check the datasheet
not an automotive blade fusethose are made for tens of amps and small short-circuit currents

If several branches leave the battery in thinner cable (two UPSes in our case), each branch needs its own fuse at its start, sized for its cable. The main fuse at the battery will not protect a thin branch: it is sized for the thick cable.

A load switch after the fuse is handy for isolating the battery, but it does not replace the fuse: it never trips on its own. A DC breaker can replace the fuse only if its breaking capacity exceeds the battery's short-circuit current.

[TO ADD: which fuse we have, type and rating]

Connecting copper cable to a LiFePO4 terminal

The lug. A copper tube lug sized for the cable and for the terminal bolt (M6 on EVE 280 cells), crimped with a hexagonal crimping tool. A proper crimp is a cold weld: the copper of the cable and the lug become one piece.

Do not solder the cable into the lug. Solder that wicks between the strands makes the cable stiff next to the lug, and vibration breaks it right there. And under current and heat, solder slowly creeps.

Do not tin the lug yourself; factory-tinned is fine:

LugOn a LiFePO4 terminal
factory-tinned (a thin electroplated layer)best: tin stops the copper oxidising and reduces galvanic corrosion between the copper and the aluminium (these cells usually have aluminium terminals)
bare copperfine in a dry room: clean it bright and apply a thin layer of antioxidant contact paste
tinned with a soldering ironno: a thick, uneven layer of solder under the bolt creeps under pressure and heat, the bolt loosens and the contact heats up
aluminium, a twisted joint, a car crocodile clipno

Order under the bolt (bottom to top): cell terminal → lug, flat face to the terminal → BMS sense wire ring → flat washer → spring or disc washer → bolt. No washer between the terminal and the lug: the current must flow through the lug's flat face into the terminal, not through the steel bolt. The lug lies flat, no wider than the terminal, not bent. Tighten with a torque wrench to the torque in the cell datasheet, and check it again after a week.

Fixing a temperature sensor to a terminal

⚠ Most important: the sensor must be insulated from the terminal. The BMS temperature sensor wires connect to the BMS circuitry, which is referenced to the battery negative. The "+" terminal is 25–29 V higher. A sensor with a metal ring under the bolt, or with damaged insulation, would connect the battery "+" to a BMS input and burn out the BMS. So the sensor does not go under the bolt; it is pressed against the lug or busbar next to the terminal, and only with intact insulation (an epoxy bead or heat-shrink, like the BMS's own probes).

How to fix itGood enough?
electrical tape onlyno: PVC tape adhesive softens from 50 °C, the tape slides and the sensor lifts off the metal
a cable tie onlyweak: it presses at one point and leaves an air gap
thermal paste + Kapton tape + cable tieyes: the paste fills the gap, Kapton holds up to 200 °C, the tie presses it down
thermal adhesive (thermally conductive, electrically insulating)yes, if you will never need to remove the sensor

Thermal paste is not essential, but with it the sensor reads a few degrees more accurately and responds faster. Use an ordinary electrically non-conductive silicone paste (the kind used for CPUs); metal-filled pastes (silver or liquid metal) are not suitable here. Apply a thin layer, just enough to fill the gap. Cover the sensor and lug with a piece of foam so the sensor measures the metal, not the air.

Compress or not, and why not with clamps

In short: compress, yes, evenly and moderately. With clamps, no.

Why compress. A prismatic cell gets slightly thicker as it charges and thinner as it discharges, and over the years it slowly swells. Inside are layers of electrodes; when nothing holds them together they separate, and the cell ages faster. Manufacturers measure cycle life on compressed cells. For example, the EVE LF280K datasheet gives cycle life measured in a fixture that presses on the wide face with about 300 kgf; over the whole face (≈ 17 × 20 cm) that is less than 1 kgf/cm². Not much pressure, but it is constant and even.

The second purpose is to protect the busbars and terminals. The cells are always moving a little: they get thicker with charge and heat, thinner with discharge and cold, and over the years they also swell from the gas slowly building up inside. A cell that isn't held in place moves freely: it shifts, tilts and bulges. Every such movement pulls on the busbar, and the busbar pulls on the bolt and the terminal: bolts work loose, the contact heats up, and the thread in the aluminium terminal strips. Compressed cells stand as one block, the frame takes the movement, and the busbars and terminals carry no extra load.

Why not clamps:

A clampWhat happens
presses with a small pad on one spotthe thin aluminium case bends, and the pressure inside is uneven
the force is unknown and depends on your handeasy to overdo: the case deforms and the cell can be damaged
rigid, with no springthe cell breathes but the clamp does not: during charging the pressure rises, and nobody knows by how much
slips or loosens over timethe compression is lost without anyone noticing

How to compress properly:

  1. Two rigid end plates covering the whole wide face of the end cells: steel from 6 mm or aluminium from 10 mm, or thick plywood with a steel channel across it: a thin plate bends in the middle and the pressure stays only at the edges. Put an insulating sheet between the plate and the cell.
  2. Four threaded rods (M8 or thicker) at the corners, running along the row of cells. Slide tubing over each rod: PVC or silicone, a snug fit, along its whole length from plate to plate. The rod runs along the edges of every cell, and a cell case can be live. If rubbing or vibration damages the heat-shrink film on the cases, a bare rod connects the cases of several cells, and a short-circuit current flows between them. Thin heat-shrink on the rod wears through as well; thick tubing stands up to rubbing. It also keeps the rod away from terminals and busbars.
  3. A spring under the nut on each rod. The spring keeps almost the same force as the cells get thicker and thinner. Set the force by how far the springs are compressed: for ~300 kgf over four rods, each one carries ~75 kgf (≈ 740 N). A spring rated 50 N/mm gives that force when compressed by about 15 mm.
  4. Tighten the nuts evenly, in a criss-cross order, half a turn at a time, measuring the spring compression with a ruler.
  5. Tighten with the cells half charged (on the plateau), not full.

Springs or just rods?

WhatRods with springsRods only, no springs
when the cells get thicker (charge, heat, age)the force barely changes: the springs compress a little morethe force rises, by how much nobody knows: the rigid frame does not let the cells expand
when they get thinner (discharge, cold)the force staysthe force drops, a gap may open, and the cells shift
how to know the forcemeasure the spring compression with a rulerno way: it depends on your hand
upkeepglance at the springscheck for gaps and retighten the nuts from time to time
best suited forany battery, especially with frequent cycles and high currentbackup and UPS: the battery sits full, few cycles, low current

Our advice: springs are better. For a backup battery, rigid rods without springs will do, but tighten them with the cells half charged, only until everything sits snug, no tighter, and every few months check that no gap has opened and no face has bulged.

Does compression extend service life? Yes, but to be more precise: compression lets the cells reach their datasheet life; it adds nothing beyond it.

How the cells are heldWhat happens insideService life
loose, with gapsthe electrode layers separate, part of the area stops working, gas stays trapped between the layers; in a study of unconstrained prismatic cells, swelling sped up after only ~250 cyclesthe shortest; nobody promises the datasheet cycles here, since the maker measured them in a fixture
snug in a box, no forcethe cells cannot shift, but almost nothing resists their growthlonger than with no box, shorter than in a frame; for a UPS or backup this is usually enough
moderate and even, with springs, at the datasheet forcethe layers are pressed together, gas is squeezed out, the particles make better contactthe datasheet figure; in lab studies noticeably more cycles than without compression (up to ~25 % in one 2025 study)
too hardthe separator pores close up and the electrolyte moves between the electrodes less freelyshorter than with moderate force: in studies the highest pressure gave the fastest capacity loss
a clamp on one spotover-pressed in one place, the rest of the face freeunpredictable

The fewer the cycles, the smaller the difference. A UPS battery that sits full and is discharged a few times a year ages mostly from time, heat and the voltage it is held at (see Service life), not from cycling.

Is it essential in a UPS? In a UPS the battery sits full most of the time and discharges rarely and at low current, so it will work without compression too. But at the very least the cells must sit tightly, with no gaps, in a frame or box so they cannot spread apart or shift. Otherwise any movement of the cells passes to the busbars, and the busbars tear out the terminals.

⚠ Compression will not "cure" a swollen cell. If a face is already bulging, replace the cell rather than clamping it.

[TO ADD: how ours is compressed — frame, plates, rods, springs, or no compression; photos]

Service life: what makes a battery last longer

A battery ages in two ways at once: from cycling (charge and discharge) and from time, even when it just sits. Time does more harm the warmer it is and the higher the charge. In a UPS, where the battery sits full nearly all the time, the second matters more.

Does it last longer if you do not charge or discharge it fully?

In short, yes, and the top end makes the biggest difference. LiFePO4 ages fastest when it sits fully charged for a long time, especially in the warm, and when it is discharged below 2.5 V. The middle of the range is the easiest on a cell.

How it is usedHow to set it upWhat happens to service life
all the way in both directions every timecharge to 3.65 V, discharge to 2.5 Vthe datasheet cycles: 6000 to 80 % capacity for the EVE LF280K (25 °C, 0.5C, in a fixture); both ends are the hardest on a cell
without the top and bottom endscharge to 3.45–3.55 V, cut off discharge at 2.8–3.0 Vusually more cycles than the datasheet; you lose only a few per cent of capacity, since LiFePO4 holds little energy above 3.45 V and below 2.8 V. This is the setting we recommend
a narrow band in the middle (20–80 %)by the BMS state of chargea little longer still, but each cycle delivers ~40 % less energy, so over the whole life the energy gain is small
only shallow cycles in the middle, never a full one—in one study (Naumann, 2020), a surprisingly large capacity loss; part of it comes back after a few full cycles
sits full all the time (UPS)the voltage it is held atthe higher, the faster it ages: 3.65 V per cell is the worst, 3.40–3.45 V (27.2–27.6 V for 8S) is good
discharge below 2.5 V—fast ageing; below ~2.0 V the copper inside the cell starts to dissolve, and such a cell can become dangerous

Compare energy, not the number of cycles. Sellers write, for example, "6000 cycles at full discharge and 8000 at 80 %". But 8000 cycles at 80 % add up to 6400 full ones, which is only 7 % more energy over the whole life. The cycle count goes up mostly because each cycle is smaller.

Once every month or two, charge fully to 3.55–3.60 V and let the cells balance. The BMS then corrects its state of charge, the balancer evens out the cells at the top, and part of the loss from shallow cycling comes back.

If a new battery just sits

Even without a single cycle a cell ages: a protective film slowly grows on the graphite electrode and ties up some of the lithium. The rate depends most on temperature and less on the state of charge. Capacity falls fastest in the first year and more slowly after that.

Time in storage (approx.)10 °C, 50 % charge25 °C, 50 % charge25 °C, 100 % charge40 °C, 100 % charge
1 year99 %99 %97 %93 %
2 years99 %98 %96 %90 %
5 years98 %97 %93 %84 %
10 years98 %95 %91 %78 %
How much capacity a new LiFePO4 battery keeps while it just sits: an approximate model for four storage conditions75 %80 %85 %90 %95 %100 %012345678910years in storagecapacity, % of new10 °C, 50 % charge: after 1 yr — ≈ 99 %10 °C, 50 % charge: after 2 yr — ≈ 99 %10 °C, 50 % charge: after 5 yr — ≈ 98 %10 °C, 50 % charge: after 10 yr — ≈ 98 %25 °C, 50 % charge: after 1 yr — ≈ 99 %25 °C, 50 % charge: after 2 yr — ≈ 98 %25 °C, 50 % charge: after 5 yr — ≈ 97 %25 °C, 50 % charge: after 10 yr — ≈ 95 %25 °C, 100 % charge: after 1 yr — ≈ 97 %25 °C, 100 % charge: after 2 yr — ≈ 96 %25 °C, 100 % charge: after 5 yr — ≈ 93 %25 °C, 100 % charge: after 10 yr — ≈ 91 %40 °C, 100 % charge: after 1 yr — ≈ 93 %40 °C, 100 % charge: after 2 yr — ≈ 90 %40 °C, 100 % charge: after 5 yr — ≈ 84 %40 °C, 100 % charge: after 10 yr — ≈ 78 %10 °C, 50 % charge — 98 %25 °C, 50 % charge — 95 %25 °C, 100 % charge — 91 %40 °C, 100 % charge — 78 %10 °C, 50 % charge25 °C, 50 % charge25 °C, 100 % charge40 °C, 100 % charge
How much capacity a new battery keeps while it just sits. An approximate model based on published measurements of LiFePO4 cells: the measurements lasted up to 2.5–3.5 years, and beyond that the curve is extrapolated. Cells from different makers can differ several-fold: in one comparison under the same conditions (20 °C, 2.5 years), one cell lost 1.3 % of its capacity and another 6.4 %.

What else changes while the battery sits:

WhatHow it changesWhat to do
capacityfalls slowly (table above)store it cool, at 30–60 % charge
internal resistancerises by a few per cent a year: the voltage sags more under currenttest the battery under load before putting it into service
self-dischargetypically 1–3 % a monthevery 3–6 months check the voltage and top up to about half
spread between cellsthe cells self-discharge at different rates, so the spread growsbalance them before assembly (top balancing)
a BMS left connecteddraws a little power itself and over months can drain the battery flatfor long storage, disconnect the BMS or check more often
frostsitting in the cold does a cell no harmnever charge below 0 °C

How to store it: 30–60 % charge (on the plateau you cannot tell it from the voltage, so discharge a full battery by about half its capacity), 10–25 °C, dry, BMS disconnected. Check the voltage every 3–6 months: no cell should drop below 3.0 V.

When buying "new" cells, ask for the production date of the batch: a cell that has spent two years in a warehouse fully charged and in the warm is no longer quite new.

The BMS: what it can do

A BMS (battery management system) is a board that the battery's whole current passes through. It sits on the negative side: the B− terminal goes to the negative of cell 1, and P− goes to the load and the charger (on our board charging and discharging share the same terminal). The board measures each cell through a separate connector with thin wires.

On a JBD board the charge and discharge switches (six MOSFETs each) are connected in series back to back, so current in either direction passes through both groups. When a protection trips, the BMS turns off one group: charging or discharging.

FeatureHow it works
cell protection: overchargeany cell above the threshold for longer than the delay → charging stops; a second, hard threshold sits higher
cell protection: over-dischargeany cell below the threshold → discharging stops; a second, hard threshold sits lower
battery protection: voltagethe same for the total of all cells
charge and discharge currentabove the threshold for longer than the delay → off, then another try after a set pause
short circuitits own threshold, with a delay in microseconds
temperaturefour thresholds: too hot and too cold, separately for charging and for discharging
state of chargecounts the amp-hours in and out; you need to enter the battery capacity for this
counterscycles, and how many times each protection has tripped
balancingpassive: bleeds the highest cell through a resistor at a low current
communicationUART (and Bluetooth on versions with the module): all readings and settings, switching the MOSFETs on and off

Each threshold has a "release" value at which the protection clears by itself. After overcharge the release is below the threshold, after over-discharge it is above. Otherwise the switch would keep turning on and off.

The thresholds we recommend for LiFePO4 8S

SettingWe recommendWhy
cell overcharge3.60 VLiFePO4 is charged to 3.55–3.65 V; above that it ages faster
release after overcharge3.45 V0.1–0.2 V below the threshold
hard overcharge threshold3.70 Va second safeguard, a little above the main one, no higher than 3.75 V
cell over-discharge2.80 Vbelow 2.8 V there is almost no capacity left, and below 2.7 V it is a deep discharge
release after over-discharge3.10 V0.2–0.35 V above the threshold
hard over-discharge threshold2.50 Va second safeguard, no lower than the datasheet limit
battery: overcharge / over-discharge28.8 / 22.4 V8 × the cell thresholds
charging: too hot / too cold45 / 2 °Ccharging below 0 °C plates lithium and ruins the cell for good; 2 °C allows for sensor error
discharging: too hot / too cold60 / −20 °CLiFePO4 delivers current down to −20 °C; above 60 °C is dangerous for the cells and the board
charge and discharge currentthe board rating50 A for ours; more only after checking how hot the board gets under current
battery capacity280 Ahthe state of charge is counted from it

Passive and active balancing

Passive balancing in the BMS simply burns off the excess of the highest cell in a resistor, at a low current. It keeps a battery that was balanced before assembly in balance, but it cannot close a gap of a few amp-hours.

So we have a separate active balancer board: it moves charge from the higher cell to the lower one at a few amps and keeps the cells within a few millivolts of each other. We turned off the BMS's own balancing so the two systems do not work against each other.

The active balancer's wires go to the same points between the cells as the BMS sense wires, and also under the terminal bolt.

Current: the board rating and what the UPSes need

The board is rated at 50 A. At full power the SUA1000I draws up to ~38 A from the battery and the SUA1500I up to ~55 A, so the SUA1500I alone would exceed the rating at full load, let alone both together. Our load is lower [TO ADD: the actual discharge current of both UPSes]. The BMS discharge current threshold must be above the real current, or the BMS will shut the UPS down under load. The charge current is the sum of the charger and the UPSes, which also top the battery up; that sum must be below the BMS charge threshold.

The board can only be pushed above its rating after checking how hot it gets under current: in steps, watching the board sensor. We have not done this test yet.

Shunts: how much current they can carry

A shunt is a resistor of very low resistance that the battery's whole current flows through. The BMS measures the voltage across it (in millivolts) and works out the current from it. To keep the shunt cooler, boards use several identical resistors in parallel. Ours has five, marked 0m50.

Reading shunt markings:

MarkingResistanceHow to read it
0m50, m500.50 mΩ"m" stands where the decimal point goes, units are milliohms
1m00, 1m01.00 mΩthe same
R0011 mΩ"R" stands where the decimal point goes, units are ohms: 0.001 Ω
R00050.5 mΩ0.0005 Ω
R0022 mΩ0.002 Ω

How to work it out. Five 0.50 mΩ shunts in parallel make 0.50 ÷ 5 = 0.10 mΩ in total, and each carries a fifth of the current. How much one shunt can take is set by its rated power P, which depends on the package. The current of one shunt is I = √(P ÷ R). For continuous use we apply two corrections:

  • 60 % of the rated power. The rating is given for +70 °C, and the shunts sit next to hot MOSFETs. Above +70 °C the allowed power is reduced.
  • 15 % imbalance. The traces to the resistors differ slightly, so the most loaded shunt carries 15 % more than the average.
Rated power of one shunt, WTypical packageLimit of one shunt per datasheet, AAll five per datasheet, AAll five continuously (60 % of power, 15 % imbalance), ≈ A
1SMD 2512, standard45224150
2SMD 2512, metal (alloy)63316210
3SMD 2512 / 2725, metal77387260
5SMD 3920 / metal strip100500340

How much heat the shunts give off (heat = current² × 0.10 mΩ; the hottest one with the imbalance correction) and the voltage drop they cause:

Battery current, AHeat in all five shunts, WHeat in the hottest shunt, WVoltage drop across the shunts, mV
500.250.075
800.640.178
10010.2610
1502.250.615
20041.0620

The verdict for our board. The shunts are not the weak point: even five ordinary 1 W shunts carry ≈ 150 A continuously. The limit is set by the MOSFETs, 6 + 6, for which a sensible limit is ~80–100 A. For comparison, at 100 A the shunts together give off 1 W and the twelve MOSFETs ≈ 16 W.

[TO ADD: size and look of our shunts — 2512 or larger, metal or standard; photo]

⚠ The shunt resistance is also stored in the BMS settings (register 2C, "shunt resistance"). The board works out the current from exactly this number. If you add or replace shunts, the current readings will be wrong. Then the current is calibrated again: a load with a known current, a clamp meter on the cable, and the BMS sets the new resistance itself. Do not tweak the number in register 2C by hand.

Shunt calculator. Enter the marking (0m50, R001) or the resistance in milliohms, the number of shunts, the rated power of one shunt and the battery current. The calculator shows the continuous current limit, the heat and the voltage drop. If you enter the continuous current you need, it shows what power each shunt must be rated for.

The calculator runs in the browser and needs JavaScript; the same numbers are in the tables above.

Order for connecting the BMS

  1. Check the sense connector before plugging it into the board. Multimeter: black probe on the first wire (battery negative), red probe on each following wire in turn. The voltage should rise in even steps of ~3.3 V: 3.3 → 6.6 → 9.9 … → ~26.4 V. A missing step or a drop means wires are swapped.
  2. Connect the board's B− to the battery negative.
  3. Plug the sense connector into the board. Check the exact order of steps 2 and 3 in your board's manual: it differs between manufacturers.
  4. Connect P− to the load and the charger. Never connect B− and P− directly: all the current would then bypass the protection.
  5. Check the readings: all eight cells, the total equal to the voltage across the battery terminals, sensible temperatures.

Disconnect in reverse order: the load first, then the sense connector, and B− last.

Temperature sensors: where to put them

Our board reports three temperatures: two external sensors (10 kΩ NTC on wires) and the board's own sensor next to the MOSFETs. [TO ADD: which of the three readings is the board; it is easy to spot: under heavy current it rises while the other two hardly move.] The BMS settings let you choose which sensors are enabled. A disabled sensor is not shown and plays no part in the protection.

🔑 The key point: the board has no separate thresholds per sensor. All enabled sensors work with the same too-hot and too-cold thresholds for charging and for discharging. So the "45 °C while charging" threshold applies to the board sensor too. At our currents (tens of amps) the board barely warms up, so this does not matter. But if you raise the current to 80–100 A, the board may reach 45 °C and stop charging while the cells are cold. The external sensors do not go on the board or its heatsink: it already has its own.

If the battery is always kept warm

When the battery only ever sees temperatures above freezing, there is no cold to worry about, and both external sensors watch for heat:

SensorWhereWhat it catches
external 1on the side (narrow) face of a middle cell, the fourth or fifth, at half height (in two rows, an inner one)the hottest spot: the middle of the row cools worst
external 2on the battery's "+" output terminal, where the heavy cable is attached, or on the busbar next to ita bad contact: a loose bolt heats up before anything else
board sensoralready on the board, next to the MOSFETsheating of the BMS itself

Putting the terminal sensor under the 45 °C threshold is deliberate: if a contact has reached 45 °C something is wrong with it, and charging is better stopped until the bolt is checked.

Leave the cold-charging protection (2 °C) enabled anyway. It costs nothing, and a "warm" room turns cold if the heating goes off for a long time in winter.

If the battery may see frost

Then move external sensor 2 from the terminal to the cold side: onto the side face of an end cell, near the bottom or on the side where cold air comes from. That is the sensor that will block charging in frost. Sensor 1 stays on the middle cell. Check the terminal that no longer has a sensor by hand or with a thermal camera after an hour at high current.

⚠ The sensor on the "+" terminal must have intact insulation and must not go under the bolt: the terminal is 25–29 V above the BMS negative. How to fix it is in the section on the terminal sensor.

How to mount them:

  • the sensor head must sit tight against the metal or the case: a thin layer of thermal paste, with Kapton or aluminium tape over it;
  • put a piece of foam or other insulation on top, so the sensor measures the cell, not the air;
  • route the sensor wires away from the busbars and fasten them so they cannot chafe;
  • do not squeeze a sensor between cells: it will either push through the insulation or end up in a gap and read poorly. In a compressed battery the wide faces are covered, so the sensors go on the exposed side faces;
  • keep the top of the cell between the terminals clear: that is where the safety vent is, and it must not be covered.

Check. At rest, after a few hours with no current, all three readings should agree within 1–2 °C. If one reads very differently, that sensor is poorly attached or faulty. We monitor the sensors all the time: if a sensor disappears or shows an impossible temperature, we get a notification.

[TO ADD: where our external sensors are; photos]

Checking the assembled battery

CheckHowGood
cell spread at restBMS readings after a few hours with no currentup to ~10 mV on the plateau; a few mV with an active balancer
total of the cellscompare with a multimeter across the battery terminalsdiffers by no more than 0.1–0.2 V
currenta load of known power, a clamp meter on the cablethe BMS shows the same within 1–2 %
contact heatingafter an hour at high current, feel the terminals and busbars (or check them with a thermal camera)barely warm, all the same
first full chargewatch the cells at the topthey reach the top together, with no cell running ahead
state of chargeafter the first full charge the BMS sets 100 %it then counts on its own; do a full charge every few months

We do a full discharge to measure the real capacity rarely, and with the UPSes: that is covered in the article on the APC Smart-UPS with LiFePO4.

The spread grows under current: check the bolts

A voltage difference between cells comes in two kinds, with different causes:

How the difference behavesCauseWhat to do
small at rest, grows noticeably as soon as charge or discharge current flows, gone a minute after the current stopsa bad contact: a loose bolt, an oxidised terminal, a sense wire not under the boltcheck and tighten the contacts (below)
grows slowly, stays at rest too, largest at the end of a charge or dischargethe cells are at different states of charge or have different capacitiesbalancing; check whether it is always the same cell

Why a contact affects the readings: the BMS measures a cell's voltage together with the voltage drop across the joint next to it. Under current a bad contact adds tens of millivolts to the reading, and the cell next to it looks higher or lower than it really is. The BMS may then stop charging or discharging too early, and the balancer may move charge where it is not needed.

How to find a bad contact:

  1. Compare the BMS readings at rest and under a steady high current. The cell whose reading jumps the most points to the place: look around its terminals.
  2. At the same current, measure the voltage drop across each joint with a multimeter: one probe on the body of the cell terminal, the other on the busbar or the lug on it. Good joints all show roughly the same few millivolts; a bad one shows several times more than its neighbours. Work carefully: the probe must not touch the next terminal.
  3. After an hour under current, feel the terminals or look at them with a thermal camera: a bad contact is warmer than the others.
  4. Once found, switch off the load and the charger, undo the bolt, clean the terminal and the lug, reassemble them in the right order and tighten with a torque wrench to the datasheet torque. Do not tighten harder "just in case": the thread in an aluminium terminal strips.
  5. Check that the BMS and balancer sense wires sit under the terminal bolt, not in the middle of a busbar, and that their lugs are secure.

⚠ A bad contact does more than spoil the readings. Under current it heats up, the heat loosens it further, and that is how terminals melt and busbars burn. So if the spread grows under current, check the bolts the same day.

Controlling the BMS: command line, Python, microcontroller

A JBD board is not read-only: from a computer or a microcontroller you can change its settings and switch the charge and discharge MOSFETs on and off. Below: how it communicates, ready-made command frames, programs and libraries.

⚠ Turning off the discharge MOSFETs cuts power to everything the battery feeds, in our case both UPSes and the servers behind them. Try write commands on a battery with no load first.

Connection

ItemHow
interfaceUART, 9600 baud, 8N1; the same four-pin connector the Bluetooth module plugs into
levelsTTL logic, not RS-232 or RS-485; measure the voltage on the board's TX pin before connecting (3.3 or 5 V)
to a computera USB → TTL UART adapter (CP2102, CH340, FT232RL): board TX → adapter RX, RX → TX, ground → ground; do not connect power
to a controllerESP32 (3.3 V) directly if the board is also 3.3 V; if the board and controller levels differ, through a level shifter
Bluetooththe module plugs into the same connector: for a wired link you remove it or use a splitter; if both are connected, disconnect the phone while you write to the board

⚠ On most boards the UART ground is tied to the cells' negative (B−). If the controller or computer shares a ground with the load or with another battery, then when the BMS switches its MOSFETs off, current may flow through the thin UART wire and burn out the adapter or the board. One BMS, one controller. Where grounds might meet, use galvanic isolation: an isolated USB → UART adapter or a digital isolator.

How a command is built

Every command is a frame of bytes:

DD  A5|5A  command  length  data…  checksum (2 bytes)  77
  • A5 reads, 5A writes;
  • checksum = 0x10000 − (command + length + all data bytes), high byte first;
  • reply: DD command status length data… checksum 77; status 0 means OK, and the reply checksum is calculated starting from the status byte.

Ready-made frames, checksums already worked out:

ActionFrame
basic data: voltage, current, charge, MOSFETs, temperaturesDD A5 03 00 FF FD 77
cell voltagesDD A5 04 00 FF FC 77
board nameDD A5 05 00 FF FB 77
charge and discharge onDD 5A E1 02 00 00 FF 1D 77
charge offDD 5A E1 02 00 01 FF 1C 77
discharge offDD 5A E1 02 00 02 FF 1B 77
charge and discharge offDD 5A E1 02 00 03 FF 1A 77
enter service modeDD 5A 00 02 56 78 FF 30 77
exit and save changesDD 5A 01 02 28 28 FF AD 77
exit without savingDD 5A 01 02 00 00 FF FD 77

In command E1 a set bit means "off": bit 0 is charge, bit 1 is discharge. In the reply to 03 it is the other way round: 1 means "on". Send only these two bits and leave the rest at zero.

What the replies to 03 and 04 contain

All numbers are high byte first.

BytesMeaningUnits
0–1battery voltage10 mV
2–3current, signed: negative is discharge10 mA
4–5remaining capacity10 mAh
6–7full capacity10 mAh
8–9cycle count—
10–11manufacturing dateyear − 2000 (7 bits), month (4), day (5)
12–15balancing: 12–13 are cells 1–16, 14–15 are 17–32; each bit is one cell—
16–17protection flags (table below)—
18firmware version0x97 is version 9.7
19state of charge%
20MOSFETs: bit 0 charge, bit 1 discharge1 is on
21number of cells—
22number of temperatures N—
23…N temperatures, 2 bytes each0.1 K: (value − 2731) ÷ 10 = °C

The reply to 04 is 2 bytes per cell, in millivolts.

BitWhat trippedBitWhat tripped
0cell overvoltage7too cold while discharging
1cell undervoltage8charge overcurrent
2battery overvoltage9discharge overcurrent
3battery undervoltage10short circuit
4too hot while charging11measurement chip fault
5too cold while charging12MOSFET turned off by command
6too hot while discharging

Settings in EEPROM

Thresholds, delays and capacity live in the board's EEPROM. You can only read and write them in service mode:

  1. If a Bluetooth password is set, send it first by writing register 06. On ours, after a password was set, reading over UART still worked but writing did not.
  2. Enter service mode: DD 5A 00 02 56 78 FF 30 77.
  3. Read a register with an A5 frame carrying the register number and zero length; write it with a 5A frame carrying two bytes of value.
  4. After writing, read the register back and compare.
  5. Exit with saving (28 28) only if everything matches. Otherwise exit without saving (00 00), and the board keeps its old values.

Example: the cell overvoltage threshold, register 24, in millivolts. Read: DD A5 24 00 FF DC 77. Write 3.60 V = 3600 mV = 0E 10: DD 5A 24 02 0E 10 FF BC 77.

RegisterMeaningUnits
10 / 11design capacity / cycle capacity10 mAh
12, 32–35, 13cell voltage for 100, 80, 60, 40, 20 and 0 %mV
18–1Ftemperature thresholds and releases: charge and discharge, hot and cold0.1 K
20–23battery: overvoltage, release, undervoltage, release10 mV
24–27cell: overvoltage, release, undervoltage, releasemV
28 / 29charge / discharge current10 mA
2A / 2Bbalancing: start voltage / start differencemV
2Dfunctions: switch, balancing, LEDsbits
2Ewhich temperature sensors are enabledbits NTC1…NTC8
36 / 37hard cell thresholdsmV
3A–3Fprotection delayss

⚠ Leave the number of cells (register 2F) and the shunt resistance (2C) alone: a mistake in either breaks the measurements.

Command line: jbdtool

The open-source Linux program jbdtool works over a serial port, Bluetooth, CAN or the network (through an ESP adapter):

jbdtool -t serial:/dev/ttyUSB0,9600            # basic data and cells
jbdtool -t serial:/dev/ttyUSB0,9600 -j         # the same as JSON
jbdtool -t serial:/dev/ttyUSB0,9600 -r -a      # all EEPROM settings
jbdtool -l                                     # parameter names
jbdtool -t serial:/dev/ttyUSB0,9600 -r BalanceStartVoltage BalanceWindow
jbdtool -t serial:/dev/ttyUSB0,9600 -w NtcConfig NTC1,NTC2
jbdtool -t serial:/dev/ttyUSB0,9600 -g off     # charge off (on to turn it back on)
jbdtool -t serial:/dev/ttyUSB0,9600 -G off     # discharge off: cuts power to the load!

⚠ -w rewrites a bit field completely: any name not in the list is turned off. -w NtcConfig NTC1,NTC2 disables every other sensor.

A GUI program: bms-tools

bms-tools is an open-source Python program for Windows and Linux. It does what the vendor's app does: readings, all EEPROM settings, calibration, MOSFET control and logging. Inside is a separate library you can use in your own scripts.

Your own Python script

For simple jobs you do not need a library: the frame is short. The script below reads the basic data and the cells (needs pip install pyserial):

import struct
import serial

def frame(cmd, data=b'', write=False):
    # DD, A5 (read) or 5A (write), command, length, data, checksum, 77
    body = bytes([cmd, len(data)]) + data
    crc = (0x10000 - sum(body)) & 0xFFFF
    return bytes([0xDD, 0x5A if write else 0xA5]) + body + crc.to_bytes(2, 'big') + b'\x77'

def ask(port, cmd, data=b'', write=False):
    port.reset_input_buffer()
    port.write(frame(cmd, data, write))
    head = port.read(4)  # DD, command, status, length
    if len(head) < 4 or head[0] != 0xDD:
        raise IOError('no reply from the BMS')
    if head[2] != 0:
        raise IOError('BMS returned error %#04x' % head[2])
    body = port.read(head[3])
    tail = port.read(3)  # checksum (2 bytes) and 77
    if len(body) != head[3] or len(tail) != 3 or tail[2] != 0x77:
        raise IOError('incomplete reply')
    if (0x10000 - sum(head[2:4] + body)) & 0xFFFF != int.from_bytes(tail[:2], 'big'):
        raise IOError('checksum mismatch')
    return body

with serial.Serial('/dev/ttyUSB0', 9600, timeout=1) as p:
    d = ask(p, 0x03)
    volt, cur, remain = struct.unpack('>HhH', d[0:6])
    print('battery %.2f V, current %.2f A, remaining %.2f Ah, charge %d %%' % (volt / 100, cur / 100, remain / 100, d[19]))
    print('charge', 'on' if d[20] & 1 else 'off', '· discharge', 'on' if d[20] & 2 else 'off')
    print('temperatures, °C:', [(int.from_bytes(d[23 + 2 * i:25 + 2 * i], 'big') - 2731) / 10 for i in range(d[22])])
    c = ask(p, 0x04)
    print('cells, V:', [int.from_bytes(c[i:i + 2], 'big') / 1000 for i in range(0, len(c), 2)])

To turn charging off with the same script: ask(p, 0xE1, b'\x00\x01', write=True); to turn it back on, b'\x00\x00'. On Windows use COM3 instead of /dev/ttyUSB0 (the number is shown in Device Manager).

Microcontroller

WhatFor
esphome-jbd-bmsESP32 or ESP8266 over UART, ESP32 also over Bluetooth; all readings in Home Assistant, MOSFET on/off
Overkill-Solar-BMS_2-Arduino-LibraryArduino: readings and a MOSFET control function; one user reports that MOSFET control did not work for them, so test it
GenericBMSArduinoArduino, read-only
your own codethe same frames as in the table above: 7 bytes to read, 9 to write

The easiest route is an ESP32 with ESPHome: UART at 9600 baud on any two free pins, and the battery appears in Home Assistant with charge and discharge switches. The project's author warns about the same thing we did above: one controller per BMS, with no shared ground between batteries.

Article changelog

  • 2026-11-10 — service life: whether compression and a partial charge range extend it; what happens to a battery that just sits (tables and a chart); voltages of common pack sizes. Earlier the same day: the cable tables split into narrower ones; compression: the second purpose, tubing on the rods, springs or rods.
  • 2026-11-09 — "The essentials" section: what connects where, 15 questions with consequences, safety; a fuse that blows before the cable; cell spread under current and checking the bolts.
  • 2026-11-09 — BMS control (protocol, jbdtool, bms-tools, Python, ESP32 and Arduino); temperature sensors: two external plus the board sensor, separately for a heated room and for frost.
  • 2026-11-09 — first draft: assembly, BMS, temperature sensors, compression. Photos and our specific choices will be added after discussion.