# Battery Charging Circuit - NiCd

I am designing a battery charging circuit for an in circuit NiCd battery (used on a RC car).

From my research I understand that I need to charge using a constant current source, and for fast charging on NiCd batteries this can be a maximum of 1C (provided that the shutoff circuitry is well designed). However, as BJT are likely not able to provide this current I have chosen a 0.1C charging time.

Therefore I have designed the following constant current circuit, with the mathematics shown.

Battery Specs

• Capacity = 2100mAh
• Voltage = 7.2V simulate this circuit – Schematic created using CircuitLab

Calculations

Current for the battery $0.1C=210mA$

BJT
$V_{be}=0.7V$
Zener
$V_z=5.1V$

therefore

$R1=\frac{(5.1-0.7)}{(210\times10^{-3})}$

$R1=21Ω$

Base current
$h_{fe}=100$
$I_b=\frac{I_c}{100}+2mA$
(2mA for the Zener)
$I_b=4mA$

therefore
$R2=\frac{(12-5.1)}{(4\times10^{-3})}$
$R2=1.7kΩ$

Which shows the circuit below.

Is there anything here that I have missed or is this correct?

Further questions:

1. If the motor is suddenly turned on (it will draw approximately 35-50A) during charging will this current be provided by the battery? I would assume so as the battery acts as a capacitor and therefore will resist the change of current to keep the voltage the same?

2. Is it possible to redesign the circuit so that the full 1C can be provided (2.1A)

3. Would it be a better idea to use a regulator somewhere?

EDIT1:
Updated to show location of motor in the schematic.

EDIT2:
New schematic simulate this circuit

• Does the 12V source represent a motor? Is this in an automobile? – Dan Laks Sep 23 '14 at 22:22
• What type of transistor is that? – venny Sep 23 '14 at 22:27
• @Dan No it represents a 12V source (in reality a boosted 5V -> 12V) – Lhh92 Sep 23 '14 at 22:29
• So where does the motor come in? – Dan Laks Sep 23 '14 at 22:30
• @venny A generic NPN transistor with a beta equal to 100. For example a BC107 – Lhh92 Sep 23 '14 at 22:32

In principle your calculations are correct. However, you have to realise a few things about your chosen set-voltage:

At the collector of the transistor you have at absolute least your chosen zener voltage of 5.1V if 210mA is flowing (probably 0.3V more even). This leaves only 12V - 5.1V = 6.9V for your battery, so the current regulation will start to fail well before the battery is reaching it's specified voltage, let alone the limiting charging voltage. So charging will take much longer to reach full, if it even does at all.

Secondly, you are putting 5.1V - 0.7V = 4.4V across your resistor, meaning 1 watt.

Edit1: Your question about the motor turning on: Your battery voltage will drop when power is consumed, so the voltage across the transistor will increase a little, and the transistor will still want to supply its configured current. But other than that, the rest comes from the battery.

You could change your plan to a lower zener voltage to accomodate more reliable charging, but it's advisably to include a small monitor regardless of what you do that checks when the battery reaches 8.4V to 8.5V, to then shut off the charger, to keep from over charging.

Your schematic can be improved to allow the full 2.1A charge current, this means you might have to upgrade the transistor to a Darlington type (good power, great current amplification, 1.2V to 1.4V Vbe in this setup) and attaching it to a heat sink. But always also keep the power in your resistor in mind, as you want that to stay cool enough.

But with 1C charging currents your monitor circuit should include some way of turning off when the batteries get too hot. There are little thermal fuses that sometimes get added to the battery pack, they "melt" at 75 to 85 degree C, so that the batteries don't blow up, but be sure one of those is present, else you will have to really check that temperature yourself.

A darlington is basically a double transistor, one driving the other: simulate this circuit – Schematic created using CircuitLab

So you can also make that yourself with one small-signal transistor and one power transistor. The power transistor should be the bottom one (Q1) and that's also the one you want to attach to a heatsink. The small signal amplification (hfe) then gets multiplied, Q1's hfe multiplied by Q2's hfe is the hfe you see at the base of Q2.

Edit2: Another schematic, with op-amp for more accurate Resistor voltage prediction: simulate this circuit

R1 offers a 1 to 1.2mA bias to the standard 1N4148 diode, making it conduct at about 0.6V. If in practise this voltage is too high the resistor can be increased up to 50k, if it turns out too low, it can be reduced all the way down to 1k1. (iteratively of course). R2 is there for a feature to follow in the next schematic, but in this schematic it allows to focus on how little influence it has during "normal operation". The op-amp pulls negligible current on its positive input, so the drop in this situation across R2 is so small we can assume it zero.

R3 is a protective resistor, at initial switch on this prevents the op-amp or transistor getting "punished" outside their normal operation.

R4 is calculated using an estimated charging current of 1.75A, to allow some wiggle room for your batteries to be out of shape a little.

