Hey gang - back again (accursed timezones and the demands of a real job!
OK, to answer some of what's happened in the last little while:
nmbg - That was an interesting plot of Ichg vs Vout! And yes, I see the taper from full current to zero over ~600 mV. In practice, this isn't so bad as it will just extend the battery charging time at the point when the cell's ability to absorb charge (i.e. near the end of the charge cycle) is diminishing anyhow. Given we're not temperature compensated (more on this in a sec, KerimF), this is quite acceptable. But yes, I agree, it'd be nice to do better
goldsmith - You are certainly correct about the batteries' internal resistance changing. The finite battery impedances mean the charge currents do naturally diminish when charging from a constant voltage source. The goal of this charger is a little of both - a constant current source capped at a certain voltage, so we expect to see the current taper right at the end point. Until that point though, we'd hope for a constant current (which NiMH/NiCD batteries certainly don't mind) - and that point is a little 'broader' than hoped here...
To your question nmbg: Why does the BC547 pass current under the zener voltage?
Predominantly, because low voltage zeners s.u.c.k.! That, and the currents we're talking about here are actually tiny. As caused us grief earlier, all zeners exhibit leakage current at reverse bias below breakdown. Have a peek at a [random] zener datasheet (
https://www.fairchildsemi.com/ds/1N/1N5225B.pdf) - some of the devices LEAK > 100 uA at only 1V reverse bias! (Lower voltage devices are ALWAYS worse). The breakdown "knee" is also pretty poorly defined in low voltage zeners, and especially so at tiny currents. The datasheet parameter Zzk refers to the 'effective resistance' that appears in series with an otherwise ideal diode for the current (Izk) shown. For devices < 5.6 V (where the physics of the breakdown mechanism change), this parasitic resistance is ~1 kohm, which significantly affects the transistor base current in exactly the same manner as the resistor R1.
This problem is further compounded by the gain of Q1, which (due to its effective current gain) can sink ~100x the current via its collector as the zener provides to the base. Given that drawing only ~100uA from the LM317's adjustment pin will pull the output voltage to the minimum of 1.25V, this process is achieved with only ~1 uA of base current. Hence, adding the resistor R4 was essential to better define the turn-on point of Q1. Actually, let me digress briefly to talk about transistor operation here, as it will make it easier to discuss temperature stability in a moment
Unfortunately, the hand-wavy discussion of collector vs base current I just participated in is seen all too often in transistor analysis. In *some* cases (like illustrating the point above), it's a useful guideline. Strictly speaking though, the transistor is a
transconductance amplifier - a complicated way of saying the CURRENT in the collector is controlled via the VOLTAGE across the base-emitter junction. It's not a 'current amplifier' (even though it can be *configured* as such). There's oodles of maths on the net if you're interested, but you can go a long way with a few rules of thumb:
1. Vbe has to be ~0.6V before any collector current starts to flow.
2. The collector current increases approximately 10x for every 60mV of Vbe increase
3. The Vbe temperature coefficient is -2mV/degree C
Rule 1 is why we added R4. By forcing the zener to develop a *voltage* across the resistor, we could more precisely define the turn-on of the transistor. Rather than relying on poorly defined (and tiny) zener currents, we could now count on ~600 mV having to be developed before anything would happen. R4 is relatively small, so this amounts to a macroscopic zener current. Much better! Once the transistor *began* to conduct, sure, a tiny base current is required to sustain the collector current, but this is only ~1uA, a factor of 1000 times smaller than the zener current required to develop the 600 mV across R4. Thus; a) we don't notice it, and b) who cares if it was 50x bigger or smaller? It's tiny! We have thus gained some independance from slight variations between zener diodes!
OK, back to the excessive charging current taper observed.
I suspect this will have a lot to do with the zener characteristics, and the parasitic resistance (mentioned previously) in particular. There's a couple of possible strategies around this:
a. Remove the parasitic resistance,
b. Insert a voltage reference and a high gain 'comparison' device to effect a narrow voltage decision threshold.
I must admit I'm a little underwhelmed (and I've learned a valuable lesson!) with the performance of the zeners we've seen here... so what if we got rid of it and relied solely on the transistor's Vbe as the voltage-cutoff-determining-value? Here's my thoughts:
I've added a 100R trimmer on the base to allow the threshold to be set, since the end-point is determined by the exact Vbe voltage that draws sufficient current from the LM317 to shut it down, multiplied by the voltage divider network by ~10x. Now, the effects of the transistor's temperature coefficient (which were/are present in the original circuit, just swamped by the zener's characteristics) are more clearly visible... enter BJT rule 3. The Vbe required to pass a given collector current DECREASES by 2mV for every degree (C) of temperature rise. Therefore the end-voltage will appear to decrease by ~20mV of ambient temperature increase. For charging batteries at room temperature, this is probably OK. Alas, it's also the best we can do with a single transistor (without temperature compensation networks).
If we added another transistor (or more), we could start down the road of approach b) - by constructing a differential amplifier to 'compare' a voltage reference (which could be a precision bandgap reference, or just a [comparatively well behaved] high voltage zener) with the output voltage and abruptly switching the LM317 on/off. While a fun exercise in BJT's (!), KerimF's approach is probably the better - grab an op-amp like the LM324 (which is especially nice since its common mode voltage ranges are well suited for single 12V supply operation). The LM324 is happy with a very wide range of rail voltages, so you could omit adding a regulated supply for simplicity. While you could add a series PNP switch (or FET) ahead of the LM317, I'd suggest retaining the current BC547 approach to shutting the LM317 down, since a series transistor has to pass the (higher) charge current (and dissipates [possibly negligible] additional heat to dispose of). Yes, the op-amp could certainly control either approach though
It's all a matter of how much complexity and what tradeoffs you're willing to make!
Apologies for the novel, but I'll leave you with a circuit that leaped at me that would probably also work for you nmbg and is yet another interesting permutation of transistor + LM317:
(Lifted straight from page 21 of the datasheet:
https://www.ti.com/lit/ds/symlink/lm117.pdf)
The resistor values shown are pretty close to the currents you're after, and the voltage is set by appropriate choice of R2. The caveats to beware are: a) The input supply 'ground' is different from the battery 'ground', and R3/R4 will dissipate a few hundred mW (depending on your charge current).
*phew* Hope there's something useful to you in all of that! Good luck!