Solar cells have gotten cheaper and cheaper, and are becoming an economically viable source of renewable energy in many parts of the world. Capturing the optimal amount of energy from a solar panel is a tricky business, however. First there are a raft of physical prerequisites to operating efficiently: the panel needs to be kept clean so the sun can reach the cells, the panel needs to point at the sun, and it’s best if they’re kept from getting too hot.
Along with these physical demands, solar panels are electrically finicky as well. In particular, the amount of power they produce is strongly dependent on the electrical load that they’re presented, and this optimal load varies depending on how much illumination the panel receives. Maximum power-point trackers (MPPT) ideally keep the panel electrically in the zone even as little fluffy clouds roam the skies or the sun sinks in the west. Using MPPT can pull 20-30% more power out of a given cell, and the techniques are eminently hacker-friendly. If you’ve never played around with solar panels before, you should. Read on to see how!
Let’s start at the ends. The specs for any cell will include an open-circuit voltage and a short-circuit current that it produces under a given illumination. If you don’t have the spec sheet, you can measure these yourself. Connecting a voltmeter to the cell and putting it in the sun measures the former, and swapping out an ammeter and measuring the current measures the latter. So far, so good. But neither of these configurations produces any power, and power delivered over time is what charges up your batteries.
Power equals voltage times current,
P=IV. The open-circuit power is zero because no current is flowing, and the short-circuit power is zero because there’s no voltage difference across the terminals (ideally). Somewhere between these extremes of infinite resistance and zero resistance lies the maximum power point.
Finding it by yourself is as easy as attaching a variable load resistor to the solar panel and noting down the voltage across and current through the resistor at various resistances. Write
V down as you vary the load resistance and pick the highest value. Done! (Yellow is the current vs. voltage curve, and green is the power.)
If you’re doing this by hand, the first thing to mention is the power handling capacity of the resistor that you’re using to measure the current. A big twenty-watt panel is going to literally burn through a standard 1/4 watt resistor faster than you can say “what’s that smell?”. [Julian Ilett], in his lengthy YouTube video series on creating an Arduino-powered MPPT battery charger, uses a large array of miniature bulbs (LAMB) that he can screw into their sockets to vary the load. We’ve also seen various controllable dummy-load projects ranging from small to very large. That’s ideal, but it’s a project in itself.
For a quick lash-up that will work for small-to-medium cells, you could do worse than a potentiometer manually controlling the current through a heatsinked power MOSFET. This circuit doesn’t offer precise control of the current, but you don’t need it either, and heck, it only requires two parts and is good for a few watts. It won’t work below the gate threshold of the FET, which was around 3.5 V, so it’s only good for bigger panels or bright sun.
Stay in the Zone
Once you have a good idea about how your panel runs under various loads, you can start designing a system to optimize this for you, and switch out the dummy load for something useful like a battery. An MPPT automates the above current and voltage measurements and includes a voltage converter to keep the solar panel running at its maximum power rating. If we’re interested in charging batteries at a lower voltage than the cell’s maximum power voltage, this converter can be as simple as a buck converter: a fast switch, a large inductor, and a freewheeling diode (or second switch).
We usually think of a buck converter as taking an unknown input voltage and stepping it down to a fixed lower output voltage by varying a PWM duty cycle. Here, the PWM is set to maintain the desired voltage on the input from the solar panel so that it’s operating at peak power. Whatever charge passes from the panel into the inductor eventually makes its way downstream to the battery, minus switching and resistive losses in the inductor.
TI has an app note (PDF) that describes possible control strategies in overview. These can be as simple as operating the panel at 80% of it’s open-circuit voltage, or as complicated as sweeping the full range and picking the maximum directly. Just be aware that any adaptive strategy has to take into account that external lighting conditions can be changing continuously as the controller is trying to find the peak.
In particular, if you choose what TI calls a “perturb and observe” strategy — varying the panel voltage a little bit and observing whether more or less power results — changes in the light hitting the panel can make a perturbation look like it improves the panel’s efficiency when really it was just a cloud fading away. Indeed, in [Julian]’s video on automating the power controller you can see it falling into this trap, and we suspect it’s because his algorithm reacts too frequently. A slower feedback loop would be better in our opinion: you don’t mind losing a tiny bit of total power by failing to account for every crow that flies over the panel, but still you do want to drop the buck ratio when it becomes cloudy over a few minutes. There’s tons of room here for experimentation.
With Great Power…
Nature controls the inputs, and your MPPT controls the solar panel’s working voltage to maximize power. The downstream voltage and current are left to fluctuate. If you’re doing something forgiving like charging a lead-acid battery, you can pretty much just dump straight into the battery, taking care to shut off the solar panel when the battery is fully charged. Other than possible overcharge, which you could guard against by reading the battery voltage, a car battery will soak up whatever current you hand it.
If you’re charging up a battery with more sensitive chemistry, you may need further voltage or current limiting. We’re currently experimenting around with cheap eBay 5 V lithium-ion chargers and old laptop batteries. [Rusdy] has more real-world data on his e-bike charging setup, but there he’s using a step-up converter to charge higher-voltage battery packs.
A panel-to-battery MPPT and charge controller that makes charging lithium-ion batteries simple and efficient is obviously a great thing to have. We’ve had a number of MPPT charger projects on Hackaday.io and they’ve even done well in the Hackaday Prize. There are many open designs out there for you to draw inspiration from, or just copy.
An MPPT is a great intermediate project in power electronics — you’ll learn something about current measurement and get to build your own boost or buck converters. There’s lots of room for data logging and optimization of control algorithms in firmware if that’s your thing. You can start with a small panel and parts from your junk box, or modify eBay parts. And in the end, you get your batteries charged “for free”. How cool is that?
Are you working on an MPPT project right now? If so, let us know!