The op-amp measures the voltage across R4 with its negative terminal and wants to try and get its negative terminal up to the voltage that is at its positive terminal. Of course there are limitations on input/output, but the LM358 luckily supports input and output all the way down to its negative supply voltage. So if you put 0.6V at the positive terminal, the op-amp will try to get 0.6V across the resistor, by pushing whatever the transistors need into them at the base of Q1. As long as that needs no more than 2V less than V+ on the output of the op-amp.

Edit3: Once you have that schematic understood it's time to add another feature, the LM358 has two op-amps, so let's put them both to good use: Edit3.5: Changed Q3 to a BS170 mosfet, as they are cheaper than the low saturation transistors I normally stock. simulate this circuit

For this addition, you have to keep in mind that the battery is fixed to the +12V.

When the battery is anything below 8.4V, its negative terminal will be anything above 12 - 8.4 = 3.6V. The Zener D2 creates a voltage drop of 8.4V from 12V, so creating a reference point of 3.6V (always check this in the real world and tweak the resistor R5 to adjust if necessary). Make sure the Zener D2 always drops between 8.2 and 8.4 volt. If there's no suitable single zener in your price range, two or more can be stacked.

Now, if the battery is below the zener-drop voltage the op-amp OA1-B sees a voltage on its negative pin that's higher than the voltage on its positive pin. This swings the output down to 0, forcing the transistor Q3 off: The original schematic works exactly as the previous one, it's as if nothing changed.

If the battery gets to the threshold set by the zener, suddenly the op-amp sees a higher voltage at its positive terminal, this makes the output swing to positive, forcing the transistor Q3 on. The voltage at the positive input of op-amp OA1-A becomes a few millivolts, because the mosfet only presents a couple of ohms to ground, causing a charge current of 0.01 / 0.39 = 26mA or less.

And, as a bonus feature: The LED turns on to let you know that you should disconnect the charger.

Whether =<26mA is enough to keep the battery-charger system to oscillate between charging/trickle constantly can be pondered at, as such, when I have time to do some actual calculations I will add a 4th edit, where OA1-B gains some hysteresis to allow it to shut off at 8.4V and turn on only at 7.8V. Again with a full explanation of its operation.

Edit4: Took a little break from embedded sorting algorithms to do some simpler thinking: Adding a schematic with hysteresis on the off-switch: simulate this circuit

In this schematic R10 is added to allow you to determine the trickle-charge once main-charging is turned off. If you turn down R10 to 0 Ohm the trickle charge should be in the range of several mA, of you turn it up to 220 Ohm it comes out to about 25mV at the op-amp +in, which gives: 0.025V / 0.39Ohm = approx 64mA. On-line reference manuals for NiCd batteries will teach about a good level and how to find out if that is working for your batteries. Of course, this part is optional. Left out you will just get a few mA of trickle, which should be allowable to most batteries with 2.1Ah capacity.

Another change to the earlier set-up is that D2 and R5 have been adjusted for a 8.1V reference voltage, in stead of 8.4V. This has to do with the required offset to be able to switch with hysteresis. This will be explained below. An alternative would be a positive biased 3.9V zener to ground (12V - 8.1V = 3.9V)

The only real additions made to the schematic for hysteresis are R8 and R9. To understand the functionality there are two situations:

1. The battery gets charged from 7V upwards
2. The battery gets discharged from 8.4V downwards

1. The battery gets charged from 7V upwards

When the battery gets charged the op-amp's output is off, so that Q3 does not conduct. So we know the output is at 0V. We also know that the zener diode is at 8.1V below 12V, which is 3.9V. The voltage at the op-amp's +in pin can be calculated using the given resistances for R8 and R9:

Vdiff = 3.9V over R8 and R9, gives: Idiff = 3.9V / 13kOhm = 0.3mA

V+in = 0.3mA * 12kOhm = 3.6V (because the output is 0, the input voltage falls entirely over R9).

Again once the -in of the op-amp reaches this +in voltage (going downwards, when the battery voltage increases, -in decreases) the op-amp will "switch over" to it's on state. 3.6V equates to: 12V - 3.6V = 8.4V, exactly the voltage we want the battery to be "disconnected" at. When the output turns on the +in pin voltage goes up a bit, so that a small drop in battery voltage will not make the op-amp go off again directly, more on this in:

The battery gets discharged from 8.4V downwards

For this, we need to know that an LM358 has an output voltage swing at most to 1.5V under V+. For ease of calculation we will assume this to be true, as the margins created by the resistors are large enough, so Vo = 12V - 1.5V = 10.5V.

The reference point at the zener diode is 3.9V, Vo = 10.5V, so we calculate:

Idiff = (10.5V - 3.9V) / 13kOhm = 6.6V / 13kOhm = approximately 0.5mA.

