# How to power an attiny from a solar panel?

I'm using an attiny microprocessor that uses around 6mA plus another 3mA for the LED. It periodically runs a servo ( Tower 9G ) that according to a few source online draws 120 - 200 mA ( for around 6 seconds ). (200 x 6)/3600 gives me .33 mAh. If I add the two together, I get a draw of 10 mAh a day. Now lets say i had a tiny battery, something like this one. that has 100 mAh. If i then add a solar panel like this that is capable of providing 45 mA in peak sun, It sould ba able to provide more than ample power to keep the battery fully charged indefinely ... are my calculations correct? or am I missing something?

You power budget looks ok. But the battery says:

"very important that you only use a LiIon/LiPoly
constant-voltage/constant-current charger to recharge"


and

"Never charge or use unattended."


The battery claims to have overvoltage protection, but it's not clear how that is achieved. It may overheat and catch fire....particulary as it says that

"the batteries we sell do not have thermistors built in"


so-- don't burn your house down.

Lithium-Ion/Lithium-Polymer batteries must be handled and used with extreme care.

They are sensitive to over-charging, over-discharging, current draw above what they are rated for, temperature, mechanical force (eg. puncture to the soft casing), trickle charging... just to name a few.

Even if they have built-in protection circuitry, it is always best to have a solid understanding of the risks and safety precautions involved.

Also, with respect to charging, there are specific profiles that must be followed. Parameters will be given by the battery manufacturer for constant current and constant voltage levels required. A compatible charge circuit is absolutely required. Unless you have in-depth experience with this, just buy a reputable one, pre-made. The site your battery is from sells them.

45mA from your solar panel fits within the charge current listed in your datasheet, but that's in ideal light conditions. You may still run into problems of insufficient current from the panel. This could result in trickle-charging your battery, which can be damaging over a long period of time. If the charger protects against this, you could still run into intermittent/short charge periods, which is not ideal.

To learn more about Lithium Ion batteries, I would recommend doing some research online. Places like Battery University have a lot of good information.

Also consider using a different battery chemistry. For example, NiMH batteries are a lot more forgiving.

Otherwise, your choice of battery capacity should be sufficient for your application.

Use a MCP73831 li-ion charge controller. It is cheap, easy to use and will protect your battery against overcharging. Just make sure that the peak voltage from panels will not exceed chip's max input voltage when the battery is full.

Panel -> MCP73831 -> battery -> MCU