I'm trying to charge 3 NiMH/NiCd AAA cells from USB. I've already got an atmega32u4, so I can use that to read battery voltage and stop when battery reaches 4.2V. I'm not sure about the capacity, but 100mA seems a safe charge rate. Board space is limited so I would like to use as few components as possible.

I can't use an LM317, the voltage drop is too high. Is there another voltage regulator that I can use with current limiting?

Alternatively, the atmega32u4 can do about 100mA total on it's io pins. Can I just use a few pins, add a diode or 2 in series for the voltage drop, and use that to charge the battery?


Charging directly from the I/O pins would be a compromise solution that was unlikely to produce a good result.

Simple charger

If you want to charge the batteries "properly" to achieve longest battery lifetime and quick charging, then the BQ2000T IC mentioned by Matt is a good choice. There are many others but that does all of what you need and is compact and has relatively simple circuitry. [BQ2000T datasheet here](http://www.ti.com/lit/ds/symlink/

However, it's "simple" charger is shown in the circuit below. You can decide if this level of complexity is OK considering what it offers. Note thatthis is not overly complex. Q1/Q2/Q3 form a switching regulator with L1. This could be reduced to Q1 & Q3 with removal of Q2 and L1 if USB was used as power source. The rest is mainly diodes, resistors and capacitors.

Note that this is a very "nice" solution and achieves a degree of sophistication which is hard to achieve without an IC of this sort. At $4.50/1 it's a bargain compared to doing it yourself.

enter image description here

MPPT charger.

The LT3652 is a IC that produces a sophisticated tracking charger and which can handle all major battery chemistries. $6.50 in stock Digikey

This IC allows the USB input voltage (in this case) to be adapted to suit battery level.

enter image description here

Note that no external transistor switch is required.

Super simple system

If you wanted greater simplicity and lower cost then a very simple system could be used.

Acceptable charge rates with proper charge termination are up to 1C = one hour o meet full nominal charge capacity. Typical AAA NimH are around 1000 mAh and NiCd are lower. If you are happy with the 100 mA that you mentioned then this is about C/10 for NimH and under C/5 for NiCd.

At charge rates of C/5 - C/10 you can "get away with" charge termination based on endpoint voltage and absolute charging time. This is not likely to be as good for your batteries long term but is probably acceptable.

The charger can be an on/off switch from USB, feeding a series resistor to batteries. Battery voltage is monitored and charge terminated at 1.45 V/cell. A thermistor temperature monitor can be added as per eg fig 11 of datasheet.

The series resistor can instead be a current source. The low headroom (= VUSB - Vbattery) means that an opamp design would be best and you may need as much PCB area as a BQ2000T design would have taken. In practice a series resistor would work OK.

Battery flat = 3V. 100 mA required.

Rseries = (V_USB-Vabt)/Ichg = (5-3)/0.1 = 20 R.

Fully charged. (5-4.35)/0.1A = 6.5R.

Compromise R = ??? - maybe 15R.

  • Remove ALL the circuit except Q1.

    Replace L1 with a resistor OR a low dropout current source (see text).

    Supply from USB

    Monitor battery voltage with processor.

    Monitor temperature (optional).

    Timeout if charge cycle is too long.

    Q1 can be driven directly by the processor - even more easily if a P Channel MOSFET is used.

I'd personally strongly lean towards the nice IC based design, but the simple one would work OK.

Trickle Charging

For a fuller treatment of this see this stack exchange answer to - "Is it safe to uprate Ni-MH batteries to a higher rating than the vendors recommended spec?" but ...

Modern high capacity NimH cells are very much more prone to damage from ongoing trickle charging than older lower capacity cells.

There are 3 main schools of advice re trickle charging modern high capacity NimH -

  • NO trickle charging - most major battery makers.

  • Trickle charge for strictly limited periods. Most others.

  • Trickle charge at very very very low rates compared to old school rates - say at C/100 !!! A very few.

Some few manufacturers suggest trickle charging at C/10 is OK as in old version batteries. Shun such makers and do not buy their products - they demonstrate that they are churning out data sheets with no understanding of what they are doing.

For AA NimH cells, anything over about 2000 mAh can be considered "high capacity". AAA energy is usually somewhat under half AA so anything over about 900 mAh is probably "high capacity".

  • \$\begingroup\$ The simple current limiting resistor sounds nice. 6.5 ohms starts with (5-3)/6.5 = 300mA charge, which *5V=1.5W, so that does look like too much. 15 ohms starts with (5-3)/15 = 133mA, which *5V=0.66W . End charge is (5-4.35) = 43mA, a nice trickle charge :) . This means I could skip sensing the termination voltage, which eliminites my need for ADC on the µC (and a transistor), so I could get the smaller & cheaper atmega32u2. Or better safe than sorry and terminate charge based on voltage and temperature? \$\endgroup\$ Aug 11 '11 at 10:41
  • \$\begingroup\$ Trickle charging is very largely not recommended for modern high capacity cells - say 2000 mAh+ for AA and ? 900 mAh+ for AAA - see added comment at end of answer above. \$\endgroup\$
    – Russell McMahon
    Aug 11 '11 at 11:27
  • \$\begingroup\$ I actually have no idea what type of cells they are, only that they're rechargeable AAA's. I'm talking about the battery in the Ikea Spöka. The cells are wrapped so I can't see any markings on them, but judging by the cheap hand soldered through hole pcb I'm guessing they're nowhere near 900mAh. Thanks for your help, I'll go for voltage+temperature termination. \$\endgroup\$ Aug 11 '11 at 13:37

There are specific ICs for charging batteries. Take a look at, for instance, the BQ2000T from Texas Instruments. There are many others from other manufacturers.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.