The Ill-Advised 1kWh LiFePO4 1U Rack Mount Battery 3S1P 105Ah

rsaeon

Patron
Actual capacity would probably be closer to 960Wh with these used 'C' grade cells but 1kWh sounds catchy. I'll be making a top-balancing BMS using Tasmota for this.

The entire premise of the project is ill-advised because we'd be dealing with large amounts of current since it's only a 3S pack and I'd like to build this to provide at least 500W for future expandability.

After a teardown that revealed 15 cells, and a purchase of 4 additional cells, I have 3 left over cells that'll be perfect to turn into a 3S pack that'll power simpler loads in my currently empty rack. Add in a charger and this becomes a DC UPS that'll keep my adblock running for weeks, ha.

My first flow chart in over three decades:

battery.jpg

Some of the things I've gathered so far:

photo_2024-07-02 16.21.52.jpeg

The cells will be encapsulated in 2mm G10 FR4 resin fiberglass sheets and 2mm stainless steel.

With a cell height of 36mm plus 2mm on each side for the fiberglass plus another 2mm for the stainless steel on both sides, the total height comes up to 44mm which is just shy of the 45-something-mm height of 1U.

The two SMPS will be connected in series, they're 5V 60A each — so that's going to limit maximum power draw by itself to 600W. I wouldn't be loading more than 500W on this anyway so that leaves 100W left over for charging the cells after a power outage. Realistically, I don't expect to have anything over 200W connected to this.

But first, I'm going to make a Micro-Ohm Meter to make sure I have good connections since this is dealing with higher currents than I'm used to — that'll be a separate thread, I just finished building a prototype.

Budget is, as usual, very restricted (about 1k per week) so this'll take a while.
 
Can you simply measure low resistance values just by hooking up a set of leads?
Looking at a bridge circuit itself gave me a headache so i just gave up ( i wanted to measure iem cable impedances)
 
Can you simply measure low resistance values just by hooking up a set of leads?
Looking at a bridge circuit itself gave me a headache so i just gave up ( i wanted to measure iem cable impedances)

I'm not sure how practical it would be to measure micro-ohms with wheatstone/resistance bridges, it kind of feels like ancient folklore when we have micro controllers and ADC's:

 
Last edited:
I'm not sure how practical it would be to measure micro-ohms with wheatstone/resistance bridges, it kind of feels like ancient folklore when we have micro controllers and ADC's:

You don’t need Arduinos for that.
Measuring just the voltage drop over a bridge is adequate and more for a fairly precise measurement. Have donethis quite a few times for random DIY projects and can confirm the accuracy of the method
 
Update time! I got three screens working!


So far I've got seven I2C devices connected to a single ESP8266, apart from the screen (three temperature sensors, four voltage sensors). From the video description:

This is a proof-of-concept of a very much ill-advised 1kWh 3S LiFePO4 1U rack-mount DC UPS.

Processing and logging is done server-side with self-hosted installs of MQTT, Node-RED & InfluxDB. All stats except uptime are randomly generated in this demonstration. Screen update is through MQTT every 10 seconds here, it would actually be 30 seconds in use.

An ESP8266 module is running a custom compiled version of Tasmota with UFS, uDisplay, ramfont, INA219 and MCP9808 support.

This module is connected to four INA219 modules, one for each LFP cell, one for the charger. Energy in and out of the cells is logged with a PZEM-017. Only one of the INA219 is used for current monitoring, that's the one connected to the charger with a 100A shunt.

Charger is two series connected 5V 350W meanwell units, with the trimpot of one replaced by several digital pots wired in parallel with each other. The digital pots are controlled with two GPIO pins for pseudo constant-current control.

There's also three MCP9808 temperature sensors to monitor the temperatures of the power resistors during balancing. The bright green leds flashing here indicate balancing is active for a particular cell, balancing is run for 5 seconds here, it would actually be 30 seconds in use. Balancing is immediately halted in this video if the temperatures rise over 75 celsius (tentative threshold).

Three displays are connected using a 3-to-8 analog multiplexer, the 74HC4051, which multiplexes the SCL line. Unlike LCD displays, there is no special initialization required for these OLEDs. Each display is selected by binary with prefixing Power1 X; Power2 X commands before DisplayText. Displays are selected at random here for demonstration purposes.

GPIOs:
0,16 — to the multiplexer
1,3 — RX/TX to the PZEM
4,5 — I2C for the displays & sensors
12,13,14 — to LR7843 mosfet modules for battery balancing
2,15 — to the digital pot

