PiWem (Raspberry Pi Weather Monitor)

User avatar
pferland
Random Intervals Admin
Random Intervals Admin
Posts: 412
Joined: Mon Oct 22, 2007 8:38 am
Location: The Universe
Contact:

PiWem (Raspberry Pi Weather Monitor)

Postby pferland » Sun Sep 04, 2016 8:42 am

Well stupid me click on a link in my preview and lost my entire write up, so I have to write it again....

I wanted to start a new project so I decided to make a weather monitor out of a Raspberry Pi. After a little research it didnt look all that hard so I set off and started getting the parts.
I didn't take any pictures yet, but will soon. :oops:


Hardware:

I started off with a RespberryPi 3 and the SunFounder 37 Modules Sensor Kit V2.0.
The SunFounder kit has a BMP085 (barometer and temp), DHT11 (humidity and temp), Thermistor, Photoresistor, Analog Temperature Sensor, PCF8591 Analog to Digital Converter, and a small breadboard, and an adapter to go from the GPIO header to the breadboard.
I also went and bought a BMP280 barometer and an AM2302 Humidity and temp sensor

The PCF8591 can address up to 4 devices on the I2C protocal on the address of 0x48. This way I can have the Thermistor, Photoresistor, and ATS all attached and read them through the one device switching the channels (0-3). Really there is no need to have more than one temp sensor, but I did this for development purposes to support as many devices as I physically can at a time. Hopefully I don't need more than 4... :roll:

The BMP sensors are I2C. By default they are set to address 0x77 if there is no level set on the SDA pin or it is high (5v). If the SDA pin is Low (ground) the address can be set to 0x76. The problem with the SunFounder BMP085 is they did not breakout the SDA pin, so the address is hard set to 0x77. The BMP280 I got has the SDA pin broken out so that you can ground the pin and set its address to 0x76. This way you can have up to two BMP sensors running on one device at the same time without an I2C multiplexer.

I have not added the AM2302 support yet. I do have the sensor, just need to add the code for it and the table to store the data.


Software:

The code part of the project is hosted on GitHub: https://github.com/pferland/PiWeM

Most if not all of the settings for the daemon can be changed in the settings.ini file.
To create one, just copy the settings.ini.sample to settings.ini and change the settings to your desired ones.

The daemon is written in python at the moment because that is what I know the most at the moment, but I do want to re-write it in C++. On each loop the daemon polls all the enabled sensors and inserts their values into the respective sensor tables with the station hash so that we know what station inserted what values. This is for the front end viewer to get the data.

Initially I was reading that you can use the BMP085 class to read the BMP280. When I tried that, the values were all waaay off :roll: . So I set out to find some code that could read the BMP280. I came across this post: https://forums.adafruit.com/viewtopic.php?f=19&t=89049
I took that code and made a class to work with that will setup the BMP280, read the values and return them.

The front end is written in PHP and is very basic and not really all there yet. So far it just has an index page that shows the stations that are logging and their most current values.

Will update with more when it is relevant.

-Phil
The best acceleration you can get on a Mac is 9.8ms^2

User avatar
pferland
Random Intervals Admin
Random Intervals Admin
Posts: 412
Joined: Mon Oct 22, 2007 8:38 am
Location: The Universe
Contact:

PiWem (Raspberry Pi Weather Monitor)

Postby pferland » Sun Oct 30, 2016 3:27 pm

arizonajon, what are you using for sensors on your Raspberry Pi weather station?
The best acceleration you can get on a Mac is 9.8ms^2

arizonajon
Contributor
Contributor
Posts: 211
Joined: Wed Feb 04, 2015 11:17 pm
Contact:

PiWem (Raspberry Pi Weather Monitor)

Postby arizonajon » Sun Oct 30, 2016 10:33 pm

Hi Phil - I use a Davis Vantage Pro 2 wired station up on the roof. Chose wired over wireless as I have ham transmitters in the house and I didn't want to have interference between the wx station and my other stuff. Considering homebrewing some sensors like dust/particulate pollution, as the commercial ones are pretty costly. Problem for me is calibrating the sensors so that the data are comparable to other "more better" stations in the area.

User avatar
pferland
Random Intervals Admin
Random Intervals Admin
Posts: 412
Joined: Mon Oct 22, 2007 8:38 am
Location: The Universe
Contact:

