Self sufficient (solar powered) pyboard?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
vext01
Posts: 9
Joined: Mon Apr 20, 2015 10:11 pm

Self sufficient (solar powered) pyboard?

Post by vext01 » Tue Apr 21, 2015 10:51 am

Hi,

Has anyone had any success solar powering their pyboard?

I would like to do this. I think I can use a timed low-power sleep (http://forum.micropython.org/viewtopic.php?f=2&t=656) in combination with underclocking (pyb.freq) to bring power consumption to a minimum. I would need a battery to keep the board alive over night, and obviously a solar panel to charge the battery.

Any recommendations on cost effective solar panel/battery combos? Easier is better :)

Thanks

moose
Posts: 9
Joined: Fri Apr 17, 2015 4:22 pm
Location: Anchorage, Alaska
Contact:

Re: Self sufficient (solar powered) pyboard?

Post by moose » Tue Apr 21, 2015 7:30 pm

The Adafruit people have thought about this quite a bit, and here is the solar charger product they came up with: https://www.adafruit.com/products/390. They also sell LiPo batteries and 6V Solar panels that match the charger.

If I knew your location, orientation of the panel, and an idea of what your average pyboard current draw will be (active current draw * percent of time active + sleep current draw * percent of time sleeping), I could help a bit with sizing the solar panel and battery.

vext01
Posts: 9
Joined: Mon Apr 20, 2015 10:11 pm

Re: Self sufficient (solar powered) pyboard?

Post by vext01 » Wed Apr 22, 2015 11:14 pm

Hey,

Thanks for the adafruit link. Will look into that.

I'm in the UK. Orientation, not really sure what you mean. I was just going to point it up :P (I've never used a solar panel, is it obvious?).

I will wake the system every 5/10/15 minutes and relay results via to a socket on a remote machine. When the system is inactive I will put the hardware into a low power mode.

I plan to underclock the pyboard as low as I can while the UARTs still work.According to Damien's kickstarter update (https://www.kickstarter.com/projects/21 ... sts/685745), at 42MHz the board draws around 16ma
when blinking an LED. Hopefully I can clock down lower, to say 8MHz.

I'm also going to use a few analog sensors and an ESP8266 wifi chip (hence the need for UART) (http://www.espruino.com/ESP8266). Looks like this uses very little power, although I'm not sure how much control I have over the power modes. I don't see any AT commands to set power, but worst case I can hold the CHIP_PD pin off to switch off the chip (would rather not, as the chip would probably need a new DHCP lease each time I turn it back on). I think to have real control over sleep modes you have to flash custom code:
https://nurdspace.nl/ESP8266#Power

Cheers

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Self sufficient (solar powered) pyboard?

Post by kfricke » Thu Apr 23, 2015 9:17 am

I think this power solar power-supply and lipo-charger module should be of particular interest:
http://www.seeedstudio.com/wiki/Lipo_Rider_V1.0

Sold from germany:
http://www.exp-tech.de/seeed-studio-lip ... er-booster

Regarding the ESP8266... which firmware version do you use? I have not yet had the time to check the recent versions (from the Espressif forum). But the older versions had severe problems in the AT-command firmware. imho the pre 1.0 firmware versions made the use really hard and a stable implementation near impossible. At least their bug-hunting bounty program sees to have kicked in!

moose
Posts: 9
Joined: Fri Apr 17, 2015 4:22 pm
Location: Anchorage, Alaska
Contact:

Re: Self sufficient (solar powered) pyboard?

Post by moose » Thu Apr 23, 2015 9:07 pm

One issue with the SEEED Studio board is efficiency in this particular application. The board charges the LiPo battery, but then boosts the battery voltage up to 5V before delivering to the load. If 1 Amp-hour goes into the battery from the solar panel, with the voltage boost, at most 3.9 V / 5 V = 0.78 Amp-hour can be delivered to the load. Because the boost converter is probably only about 85% efficient, really only 0.78 * 0.85 = 0.66 amp-hours will be delivered to the load.

Because the Adafruit charger supplies the load directly from the LiPo battery, 1 Amp-hour of charge from the panel goes into batttery, and the full 1 Amp-hour is available to serve the load (ignoring small Coloumbic efficiency losses in the battery). Luckily, the pyboard can accept most of the charge from a LiPo battery before the voltage falls too low (3.6 V).