For larger battery packs, each ESP8226 will be monitoring and balancing 4 cells (with four temperature sensors, four voltage sensors and four mosfets connected to power resistors). Control is server-side but not server-reliant: Tasmota rules can be used for balancing when the server is unreachable.

This was inspired by ‪@StuartPittaway‬'s DIY BMS.

Now to take a break from this and go for a long walk.

You don’t need Arduinos for that.
Measuring just the voltage drop over a bridge is adequate and more for a fairly precise measurement. Have donethis quite a few times for random DIY projects and can confirm the accuracy of the method

I didn't think wheatstone bridges would've been practical for measuring micro-ohms — sounds like I would need a very precise multimeter? The ADC was just a few hundred, ha.
 
Last edited:
I designed a couple of panels and and got them laser cut in 3mm black acrylic to mount the various modules:

photo_2024-09-15 00.49.38.jpeg



I used 5mm brass spacers here with M3 x 5mm screws, 6mm spacers would've been better because I wouldn't have needed the nylon washers that you see:

photo_2024-09-15 00.49.40.jpeg

These DFRobot I2C hubs help keeps wiring tidy and allows for a point to point connection with every pin on all of the modules I'm using without having to solder wires and/or splices.



All put together, It feels satisfyingly dense and expensive. Probably because of the brass.

photo_2024-09-15 00.49.42.jpeg



The displays still work even after I dropped one and chipped the glass of another:

photo_2024-09-15 00.49.44.jpeg
 
This NH 00/000 fuse holder is intimidating, but necessary (70mm bus bar for scale):

photo_2024-09-20 14.22.52.jpeg




I'll be using this 80A fuse (it's rated for 250V DC):


photo_2024-09-20 14.22.53.jpeg

I don't plan on having loads more than 50A and the charger is rated for 60A so 80A sounds like it makes sense in case there's a short/fault somewhere.



I needed to figure out a way to flush-mount this fuse holder and the 125A 22mm MCB to the 45mm 1U front panel. This looks like a good idea:




So I designed a couple of panels to be laser cut from 1mm stainless steel:

photo_2024-09-20 14.22.54.jpeg

The cuts along the bend lines are to make bending easy, they're 3mm wide.



A vise made bending the flanges easier:

photo_2024-09-20 14.22.55.jpeg



This one is ready to be flush mounted:

photo_2024-09-20 14.22.57.jpeg

photo_2024-09-20 14.22.59.jpeg

This breaker can't do any breaking, it's just an isolator. So I'll be using it as a power switch to disconnect the cells if and when the fuse needs replacing, hopefully it won't ever.



This safety stuff is expensive, the fuse and holder were around 1k and these laser cut panels were about 600 together.

I'm re-using the isolator from the MuscleGrid battery, but they run for around Rs 700 each.

But I'm expecting a 10 year life out of this so it's probably worth it.
 
The part of this project I wasn't entirely sure about when I started, was the balancing.

Theoretically, the idea is simple — when a cell needs to be balanced because it's at a higher voltage than it should be, a load is connected across its terminals. This expends energy and drains the cell thereby bringing the voltage down.