PiWem (Raspberry Pi Weather Monitor)

Postby pferland » Mon Oct 31, 2016 12:03 am

Ahh nice. I am using all commodity hardware that is for the Raspberry Pi at the moment.

The Temperature and Barometric Pressure sensors are pretty accurate. The issue I am having right now is the Humidity sensor is way off on the DHT11. I have an AM2302, but the library that says will work with it is not reading it correctly for some reason :/ I am logging my data to Weather Underground so I can easily compare it to the other weather stations in the area. Right now Humidity is the only thing that is out of wack.

I just ordered a Wind speed and direction sensor that works over I2C, so will see how that works out.

I also ordered a nice water proof casing for the Raspberry Pi, batteries, and the Solar Panel charging control unit. I still need to figure out what I am going to do for the wiring from the control unit to the sensor unit.
The best acceleration you can get on a Mac is 9.8ms^2

arizonajon
Contributor
Contributor
Posts: 211
Joined: Wed Feb 04, 2015 11:17 pm
Contact:

PiWem (Raspberry Pi Weather Monitor)

Postby arizonajon » Fri Nov 04, 2016 6:57 pm

I have a 5 watt Harbor Freight solar panel that i got a long time ago. I think I'll try running an RPi from that in a mode that puts the RPi to sleep and then wakes it up every so often to communicate something. Are there some good power saving modes available in an RPi universe? I mean like a milliwatt or so of standby power? A 5 watt panel is not so big, so I might be able to stash it out in the desert somewhere and see if it can report back temperature or something regularly. What waterproof casing did you get?

User avatar
pferland
Random Intervals Admin
Random Intervals Admin
Posts: 412
Joined: Mon Oct 22, 2007 8:38 am
Location: The Universe
Contact:

PiWem (Raspberry Pi Weather Monitor)

Postby pferland » Fri Nov 04, 2016 8:17 pm

I got this utility looking box: https://smile.amazon.com/gp/product/B00 ... UTF8&psc=1

And this plate that goes inside to mount everything to, it hasn't come in yet, so I dont know how well it is going to work out yet: https://smile.amazon.com/gp/product/B00 ... UTF8&psc=1

I also just got this Solar Shield in for the sensors: https://smile.amazon.com/gp/product/B01 ... UTF8&psc=1

I have not even looked into an ultra low power mode for the RasPi to put it to sleep and wake up every so often, that would be a really good way to save power. Especially when the 20W solar panel I have does not charge the batteries when it is below 1Amp.

Battery packs: https://smile.amazon.com/gp/product/B00 ... UTF8&psc=1
Solar Panel: https://smile.amazon.com/gp/product/B00 ... UTF8&psc=1
I got this Solar Panel charge control unit: https://smile.amazon.com/gp/product/B00 ... UTF8&psc=1
The one that came with the solar panel is really low quality.

I really need to look into making the battery part better. The battery packs use 6 of the 2000mAh 18650 Lithium Ion batteries and there is a little charge control for both packs, and it is not working out very well since one pack tries to charge the other by giving feedback into the circuit. So I was thinking of taking out one of the charge control units on the battery packs and combining both battery arrays into one pack attached to the one charge control unit and then connected to the 12v Solar charge control unit.

I also need to find a good 12v to 5v regulator or converter to then drive the Raspberry Pi off of the load terminal on the Solar Charge control unit. I think that would make the whole thing run better. But I still need to test it out.

I also just picked up an analog Wind meter and wind vane, so I will need to figure out how to read them this weekend.

-Phil
The best acceleration you can get on a Mac is 9.8ms^2

User avatar
pferland
Random Intervals Admin
Random Intervals Admin
Posts: 412
Joined: Mon Oct 22, 2007 8:38 am
Location: The Universe
Contact:

PiWem (Raspberry Pi Weather Monitor)

Postby pferland » Fri Nov 18, 2016 12:45 pm

Well, we had some rain on Tuesday that I didnt look out for and the Raspberry Pi was killed. :(

Going to have to get a few more so that I have some spares in case it happens again.
The best acceleration you can get on a Mac is 9.8ms^2


Return to “Raspberry Pi”

Who is online

Users browsing this forum: No registered users and 1 guest