Go Down

Topic: my first big project - BMS - is it possible? (Read 28533 times) previous topic - next topic


Hi all,

You can scroll to the Essence if you want.

Short "me" story:
I'm a newly registered member, in a "trying to figure out arduino" status, being baffled about the possibilities.
My business is computers and Arduino seems a good way to break out of "the box".
I learned about "some" basics in electronics (I understand things like voltage, current, resistors, diodes, transistors, but that's about it) 
and about Java programming (a long time ago, so the Arduino environment looks *just* a bit familiar).
I essentially discovered and received an Arduino board a few weeks ago, and took some time to read the basics on the Arduino website (and successfully practiced some examples mostly by copying and adapting existing code).
I still have to discover a lot of the possibilities.

I also happen to posess an EV (a 2008 150V Nimh Vectrix (http://www.vectrix.com/products/vx-1, but older model); now with about 12000kms on it.) . This fact triggered my curiosity about battery technology, so I started to get into the matter (ie a lot of forum reading).
It seems my beloved vehicle has no battery management system, and one battery pack after another gets destroyed by unbalanced cells (mine survives still, but certainly won't last forever either).
The separate cells with a lower SOC (state of charge) tend to get "reversed charged" and die when the pack is drained beyond a certain point.
(there are other issues like temperature and systematic overcharging, but that aside)
The only system used for balancing is so called top-balancing, where systematic overcharging the whole pack should pull up the lower SOC cells.


Picture an Electric Vehicle with 102 Nimh cells @ 1,4V (when fully charged) and no "battery management system (BMS)"
I want to avoid that the cells get out of balance with each other.
My first thought was to connect all separate cells to an Arduino (with som I/O extenders?), measure the voltages, compare them and act upon differences. (ie. warn me or something)

I'm afraid that Arduino has a too limited number of Analog inputs to realise that.
So maybe I'll just have to compare groups of cells instead. (accuracy will go down)

I know this is vague, but I prefer to check the main story first. then go on with some details.
I also realize that this may be to big for me as a beginner, but I'm not scared to learn, and I'm not in a hurry.

Am I in any good direction?? Can such a thing be done, and how?

Any help or better ideas are welcome.




I'm no expert, but as faar as I know, theres ways of getting more digital and analog inputs, by buying certain chips. I've not gotten to the input part yet, but I will.
Right now I'm working on using several outputs. I figured out how to link shift registers and thereby use 3 digital ports to run 320+ outputs on 3 digital ports.

Your idea should be possible. Though I'm wondering what kind of output system you're thinking of having?
I recommend either LCD, or 7 segment displays.

I haven't gotten into LCD's yet, and i believe they're harder to set up and program.
7 segment, 4 digit displays are easier to manage then I thought. Just don't get stuck in the thought that
"I don't get the different digits to show different values".

If you just want a graph output, there's the led bars. Though, you'd probably need lots of outputs for these as well.


I already managed to control such a display. I pulled it from an old decoder, and got it to work with multiplexing. ( again by adapting existing code)
So yes I was planning to use it to show me what cell is failing and Soc data


There are special chips, design to do such things, like monitoring individual cell in the battery string, equalization, balancing. Arduino could be in this case a log/monitor Manager . :)
I'm not an expert in this area, but you can dig in web-sites maxim and I think, TI. Look through their application notes, sometimes it's really helpful for quick-learning.


There's no practical limit to the number of analogue inputs you can have if you add some external hardware.

However I assume these cells are wired in series? If so you have problems with measuring very high voltages and that probably means isolating the inputs which starts to get complicated.

Rob Gray aka the GRAYnomad www.robgray.com


Or set the arduino up as a floating  meter and measure across each individually.
We  had a huge thread going on this in the old forum.
My suggestion was  a series of relays for 100% isolation, arduino ground becomes - of battery being measured, Analog-in connects to battery+ (which is battery- of next in line, but so what?) Work it just like a multimeter with a relay multiplexer in front of it.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Yep I remember that thread, what a marathon.

I think the relay idea works as long as the Arduino is floating and not sitting on the battery bank GND. This probably means an isolated PSU for the Arduino.

Can turok afford 104 relays :)

Rob Gray aka the GRAYnomad www.robgray.com


Sure, he's been saving on gas money for 3+ years, driving around on inexpensive electricity  :D, or something like that 8)


I don't know what this page says, I think  selected Nederlands for language.
Can search for similar - 5V, 250ohm coil (20mA to turn on), 30V, 1A.
Maybe look around for similar spec part but at lower cost.
Need a relay per battery.
NO side of relay connects to battery. Call that pins 4  to B+s & 7 to B-s.

Then all pin 3s get connected together and go to Analog in.
All pin 8s get connected together and to arduino Gnd.

Then the multplex circuitry turns on 1 relay at a time, connecting B+ and B- to Analog In & Gnd.
Make the measurement, turn off the relay, on to the next device.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Jul 23, 2011, 04:29 am Last Edit: Jul 23, 2011, 04:30 am by Graynomad Reason: 1
I think it would be very important to use proper hardware decoder chips (74xx138/74xx154 style) so there is absolutely no chance that two relays can be turned on at the same time.

This would need 8 154s enabled by a single 138.

Rob Gray aka the GRAYnomad www.robgray.com


Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


ok! thanks for all the replies, greatly appreciated!

I don't fully understand everything, but it seems like you all agree that a method of multiplexing is the best solution.
seems like a good idea to me.
Let's see if I understand this:

Instead of reading all cells at the same time, I would connect every cell briefly to the Arduino by switching 102 relays with a separate IC?

something like this?

@ Greynomad, I don't mind buying a lot of relays (they're cheap enough), but I don't have a LOT of space in the Vectrix. Worries for later though..
@ CrossRoads, indeed :-)
@ Magician, I know there are ready-available BMS systems, but this one, I'd like to learn and understand instead..


If I've got this correctly you will have to switch both the analogue input and the GND. Note how your drawing has GND going to one battery, what happens for the others? So you need double-pole relays.

Also the Arduino has to be powered from a power supply that is isolated from these batteries.

Another thing to think of is when do you read these voltages. If you are going to compare readings against each other or indeed any other data you have to have a known and constant load. Meaning that I think you can't really take a reading while driving as the load will vary a lot I would think.

Rob Gray aka the GRAYnomad www.robgray.com



Good point

If the cells are being read out in a short amount of time (a few milliseconds) there shouldn't be a problem I guess.
If the BMS gives me a warning while I'm accelerating or braking (regenerating) I could guess there might be another reason than actual imbalance.
I guess It would be quite reliable when cruising at a more or less fixed speed (even at top speed = limited to 110kph).
I can also choose/adapt the tolerance for the difference between voltages.
I could also program the arduino to give a secondary alarm if the voltage of one cell drops below a safe point.

An external power supply shouldn't be a problem (I also have a 12V circuit in the Vectrix).
I'd make the circuit so I can put it on when I want (not all the time)


This is the system I was discussing.
The MAX6921 might be used, or the other demux chips discussed above.
Note how each battery is connected to nothing until a relay is closed.
A change is needed in the the Gnd for the battery WOULD NOT the GND for the Arduino, demux, & relay coils.
The two would be isolated so that the measuring electronics only connect to the battery under measurement +/- terminals.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


I'm reluctant to be negative towards the relay idea because I don't have a better one to replace it, but how much room is 102 relays going to take up? I mean if it was a car, then yeah just stick it in the boot, but it's a scooter, and there isn't much storage room on a bike...

Go Up