In IoT 101: Power Supplies, Part 1 we covered batteries as power sources, IoT devices as loads, and regulator circuits in-between. Today, we return to that design pattern and discuss line power and solar panels as sources, our batteries and devices as loads, and regulator circuits between them.
Straight to the source
Let’s start with the basics: if there’s a power plug near your IoT node, forget the batteries and just plug it in using an external charger and a USB cable. The USB specification now includes a Dedicated Charging Port capable of delivering 2 A @ 5 V or more. That’s plenty for our IoT node. If your node draws more than 100-500mA, be sure to warn your users they can’t just plug that USB cable into any computer; it won’t damage their computer, but depending on the module you are using and the specific application, the current their computer provides might not power your IoT node reliably.
To tell the charging port we just want power, with no data required, we can short the two data pins together. We’ll also add a surge capacitor (sometimes called a decoupling capacitor) so sudden demands for power aren’t pulled all the way through the power cord.
When the lights go out
If we want our IoT device to continue to operate even when power goes out, we can add two Lithium-Ion cells, as discussed in Part 1 of this tutorial. Here are possible states for our IoT node:
- Normal operation when we’ll run off the wall charger.
- Battery operation when we’ll run off batteries.
- Recovery operation when we’ll run off the wall charger and re-charge the batteries.
We’ve already covered the first two states, so let’s talk about charging batteries. To charge a Li-Ion battery, you start with a constant current supply until the voltage of the battery rises to a level that lets you know it’s charged to about 85% of capacity. Then you maintain a constant voltage until the current drops to about 10% of maximum, indicating full charge.
There are plenty of integrated circuits on the market that handle the charging protocol for Li-Ion batteries; the trick is to source one that accepts the 5V supply from our USB wall charger. The LT1512 from Linear Technology does the trick for less than four dollars in hundreds (a single unit is less than seven dollars). This will allow us to charge two Li-Ion cells from our 5V source by implementing a circuit that allows the input voltage to be greater than, less than, or equal to the output voltage. I mentioned in Part 1 of this tutorial that such a circuit was more complicated than I wanted to go into; it still is! If you want details, check out this article on single-ended primary-inductor converters. For details on implementing the circuit with the LT1512, check out the data sheet.
We’re still going to need to regulate the battery voltage. When batteries were the sole source of power, it was worth the expense of a high-efficiency buck regulator. But with line power available, it is no longer worth the expense, so we’ll go with a simple linear regulator. The final circuit looks something like this:
Seeing the light
Finally, let’s replace that USB wall charger with a solar panel for our weather station. How large a solar panel do we need? That depends on our location.
“Very bright” sun delivers about 1 KW / m2 to the earth’s surface. A good solar panel converts 15 – 20% of the solar energy into electricity, or 150 W / m2 of power during peak sunshine. To match the current available from our USB charger, we’ll need a 5 V solar array with about 10 W of power, requiring about 0.066 m2. That’s a panel about 250 mm square.
To maximize the available power, design your input circuit to operate near the Peak Power Voltage (Vpp) of your solar panel. Large solar arrays include a Maximum Power Point Transfer circuit that adjusts to changes in Vpp due to variation in temperature and solar intensity. Don’t worry about that for your IoT node; just select a static voltage at Vpp listed on the spec sheet of your solar panel.
So we’ll have plenty of power when the light’s shining, but do we have enough power for all day and all night? That depends on how much sun you get. In my home state of Arizona, we get about 6.5 “sun hours” per day, the equivalent of 6.5 hours of 1 KW / m2 power. A panel rated at 10 W would produce on average 65 W-H of energy per day. If you live in the U.S., check the U.S. Department of Energy map of sun-hours for solar potential in your region; otherwise search for equivalent maps for your region.
Tailoring your design
What we just designed for this situation is overkill, of course; 65 W-H is about the same energy available from 20 CR123A batteries! To scale it down, I’d specify a battery array equivalent to twice the energy my IoT node consumes per day (rechargeable batteries last the longest if you don’t discharge them fully each cycle). Then I’d also spec a solar panel with three times daily consumption to provide enough headroom to recharge the batteries in one day of steady sunshine.
As you can see, when it comes to powering IoT devices, there are plenty of options available to you. While there is no single “right answer” for what type of power source you use, with proper planning you will be able to keep your project up and running so you can focus on the intended use—such as collecting measurements from a weather station—rather than worry about whether it is time to replace the batteries!
About the author: Kevin Sharp has been an engineer since long before he got his engineering degree, and has extensive experience in data acquisition and control networks in industrial, retail, and supply chain environments. He’s currently a freelance writer based in Tucson, Arizona.