# How do i build a battery charge circuit that doesnt require the battery to be disconnected

I am needing some advise on how to build a circuit that can charge a 9v rechargable whilst it is still connected to my small robot. The battery will power an arduino, meastro, 4 std servos and 2 dc motors.

Input to the battery should have something basic that will convert ac to dc just in case.

Secondary to direct dc / ac input, i require another input source but that acts as a harvester. It will take power from solar panels and a piezoelectric source ( so again an a/c to d/c converter could be needed ). Maybe this could put the power into a capacitor of some kind, and when it reaches a required amount, release the power to the battery.

• You can use AXP209 or any chip from the familly. Commented Jan 4, 2015 at 11:08
• ah ok thank you. how would i use this chip, i havent looked into it yet so im guessing there will be a lot of info about it Commented Jan 4, 2015 at 11:24
• @r.zurawski: The device seems to be aimed at a single Li-Ion cell, what would make it a good choice for a 9V battery? Commented Jan 4, 2015 at 11:27
• What kind of 9V battery do you have in mind? If you mean a rechargeable PP3 battery that's likely to be a poor choice. Commented Jan 4, 2015 at 11:28
• It will be a collection of Nimh AA batteries linked together. Voltage would be about 8.4v not 9v. My mistake Commented Jan 4, 2015 at 11:49

You can connect multiple charging sources to the battery using isolating diodes, which prevent current from back-feeding into lower voltage sources. Then you just need to make sure that the combined charging current does not exceed the the battery's rating.

For the mains charger a simple DC power supply and series resistor will do the job. A 7 cell "8.4V" NiMH battery charges up to about 10.5V at the 10 hour rate (200mA for a 2000mAh battery) so you will need at least 12V to maintain a reasonably constant charging current through the resistor and diode.

This circuit shows how it could all be connected:-

simulate this circuit – Schematic created using CircuitLab

Note: most AA NiMH cells are only good for about 2~3A max. 4 servos alone could draw up to 2A, and the motors may draw a lot more. If you must use AA cells then I recommend Sanyo Eneloops. They have a higher discharge current rating than most high capacity NiMH cells, and hold their charge for much longer.

• This is great, but how about, if im using say 6v instead, and is there a way i can use something, maybe an attiny to monitor when the battery pack is fully charged? Commented Jan 10, 2015 at 12:26
• 6V what - charger, battery? My circuit is generic. Each source just has to provide sufficient voltage and current to charge the battery. It's hard to tell exactly when an NiMH battery is fully charged. Measuring the voltage gives you some idea, but current must also be taken into account. Commented Jan 10, 2015 at 20:17

Bit crude, but simple solution is using a 120VAC to 12VDC power supply. Most have an adjust, so you can take them bit lower, and then you can drop the rest of the voltage by putting diodes in series. The goal is to have the power supply produce exactly the voltage of the charged battery pack. When the batteries reach the supply voltage, the charging stops, and there is no danger of overcharging. The drawback is that it takes the batteries long time to get fully charged, as the current diminishes. This approach is good for mixing power sources, as the output goes through a diode. One thing to watch for when mixing power sources through diodes is still look for the commons. Make sure if they are connected that they don't have a different potentials.