So with the SEEED charger, the PV panel will need to be about 1.0 / 0.66 = 1.5 times larger than one that will work with the Adafruit charger.

I've done some modeling of the panel size and battery size needed for the pyboard in London. I'll write that up in a different message.

moose
Posts: 9
Joined: Fri Apr 17, 2015 4:22 pm
Location: Anchorage, Alaska
Contact:

Re: Self sufficient (solar powered) pyboard?

Post by moose » Fri Apr 24, 2015 3:01 am

I did some modeling of storage and PV requirements for a pyboard drawing a particular amount of average current. It sounds like you're not certain what that average current draw is, so I expressed results in a way that can be applied to any level of average current draw. The needed PV and storage are linear with the current draw--if you double the load, you'll double the needed PV/storage combination.

Our US Renewable Energy Lab has a simple yet respected tool for modeling PV systems called PVWatts. It turns out, they have solar data for London, so that is what I used. The tool is meant to model home-scale grid-tied PV systems, not tiny panels connected to a Pyboard. But, the tool does let you export hourly solar output for any orientation. I exported that hourly data for both a horizontal panel and a vertical panel facing south in London England. I used the hourly data in an iPython notebook model that determines how well a particular combination of PV and storage serves a load. I used that model to develop the following plot, which hopefully can help you size your mini solar system.

Image

The horizontal axis indicates how much battery storage you have. It is expressed in terms of days of storage; if you have 2 days of storage, that means your battery could supply the Pyboard load for 2 days without any solar recharge. The vertical axis is the size of the solar panel you will need to ensure that the system works for every hour of the year; i.e., the battery never discharges fully. The units of the vertical axis are the PV panel maximum Amps divided by the Load Amps. So, if the graph value is 50, and your load is 12 mA, you need a panel with a peak rating of 12 mA * 50 = 600 mA.

If you have a small battery, say enough to make it through one day, you need a big panel because you have to size the panel for the absolute worst day of the year--a rainy December day. If you have a lot of storage, you can ride those really bad days out with solar stored up from prior better days. The graph shows that there are large benefit to storage up to about 6-8 days of storage; diminishing returns occur after that level.

Here is an example. You will probably get your average load very low by sleeping at very low current for a large percentage of your operating time. But, I'll do an example at a much higher average current, say 10 mA. Say you decide on 6 days of storage. That means that you need 10 mA * 24 hrs/day * 6 days = 1,440 mAh of useable storage (temperature and the 3.6 V Pyboard limit will affect the useable storage of a LiPo battery). It just happens that the needed panel size is the same for horizontal or vertical orientation at that level of storage. You need about 48 times your load current in PV panel, so you need a panel with rating in peak sunlight of 10 mA * 48 = 480 mA. There is no safety margin built into this. PVWatts builds in 3% loss due to shading, but particularly if your panel is vertical, it's very easy to get shaded in the winter when sun angles are low. A horizontal panel during the critical winter period is getting most of its solar as diffuse radiation from the entire sky, so shading issues are not as critical. Adafruit has a 530 mA panel and a 930 mA panel. If your panel is horizontal AND you dont' think it will get covered with snow or a leaf, *maybe* the 530 mA would work. Unless the view to the south were wide open, I'd go with the 930 mA panel for a vertical panel, but at least you don't have to worry about snow (I'm in Alaska; we worry about snow!).

I should note that my calculation model assumes an Adafruit type control board where 1 mAh from the panel puts 1 mAh into the battery and 1 mAh delivered to the load. These calcs don't apply to MPPT chargers or solar charger boards like the SEEED that convert the battery voltage to a higher load voltage.

The other issue is how large of a LiPo battery do you need to provide 1,440 mAh of effective storage. At room temperature and the very low discharge rate imposed by the Pyboard load, you can get 90% of the rated mAh out of the battery before it's voltage drops down to 3.6 V, the Pyboard limit. But, I suspect all your equipment is outside. From my quick Googling, it looks like you only get about 40% of the rated battery capacity at 0 deg C if your usable cutoff voltage is 3.6 V. So, that means that if you need 1,440 mAh of effective storage, you need to use a battery rated at 2.5 x that value, or 1440 mAh * 2.5 = 3,600 mAh. Adafruit sells 4,400 mAh and a 6,600 mAh units. 18650 cells have 2,500 - 3,400 mAh depending on model, so one or two in parallel would suffice and be relatively inexpensive.