(Incidentally, Vzener - Vop-amp-swing = 8.1V - 1.5V = 6.6V, as per Kirchoff, further research left to the reader's initiative)

This time the current flows down from Vo to the reference point, so the V+in voltage will be higher than the reference voltage, as determined by R9, as follows:

V+in = (Idiff * 1kOhm) + 3.9V = approximately 4.4V

So now to get the op-amp to turn off again the -in pin has to go above 4.4V, which means the battery voltage has to decrease to: 12V - 4.4V = 7.6V

So, as long as the battery doesn't drop to 7.6V immediately once trickle charging kicks in, this will give the battery rest until some power is used from it again.

Important note:

With this hysteresis trick, the trip point is no longer only determined by the zener diode, but also by the positive voltage rail's voltage. There is some room for margin, but not very large. If you increase the supply voltage the "distance" between the reference point and 0v becomes such that at some point the charging trip-point will go beyond 8.5V battery voltage, which is not very good for your batteries. So, if you can, it is best to make sure your supply voltage is in the 12V to 12.5V range.

If you want to make the schematic immune from input voltage change this will require more levels of biasing. This eventually puts the reference circuit floating under the positive supply rail at a set voltage, but the complexity would become such that other tricks and directions of thought would prove more useful. Up to this schematic the thinking was useful, and hopefully provided some good insights into the workings covered.

• So in theory if I replaced at zener with a 1.4V version, and used a BC337 with a TIP31 (0.637, 0.635 vbe), a 50mOhm emitter resitor and a 1k base resistor it would then work? – Lhh92 Sep 23 '14 at 23:55
• I have dded a new schematic to the main question. Does this incorporate what you are meaning? – Lhh92 Sep 24 '14 at 0:01
• @LanceHenderson The basics are there, but you will still want some monitoring on the battery to make sure you don't destroy anything. The low voltage margin with the Darlington should be checked several times during the first test as well, as stated in other comments both voltage drop and hfe can vary, so best keep an eye out. I'll post more schematics to my answer to help you further in a little bit. – Asmyldof Sep 24 '14 at 11:12
• @LanceHenderson My "kudos" was aimed at the schematic by the way, the 50mOhm with 1.4V zener would be so close to the margins that you'd have no real guarantee of consistent operation. – Asmyldof Sep 24 '14 at 11:15
• I think my answer has reached its limit of usefulness. Done edit-adding. – Asmyldof Sep 24 '14 at 21:21

You should throw away a bit more current into the zener, maybe 5-10mA, so reduce R2 accordingly. You want the zener voltage to remain approximately constant, so running it at close to the test current is good. For a 1N5231, that's 20mA, but that's a bit wasteful. An SMT BZT52C5V1-TP is 5.1V at 5mA, so if you allow the current through R2 to be 10mA you'll be good.

Power dissipation will be a consideration. At 210mA if the battery was shorted the transistor could dissipate 1.6W which is way too much for a TO-92.

Another problem is that the compliance of the CC source is 12V - 4.5V approximately, so it will be very close to saturation if the battery is 7.2V.

You can cure this by replacing the zener with a TL431 set for something like 4V, but you'll still need to use a transistor that won't overheat if the battery is shorted (as NiCd cells are wont to be). A suitable part might be a TIP31 with a heatsink.

For example, you can do this: The TL431 shunts base current away from the TIP31 to maintain the emitter voltage at about 2.5V. Thus the emitter current is about 210mA (and the battery current a teeny bit less because the base current adds to the emitter current by 1% or so) You could use a Darlington with this circuit rather than a TIP31, but it's really not necessary- the circuit shown will maintain the battery charging current quite steady for battery voltages from 0V to 9V.

Since the feedback loop is measuring the emitter current directly, the gain will have a small effect on the battery current (<1%), and Vbe decrease due to heating of the transistor will have negligible effect. If you had a Darlington with two Vbe drops and a 3V 'Zener' and the transistor heated by 40°C (quite plausible) then the current would change by 10-15% (increasing as the transistor heats).

Since you're charging with constant 0.1C current, you should use a timer to shut off the charge current if I recall the NiCd charging algorithm correctly. It's also advisable to shut down the charging if the voltage is too high or too low, but that usually indicates a damaged (due to over-discharge or over-charge) or a disconnected battery.

• Could you please explain what you mean by "the compliance of the CC source...so it will be very close to saturation."? – Lhh92 Sep 23 '14 at 22:57
• When the Vce of the transistor gets less than a few hundred mV it can no longer control the current. Since the emitter voltage is about 4.5V, the collector voltage should be more than about 5V. That leaves only 7V for the battery. – Spehro Pefhany Sep 23 '14 at 22:59
• and the 510 resistor is to provide the base current? Say I were to reduce the resistor on the emitter to 20mOhm (to reduce power consumption). This 510 would then change also? – Lhh92 Sep 24 '14 at 3:25
• And would it be a better idea to use an op amp to provide the feedback? – Lhh92 Sep 24 '14 at 3:26
• The TL431 is kind of an op-amp plus reference for a dime or so in smallish quantities. Hard to beat. You could use a conventional op-amp if you want, certainly, but you'd still need a reference, and I don't see much advantage in increasing the feedback gain- the reference inaccuracy will swamp that. – Spehro Pefhany Sep 24 '14 at 3:41