Tutorial: Part 7 -Building a Solar Powered 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”]
Building the Box
As with most projects, we tend to “breadboard” the circuitry before we put it into the enclosure. With GroveWeatherPi, we spread out the parts, wired them up, made sure each of the major paths worked (and of course, took the obligatory nighttime geek shot) and then started placing them in the box, attaching them velcro to the sides, bottom and top of the box.
Once you have it breadboarded you can run the following test.
On your Raspberry Pi install the github archive github.com/switchdoclabs/SDL_Pi_GroveWeatherPi .
Do the following:
cd SDL_Pi_GroveWeatherPi cd SDL_Pi_TCA9545 sudo python testSDL_Pi_TCA9545.py Test SDL_Pi_TCA9545 Version 1.0 - SwitchDoc Labs Sample uses 0x73 Program Started at:2016-08-13 18:52:00 -----------BUS 0------------------- tca9545 control register B3-B0 = 0x1 ignore Interrupts if INT3' - INT0' not connected tca9545 control register Interrupts = 0x0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- -- 40: 40 -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 70: -- -- -- 73 -- -- -- 77 ----------------------------------- -----------BUS 1------------------- tca9545 control register B3-B0 = 0x2 ignore Interrupts if INT3' - INT0' not connected tca9545 control register Interrupts = 0x0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: 03 -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- 73 -- -- -- -- ----------------------------------- -----------BUS 2------------------- tca9545 control register B3-B0 = 0x4 ignore Interrupts if INT3' - INT0' not connected tca9545 control register Interrupts = 0x0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: 40 -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- 73 -- -- -- -- ----------------------------------- -----------BUS 3------------------- tca9545 control register B3-B0 = 0x8 ignore Interrupts if INT3' - INT0' not connected tca9545 control register Interrupts = 0x0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- 73 -- -- -- -- -----------------------------------
If your display matches the above, you have correctly wired your GroveWeatherPi. If some devices are missing, look up the devices above in the I2C Address chart and check their wiring. Always shut down and turn your Raspberry Pi off before changing wiring.
Putting the GroveWeatherPi into the BUD Industries box is pretty straight forward. We chose to put the solar power part of the circuit on top and the Raspberry Pi and the WeatherPiArduino Sensor array in the box bottom. The parts were all placed and then all the screw holes and outside screws were sealed with silicon caulking.
When I attempt to test the wiring, I continue to get the following error with the test software. I’ve double checked the wiring and tested the software installations. I must be missing something obvious.
pi@raspberrypi:~/SDL_Pi_GroveWeatherPi/SDL_Pi_TCA9545 $ sudo python testSDL_Pi_TCA9545.py
Test SDL_Pi_TCA9545 Version 1.0 – SwitchDoc Labs
Sample uses 0x73
Program Started at:2016-11-05 17:55:55
Traceback (most recent call last):
File “testSDL_Pi_TCA9545.py”, line 51, in
tca9545 = SDL_Pi_TCA9545.SDL_Pi_TCA9545(addr=TCA9545_ADDRESS, bus_enable = TCA9545_CONFIG_BUS0)
File “/home/pi/SDL_Pi_GroveWeatherPi/SDL_Pi_TCA9545/SDL_Pi_TCA9545.py”, line 44, in __init__
self._bus = smbus.SMBus(twi)
IOError: [Errno 2] No such file or directory
pi@raspberrypi:~/SDL_Pi_GroveWeatherPi/SDL_Pi_TCA9545 $
Kevin,
From the directory where you are executing this program, do a “pwd” and give us the results. Looks like you are some where else
SDL
Also make sure you have your I2C bus set up right (do “sudo i2cdetect -y 1” and include the results in your reply).
SDL
Apparently it is I2C that is missing:
“pi@raspberrypi:~/SDL_Pi_GroveWeatherPi/SDL_Pi_TCA9545 $ pwd
/home/pi/SDL_Pi_GroveWeatherPi/SDL_Pi_TCA9545
pi@raspberrypi:~/SDL_Pi_GroveWeatherPi/SDL_Pi_TCA9545 $ sudo i2cdetect -y 1
Error: Could not open file `/dev/i2c-1′ or `/dev/i2c/1′: No such file or directory
pi@raspberrypi:~/SDL_Pi_GroveWeatherPi/SDL_Pi_TCA9545 $ ls /dev/i*
/dev/initctl
/dev/input:
by-id by-path event0 event1 mice mouse0
pi@raspberrypi:~/SDL_Pi_GroveWeatherPi/SDL_Pi_TCA9545 $
“
Use this link:
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c
SDL