There are logical explanations for why the Vertical orientation and Horizontal Orientatiin lines cross on the graph, but I fear I've carried on too long already. I'm quite interested in the topic, so if you have any questions please ask.

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: Self sufficient (solar powered) pyboard?

Post by blmorris » Fri Apr 24, 2015 3:11 am

For the project you are describing - wifi access with power consumption low enough to run on a small solar cell - you may be interested in the WiPy project which just met its KickStarter funding goal. Of course it isn't available yet and won't be for a few months, but it is (will be…) the perfect fit for what you are trying to do - a single chip solution integrating wifi, running MicroPython, and the chip supports very low-power operating modes even while maintaining a wifi connection. The WiPy developers are active contributors to MicroPython, so this recommendation isn't intended to detract from MicroPython in any way ;)
Of course, there is no reason to wait to start developing your project with what you have even if you eventually decide to use the WiPy.
Good luck!
Bryan
@moose - your last post came up as I was composing this - good stuff, I need to read it more closely.

moose
Posts: 9
Joined: Fri Apr 17, 2015 4:22 pm
Location: Anchorage, Alaska
Contact:

Re: Self sufficient (solar powered) pyboard?

Post by moose » Fri Apr 24, 2015 4:51 am

Yes, those are some nice power number on the WiPy. I'm a backer, but I hadn't looked closely at the power consumption.

Just as a start at estimating average current draw across a 15 minute cycle of reading sensors, posting data across WiFi and then sleeping. It seems like there are two choices: 1) keep the WiFi active while sleeping (850 uA) so that you don't have to spend the time (power) reconnecting, or 2) disconnect and go into the Hibernate mode (5 uA), but incur the penalty of needing to reconnect each cycle, which will take awhile. Taking wild guesses at how long it takes to do a WiFi connection (real timing data needed!):

1) Assume 1.5 second needed to measure and send data on an already active WiFi connection: 0.85 mA * 898.5 s / 900 s + 14 mA * 1.5 s / 900 s = average current draw of 0.87 mA

or,

2) Assume 8 seconds needed to establish a WiFi connection and send data: 0.005 mA * 892 s / 900 s + 14 mA * 8 s / 900 s = average current draw of 0.13 mA, about 7 times less than approach 1).

Both of these scenarios require tiny solar panels. My sample calc in the prior post used a 10 mA load. Method 2) above probably doesn't warrant a solar panel. You could go a couple years on 3 x AA batteries.

I wonder what the transmit power and range of the WiPy WiFi module is? It must be fairly low if the whole module only uses 14 mA when active, or maybe 14 mA only considers the receive current and not transmit?

vext01
Posts: 9
Joined: Mon Apr 20, 2015 10:11 pm

Re: Self sufficient (solar powered) pyboard?

Post by vext01 » Sat Apr 25, 2015 1:17 pm

Hi moose,

Thanks for the incredibly detailed response. That's a lot of information to process for a solar (and electronics) beginner, so bear with me while I digest it :)

I reserved this weekend for writing the software for my project, but I have fallen at the first hurdle, so to speak:
1) Micropython board won't unmount, just hangs (OpenBSD bug likely, works in linux).
2) I don't seem to be able to reliably power the ESP8266. It's very flaky indeed. I have not gotten as far as to ask it for it's firmware version. I think I cannot run it from the 3.3v pins of the pyboard.

I guess I need to 1) get a bench poer supply, 2) report a bug to OpenBSD.

Joy :)

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Self sufficient (solar powered) pyboard?

Post by kfricke » Sat Apr 25, 2015 4:26 pm

vext01 wrote: 2) I don't seem to be able to reliably power the ESP8266. It's very flaky indeed. I have not gotten as far as to ask it for it's firmware version. I think I cannot run it from the 3.3v pins of the pyboard.
I do run my ESP8266 from the 3v3 of the pyboard directly. When powered over USB the LDO can supply up to 300 mA ([url=http://micropython.org/resources/datash ... 22053C.pdf]doc[/doc]).
What power source do you run the pyboard from? USB should supply enough power to run pyboard and ESP together. Even in its most power-hungry modes. Of course in case you have no other consumers "behind" that LDO.

Post Reply