Arduino Gemma not charging Li-Poly battery

I’ve just posted this on the Adafruit forum, but it deserves to be here as well:

I purchased the Gemma (v2) recently and have gotten it to work (though not without some difficulty with drivers). I have a Li-Poly battery hooked up, but it doesn’t seem to be charging. I’ve reviewed the schematic (see http://www.arduino.cc/en/uploads/Main/arduino-gemma-schematic.pdf), and the only path for charging the battery seems to be through the series circuit including USB port, forward-biased D2, and reverse-biased D3. Therefore the charging current is primarily limited by the reverse leakage current of D3 (Schottky diode), which at the typical operating voltages present is likely only in the micro-ampere range. Such a low current would take many 1000’s of hours to recharge even a very small Li-Poly battery.

The description of the Gemma on Arduino’s site http://www.arduino.cc/en/Main/ArduinoGemma states that the device will charge the battery when the power switch is in the OFF (CHG) position, but perhaps this is for a previous version of the Gemma? There is also mention of an LED to indicate charging status, but this is not evident in the product photos or in the schematic. What are the suggested work-arounds?

The battery I'm using is a "PKCELL LP402025" - a 3.7V 150mAh single cell Li-polymer battery with integrated PCM (charging controller). Because of the integrated PCM, I'm seriously considering adding an 82 ohm resistor on the Gemma v2 between Vbat and Vbus. With USB voltage of 5V this should give a maximum charging current of around 25mA, dropping to 10mA at full charge (after which the integrated PCM 'should' cut off charging current). This should be adequate for an overnight charge. If I do this, I will test the circuit with battery in a safe, fireproof container.

Any concerns about this approach? I haven't looked at the chips used in the PCM, so I may change my approach pending more information gleaned from the battery.

That board - the one shown in that schematic - does not have a way to charge the battery, nor does the switch have a "charging position". The "off" position just disconnects things - as you've correctly noted, the schottky diode prevents charging.

Charging it with a resistor will work great as long as the battery isn't fully charged. Once it is fully charged, it will become overcharged, resulting in heat, lost capacity, and potentially catastrophic failure ("vent with flame" as they say in the biz). So that's not a good route!

The crudest way is with a 4.2v zener across the battery to clamp the voltage at 4.2, but this is far from optimal, and leaving batteries connected to it like this will accelerate aging and capacity loss. It is much better to use a part designed for this purpose, like the MAX1551 or any of countless other single cell LiPo charger ICs.

I also notice that there is no "CHG" position marked on the switch...

I suspect the documentation you're looking at is for a different board, or different version of the board? Or maybe the Arduino description is totally wrong?

The battery’s PCM is using a chip that appears to be very similar to the bq297x family of Li-poly charge controllers. There’s also a dual-MOSFET device that appears to be connected as a charge cut-off switch, so I’m proceeding with testing. I’ve added the resistor as mentioned above, and will let the battery charge for about 10 hours - disconnecting at bedtime to guard against burning my house down as I sleep.

Right now charging current is around 20mA and the battery is at 3.2V, so these values are in line with the calculations. The battery isn’t warm (nor should it be), and I’ll see what happens as charging progresses.

After 10 hours charge, battery voltage went from 2.88V to 4.23V, and current to battery was ~ 5uA (so PCM did shut off charging current). Battery was not deformed or warm, so there's no obvious evidence of overheating.

I'm going to let my circuit run until battery discharges to 3V, to get an idea of battery capacity. The circuit (just the Gemma and a strip of 8 multiplexed LEDs) draws around 20mA, so I'm hoping for at least 6 hours of run time. I will post results.

If I get really ambitious, I'll use an Arduino Uno and thermistor to monitor and chart temperature (and battery current and voltage) during charging, allowing me to optimize the resistor value for shorter-term charging.

Got over 10 hours of run time, so I'll stick with the 82ohm resistor modification for now.

I know I'm voiding any warranty on the Gemma (and the battery), but that's a calculated risk I'm willing to take. I don't recommend ANY modifications for anyone not willing to assume the risks, including the potential risk of FIRE due to battery failure.

The Gemma has no charging circuit. The docs are WRONG.