Tutorial: Part 3 -Building a Solar Powered Raspberry Pi Weather Station – GroveWeatherPi

Tutorial: Part 3 -Building a Solar Powered G51D5327BD59F9-1-600x600Raspberry Pi Weather Station – GroveWeatherPi

The Raspberry Pi is a fabulous device to on which to build your projects.    The GroveWeatherPi project is designed to show the capabilities of this computer while remaining accessible to a diverse Maker community.

GroveWeatherPi is a Solar Powered Raspberry Pi WiFi connected weather station designed for Makers by SwitchDoc Labs ( www.switchdoc.com). This is a great system to build and tinker with. All of it is modifiable and all source code is included.

This tutorial for building your own Solar Powered Weather Station based on the Raspberry Pi consists of 14 parts.

[include-page id=”gdplinks”]

 

Sizing Your Solar Power System


One of the first things that comes up in a solar powered design is how to design the power system. The three main questions to be asked and answered are:

1.How much power do I need?

2.How many solar panels do I need?

3.What size battery do I need?

The first thing you need to do when designing a solar powered system is to determine the power requirements for your solar powered design. Our criteria is that we want the GroveWeatherPi Raspberry Pi to run all day and during the night.   But we want the system to able to shutdown and restart itself when power is available.

The table below contains estimated power consumption for models of the Raspberry Pi, including a Wireless USB dongle. We are assuming in each of these that you turn the HDMI port off which saves ~20ma.   These are CPU idle numbers.

 Power

(Update November 10, 2016:   Raspberry Pi 3 – idle 320(260)mA – 1.4W – Note:  the Raspberry Pi 3 is quite an improvement in CPU power versus power consumption -but under stress it can draw 780mA)

All of the above measurements include about 60ma for the USB WiFi Dongle! Parenthetical numbers are without the 60ma.

Based on the above, first we will lay out our assumptions for our Raspberry Pi Model A+ based design. The LiPo batteries chosen will store 6600mAh. Why choose the Model A+? It’s the lowest current consuming raspberry Pi that doesn’t require soldering.

SOLDERING NOTE:   If you want to use a Raspberry Pi Zero, you will need to solder a 40 pin connector on the board.    Choosing a Model A+ reduces the need for soldering.

