# Solar Charging Circuit for Onboard NiMH Charging

Hi All,

I need some advice on my situation. I have searched for many days (weeks and months actually) and have not found anything that specifically answers my question.

I want to be able to use solar panels to keep a battery charged during the day for a project utilizing the Attiny. Because of space limitations, I am powering everything using a 4.8V NiMH, 350 mAh battery, which fits nicely in a fairly small project box. I purchased small 16-17.5 mA, 6V solar cells in the hopes that I could used them to trickle charge the battery, but unfortunately the sun only partially shines in the area where the project box is. My voltage readings are only about 3.5 V, and although I did not measure it, I assume that the 16 mA of max current from the solar cell is about half as well. One other thing I thought of after I purchased solar cells is that I really wanted for the charging to occur through the day so I had to make sure that the charging voltage would not go over 5.5 V (I think) since my components are rated at 5.5V max. I also wanted to periodically put the project box under a bright light and generate the maximum voltage charge to speed up the charging process by maintaining continuous light.

To solve this problem, I put put together the attached circuit after a bit of study.

The idea is to maintain a max of 5.4 volts on the component/battery side while also limiting the current to the battery through R2 at trickle levels (I = 350/20) after the battery gets to full charge. The ziener diode at the base of the bjt is meant to maintain around 6V even when the full light is shined on the solar cells so that the emitter side of the bjt never gets above 5.6. I realize at 7V, the ziener will probably not be able to maintain all 6v (I compute around 5.8, I can post my math if it is useful), but it should be good enough to turn on the transistor and source current to the battery at a voltage of greater than 5, less than 5.4. Of course, the mandatory shotky diode is there for when night comes along.

I purposely did not use an LM314 regulor, since I could not guarantee that the voltage at the output of the regulator would be high enough to charge the battery fully. This is because I chose to use 4 of the battery cells (for space reasons) to jack up the voltage and current to 12v, 35mA max at full light intensity (under the lamp), but I measured the typical setup to be around 7v, too low to maintain > 5 V (I think ) for charging and still use the lM314. My understanding is that the input to the regulator would have to be around 9v to get around the voltage values I require, and of course, I still have to add something to keep the clamp the voltage at below 5.5 when in full light.

I don’t consider myself an expert in these kind of circuits (my background is in digital design and software) so I would greatly appreciate any comments or suggestions for something better.

Thanks,
Jose

Instead of NuMH, use a small LiPo battery. Sparkfun has several small charge control circuits that you could add in, or borrow the design from, https://www.sparkfun.com/search/results?term=solar+charger

Thanks for your reply. Can you point me to specific circuits? Looking at Sparkfun was part of my research, but I have not found anything that seems to solve my specific problem. I was afraid using LiPo, if my circuit was not quite right, I might set the battery on fire.

Regards, Jose

Did you try the link? There are I think 4 battery chargers there. Pick one, dig into it's schematic. The charge control chip on them keeps the LiPo from overcharging. I used MAX1811 circuit to recharge 3.7V LiPo from USB in a remote control I made. Not too difficult.

Yes. Did you read my post? Which one comes close to solving my problem, in your opinion?

Jose

Regarding your original circuit, you have a strategy that allows current through to the battery when the battery voltage is lower than your zener setpoint. I’d suggest rearranging it so that you shunt current to ground when the voltage is higher than the setpoint. The advantage to that is you keep the transistor, etc. out of the current path and improve your efficiency when charging.

If you have an available analog and digital pin on the ATTiny you could also program the ATTiny to dump current when voltage gets too high. I.e. read the battery voltage and if over the programmed limit activate the transistor to dump current through a resistor, etc. That would offer a bit more control than relying on zener diodes and their imperfect nature.

I'd say the 1st one https://www.sparkfun.com/products/12084

Thanks for the post. I think those circuits are meant for the battery not connected to the load. It also doesn't allow for my need of the "overnight charging" as I posted. I will continue to study it to see if it sparks some new idea.

Regards, Jose

Hi Chagrin,

Thanks for the post. Do you mind showing me a picture? Unfortunately, I don’t have a pin available from the Attiny to be more sophisticated, though.

