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

GroveWeatherPi
Full GroveWeatherPi Ready for Installation

Tutorial: Part 12 -Building a Solar Powered

GroveWeatherPi
Full GroveWeatherPi Ready for Installation

Raspberry 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”]

Starting the Whole System!

You can now start the GroveWeatherPi software by running the following commands.

From your login directory:

cd SDL_Pi_GroveWeatherPi
sudo python GroveWeatherPi.py

You will get a display that looks something like this:

GroveWeatherPi Solar Powered Weather Station Version 2.0 - SwitchDoc Labs


Program Started at:2016-08-12 22:41:31

----------------------
I2C Mux - TCA9545:   		Present
DS3231:   		Present
BMP280:   		Present
FRAM:   		Not Present
HTU21DF:   		Present
AM2315:   		Present
ADS1015:   		Not Present
ADS1115:   		Present
AS3935:   		Present
OLED:   		Present
SunAirPlus:   		Present
----------------------
as3935 Interrupt
processing Interrupt from as3935
Last Interrupt = 0x4:  Disturber detected - masking
---------------------------------------- 
---------------------------------------- 
---------------------------------------- 
---------------------------------------- 
---------------------------------------- 
---------------------------------------- 
---------------------------------------- 
---------------------------------------- 
---------------------------------------- 
---------------------------------------- 
----------------- 
 WeatherRack Weather Sensors Sampling
----------------- 
Rain Total=	0.00 in
Wind Speed=	0.00 MPH
MPH wind_gust=	0.00 MPH
Wind Direction=			 270.00 Degrees
Wind Direction Voltage=		 4.476 V
----------------- 
----------------- 
 DS3231 Real Time Clock
----------------- 
Raspberry Pi=	2016-08-12 22:41:41
DS3231=		2016-08-12 22:41:41
DS3231 Temperature= 	25.25 C
----------------- 
----------------- 
----------------- 
 BMP280 Barometer
----------------- 
Temperature = 	25.60 C
Pressure = 	94.66 KPa
Altitude = 	570.64 m
Sealevel Pressure = 	94.66 KPa
----------------- 
----------------- 
 HTU21DF Temp/Hum
----------------- 
Temperature = 	24.70 C
Humidity = 	43.40 %
----------------- 
----------------- 
 AS3935 Lightning Detector 
----------------- 
Last result from AS3935:
Disturber: Disturber detected - masking
Lightning Count =  0
----------------- 
----------------- 
 AM2315 Temperature/Humidity Sensor
----------------- 
outsideTemperature: 24.4 C
outsideHumidity: 36.9 %
crc: 1
----------------- 
----------------- 
SunAirPlus Currents / Voltage 
----------------- 
LIPO_Battery Bus Voltage: 3.78 V 
LIPO_Battery Shunt Voltage: -14.56 mV 
LIPO_Battery Load Voltage:  3.76 V
LIPO_Battery Current 1:  -145.60 mA
Battery Power 1:  -0.55 W

Solar Cell Bus Voltage 2:  4.75 V 
Solar Cell Shunt Voltage 2: -40.64 mV 
Solar Cell Load Voltage 2:  4.71 V
Solar Cell Current 2:  406.40 mA
Solar Cell Power 2:  1.91 W

Output Bus Voltage 3:  4.94 V 
Output Shunt Voltage 3: 18.88 mV 
Output Load Voltage 3:  4.94 V
Output Current 3:  188.80 mA
Output Power 3:  0.93 W

Add a Bootup Start for GroveWeatherPi 

The final system step you need to do is to add a line to startup GroveWeatherPi when your Raspberry Pi reboots.   If you don’t do this, then you have to start it manually which doesn’t work with the WatchDog or if the station runs out of energy.

On your Pi, edit the file /etc/rc.local using the editor of your choice. You must edit with root, for example:

sudo nano /etc/rc.local

Add commands below the comment, but leave the line exit 0 at the end, then save the file and exit.

Add the following command (all on one line) to the file before the exit 0 line.

cd /home/pi/SDL_Pi_GroveWeatherPi; sudo python /home/pi/SDL_Pi_GroveWeatherPi/GroveWeatherPi.py >> /home/pi/GroveWeatherPi.log &

Now reboot your machine by typing:

sudo reboot

Login in again and you can look at the output of GroveWeatherPi by running the following command in /home/pi

tail -f GroveWeatherPi.log

Running on AC Power

