[AVR / Components] Need help regarding NiMH AAA charger - Page 1
Forum section: electronics / beginners

author: Nitrus
author_rank: Contributor
timestamp: February 07, 2017, 04:00:23 am
content: Hi everyone,I've been trying my hand at making a NiMH charger (I'll explain my project below).I know the topic has been extensively discussed to hell and back, however surprisingly there areveryfew open source circuits available online.My requirements are that it needs to be capable of charging two AAA cells @900mAh each (wired in series), to run off USB +5V, and to be reasonably fast (3, 3.5 hours is acceptable).I foundthis one charger circuitand I think it will be suitable for my purposes, however there are a few things in it that I can't wrap my mind around. I tried asking the author however I don't think he's active on that blog anymore.https://arduinoelectronics.wordpress.com/2012/04/20/smart-nimh-battery-power-charger-based-on-attiny85So, if you've taken a look already, you would have seen the Red LED that's used to provide constant current. I'd venture to say that it is a neat trick (even if I disagree with it).Here come my questions:1) Can anyone explain to me how that Red LED constant current thing works? I understand as far as forward voltage drop, but not the part about the constant current, not really. I've remade the schematic in a SPICE simulation environment and that LED never blinks for me, which is clearly different from the author's video. I get pulsed current, but not the blink.2) There is a Schottky below the PNP. Is there any other function to it other than to protect the components behind it from the battery connection?3) Can the circuit work as-is with +5V, instead of the +12V specified in the schematic? The author says it was designed for 6 cells @2500mAh, however I think it can work as-is for my requirements as well: 2xAAA cells @1800mAh. I only got rid of the linear v.regulator part of the circuit, everything before the Red LED, and replaced the 12V source with 5V. I'd appreciate if anyone can make the corrections (if any), or better yet teach me about what needs to be corrected.Finally, if anyone can link me a better circuit, I'll gladly take it. Any advice is welcome at this point, I've rarely done anything to do with NiMH/NiCd charging before, other than some research in the past few days.---My application is as follows: I need a small circuit to implement within the enclosure of a joystick controller that has two built-in AAA batteries. Ideally I would have wanted to replace those with LiPos and have a single-chip charging setup, but the problem is I can't bloody fit any decent capacity LiPOs in the casing, I'm very limited in terms of space. The current draw of the joystick is about 15mA, which is quite a lot for e.g. those small 250-300mAh LiPOs. It would be discharged in a matter of hours...So, I'm stuck with NiMH AAAs, and need an intelligent charging solution for the specific situation.I'm not afraid of AVR, I've got a few different types at my disposal.Thank you all in advance for anything you can throw at me.

author: tron9000
author_rank: Frequent Contributor
timestamp: February 07, 2017, 09:43:38 am
content: FYI - introduce yourself first - go do that now:https://www.eevblog.com/forum/chat/new-member-please-introduce-yourself/?topicseenI'll give it a shot: The LED is acting like a zener: applying a fixed "regulated" voltage. The LED has a forward voltage of ~2V and the PN junction of Q1 has a drop of ~0.7V. This means that there must be about 1.3V across R3. Current therefore through Q1 and thus into the batteries should be1.3/R3and should be constant with respect to the LED voltage. Build it and try it and change the LED colour and you should see a different current through Q1Nope - you hit the nail on the headNope

author: Nitrus
author_rank: Contributor
timestamp: February 07, 2017, 12:31:47 pm
content: Quote from: tron9000 on February 07, 2017, 09:43:38 amRight, I've gone and done thatThanks for your explanation on 1), it confirmed some of the things I was thinking, I'll mull it over some more. I didn't have anything like the darlington on hand, and only BC517 for now so I'm waiting for those to arrive, which may take a while since when I order components like these, I order in bulk of 50s or 100s from ebay or aliexpress. (more legit places rarely deliver to my country, or delivery costs 10 times as much as the components)To be perfectly honest I'll be getting surface mounts components sooner than through hole ones, I put an order for typical kit stock of caps and resistors before hand, because I was hoping to design and make it as small as I can.As for 3), you mean it cannot work as-is, or you have no corrections/suggestions?Thanks for the help so far!