It is wasteful (you're converting energy to heat) but effective and it's what makes sense as my first BMS solution.

These cells aren't the highest grade, and they were in terrible shape when I received them as part of the MuscleGrid battery (voltages/capacities all over the place).

So I decided on using 100W wire-wound resistors, 2 ohms, as the balance resistor. Stuart Pittaway calls this the 'dump load' in his older diyBMS schematics which I'm referencing.

At first, I thought I'd use a relay, but that might be very loud and wear out over time and all the other BMS uses a mosfet so a mosfet made more sense.

Except I've never used a mosfet before so I needed to learn a few things first.

I found that one of the commonly available mosfet modules, the LR7843, is sometimes referred to as a 'logic-level' mosfet so it'll run fine switching loads of around 3.3V and it has a low resistance so it wouldn't heat up as much.

Except it comes with an opto-isolator on board, which has a voltage divider with a pair of resistors on the switching side, which prevents it from working as a 3.3V logic-level mosfet (but not at 5V).

A bodge/short is necessary, bypassing the top half of the resistor divider:

photo_2024-10-12 00.59.06.jpeg

Since I didn't know much about mosfets, the clearances between the three pins concerned me. They're not spaced very far apart and these cells are capable of 525A discharge.

But when I started to think about it, if there's a short between the middle pin and the ground pin, then that just forces current through the resistor. The worst that would happen is the resistor would heat up, and there'll be a temperature sensor attached to it, so any short that would result in a thermal irregularity will sound an alarm/notification.

If the short is between the middle pin and positive, then that only bypasses the resistor so no harm is done there.

What would be dangerous is if all three pins would be shorted together, but at that point, the wires would overheat and melt way before any fire starts. Hopefully.

Anyway, these pins must be covered in some kind of insulation, maybe conformal coating. Later.

For now, here's a proof-of-concept of the balancing in action:

photo_2024-10-12 00.59.05.jpeg

1.66A running through the resistor when the cell is at 3.35V sounds about right for a 2-ohm resistor.
 
I found that one of the commonly available mosfet modules, the LR7843, is sometimes referred to as a 'logic-level' mosfet so it'll run fine switching loads of around 3.3V and it has a low resistance so it wouldn't heat up as much.
Afaik, logic-level refers to the gate voltage of the mosfet aka V_GS aka the middle pin being compatible with the 3.3/5V provided by an MCU's output. That is, a logic-level mosfet can be driven directly by an MCU without having to use a mosfet driver. You might find that non-logic level mosfets still have a V_GS(threshold) value around 5V in the datasheet but the crucial difference is that they will only open partially at that voltage, which means their R_DS(On) will be too high, and therefore you'll have higher losses. That's why you need to look at the R_DS(On) for a specific V_GS voltage. In the case of the LR7843, the R_DS(On) is specified as 3.2 milliohms for 4.5 V_GS, which is good.

It doesn't have anything to do with the loads connected through drain and source. That's given by the V_DS rating, the drain to source voltage.
 
Last edited:
Thanks, it took many, many attempts trying to figure things out.

The first confusion is why the ground connection is called source and the positive connection is called drain? Seemed opposite of the way things were and tripped me up constantly when I tried to read the datasheet. Like a Vgs of 2.5V meant that the gate had to be 2.5V lower than the supply voltage? No, it has to be 2.5V higher than ground. It finally clicked when I thought of electron flow, which is from negative to positive, so from source to drain. Then things started making sense. I'm hoping I won't forget this, ha.

The other confusion was that the mosfet in this module did not switch on when connected across the battery terminals, I thought that maybe 3.3V was not high enough. Then I thought it was the LED indicator, so I knocked that off. Then I noticed the resistor divider in the schematic which was essentially dropping the Vgs from 3.3V to half that, which barely allows the mosfet to "open up". This also explained why it worked with a 5V supply but not at 3.3V in my early testing.

Once I bypassed that top resistor, Vgs became the cell voltage (through the transistor in the optocoupler), which ended up working fine as seen above. Hopefully there's no longterm issues with Vgs being equal to Vds.

Overall, mosfets are still a little bit mysterious and strange but I'm really happy that balancing is work as it should. In a way, knowing that mosfet-controlled balancing was used by every other BMS gave me the reassurance that it'll work in the end and I just needed to figure out how.
 
Did a quick test of another part of this project, the 60A/600W charger.

It's comprised of two Meanwell LRS 5V 350W units connected in series. These LRS models have an adjustable trimpot to change the voltage slightly.



With both trimpots at one end, both power supplies output a combined 8.5V:

photo_2024-10-16 06.15.09.jpeg



With one of the trimpots turned all the other way, the combined output is 10V:

photo_2024-10-16 06.15.11.jpeg



Then with both trimpots turned so that both power supplies output the maximum voltage possible, it's 11.5V:

photo_2024-10-16 06.15.12.jpeg



The datasheet indicated an adjustable range of 1V per unit, but we're seeing 1.5V here, which is good.

To keep things simple, I'll only be making one adjustable, the other will be fixed. This is also because I've run out of GPIO pins on the ESP8266 and don't have any left to control a second pot. I could get around this by using a GPIO expander, but I'm not going to — sometimes you need to put hard limits on feature creep otherwise your project never gets finished.

So with a range of 1.5V, I'd like to target an upper cut-off of 10.5 which means a per-cell voltage of 3.5V, then starting voltage would be 9V.

The thing with these power supplies is that they have over current protection that cannot be disabled, so I'm hoping that fully discharged cells won't trigger it at 9V. If it does then I'll need to wire in that second digital pot and GPIO expander. This can only happen after the project is completed and this DC UPS is put into use though.



There's not going to be any over discharge protection in this DC UPS, but with a 200W load the power outage would need to last 5 hours to reach that. That has happened a few times in the past year, so it's not an impossibility. In such a situation, I'll need to rely on software to shutdown the systems connected and/or switch the AC side of this UPS to another UPS that has enough reserve power. It gets complicated, but this is one of three battery backup systems I have planned.
 
Back
Top