Want to run inside on AC power?  Plug a 5V Mini USB power supply into SunAirPlus.

GroveWeatherPi
Plugging in a Power Supply to SunAirPlus

Remove OLED Display

Turn off the power now and remove the OLED display from the box, as we won’t be0070G looking at it once we shut the box.   Alternatively, you can leave the display in (it takes about 15mA) and put a small plexiglass window on the side of the box to read it.

10 Comments

  1. getting the following error
    >>>>>>>>>>>>>>>>>>><<<<<<<<<<>>>>>>>>>>>>>>>>>><<<<<<<<<<<
    Error accessing 0x48: Check your I2C address
    Error accessing 0x48: Check your I2C address
    Type Error
    Traceback (most recent call last):
    File "GroveWeatherPi.py", line 557, in
    import crcpython2
    ImportError: No module named crcpython2

  2. as3935 Interrupt
    Error 1049: Unknown database ‘monkeyboy’
    Traceback (most recent call last):
    File “GroveWeatherPi.py”, line 1447, in
    pclogging.log(pclogging.INFO, __name__, “GroveWeatherPi Startup Version 2.0”)
    File “/home/pi/SDL_Pi_GroveWeatherPi/pclogging.py”, line 70, in log
    cur.close()
    UnboundLocalError: local variable ‘cur’ referenced before assignment

    • Sounds like you haven’t set up your database correctly. “Unknown Database monkeyboy”

      SDL

  3. my weather station will suddenly stop reporting after about 3 hours. Sometimes it fixes itself, but most times I have to reboot the pi. Was able to verify the network, or the pie losing connection to the Internet.

    • You have an issue with your wireless WiFi dongle. Try replacing it. It may be a WiFi strength issue too.

      SDL

  4. Hi guys,

    cant get passed this point :

    Traceback (most recent call last):
    File “GroveWeatherPi.py”, line 246, in
    Sunlight_Sensor = SDL_Pi_SI1145.SDL_Pi_SI1145()
    File “./SDL_Pi_SI1145/SDL_Pi_SI1145.py”, line 160, in __init__
    self._device = I2C.Device(address, busnum)
    File “./SDL_Pi_SI1145/I2C.py”, line 96, in __init__
    import Adafruit_PureIO.smbus
    ImportError: No module named Adafruit_PureIO.smbus

    config is:
    TCA9545_I2CMux_Present = True
    SunAirPlus_Present = False
    AS3935_Present = False
    DS3231_Present = True
    BMP280_Present = True
    FRAM_Present = False
    HTU21DF_Present = False
    AM2315_Present = True
    ADS1015_Present = False
    ADS1115_Present = False
    OLED_Present = True
    WXLink_Present = False
    Sunlight_Preset = False

    • This is an odd error that we just ran across too. Something is askew with the file structure, but here is the way to fix this:

      If you get the error:
      “ImportError: No module named Adafruit_PureIO.smbus”

      Try the following:

      git clone https://github.com/adafruit/Adafruit_Python_PureIO.git
      cd Adafruit_Python_PureIO
      sudo python setup.py install

      This will correct the error and we will get to the root of the problem. We aren’t including something correctly.

      Best, SDL

  5. Hi again SDL,
    After adding Python PureIO its throwing this now:

    Traceback (most recent call last):
    File “GroveWeatherPi.py”, line 244, in
    tca9545.write_control_register(TCA9545_CONFIG_BUS3)
    File “./SDL_Pi_TCA9545/SDL_Pi_TCA9545.py”, line 74, in write_control_register
    self._write(TCA9545_REG_CONFIG, config)
    File “./SDL_Pi_TCA9545/SDL_Pi_TCA9545.py”, line 52, in _write
    self._bus.write_byte_data(self._addr, register, data)
    IOError: [Errno 5] Input/output error

    I have to shutdown each attempt, else it tells me the MUX is missing. Ive checked the wiring 5 mines.. just to make sure and try and debug. Is there an ISO or similar I can download and write a new SDCard with a working operating system?

    • Topher,

      Would you do three things for us.

      1) Post the start of the GroveWeatherPi with all of the device detection shown.

      2) Post a picture of the Mux and the wiring to the Mux.

      3) Would you run the Test in the TCA directory and post the results?

      We don’t build an ISO for the system. We go to the RaspberryPi.org and get the ISO from there and overlay our software on that image (as in the realm).

      Thanks!

      SDL

Comments are closed.