Low Cost BMS for Home Storage Batteries

non-EV Solar, Wind and other renewable power sources
non-EV batteries and other energy storage stuff
Forum rules
Important!
This forum is for discussion of Non-EV matters.
francisco.shi
Groupie
Posts: 235
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Low Cost BMS for Home Storage Batteries

Post by francisco.shi » Sat, 01 Dec 2018, 07:53

How big are the capacitors?
Do you have a circuit of how the capacitors are switched?

T1 Terry
Senior Member
Posts: 991
Joined: Thu, 30 Sep 2010, 20:11
Real Name: Terry Covill
Location: Mannum SA

Re: Low Cost BMS for Home Storage Batteries

Post by T1 Terry » Thu, 06 Dec 2018, 11:14

Sorry, been off the air for a while, daughter is in hospital in Canberra with back problems that required surgery.
The units we use are mass produced some where in China and are designed to balance 4 cell groups. We balance cell groups 1 & 2, 3 & 4, 5 & 6, 7 & 8.Seems to working ok, there is the possibility of the 2 series cell groups within each pair to get out of balance slightly with each other, but combined with the charge limit of 3.6v in any one cell group the drift apart is limited to a max of 3.4v low - 3.6v high in the pair and that has never shown up o the extend over a 12mth log of a 600Ah @ 24v off grid system we monitor closely as our test outfit out in the field while I get our system installed and running. I could drop the high charge cut off to 3.5v to bring the two even closer together, but a differential of 0.02v max at the top end of charge is really neither here nor there.

T1 Terry
Green but want to learn

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Sat, 26 Jan 2019, 12:28

T1 Terry wrote:
Fri, 30 Nov 2018, 14:30
200mA is ok for a small capacity cell but wouldn't do much for a 200Ah or 400Ah cell. This is the real difference in balancing house battery cells against EV battery cells, the house battery is big capacity but low voltage and top balanced rather than bottom balanced.
Thanks Terry, you've given me food for thought.
I was thinking of top balancing, like in the car. But bottom balancing might be more suited to this application. The car's cells are 130Ah by the way, and these home battery storage cells are 220Ah (some people have 460Ah).

In the summer top balancing would be fine. 6 hours out of the 11 hours of sunlight we get would fill my 22kWh battery (assuming a 4kW charger), and top balancing can progress for the remaining 5 hours.
In the winter it is a different story, as the battery might not be filled each day. Indeed there might be many days in a row where it is not filled. But it will be emptied every night, as we seldom use less than 22kWh on a wintery evening.
This does seem to suit bottom balancing. Discharge the pack into the load (i.e. the house) until one cell reaches (say) 2.9V, then isolate the pack from the inverter. Turn on the balancing resistors for every cell that has not reached 2.9V, then turn them off as they hit 2.9. With a balanced pack , all cells would reach 2.9V at some point, and then we'd be ready to charge again the next day. As Terry points out, there might not be much time to top balance, but there should be plenty of time to bottom balance. In the summer we might not balance very often, but we do occasionally use more than 22kWh after the sun goes down (if both cars need charging), so it would happen at least once every couple of weeks.

I'm assuming here that LiFePO4 cells are ok being used at their 'lower end'. In the scenario above each cell would go to 2.9V most nights, then get charged up during the day to a greater or lesser extent.

I think I'll start off with top balancing, because I'm familiar with it (and the code is written). But bottom balancing might be a good option to explore.

T1 Terry
Senior Member
Posts: 991
Joined: Thu, 30 Sep 2010, 20:11
Real Name: Terry Covill
Location: Mannum SA

Re: Low Cost BMS for Home Storage Batteries

Post by T1 Terry » Sun, 27 Jan 2019, 10:43

As far as pulling the batteries down to their lowest point, for extended battery life you are better off stopping at the 100% discharged point rather than the 2.9v in any cell point. The cell voltages certainly need to be monitored just in case the Victron BMV looses its way as far as the SOC, but discharging to 2.9v ever time .... your call but I certainly wouldn't advise it if you still want the 10yrs plus battery life.

