# Calculate the charging time of a battery with a solar cell while the battery is being used.

I'm working on GPS tracking device and I need to know how to calculate how long it would take for it to run out of power.

The unit is using drawing an average current of 5mA from a Lithium 3.7 V 1200mAh battery. If I'm not wrong, 1200mAh/5mA= 240h

Then if I add a solar cell of 5.5v 120ma 0.66w to charge the battery while the GPS is still drawing 5mA of current. how long would it take to charge the battery and in how long will the unit run out of charge using the battery and the solar cell?

In ideal conditions, (3.7v*1200mAh)/0.66W= 4.44Wh/0.66W= 6.72 hours to charge the battery. but this is just in ideal conditions and not taking into account that the battery is still drawing 5mA to the GPS.

In principle, your ideal case math is correct, however in practice there are a few things to consider.

• First off, don't expect the solar cell to deliver its nominal current at all time, but depending on the conditions it can deliver anything from 0 to 100% of that (don't exceed 100%).

• Secondly, lithium-based batteries are indeed nominally 3.7 V, but their actual voltage ranges between 3 V and 4.2/4.5 V depending on whether you want to get more juice (wider voltage range) or preserve them (narrower range).

• When charging, the voltage is typically higher than when discharging for a given charge level, so assume something like 4 V during the whole charge. Add a drop for the charging circuit, which may be as low as a (schottky) diode drop. I think you can get in the ballpark using the current delivered by the panel as the current entering the device.

Subtract 5mA X 3.7 = 0.019 W from 0.66W for ideal conditions. For real conditions, you need to subtract losses in the voltage conversion and charge control devices. While charging, the solar cell is supplying the 5mA. Current flows either in or out of the battery, not both directions at the same time.

Battery capacity:

1200mAh/5mA= 240h

So, the battery, if fully charged, could support the system for 10 days without beeing recharged.

The solar cell produces 5.5v, 120mA.

Even if the 1.8 volts extra voltage get entirely lost when reducing voltage in order to charge the 3.7V battery, and in spite of the continuous drain from the GPS, you would still get 115mA to recharge the battery, with the solar cell at its peak power.

With only one hour of full sunlight each day, you run your GPS, and also send the extra 115mAh to recharge the battery. These 115mA are exactly what you need to supply 5mA to the GPS in the other 23 hours of day (23h x 5mA = 115mA).

The correct calculation should be:

0.005A x 3.7v = 0.0185 W power consumption of GPS device
0.12 A x 5.5v = 0.66 W theoretical maximum power of solar cell
0.66 - 0.0185 = 0.6415 W hourly power available to recharge the battery 3.7v*1.2Ah/0.6415 = 6.92 hours of high power direct sunlight to fully charge

Even if you start with a empty battery, the solar cell outperforms the device in a ratio of 35:1, so, there's a lot of energy to keep charging the cell, and the cell gets energy enough to keep the GPS working until the next sunlight time, when the charging starts again. This configuration seems very stable, IMHO.

So, even with many unavoidable power losses in conversion and heating and etc. and even with sub-optimal sunlight (but remember that the battery can cope with 10 days without sun), it seems to me that the system that you described would run until the end of battery's lifetime.