Driving mosfet in battery balancing circuit by an mcu

Discussion in 'General Electronics Chat' started by Jabar_10, Mar 16, 2016.

  1. Jabar_10

    Thread Starter New Member

    Mar 16, 2016
    I'm trying to make a simple passive battery balancing circuit using logic level n-mosfet driven by MCU. However, I've got some issue on how to drive the mosfets by the digital output of the mcu, and also having isolation between mcu ground and the source legs of the mosfet. Otherwise, in the case of the attached circuit, the 2nd battery would be short circuited.

    Looking forward to hear your thoughts or maybe another alternative to drive the mosfet. I was thinking to use optocoupler, but then I need another isolated supply. Thanks
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    You could use a simple level-shifter like this:
    The shifter would require logic-inversion of the driving signal.
  3. GopherT

    AAC Fanatic!

    Nov 23, 2012
    I don't mean to be a party pooper but your circuit will create some real sadness. Look carefully and you will see that BAT2 has both terminals connected to ground.

    You need a new design. Or, you need to spend about $12 and buy one.

  4. MrAl

    AAC Fanatic!

    Jun 17, 2014

    What is the charging current?

    Also, can you even do it this way to begin with? I ask because it looks like you want to 'pulse' the bypass transistor when the associated cell is fully charged, or else completely bypass it. But do either of these ideas actually work?

    For example, with a 1 amp charge current and a 100 ohm drain resistor, the max current that can be bypassed is about 4.2/100=42ma. With a 10 ohm drain resistor, the max is 4.2/10=420ma which may be enough but that's only if the charger shuts off completely when the second cell is fully charged.

    For another example, with a 1 amp charge and 420ma bypass resistor (10 ohms) if the MOSFET is pulsed on and off that means that sometimes the cell is being charged with 1 amp and sometimes it is being discharged by some amount. I am not sure if that is good for the cell life.

    I would think a more typical method would be to use a linear technique, where the cell is bypassed with a linear shunt regulator that progressively bypasses any amount of current as the cell nears the fully charged state. That would mean the cell would be charged the same way as it would be charged on probably all chargers made today.

    So i think it would be best if you provided the circuit you intend to use, as well as the basic algorithm. That way we can go over the pro's and con's of the total design. The algorithm doesnt have to be stated in complete form, just in words as to how and when the cell gets bypassed and what the mechanism is.

    Another way to do this in a linear fashion would be to use op amps, floating voltage references, and bypass transistors similar to what you have. When the cell nears the fully charged state, the transistor conducts a little, then more, then more, etc., as needed.

    Of course a simpler method would be to charge them individually, if that is possible, which means the cells have to be able to be separated (not always possible of course).

    Another simpler method would be to use two isolated chargers, that charge each cell individually. To do this with an Arduino, that would mean two Arduinos and two wall warts, unless you use one wall wart and an isolating DC to DC converter. One Arduino driven from the wall wart directly, and the other driven from the isolating DC to DC converter. Both charge circuits would be identical, except for the DC to DC converter which powers only one of them. The lower charge circuit could still monitor both charge processes however and report the progress. Using Arduinos, two Nano's would handle this quite easily. Each Nano would have the very same program unless the lower one was to monitor both processes and then that one would require a little more code.
  5. GopherT

    AAC Fanatic!

    Nov 23, 2012
    LiPo batteries normally come in a package with 2, 3 or 4 cells in series and only two power wires for + and - of 8 to 16 gauge wire. There is a charge balancing ports with much smaller wires (22 to 26 gauge) and a warning not to charge through these wires. Apparently, the goal is to bypass small amount of current on a millisecond basis to insure the cells all charge at the same rate and maintain less than a few tens of millivolt differences during the charge process.

    In other words, it would be against the manufacturer's recommendation to charge through the balancing wires (or run any significant current though the balancing wires).
  6. MrAl

    AAC Fanatic!

    Jun 17, 2014

    Thanks for that info, very interesting and informative.

    If the wires are too small then i can not see using them to balance the charge in any way that we normally would want to do it. That's because the bypass current sometimes must be large too, and this would be a typical thing to happen because when one cell is charged and the other is not, the one that is not can still require significant current and thus the bypass circuit for the charged cell would have to be able to shunt the full charge current.

    Perhaps there are other limitations imposed also. For example, if we limit the current to 250ma then maybe the smaller wires can handle that. That would mean 250ma max for the total charge current coming out of the charger, so the charge process would take about 4 times longer than normal. That could be very acceptable though. But if the full current is 1 amp, then it would be necessary to be able to bypass the full 1 amp, which means the smaller wires would have to handle the full charge current.

    If we dont limit the max current, then all we can do is measure the cell state and turn off the charge when the first cell is charged. That means the other cell(s) wont be fully charged, however that may not matter because the first cell to charge dictates the run time anyway, and we cant run longer than that or it would reverse charge which would be very damaging.

    If you see another way around this, please elaborate as that would be interesting to know about.

    Thanks again for the info. I dont work with series connected cells that are not NiMH. That means no series Li-ion cells for me, unless i charge them individually. Lucky for me though i never needed series connected cells YET, but who knows in the future with the newer cordless drills having Li-ion cells and they must be in series, with 2, 3, or more in series. It probably comes with a charger, but after taking apart a cell phone charger recently (for single Li-ion cells) i tend not to trust store bought chargers without a thorough test first. The cell phone charger in question was capable of putting out more current than the phone should see. Another charger i took apart (for 2 Li-ion cells) not only had the two cells wired directly in parallel, but allowed the charge voltage to reach too high of a level before terminating the charge. Out of 4 chargers purchased, only one of them was near the right voltage level at the end of charge. Perhaps i should create a new thread mentioning these facts. I use a precision voltage reference for calibrating my meters also.