T1 Terry
Green but want to learn

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Sun, 27 Jan 2019, 15:03

Good news!
10 people have decided to jump in on the order for these boards, meaning over 200 of the celltop module boards to manufacture. This has dropped the unit price dramatically. So dramatically that it has now become economical to get some of the components pre-assembled.
The new prices are:
Master Board only: $5
Master Board and all components: $25
Module Board only (some components already fitted): $5
Module Board and all components: $10

So a BMS for the typical AVASS battery might be:
2 x Masters = $50
20 x Modules = $200
(this includes some spares just in case)

What does this get you?
  • Module circuit boards are designed to fit the AVASS cells recently purchased by AEVA members. There were two types of cells sold, this suits both types.
  • Circuit boards and components delivered to my place in Northern Tasmania. Shipping costs to you are extra, but can be arranged.
  • Some components are not included - wire to go between the cells, connectors, a box, buttons, LED etc. These things will depend on your situation, so I've left them for you to purchase or make.
  • You need to assemble the boards yourself, or find someone to do it for you, or come to my place where we'll all be assembling them together.
  • The microcontrollers are delivered blank, so these boards will not work until programmed. You'll need a programming tool, or you'll need to come to my place once the boards are assembled (can't programme them until they are assembled in the board).
  • I have not tested this version of the boards. They are almost the same as the version I have working in the car though, so I'm pretty confident there won't be too many faults to fix.
  • The Master is configured with two digital inputs (buttons), and three digital outputs. This is in addition to the LCD display that lets you know voltages etc., and an RS232 output for logging and/or control of some devices. The digital outputs could be connected to relays, chargers, a fault light etc.
  • My code is available to use this system as a vehicle BMS.
  • The Master code will need to be altered if you are using this for a home storage battery (Module is the same). I have not done this yet. I'll write the code for my system, and make it available, but that might not be suitable for yours. I'm happy to tweak it for others - to a certain extent! My initial idea is that the basic code will balance the cells, turn off a relay at high voltage and turn off another relay at low voltage (cell or pack voltages). With a fault LED to gain attention if something has gone wrong.
I have not ordered these components yet, so there is still time to place your order. Go to: https://airtable.com/shrEdYHvjoLEaMpz6
If you've previously put in an order, and want to change it based on the pricing changes (e.g. add more boards), fill the form in again and put a comment that you'd like your previous entry deleted.

In the interests of transparency, I'd like to point out that the prices above are calculated to give me a little bit of money left over. Hopefully enough so that I don't have to change the price when the thing I've forgotten to price turns out to be pricey! But if nothing like that happens I'm pocketing it.

rhills
Site Admin
Posts: 390
Joined: Fri, 25 Jul 2008, 01:57
Real Name: Rob Hills
Location: Waikiki, WA

Re: Low Cost BMS for Home Storage Batteries

Post by rhills » Mon, 28 Jan 2019, 20:35

I guess the circuitry difference between top-balancing and bottom-balancing is too great to be able to include both and switch between the two?
Rob Hills
AEVA Webmaster
2014 Mitsubishi Outlander Aspire PHEV
Jul 2014 - Sep 2019
Total Petrol: 662.2L
ODO: 51803
Av Consumption: 1.25 L/100km

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Tue, 29 Jan 2019, 13:55

rhills wrote:
Mon, 28 Jan 2019, 20:35
I guess the circuitry difference between top-balancing and bottom-balancing is too great to be able to include both and switch between the two?
No difference in hardware, the difference between top and bottom balancing is all in the software. Nevilleh's original BMS was setup for bottom balancing, but it isn't really suited to a car who's battery is rarely empty. So he changed it to top-balancing before I came along.

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Mon, 22 Apr 2019, 06:41

Ok, in writing the above posts I realised that I really should get some boards to test. They are not too expensive to get just a few made, so I ordered the minimum quantity (I went through Seeed (https://www.seeedstudio.com/fusion.html), which I have used before).
So here are the boards!
IMG_20190422_075743330.jpg
IMG_20190422_075743330.jpg (191.94 KiB) Viewed 1015 times
The master board is a bit sparse. This was in reaction to the previous incarnation, which was difficult to assemble and troubleshoot because it was too dense. I may have gone too far the other way, but it is still only 80mm square.

I assembled them both - took about an hour once I was set up. Surface mount components are fun! I did loose one though, Q1 on the module board is missing because it fell into the grass. I only had one of those, so that bit isn't tested yet...

First thing to test was programming. The module firmware will be exactly the same between the car BMS (currently running away in the Brumby) and the Home Storage BMS. So I was able to dig up the latest version, dust off the programmer and connect it up. The module board programmed first time! Happy days.

Then I was able to test the module by unplugging a module in the Brumby and plugging this one in in its place.
IMG_20190419_154005439.jpg
IMG_20190419_154005439.jpg (300.51 KiB) Viewed 1015 times
Worked first go!
I replaced module 5 (in the car), and the new module 5 was then giving a different voltage reading than the balanced cells in the car. I've quickly tested the communications, the voltage sense and the temperature (I put my finger on the sensor to warm it up). The only thing left to test was the balancing (shunting).

Unfortunately the component missing is the one that turns on the balancing resistors, so I can't tell the module to balance. I can make it do it manually though, with an alligator clip. So I did that, and found that the resistors got too hot for my comfort. Probably within the tolerances of the component, but hotter than I'd like. These things need to be able to balance every day year after year. So I did some experiments, and finally decided not to use the 3.9 Ohm resistors I'd previously selected, but to go back to the 10 Ohm value I use in the Brumby. I'll use 6 of them though, for a total power dissipation of about 1.7 W (0.5 A). The Brumby boards have 2 resistors, and dissipate about 0.6 W.
This was a good day's work!
Attachments
IMG_20190419_153938737_HDR.jpg
IMG_20190419_153938737_HDR.jpg (115.58 KiB) Viewed 1015 times

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Mon, 22 Apr 2019, 06:59

The Master board had a few bugs to iron out. I'm really glad I got some made to test.
At first it just would not program. Many wrong paths later, I figured out that I'd ordered the wrong chip! I'd ordered the PIC16LF1847, instead of the PIC16F1847. This may have been deliberate on my part (I can't remember, this was days ago), as the LF is a bit cheaper than the F, and it uses less power. What I didn't realise is that the LF version has a lower upper limit for voltage. So the LF version will not program (although it will run) on the board I made, which runs at 5V.
Once I finally figured this out, I was able to power the board with a benchtop power supply at 4.5V, and the chip programs fine.
There is a modification you can see in the picture for the assembled master board in the previous post. This is a decoupling capacitor, as I thought that might have been the problem. It did help somewhat, but wasn't the ultimate problem.

Once I was finally able to get the thing programmed, I discovered another problem. I got the pin allocation wrong for the MOSFETs that I'm using. They don't work around the wrong way.

So I've made the following changes to the Master board:
- Added a decoupling capacitor near the PIC.
- Corrected the MOSFET pins.
- Altered output 3 to use a MOSFET instead of driving a LED (it can still be used to drive a LED, but is more versatile this way).
- Swapped the pins on the D-In and D-Out connectors. These are to connect to the modules, and swapping them means I can use the same connecting cables that I use everywhere, instead of having to have different ones for the Master.

I've also improved various track placements along the way. This is always a temptation, but I hope I haven't introduced any more errors!

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Mon, 22 Apr 2019, 07:10

The outcome from all this testing is that I'm now ready to place orders for the boards.
So far I've received orders for an even 300 of the module boards, spread out over 13 customers. You can order complete boards (i.e. with components), or boards only, or a combination.
Still time to order if you'd like some, go to the online form here: https://airtable.com/shrEdYHvjoLEaMpz6
These boards will work for a car BMS or for a Home Storage BMS, but there is lots of work to do, as outlined in previous posts.

I'll be sending out bills to everyone who has ordered shortly. Once I have the money in I'll place the orders. There is no particular timeline on this, but perhaps within a week or two.

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Tue, 23 Apr 2019, 15:33

Ok, for those buying their own components, here are some screenshots of my spreadsheet:
Screenshot at 2019-04-23 17-26-37.png
Screenshot at 2019-04-23 17-26-37.png (101.17 KiB) Viewed 1000 times
Screenshot at 2019-04-23 17-30-16.png
Screenshot at 2019-04-23 17-30-16.png (55.82 KiB) Viewed 1000 times
Send me a message if you'd like the original sheet.

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Tue, 23 Apr 2019, 16:06

Something else that you'll need if you are going to build and program these yourself is a programming tool. I used the PICkit 3, which is available from Microchip (who make it), or I see that Element 14 also sell it for $69. The PICkit 4 is now available, but it looks like it doesn't have the very useful 'programmer to go' feature yet. This feature lets you program multiple boards very quickly. You load the program in, then press a button on the PICkit to program the board. Move to the next board, push the connector on and press the button again. You get a green light if the programming was successful or a red light if something went wrong. This feature was very very useful for programming the 48 cell module boards for the car, so I wouldn't buy the PICkit 4 at this stage myself. The website says that this functionality will be added via a firmware update at some stage in the future, but is not there yet.
If the programmer-to-go feature is not important to you, get the PICkit 4, as it is faster. But if you are going to program lots of boards in a row, get the PICkit 3.

Microchip: https://www.microchip.com/DevelopmentTo ... s/pg164130
Element 14: https://au.element14.com/microchip/pg16 ... dp/1771323

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Thu, 25 Apr 2019, 07:43

Ok, so now I need to develop a program for the Master to suit home storage. This is a bit different to a car BMS, as it needs to be able to be set-and-forget. A car BMS is able to rely on the driver for some functions.
Here is my logic table:
Screenshot at 2019-04-25 09-18-55.png
Screenshot at 2019-04-25 09-18-55.png (31.72 KiB) Viewed 981 times

Charging:
• Charger turns on, charges pack.
• When pack voltage reaches a defined point, the charger goes into low-current mode. Function of the charger, no input required from BMS.
• When a cell gets to a defined voltage, the module turns on balancing mode for that cell.
• When all cells are balancing, the master tells the charger to turn off.
• If a single cell exceeds a maximum voltage, the pack is disconnected. Could happen with a charger fault or with an unbalanced pack.
• If the charger does not turn off, and the voltage exceeds a setpoint, the pack will be disconnected.


Discharging:

• Inverter turns on, pack starts to discharge.
• When a cell gets to its low cell voltage, the inverter is told to turn off.
• If a cell gets to an extra low voltage (low low), the pack is disconnected and an alarm is sounded.


Most of this is the same for the car BMS, but there are a couple of changes.
The "disconnect pack" function is not used in the car BMS. This is intended to give a failsafe in case the inverter/charger goes haywire. For certain fault conditions the pack is disconnected via a contactor and requires someone to come and press a button to reset it.
The Low Low cell volts is also new. Required in case the inverter ignores our request to stop discharging.

The charger I'm talking about here is a lead-acid battery charger. It will be a 48V charger in the final installation, but I might charge up the pack with a lowish current 12V charger first as proof of concept. Good Lead-acid chargers taper off the current that they deliver at higher voltages, so that is where the cell balancing will occur.

francisco.shi
Groupie
Posts: 235
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Low Cost BMS for Home Storage Batteries

Post by francisco.shi » Thu, 25 Apr 2019, 17:40

Is there a reason why the BMS only balance as the cells after they get to full charge?
Is it possible to balance as the cells are charging?
If one cell is getting a higher voltage than the rest could it not be bypassed so all cells vet to full charge at the same time?

User avatar
coulomb
Site Admin
Posts: 3779
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

Re: Low Cost BMS for Home Storage Batteries

Post by coulomb » Fri, 26 Apr 2019, 08:04

francisco.shi wrote:
Thu, 25 Apr 2019, 17:40
Is it possible to balance as the cells are charging?
If you can predict the future, yes. It's easiest to base the balancing decision on instantaneous voltage when at the end of the charge cycle, when it's obvious which ones are too full. But if a BMS notes that a cell has far too much charge compared to the others, it could burn off charge continuously. It doesn't even have to be while charging.

The flat nature of the voltage versus SOC graph for LFP means you can't gauge the SOC from voltage except at very high or very low states of charge, which implies top or bottom balancing. There is a sort of a kink at around 75% SOC (from memory), so you might be able to start some rough bypassing at around 80% based on what order the cells got to the kink voltage.

LFP cells are a little strange though; which cell is the voltage leader can change several times throughout a charge. That could be as a result of bypassing, of course, but in general bypassing has to be a fairly gentle process (else you are burning off too much energy as heat, and cells hate heat), so I don't think that's all the reason for the "lead changes". Of course, you can be a lot more aggressive with charge shuttle schemes (capacitors or inductors), but I don't see them as being practical, especially in an EV-sized battery. They tend to have over a hundred cells in series.
Nissan Leaf 2012 with new battery May 2019.
5650 W solar, 2xPIP-4048MS inverters, 16 kWh battery.
1.4 kW solar with 1.2 kW Latronics inverter and FIT.
160 W solar, 2.5 kWh 24 V battery for lights.
Patching PIP-4048/5048 inverter-chargers.

francisco.shi
Groupie
Posts: 235
Joined: Mon, 17 Sep 2018, 16:30
Real Name: Francisco
Location: Brisbane, Strathpine

Re: Low Cost BMS for Home Storage Batteries

Post by francisco.shi » Fri, 26 Apr 2019, 08:44

Would it work on NCMs?

User avatar
coulomb
Site Admin
Posts: 3779
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

Re: Low Cost BMS for Home Storage Batteries

Post by coulomb » Fri, 26 Apr 2019, 13:43

francisco.shi wrote:
Fri, 26 Apr 2019, 08:44
Would it work on NCMs?
Yes, anything other than LFP (LiFePO₄), I believe. Only LFP has that really flat voltage curve.
Nissan Leaf 2012 with new battery May 2019.
5650 W solar, 2xPIP-4048MS inverters, 16 kWh battery.
1.4 kW solar with 1.2 kW Latronics inverter and FIT.
160 W solar, 2.5 kWh 24 V battery for lights.
Patching PIP-4048/5048 inverter-chargers.

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Sat, 27 Apr 2019, 06:25

francisco.shi wrote:
Thu, 25 Apr 2019, 17:40
Is it possible to balance as the cells are charging?
Yes, but fiddly and there isn't any need.
As Coulomb said, you can't figure out which cell needs balancing while charging, only when the charge is almost complete. But you could remember which one needed balancing last time, and use that info to balance during the charging cycle. I could imagine an algorithm that remembers which cell started balancing first, and then balance that one a bit early next time.
As Coulomb said though, this isn't limited to the charging phase - it can be done once the pack is full and the charger turned off. So if you had a particularly unbalanced pack, and the charger turned off because one cell reached a very high voltage when the others had not caught up, the Master could tell that cell to shunt current for X number of hours afterwards. This would get the pack balanced faster than the algorithm currently used.

In my experience, in practice, once balanced, the cells aren't very different from each other, and they only take a few minutes of balancing each charge.
francisco.shi wrote:
Thu, 25 Apr 2019, 17:40
If one cell is getting a higher voltage than the rest could it not be bypassed so all cells vet to full charge at the same time?
Bypassing while charging is easy enough to do manually as a one-off, but not automatically, and certainly not with this BMS. It requires you to physically disconnect the cell from the pack. This means disconnecting the heavy cabling that takes the main current to the car's drive system or the inverter in a home battery storage system. It is the type of thing you might do the first time you charge your pack, if one cell is particularly full. To do this automatically every time though would take large contactors on every cell.

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Sat, 27 Apr 2019, 06:39

francisco.shi wrote:
Fri, 26 Apr 2019, 08:44
Would it work on NCMs?
The BMS? Sure.
It would suit many types of cell, the only difference between chemistries (from a BMS point of view) is the cell voltage range. According to a quick Google search, NCM has a higher voltage than LFP, apparently up to 4.2V. This BMS uses a PIC12F1822 microcontroller on the cell module board, and it runs directly from the cell voltage. This is the only limit to what cells can be used. The microcontroller voltage range is 1.8 - 5.5V, so should suite NCM fine.

peter_mcc
Noobie
Posts: 5
Joined: Tue, 18 Sep 2018, 14:49

Re: Low Cost BMS for Home Storage Batteries

Post by peter_mcc » Sun, 05 May 2019, 18:46

I've just got some cells from the latest AEVA battery sale - is it too late to order?

Will it keep a 48V 460A pack balanced? There are prebuilt active balancers around - the Deligreen ones are about $US20/cell. There are some chipsets around as well but they are a lot more complicated than turning on a bleed resistor!

I'm also interested in adding a colour graphical LCD to it at some point - I'm an embedded s/w & h/w developer in my "day job" and have put them in a few other products. I wouldn't be able to get to it till late in the year but it looks like it all works with a text LCD so it's more of a nicety than anything else!

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Sun, 05 May 2019, 19:08

peter_mcc wrote:
Sun, 05 May 2019, 18:46
I've just got some cells from the latest AEVA battery sale - is it too late to order?
No, not quite. I've been busy with a show for the last few days so I haven't ordered the parts yet.
peter_mcc wrote:
Sun, 05 May 2019, 18:46
Will it keep a 48V 460A pack balanced?
I'm betting on it, but I can't guarantee it. A version with a lower shunt current keeps my 150V 130Ah pack balanced in my car, and in theory a car is a lot more challenging than an insulated battery box. If we did have trouble (i.e. not shunting enough current) then we could modify the board to shunt more current. You'd only need to modify the boards of troublesome cells.
peter_mcc wrote:
Sun, 05 May 2019, 18:46
I'm also interested in adding a colour graphical LCD to it at some point - I'm an embedded s/w & h/w developer in my "day job" and have put them in a few other products. I wouldn't be able to get to it till late in the year but it looks like it all works with a text LCD so it's more of a nicety than anything else!
Sounds like fun! The software uses about half the memory in the PIC so far, so there should be room to add some more pretties. At $11 the LCD is the most expensive component as it is...

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Fri, 10 May 2019, 16:45

Had a request to modify the module board. Here is the latest
Top layer:
CellTopBMS-Top.jpg
CellTopBMS-Top.jpg (66.58 KiB) Viewed 798 times
Bottom layer:
CellTopBMS_Bottom.jpg
CellTopBMS_Bottom.jpg (58.45 KiB) Viewed 798 times
I've added holes so that you can choose to add one or two through-hole balancing resistors.
Also a hole so you can tap into the -ve with a wire if you like. Looking at these, I've decided to move that hole up next to R6, since where it is shown here might get in the way of bolts or lugs.

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Sun, 12 May 2019, 05:08

Peter has raised a request and a concern on the cell-top moudule (in an email).
The request is that holes be added to allow for through-hole or externally mounted shunt resisttor(s) and driver if desired.
The concern is that the diode (DNBT8105) might not be passing the current that I think it is.

What I've learned here is that diodes are current-amplifying devices. I'm using the diode as a switch to turn on the shunt resistors - I don't really want it to amplify as such, I just want it to be fully on or fully off. Although it is rated at 1A from collector to emitter, it won't pass 1A unless I put enough current through the base-emitter. In the circuit above it has a 330R resistor between the microcontroller and the diode base. At about 3V, this limits the current to about 1mA. This transistor, when given 1mA, will pass about 100mA.
This was fine in the original circuit (Nevilleh's, plus the one I used in my car), and 100mA is plenty to balance the 130Ah cells in the car. But this version is designed so that you can put in more resistors, and thus shunt more current, if you like. I could just decrease R5 to increase the current, but the current required to turn on the transistor fully is getting close to the limit available from the microcontroller.
So after talking with Peter I've decided to swap out the transistor for a MOSFET. The one used on the master board should be fine (PMV30UN), or I have found a cheap source of an almost-identical part PMV40UN2. This will pass a current up to 3.7A. Should be plenty - I intend to use it to switch 0.5A.

To drive a MOSFET requires almost no current. It can be driven directly from the microcontroller output, so I don't need the resistor in the middle (R5). The pinout is the same as the transistor which is nice.
Do I need a pull-down resistor for this device? I think the only reason that I would do is in case the microcontroller output pin went tri-state for some reason. It should always be driven high or low, so a non-driven state would be a fault. All such faults will result in the master unit sounding an alarm. So I think I can get away without a pull-down. Always good to reduce the component count.
This sounds really good - why not use a MOSFET from the beginning? It's because they are more expensive than transistors. The price difference is about 20c vs 10c. But I've found a cheap source of the one MOSFET, so in this case this MOSFET will actually be cheaper than the transistor.

Another advantage of using a MOSFET is that we can control the current being shunted using pulse width modulation. The current version of the firmware just turns the shunt on or off, but could be modified to turn it on proportionally. I can think of two ways:
1. Alter the code in the module to turn on at a set rate, which can be determined and programmed by each owner.
2. Alter the code in the module and the master, so that the master can control how much each cell shunts. The command to turn on the shunt is currently an on/off command, but this could easily include an 8-step ratio from 0 (fully off) to 8 (fully on). The module would change the ratio depending on the command from the master.
I like option 2 the best, this would mean less wasted current, and the boards won't get hot unless they need to.
The output used to switch the MOSFET can be configured to PWM, so this shouldn't be too hard to implement.

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Sun, 12 May 2019, 05:40

So here are the current circuit diagrams and PCB layouts for the master:
BMSMaster Storage - Schematic.pdf
(58.48 KiB) Downloaded 17 times
BMSMaster Storage-Top1.jpg
BMSMaster Storage-Top1.jpg (77.7 KiB) Viewed 782 times
BMSMaster Storage-bottom1.jpg
BMSMaster Storage-bottom1.jpg (64.37 KiB) Viewed 782 times
Main differences between this one and the last version posted is that extra MOSFETs have been added so that we have the option of up to 5 user-configurable outputs.

Module:
CellTopBMS - Schematic.pdf
(43.23 KiB) Downloaded 14 times
CellTopBMS-Top1.jpg
CellTopBMS-Top1.jpg (74.98 KiB) Viewed 782 times
CellTopBMS-Bottom1.jpg
CellTopBMS-Bottom1.jpg (66.54 KiB) Viewed 782 times
1. Removed R5 to suit MOSFET (but now will not suit a transistor)
2. Added extra copper around the shunt resistors in an attempt to dissipate heat
3. Made the drill holes in that extra copper bigger
4. Put drill holes under the shunt resistors in an attempt to dissipate more heat
5. Added Q2, which can be used with a through-hole or external switching device if desired

User avatar
4Springs
Senior Member
Posts: 568
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Re: Low Cost BMS for Home Storage Batteries

Post by 4Springs » Sun, 12 May 2019, 06:14

Some questions for the learned folk here:
1. I've put holes under the shunt resistors in an attempt to help them dissipate heat. The idea is that air will hopefully circulate, but I have no idea if that will be the case. Any comments on this?
2. I have no pull-down resistor on the MOSFET gates. My rationale is that the microcontrollers will always be driving them high or low. Is this good practice or is there something I haven't thought of?
3. The capacitor C1 (in both circuits) is currently an aluminium electrolytic as per the datasheet here: https://docs-apac.rs-online.com/webdocs ... df09a1.pdf. I am finding this particular one hard to source. I'd like to replace it, but I'm not confident enough to pick a replacement. I assume that it is there to help smooth out noise on the supply rail. Will a ceramic or tantalum capacitor do here? Both are easier to source in the SMD package, and ceramics are cheap!

Post Reply