One thing that I should have mentioned is that the Attiny does not require full current draw all the time. This is why I think the trickle charging works, since Attiny will be sleeping most of the time (only awake 17% of the time). During Attiny sleep, the current need will be very low and thus only flow to the battery. One other thing is that when the Attiny is awake, its current need is higher than what the solar panel can provide, though (maybe 70mA max). My hope is that the battery will “help out” in providing the extra current need. Is that correct, or am I thinking about it worng?

Thanks,
Jose

Basically I'm saying you want to eliminate everything between your solar cell and your battery to keep your charge efficiency up. You could get rid of R1 and the transistor, simply leaving the zener between Vin and GND. When the solar panel charges the battery over it's upper voltage limit the zener will start conducting current to GND and keep the battery voltage within limits. A 1/2W zener should handle the current fine. And again you wouldn't need R2 because in a full sun situation the zener should be preventing excess current from reaching your battery. Just don't use too many solar cells to keep things within limits.

A TL431 (very common part) will give you more precise and adjustable regulation than a zener. It is spec'd for 100ma (150ma max) and again would be plenty for multiple panels. Plus, for future needs, if you have TL431s on hand you'll never have to worry about having the right voltage zener around.

Regarding the "LM314", assuming you meant an LM317, you'd want to avoid that part to keep your efficiency up. The LM317 has a dropout voltage around 1.5V, meaning that 1.5V times your current is lost to heat, or your battery always has to be 1.5V higher than your output voltage. An LM1117 has a lower dropout voltage (around 1V), or you can always find more modern parts like a LM2931 with just .16V dropout.

Hi Chagrin,

Thank you for your reply. I think the TL431 seems to be what I need. I looked at the datasheet for the part and I think I know how to use it, but I have just a few more more questions. How do you compute how much current the part sinks during full sun? In other words, when the panels can provide all 35mA at an expected Vo of 5.5V out of the TL431. Also, how high must vi be vs expected vo?

Thanks,
Jose

With the panels in parallel with the battery the voltages will always appear to be the same as the battery voltage. You should think of the panels as outputting a wattage rather than a voltage; for a fixed amount of sunlight the voltage will appear high when little current is being drawn or low when a lot of current is being drawn. Your panels might have an "open circuit" specification which refers to the maximum voltage they will output when no current is being drawn.

For a single NiMH cell, 1.3V is the 90% charged voltage, so you'd configure the TL431 to conduct right around (4 * 1.3V =) 5.2V. If the batteries are not fully charged then they should absorb all of the current from the solar panels (minus whatever your Arduino is using). If your batteries are fully charged and you're in full sunlight then the TL431 is going to be conducting the full rated current of the panels.

Batteries can typically fully absorb a current equal to 1/10th their capacity without any problem. Your cells are 350mah and your panels are 35ma so it's a perfect combination.

Thanks. In the case of a fully charged battery, does this mean that the available current to the components are aggregated? In other words, if the current requirement is more than the panels can provide and the battery is fully charged, does the battery make up the slack?

Also, do I have to worry about maintaining the input to the tl431 voltage at some minimum given that I want to gave the output me at less than 5.4?

Thanks, Jose

Hi All,

For anyone else that comes across this… I took Chagrin’s advice and used the configurable ziener. Fry’s electronics sells NTE parts so the equivalent of the TL431 is the NTE999. Enclosed is my circuit. I used 4 of my 6V/16mA solar cells, 2 of them in parallel and then connected two of the “2 pack” in series to yield a max of 12V/32-35 mA. Shining an indoor 60W fluorescent light on the arrangement I measured around 12mA at around 9V. Comparing this to the brutal sun we get in Austin, Texas, I think this should be enough. The arrangement of resistors yields around 5.45 volts. I chose 5.45 instead of 5.2 since it was still at acceptable trickle charging levels and within the 5.5v maximum voltage for the componets.

The Attiny connected to this is asleep most of the time waiting on a PCInt on D0 to wake up with all other internal components (ADC,WDT, Timer0, Timer1, etc.) turned off until it wakes up, at which point I have to turn on Timer 0, and the WDT, and it is a wake for about 1 minute. The “waker” is a PIR sensor that should sink a small amount of current (1mA), but I am yet to test this out.

I felt the LiPO controller suggestion was to much money, and given that my contraption will be outside, I was afraid of the LiPO catching on fire from potentially designing my own cheaper version of the charger incorrectly and the heat of the day. And, of course, you can’t beat how easy trickle charging is over anything else.

Thanks for all the help,
Jose

Good to see you got everything working :)