How to design a solar-powered power supply with battery back-up for microcontrollers

solar panel photovoltaic battery charger | 2020-07-03, 02:07:00

The power consuption of a microcontroller usually stands in the range of a few tenths of milliamperes, which allows the use of small solar panels and batteries to power them.

Sunlight generates heat. Generating energy will generate heat. Regulating energy requires wasting some of it as heat.

Solar panels

The electrons inside the solar cells get energized and they're going to spend this energy generating current and potential together with their hole pairs, and/or dissipate it as heat. The conversion efficiency is low, 10-20% for the cheapest panels. Solar panels do not behave consistently across dynamic loads, different sunlight intensities or temperature, so the power generated varies with sunlight, the incident angle over the panel, panel's age, temperature and the load on it.

When choosing a panel, always check the open-circuit voltage and the short-circuit amperage in order to establish the circuit's parameters. Measure both of them at peak sun-hours, preferably during the middle of your local summer somewhere around 12:00 (PM).

-the open-circuit voltage shall not vary significantly after connecting the panel to the board;

-the short-circuit amperage shall vary significantly depending on the load.

-solder your panel terminals to the board's cables only after checking the current drawn by the circuit.

Try to find a way to increase the current drawn up until you get a significant voltage drop. By this method you should have found the Maximum Power Point, that is, the maximum voltage and maximum current the panel can supply (let's say, 15th July with clear skies at 12:00 with the average panel inclination of 45 degress).

Knowing the panel's MPP, you're left to determine:

-an average power consumption well under the maximum current;

-a regulator that can handle the input voltage;

-a suitable battery;

-whether this circuit is to run 365 days a year.

Choosing a panel and choosing a regulator

Remember volts are lost as heat. Let's pick this panel. We are told it's an 11x6 cm panel that can output 5V /1W, that is, 200mA current. But that's the average they've measured.

I have four of these and my average during summer is 6.5 volts and ~235mA, about 1.5 watts. This means I have to ensure that my input regulator can handle a peak of 6.5 volts and 250mA.

The most common solar charger IC for small power supplies is Analog's LTC4056, and all its clones, which are significantly cheaper, come in other types of packaging and do not require some external components such as mosfets or transistors.

My personal choice is the CL4056, rated for a maximum input of 8 volts, 150ºC maximum temperature, 1A max charging current and it generates 75ºC/W. This parameter is very important since, while assuming an ambient temperature of 45ºC (113 F) during a heat wave, this chip will have to handle 45+75ºC of heat for the worst case scenario, which is a very dangerous operating temperature, where the chip will transfer a significant quantity of heat to the solder joints and the board itself.

The panel itself is going to get very hot under the sunlight, even doubling the ambient temperature. This heat will spread evenly on the panel, on the surface it rests on, through the cables, in the air and wherever it can go through. Having a panel this hot means you have a lot of free electrons, which means increased current but the potential drops, lowering the voltage. Imagine the panel as a diode whose terminals are connected to the diode's ends. Being hot, the forward voltage drops, leaving us with a smaller potential difference between + and -.

The solar panel shall dictate how much energy can be spent. The charger IC shall regulate the flow of energy and the battery will affect the charging and discharging speed, and limit the microcontroller circuit.

The average work under load I've determined for one of those panels is 5.5 volts and 9x mA, about 1/2 watts-hour.

The charging IC

First, we analyze the 4056's schematic requirements:

We'll have to route a zero-something ohm resistor (warning: do not omit this resistor), necessary as a current limit, two 10uF capacitors, two leds and three resistors: two to limit the leds' current (pick any between 300 and 4.7kohm) and one to limit the battery's charging current.

The NTC protection can't be properly implemented since the recommended values for li-ion are below the ambient temperature in hot summer and it would be useless, we're going to assume a reduced lifetime because of the heat anyway.

Knowing our panel supplies about half a watt, we could limit the charging current to ~100mA with a 10k resistor on pin 2. For testing, we could add an usb connector and charge it from a 500mA/5V adapter, with a rather larger current, let's say 700mA for the battery, that is, a 1.5k resistor. The battery should be in constant current mode up until 4V. Even if it can't reach 4V at 700mA, it would charge with whatever current available.

The battery

I suggest a 18650 battery. They're big, safe, cheap and widely-available. You can 3d print the holder.

Suppose we have a 1300 mAh battery. This means it would fully charge in 10 hours and it would discharge in 10 hours if the microcontroller circuit is discharging it at a rate of 130mAh. In practice, this would probably never happen and the battery will barely need some periodic recharging during the summer. It can't fully discharge since the step-down regulator will only work if Vin>Vout.

The DC-DC converter

The microcontroller can't run properly from the battery's voltage, we need a fixed stable voltage source. Our microcontroller circuit might run on 3.3V or either 5V.

I'm going to do the circuit with a SY8083P and a FP6276 in order to have both rails. You can download my personal library for the footprints, Eagle v8+.

Pcb constraints

You should know your board supplier capabilities or your own home laboratory capabilities. If we're going to do our boards at Jlcpcb, the limit would be set at 10x10 cm and two layers.

The circuit

My routed board looks like this:

I have physical switches, holes for the panel, mounting holes, jumpers to stack boards on top of each other, a 5V input USB connector, a 5V USB output connector, holes for the battery's cables, separated 3V and 5V power paths and my personal choice to place things on a horizontal line. I tried to leave as much free area as possible, so the heat can spread evenly and keep the board cool. The bottom layer barely has components but the extra copper from the ground pour shall be useful to dissipate.

It was my guilty pleasure to have text on the board and it looks great. The font is 'vector', size 1.27, ratio 8% and distance 20%.

Remember the SY8083P has some tolerance with the output voltage. This time I've used 549k and 124k for setting the output voltage.

It looks like this, swinging from 3.4 till 3.5V, up until you add a load and then:

It works!

The stacked board used to look a lot better.

I'll write about it and the FP6276 in two follow-up posts.

 

You can have a look at the board file from my github.


Leave Comment