author: tron9000
author_rank: Frequent Contributor
timestamp: February 07, 2017, 02:38:58 pm
content: well maybe just, actually. You need a supply greater than the 2 charged AAA's + one schottky diode drop + Vdrop across R3

author: mikerj
author_rank: Super Contributor
timestamp: February 08, 2017, 09:17:33 am
content: Quote from: tron9000 on February 07, 2017, 02:38:58 pmDon't forget the Vce of the transistor. It's a darlington so this figure is likely to be quite high, certainly high enough to prevent this working. It should be possible to use a normal NPN to lower Vce with some circuit adjustments.Also the current source is configured for 1.5A to 2.5A depending on LED etc. which may be a problem for some USB ports (esp. older laptops) and is likely too high for AAA cells anyway.

author: Nitrus
author_rank: Contributor
timestamp: February 08, 2017, 10:33:48 am
content: Quote from: mikerj on February 08, 2017, 09:17:33 amThat's true. I've read somewhere that charge rate for AAA NiMH is 400mA tops (1A for AA), so I should be able to find suitable replacements easily, hopefully.Quote from: mikerj on February 08, 2017, 09:17:33 amYes, USB 1.0 & 2.0 are rated at 500mA and USB 3.0 at 900 (although I wouldn't push my luck).Anyways, where is it configured for 1.5A to 2.5A? To me it looks like it's going to scale down with the Voltage, not sure... Any pointers?EDIT: I've added my modified schematic, at least what Ithinkwould be OK. I could be dead wrong. P.S. The transistor's Vce seems to be not that bad.

author: tron9000
author_rank: Frequent Contributor
timestamp: February 08, 2017, 12:34:11 pm
content: Quote from: mikerj on February 08, 2017, 09:17:33 amYeh no Vce no workie!I think its darlington so the amount of base current needed doesn't affect the Vf of the LED maybe. hfe of 1000 for TIP127 Vs hfe of 10 for a TIP32 say means 100 times increase in base. This would give to a greater voltage rise across R1 and affect Vf of LED.

author: mikerj
author_rank: Super Contributor
timestamp: February 08, 2017, 10:09:53 pm
content: Quote from: Nitrus on February 08, 2017, 10:33:48 amIt's a constant current circuit, the whole point is that the current should remain fixed irrespective of voltage. In this case it's a fairly crude current source so there will be a little variation, but the current won't scale with voltage in the way you are hoping.The current is set by the voltage developed across R3, the 0.3 ohm resistor. e.g. given a 2v Vf LED and 0.7v drop across each Vbe junction you get I=(2-0.7-0.7)/0.3 = 2 Amps. To reduce the current, increase the value of R3.

author: Nitrus
author_rank: Contributor
timestamp: February 08, 2017, 10:38:26 pm
content: Quote from: mikerj on February 08, 2017, 10:09:53 pmOhhh, I see! Thanks, that makes a lot of sense!Hmm, I think most Red LEDs that I can get my hands on will have a 2.2 Vf, so I'll have to get a 1% resistor that will be in the 1Ohm range: ( 2.2 - 0.7 - 0.7 ) / 1.0 = 0.8 Amps.Provided that the rest of the circuit stays the same, I think this solved my dilemma.Finally, one last question, since I've very little experience with NiMH. Well with charging circuits in general really.As I mentioned previously, I've got 2xAAA that supposedly can be charged at 500mA. I'm wiring them in series because I need upwards of 2.4 Volts, so essentially like a two cell pack.Do I charge them with 500mA or with 1000mA?My guess is 1000mA, but I'd rather be safe than sorry

author: Audioguru
author_rank: Super Contributor
timestamp: February 09, 2017, 01:51:15 am
content: Two batteries in series have the same 500mA of current.A red LED has a range of voltage from maybe 1.8V to about 2.2V. You cannot order a "2.2V" LED, you get whatever is available and it might be only 1.8V.Transistors also have a range of base-emitter voltage and collector to emitter saturation voltage. Again you get whatever is available.So the very simple circuit might charge the battery with almost no current or averyhigh current.

author: Nitrus
author_rank: Contributor
timestamp: February 09, 2017, 02:38:45 am
content: You know, that first sentence you said just dawned realization on me:Series. Only adding the voltage... {gears grinding} mAh will stay the same (facepalm)Without thinking I'd foolishly set myself on a path that I somehow imagined would get me more juice... 😧I will still probably build the circuit. It's going to be useful to have a semi-intelligent NiMH charger.However, for my application I'm thinking I may go down the Li-ion route and get two CR2/15270 cells and wire them in parallel, then make them go through a v.reg.Charging solutions will be a lot simpler then.Discharge rates may be a bother but ultimately it's going to be a simpler implementation...Then again AAAs will always be cheaper if I need to replace them further down the line... Bah!I guess no matter which route I go, with my form-factor I wouldn't be able to get much more than 1200mAh, tops. (If I buy better rechargeable AAAs, or two 600mAh 15270s)Thank you all for the wonderfully educational experience, cheers!

author: eugenenine
author_rank: Frequent Contributor
timestamp: February 09, 2017, 12:37:04 pm
content: Quote from: Nitrus on February 07, 2017, 04:00:23 amTi, Maxim, etc all make NiMH charging IC's with reference designs you can use.

author: David Hess
author_rank: Super Contributor
timestamp: February 09, 2017, 10:27:09 pm
content: Quote from: Nitrus on February 07, 2017, 04:00:23 amThe voltage across R3 is roughly Vled - 2Vbe so about 2 - 1.4 = 0.6 volts so with a 0.3 ohm resistor, 2 amps.On advantage of using the LED this way is that its temperature coefficient roughly matches the temperature coefficient of one of the transistor Vbe junctions. If a bipolar transistor was used instead of a Darlington, then the temperature matching would be very good.QuoteIn the design shown in the link, the diode is necessary because otherwise the 7.2 volts from the charged battery would likely flow back through the collector-base junction through the LED and also through the emitter-base junction of the transistor when the input supply is removed.QuoteSaturation of the Darlington transistor will be about Vbe + Vce = 0.7 + 0.35 = 1.05 volts. The resistor has about 0.6 volts across it. So the total drop is 1.65 volts leaving 3.35 volts to charge two NiMH cells in series. That could work but does not leave much margin.The 2.4 to 2.8 volts from 2 NiCd cells is low enough that the reverse protection diode would not be needed.QuoteThe charging current for NiMH and NiCd batteries does not need to be that exact. Use a high side transistor switch and rely on the 5 volt supply to be stable and use a resistor to limit the current. Subtract the charged battery voltage and transistor saturation voltage from 5 volts to find the voltage across the resistor and set it accordingly for the desired current. USB limits you to 500mA so a single PNP bipolar transistor instead of a Darlington could be used.

author: Nitrus
author_rank: Contributor
timestamp: February 10, 2017, 12:10:30 pm
content: @David yes, I've since found out that the circuit could be minimized and stripped significantly when used with only 2xAAA batteries. For example, there is a wide choice of bipolar transistors that could be used at such small currents, and as you say the diode is not even needed with this application.Thank you very much for the thorough explanation!

author: tron9000
author_rank: Frequent Contributor
timestamp: February 13, 2017, 09:20:19 am
content: Something I would like to know: does the example program use negative delta V detection to determine end of charge or is that not essential?

author: Nitrus
author_rank: Contributor
timestamp: February 13, 2017, 09:31:40 am
content: Quote from: tron9000 on February 13, 2017, 09:20:19 amI believe so, the author mentions it in the text:"We need to constantly read the voltage of the battery being charged, and when there will be a maximum peak voltage followed by a sudden drop of about 20mV, the battery may be considered charged. This phenomenon (called Negative Delta V) is related to the chemistry of this type of battery, and allows to establish precisely the right moment to terminate charging."In the code it's covered (a bit convoluted) in the voltread() function, line 62 and onwards.