What is mAh (milli Amp hours)? 6600mAh means you can take 100mA for 66 hours, theoretically. In actuality, you will not be able to get more than about 80% on average depending on your battery. How fast you discharge them also makes a big difference. Slower the discharge rate, the more mAh you can get out of the battery. For comparison, an AA battery will hold about 1000mAh ( https://en.wikipedia.org/wiki/AA_battery ) and a D battery will hold about 10000mAh ( https://en.wikipedia.org/wiki/AA_battery ).

In a system like this, it is best to charge your LiPo batteries completely and then hook up the computer and see how long it takes to discharge the battery and die. We did this test on the GroveWeatherPi system. The results are on switchdoc.com ( https://www.switchdoc.com/2015/04/figuring-out-when-to-shutdown-your-solar-powered-raspberry-pi-weatherpi/ ).

Raspberry Pi A+ Solar Design

Assumptions:

  • – Two Voltaic 3.4W 6V/530ma Solar Cells (total of 6.8W)
  • – 8 Hours of Sun running the cells at least at 70% of max Delivery of current to Raspberry Pi at 85% efficiency (you lose power in the charging and boosting circuitry)
  • – Raspberry Pi Model A+ takes 195mA on average (with the Wireless USB Dongle)
  • – Raspberry Pi Model A+ running 24 hours per day
  • – 6600mAh LiPo Batteries

Given these we can calculate total Raspberry Pi Model A runtime during a typical day: PiRunTime = (8 Hours * 70% * 1060mA) *85% / (195mA) = 25 hours.

Our goal was for 24 hours, so it looks like our system will work. 16 Hours of running the Raspberry Pi Model A+ on batteries alone will take (195mA/85%)*16 Hours = 3670mAh which is comfortably less than our 6600mAh batteries can store. The WIFI dongle added about 60mA on average. It was enabled the entire time the Raspberry Pi was on. No effort was made to minimize the power consumed by the WiFi dongle. Your results will depend on what other loads you are driving, such as other USB devices, GPIO loads, I2C devices, etc.

Note that during the day, on average, we are putting into the battery about 6000mAh. This also means a bigger battery than 6600mAh will not make much difference to this system.

So, on a bright sunny day, we should be able to run 24 hours a day. Looking at the results from GroveWeatherPi being out in the sun for a week, this seems to be correct. However, it will be cloudy and rainy and your system will run out of power. The next most important part of the design is how to handle Brownouts! See a step later in this chapter about how to hand this nasty little problem.

Raspberry Pi Zero Solar Design

Assumptions:

  • – Two SwitchDoc Labs 2W 6V/330ma Solar Cells (total of 4W)
  • – 8 Hours of Sun running the cells at least at 70% of max Delivery of current to Raspberry Pi at 85% efficiency (you lose power in the charging and boosting circuitry)
  • – Raspberry Pi Model Zero takes 160mA on average (with the Wireless USB Dongle) – Removed OLED display.
  • – Raspberry Pi Model Zero  running 24 hours per day
  • – 6600mAh LiPo Batteries

Given these we can calculate total Raspberry Pi Model Zero runtime during a typical day: PiRunTime = (8 Hours * 70% * 660mA) *85% / (160mA) = 23.1 hours.   Adding another inexpensive 2W solar panel would bring this to 34 hours.  Since we are so close to the 24 hours with two, let’s go with two for this design and spend a bit of time in the future  figuring out how to shut off the WiFi for part of the time to make up the difference.

Our goal was for 24 hours, so it looks like our system will  pretty much work. 16 Hours of running the Raspberry Pi Zero on batteries alone will take (160mA/85%)*16 Hours = 3011mAh which is comfortably less than our 6600mAh batteries can store. The WIFI dongle added about 60mA on average. It was enabled the entire time the Raspberry Pi was on. No effort was made to minimize the power consumed by the WiFi dongle. Your results will depend on what other loads you are driving, such as other USB devices, GPIO loads, I2C devices, etc.

Note that during the day, on average, we are putting into the battery about 6000mAh.  This also means a bigger battery than 6600mAh will not make much difference to this system.

So, on a bright sunny day, we should be able to run 24 hours a day. Looking at the results from GroveWeatherPi being out in the sun for a week, this seems to be correct. However, it will be cloudy and rainy and your system will run out of power. The next most important part of the design is how to handle Brownouts! See a step later in this tutorial  about how to hand this nasty little problem.

Solar System Design

The four most important parts of verifying your Solar Power Design:

  • – Gather real data
  • – Gather more real data
  • – Gather still more real data
  • – Look at your data and what it is telling you about the real system. Rinse and Repeat.

The power system in Weather Pi consists of four parts:

  • – Two Solar Panels
  • – One 6600Ah LiPo Battery
  • – SunAirPlus Solar Power Controller, Pi Power Supply and Data Gathering system
  • – USB PowerControl board for Raspberry Pi Power Control

We are using 2 2W/330mA Solar Panels from SwitchDoc Labs.   You can use virtually any solar panel as long as they are 6V solar panels.  The picture above is of Voltaic Systems panels on Project Curacao after six months in the sun. Those are clouds reflected on the panels, not dirt. The panels are prefect.    The Voltaic Systems panels will run you about $40 a piece where the SwitchDoc Labs Panels will cost about $12 per panel.

We selected a 6600mAh battery from Adafruit for this design. See the “Sizing your Solar System” step above. We are using a SunAirPlus Solar Power Controller in this design.

SunAirPlus includes an I2C INA3221 3 Channel Current / Voltage Monitor and a I2C 4 channel 12 bit Analog to Digital Converter (ADS1015). The INA3221 allows you to monitor all of the major currents and voltages in the system (Battery / Solar Panels / Load – Computer ). You can tell what your solar power project is doing in real time.

SunAirPlus Results

Here are some results from the SunAirPlus board using the onboard INA3221. You can see that the battery is almost fully charged and the solar cell voltage (actually a variable power supply on the test bench) is 5.19V and it is supplying 735mA.

Test SDL_Pi_INA3221 Version 1.0 - SwitchDoc Labs 
Sample uses 0x40 and SunAirPlus board INA3221
Will work with the INA3221 SwitchDoc Labs Breakout Board 
------------------------------ 
LIPO_Battery Bus Voltage: 4.15 V 
LIPO_Battery Shunt Voltage: -9.12 mV 
LIPO_Battery Load Voltage: 4.14 V 
LIPO_Battery Current 1: 91.20 mA
 
Solar Cell Bus Voltage 2: 5.19 V 
Solar Cell Shunt Voltage 2: -73.52 mV 
Solar Cell Load Voltage 2: 5.12 V 
Solar Cell Current 2: 735.20 mA 

Output Bus Voltage 3: 4.88 V 
Output Shunt Voltage 3: 48.68 mV 
Output Load Voltage 3: 4.93 V 
Output Current 3: 486.80 mA 

You can use this board to power your projects and add a servo or stepper motor to allow it to track the sun using photoresistors to generate even more power.    We ran a test on tracking the sun to prove our point [ref:  https://www.switchdoc.com/2016/05/sun-tracking-solar-power-part-1/.

Controlling the Raspberry Pi Power

The USB PowerController Board is basically a controlled Solid State Relay to turn the power on and off to the Raspberry Pi. This board sits between the Solar Power Controller (SunAirPlus) and a Raspberry Pi Model A+. The input to the board was designed to come directly from a LiPo battery so the computer won’t be turned on until the LiPo battery was charged up above ~ 3.8V. A hysteresis circuit is provided so the board won’t turn on and then turn immediately off because the power supply is yanked down when the computer turns on (putting a load not the battery). This really happens!!!! You kill Raspberry Pi SD Cards this way.   We will talk about this in our next step in this tutorial.

GroveWeatherPi
USB PowerControl