Hardware protection in battery cell measurement circuit

I found this thread, which suggests a clever flying capacitor method of measuring voltage of single cells in a series battery:

Unfortunately I can't reply, so I'm starting a new thread, here's the schematic from reply 5:

I have two questions:

  1. Is it possible to use a pair of P and N channel mosfets instead of a relay for each cell? Voltage drop is dependent on Rds and Ids. As the flying capacitor is charging up current will decrease, so will the capacitor eventually be at the same voltage as the source of the P-channel mosfet (cell positive)?

  2. Since only one relay/pair of transistors needs to be active at a time, in case of component/software malfunction or w/e I guess I can place a dozen of fuses between all cells such that if two or more happen to be active at once the fuse will pop and prevent damage. This is not the case with the right side of the flying capacitor though, since that must also wait for any relay/transistor pair to go down, putting a fuse there will probably do little to nothing preventing my microcontroller frying up. How can I make sure in hardware that such a condition will never occur (both SX and K1 active at the same time)? I was thinking something along the lines of having D14 going to an AND gate with an output from the SX lines via an optocoupler, but once the flying capacitor is charged then I can no longer tell whether any relay/transistor pair is active. Again, this is in the case of malfunction, otherwise yes it's quite obvious that if I'm not supplying a signal to SX then it should be off.

I would use an analog MUX or an IC for monitoring battery packs like the AD7284

1 Like

MOSFETs won't work. To switch off a MOSFET you need to bring the voltage to the drain level - so for your 7th cell that's something like +22V and +18V for the two MOSFETs. So that replaces one problem with another.

You could use a series of resistor voltage dividers, one for each cell, and connect Arduino ground to battery negative. One analog input per cell needed (or indeed an analog mux to bring down the pin count). A Nano has 8 analog inputs so 7 cells is fine.

If you're worried about the leakage current, add an n-channel MOSFET to each voltage divider between the lower resistor and ground. Those can be switched all by a single digital pin - switch all on, scan the array, switch all off. Takes a few ms or so.

That is an interesting proposition, but there's a kind of side-effect function that's quite useful and will be lost - auto balancing. When switching between cells the flying capacitor will help equalize voltage between cells. Eventually I will need to add a resistor to limit current, but that's irrelevant for the posed questions.

The transistors could be optically activated, i.e. optocouplers?

Yes, sure. Transferring a few millivolts worth of charge using a 100 uF capacitor between basic 2200 mAh 18650s. Or maybe your cells are even bigger.

So how many MF (yes, I intended to write M, not m) of charge would that battery be equivalent to?

I was planning on using a bunch of capacitors as.. a flying capacitor, exactly for that purpose, to increase the transfer of charge, or even use a super cap. I suppose however, that if I can increase the frequency of switching then it doesn't need to be very big, it will just keep iterating over and over through all the cells, and will eventually work? I'm not confident in any of this until I test it, but that was my idea, I would like to conserve the energy by transferring it between cells rather than discharging higher-voltage cells through a resistor.

You should be able to replace the S1 thru S7 and K1 components with opto FETs.

Two per channel.

Prices are high these days, $7.00 each, you would need 16 :scream:


If the clicking isn’t an issue, these inexpensive DPDT miniature 5v relays are great.

about $3.00 USD each.


$24.50 for 10 relays.

https://www.jameco.com/z/DS2Y-S-DC5V-Panasonic-DS2Y-Miniature-2C-Relay-2A-5V_842996.html

1 Like

Noise will definitely be an issue but I'm more concerned about wear on the contacts.

Typically those relays are given 10M cycles lifetime, if we take for example a 10 cell battery and we assume a sequential algorithm that just goes from one cell to the next, with a relatively long period of 250ms then to complete 10M cycles it will take 25M seconds which is about 300 days or the relays would be expected to fail in less than a year.

There surely must be cheaper optocouplers, somewhere in the depths of the internet, with not so clear origin. I'm definitely not a fan of the idea of paying 70$ for just some optocouplers when I can get a full BMS for that price, which will by the way most likely probably definitely be comprised of parts from the websites in question xD

[quote="arduino_nub_qq, post:6, topic:1194040, full:true"]it will just keep iterating over and over through all the cells, and will eventually work?
[/quote]

Well i theory if you do it a couple quadrillion times you may be getting somewhere... but in the meantime you're probably spending way more power clicking all those relays than those batteries hold to begin with.

Do some research on how off the shelf load balancers work. Do they really actively discharge overcharged cells? Or just cut the charging?

Using one of those may actually be the easy way out for you. I wouldn't be surprised if you can find one that can not only help you with load balancing and overall charge control (that's the primary function of them), but also can tell you about current cell voltage and maybe even something about the health of individual cells - which can be seen on the charge/discharge behaviour of the cells.

I actually have been doing quite a bit of research recently, unfortunately. I think most off the shelf BMSes just discharge cells through resistors to keep them balanced. Some high end ones might implement load balancing via energy transfer but that is most likely done using the flying capacitor technique. I don't think cutting off charging to single cells is possible as when they are in series the charging voltage is a value that is appropriate for the entire pack, cutting off one cell (if it was possible) would either interrupt charging of all cells by breaking the circuit, or destroy the other cells because then the charging voltage will be too high for them.

I said unfortunately because with research I gained interest in the topic and also desire to create my own, which will most likely perform worse and possibly be more expensive than off the shelf ones, but it's too late now.. xD

That is why I'm looking into replacing them with mosfets that consume next to nothing.

But have the disadvantage of not actually working.

There is a bit more to that. A typical discrete cell balancing circuit has a voltage reference (TL431), followed by a power transistor. That power transistor usually has a power resistor attached, to lower dissipation in the transistor and to limit max current.
Leo..

What is the need to check the cells so often ?

I think it may be possible to use mosfets. Below is a circuit for measuring the voltage of a battery that's above Vcc. The key is the capacitor. When the control line goes low, the gate voltage drops at first by the same voltage drop, which is enough to turn on the mosfet. The capacitor begins to recharge, but the analog reading can be done before the mosfet actually turns off. And the capacitor protects the GPIO from the high voltage. I suspect a very small capacitor would work well enough. This doesn't provide any capacitive balancing, but maybe that could be worked in. In any case, you wouldn't need relays or optocouplers. What do you think?

The problem comes when you have batteries in series and you want the voltage of each battery under load.

Say 8 batteries in series.

Well, at each measuring point you would get the voltage of the entire stack below that point. So you could just save each of those readings, then subtract to get the voltage of each cell.

That requires the Arduino to be referenced to the battery GND.

To keep the Arduino isolated from the battery circuit, a flying capacitor will do the job.

Correct. However there has not been a proper description of a flying capacitor circuit yet. The one in the first post was a bit poor.

This is the relay circuit for a single flying capacitor. You need one of these for each battery in the pack. Note the contacts on the relay need to be a double pole change over switch.

Fair point, I just got around to trying to design the circuit and realized that the internal body diode would mess things up. I guess the only way to use the flying capacitor design is with relays... Bummer.

That's a very neat trick. I don't see why it wouldn't work. Avoid MOSFETs with large gate charge, as that will require larger capacitors to make it work well.

A resistor of 100k and cap of 100 nF should give you about 5 ms to read the voltage (in that period the gate goes from -5V to -3V, that's still fully on for e.g. the BSS84 - assuming <1 mA current through the voltage divider), plenty of time for an Arduino to read the voltage.