Solar Raspberry Pi for Environmental Management

Manage nitrate and other environmental factors with solar Raspberry Pi for environmental management.

Geoff Munn of WxOutside in Wellington, New Zealand recently shared with us his environmental management tools based on a Raspberry Pi A+ platform. He writes that “environmental management plans are becoming compulsory reporting items in the agricultural sector. Nitrate management is a major concern for local and central governments, and aims to prove that farmers are operating within prescribed thresholds.”

His goal is to make irrigation and fertilization decisions easy by answering questions like ‘will humidity be more than 80% tomorrow?’, or ‘what is the evapotranspiration for the next 3 days?.’ Weather forecasts are accurate for most conditions, soil moisture and soil temperature need to be recorded in the actual target locations and can’t be accurately derived from standard forecasts.

Here’s how Geoff Built the first system (here’s a detailed post for other approaches on using solar with Raspberry Pi):

Components

Voltaic Systems V44 battery: This is a really tidy battery and comes with built-­in power management. It will shut down when voltage drops too low, and won’t turn back on until there is roughly 20 minutes of power stored. The Always On mode is a killer feature which makes this whole project possible.
– 2 x 9 Watt Voltaic solar panels: Two panels give roughly 99% uptime through the course of the year, against 150mA- ­230mA device consumption. It’s easily possible to add 3 panels would probably get 99.9% uptime depending on your climate.
Raspberry Pi A+: The Raspberry Pi A+ runs all the sensors, stores the telemetry and sends messages back to the dashboard. The A+ is a low­ power model, and pulls 150mA when idle, peaking at 230mA depending on what it’s doing. The A+ is not a particularly powerful unit though, and resource intensive processes should be avoided to ensure stability. The most lightweight solution was to use Python for communicating with the sensors, and to send all messages via the Linux email SMTP protocol. A custom ­built email message bus sends telemetry back to the main site, which responds with a receipt. When the receipt is received, the telemetry records are deleted. In cases where there is an outage (cellular network unavailable, or the RPi shut down before messages were sent), then messages are queued for resending. Although it might be delayed in some circumstances, no recorded data is ever lost.

raspberry pi and battery in case
WeatherPiArduino: The weatherPiArduino is made by SwitchDoc Labs and is a very convenient unit for connecting the anemometer and rain bucket. It’s also the most complicated component to connect due to some ambiguous documentation.
AM2315: The AM2315 temperature and humidity sensor is an easy to set up, very reliable device. It needs a solar radiation shield, which you can 3D print using plans found on the web.
– Soil moisture probe: This is an I2C Soil moisture sensor from Catnip Electronics. It works well and provides the details that a standard forecast can’t provide (soil moisture and temperature). Future plans include support for more sophisticated soil probes.
– Wind Anemometer: Wellington gets some ferocious wind at times ­ it’s not unusual to have average winds of 100Kph for extended lengths of time. If it’s properly secured, the wind anemometer is a reliable device. The rain bucket absolutely must be secured to something solid and flat otherwise it won’t trigger properly. Because this is an analog device, the weatherPiArduino is required to convert readings to digital signals.
– 3G dongle (Huawei e3131): This sends data via an email­based message bus. When it’s not in use, it reverts to a low­power mode. This is really important since it’s a high ­consumption component and there is no way of switching off USB devices on the Raspberry Pi, so something with built­-in power management is really useful. It’s also very reliable ­ WiFi and radio connectivity is tricky to manage and it is an architectural principal to not maintain infrastructure.
Nanuk 905 case: This is a really solid case, and is perfect for holding all of the components together. All the cables run out a hole which is drilled in the side and sealed with a waterproof gland. Some careful tucking of cables gives it a nice clean look.
battery in waterproof case
– Silica gel packet: If you open the case and the air is moist or humid, then the heat from the components will cause humidity to reach 100% and the Raspberry Pi will shut down. Throw in a silica gel sachet and problem solved ­ or don’t open the case when it’s been raining!

Performance information

The Raspberry Pi A+ consumes very little power when not busy ­ especially compared to the RPi 2, which idles at 230mA amps and easily exceeds 300mA. I expect the Raspberry Pi Zero to match the A+ but not be much more efficient. The number one trick for lowering power consumption is to reduce the number of USB devices that are attached since there is no way of switching these on and off.

Also, it’s worth noting that these numbers were taken in Wellington, New Zealand, on the 41st parallel south, so other locations will experience different solar activity.

Summary of power consumption when not busy (idling):

• Raspberry Pi A+: 70mA

• 3G dongle: 60mA

• weatherPiArduino: 10mA

• AM2315: 10mA

• Soil probe: 10mA

• Total power in idle: 150mA

Various measurements are taken across the hour, and all telemetry is sent out in one batch. Not all sensors are triggered at once, and the telemetry is sent during a time when no final measurements are taking place, so the ‘in use’ power consumption isn’t a sum of every component.

Additional power consumption when triggered:

• 3G dongle: 180mA

• weatherPiAuduino: 20mA

• AM2315: 40mA

• Soil probe: 40mA

For the soil probe and the AM2315, these numbers also include the background process of storing the data, so it’s more than the stated power consumption that each device claims to use. During the summer months, two 9 Watt solar panels will easily provide enough power for continuous 24 hour operation ­ in fact, just one will suffice for most of summer. Occasional days of thick cloud cover or rain will not be severe enough to completely drain the battery because the daylight hours are long enough to provide a trickle of solar energy ­ enough to get us through to the next sunny day.

It is a bit different during winter when the days get shorter. Depending on the cloud cover, the battery will last about 2.5­3 days of rain and heavy cloud before it gives up. Even during the winter solstice when there is about 9 hours between sunrise and sunset (and even less that the solar panels can use), a nice clear day will fully charge the battery.

Further improvements can be made by using a power management device such as a WittyPi 2 where the RPi is shutdown for most of the hour if no rain is expected and wind is consistent. This will allow for faster charging and better up-time during cloudy days.

One Response

  1. sean

    Hi, i’ve been working on a very similar set up to this, a solar powered pi A+ with a Huawei 3G dongle (slightly different dongle to you, an E3531). I’ve had real problems with the 3G dongle causing the pi to crash and go into a reboot loop. I ran the same set up from mains power and it still does it. I note that you are running your 3G dongle directly from the pi’s usb port i.e. not using a powered usb hub; have you had any issues with the pi going into boot loops?

    By the way i tried a B+ in place of the A+ and everything works fine, albeit with higher power consumption, so i am confident that the issue is the 3G dongle messing with the A+.

    I’ve read that the A+ doesn’t have the same sort of usb power surge protection as the the Pi B+ / 2 / 3 and that appears to be true in my case, how have you got round it?

    I’d have thought it unlikely there are significant differences between the Huawei E3131 and E3531 that i am using – from what i can tell they are both HSDPA cabable – does yours ever operated in it’s faster mode (cyan light on mine) or does it stay in normal 3G (blue light on mine)?

    Reply

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.