Author Topic: Homemade Weather Station using a Raspberry Pi  (Read 74458 times)

0 Members and 1 Guest are viewing this topic.

Offline thorn

  • Senior Member
  • **
  • Posts: 51
Re: Homemade Weather Station using a Raspberry Pi
« Reply #125 on: July 03, 2016, 09:32:43 PM »


I was able to get it back together on the "face" board that mounts on top of the Pi. The only thing that went out was the Pi and A/D converter. I had an extra A/D that I got before. All the other sensors were OK. I shorten the wires and I'm going to use a solar panel and a large 12v gel battery (I got 6 of them for free, they are heavy, 50lbs!)  I'll post some photos when I get it done.

I may use a Zero Pi and one of the packet radio boards (443 MHz) https://www.adafruit.com/products/3071  to send data to a Pi inside. That way if it happens again it should only be $5 vs $30. All the Zero will have to do is read the sensors and send the data via RF. Once everything is working,  I wouldn't need a wifi connection either.

Those dishes are large but will go many miles.

Greg








Hi Greg,

Sorry to hear about the weather station. Opportunity for a new build??

The dishes look bigger than I expected. These may be a visual issue with where we're planning to put the station. I received the FONA, battery & SIM etc and working through the setup. Luckily if I switch to a Zero, it'll all fit in the same box!

I built the ProtoZero version while waiting but haven't tested it yet. I've attached a couple of pictures of it. I got the Ephem logic to work based on sun altitude at our location. Thanks Nickolas!. The camera takes pictures when the sun is greater than -6 deg to the horizon. (Twilight)

Power usage is next concern as the FONA is supposed to draw 500mA. When running I'll put the USB power monitor on it when I get it going. Ideally I'd like to go for a LiPo battery & a small solar panel but it will be driven by power usage.

Has anyone tried changing WebEx sampling interval from a Python program when its running? It would be great to change update frequency to WU at night to 30 or 60 mins and shut down the FONA between these times. The frequency could be increased to every 5 minutes during daylight.

Thanks

Donall

Offline Crannog

  • Member
  • *
  • Posts: 20
Re: Homemade Weather Station using a Raspberry Pi
« Reply #126 on: July 19, 2016, 06:54:34 AM »
I couldn't get the FONA 808 to run on the Pi3, seems to be a hardware/OS issue, the serial ports have been changed around to accommodate the onboard wireless.

I've switched to the Pi Zero and the FONA is working great, uploading data to WU! Camera needs some debugging. Smaller footprint of Zero means it'll all still fit in the current box!

I think the processor is under pressure as the 'cycling' LED is staying on at times for >1 sec of cycle time. When the camera will be running it will be worse. I was thinking therefore of not using WeeWx on it but writing directly to WU and/or a 'Server' Pi / PC with Weewx to WU. This would also give me control of write intervals as I plan to switch on connection, upload data then switch off connection. Have you tried this? It sounds similar to your planned RF connection. I think it would save alot on power as FONA is power thirsty.

I plan to cycle measurements every 3 seconds with uploads every 5 minutes for data and 15 minutes during daylight hours for images

Nick's code has code below to alternate readings, I' struggling a bit to understand condition of IF argument.
    if (math.floor(time.time()) % 2) == 0:
Can you explain? I need to code alternate every 6 seconds.

Thanks

Donall




Offline weathernick

  • Senior Member
  • **
  • Posts: 90
Re: Homemade Weather Station using a Raspberry Pi
« Reply #127 on: July 20, 2016, 10:08:54 AM »
I couldn't get the FONA 808 to run on the Pi3, seems to be a hardware/OS issue, the serial ports have been changed around to accommodate the onboard wireless.

I've switched to the Pi Zero and the FONA is working great, uploading data to WU! Camera needs some debugging. Smaller footprint of Zero means it'll all still fit in the current box!

I think the processor is under pressure as the 'cycling' LED is staying on at times for >1 sec of cycle time. When the camera will be running it will be worse. I was thinking therefore of not using WeeWx on it but writing directly to WU and/or a 'Server' Pi / PC with Weewx to WU. This would also give me control of write intervals as I plan to switch on connection, upload data then switch off connection. Have you tried this? It sounds similar to your planned RF connection. I think it would save alot on power as FONA is power thirsty.

I plan to cycle measurements every 3 seconds with uploads every 5 minutes for data and 15 minutes during daylight hours for images

Nick's code has code below to alternate readings, I' struggling a bit to understand condition of IF argument.
    if (math.floor(time.time()) % 2) == 0:
Can you explain? I need to code alternate every 6 seconds.

Thanks

Donall

% is the modulo operation. Basically it returns the remainder of the divide. In this case I divide by two and when the remainder is 0 I am at an even second. So for your code you will need 6 instead of 2.

Thanks,

Nickolas
PWS: Custom built with Raspberry Pi collecting the data from the sensors.
CWOP: EW5462
Wunderground: KAZYUMA27
Personal WX page: http://mccolls.weewx.s3-website-us-east-1.amazonaws.com/

Offline Crannog

  • Member
  • *
  • Posts: 20
Re: Homemade Weather Station using a Raspberry Pi
« Reply #128 on: July 30, 2016, 06:53:30 AM »
Thanks Nick, makes sense.

Finally got the whole thing working on GSM/GPRS. I've removed camera option for now to reduce data upload time. I also uninstalled Weewx and write directly to WU with "GET" command. This greatly improved Zero performance. The station now cycles measurements  every second again. It stops every 5 minutes, turns on "PPP" connection on Fona, uploads data, then turns off the "PPP" connection. I discovered running the PPP crashes the I2C BMP180, hence the stop to upload. The "PPP" is only connected for 20 seconds so power usage is low.

Power usage seems very good, 70mA on Zero, less on Fona (it has a 1000mA LiPo)!! I'm thinking of the Sparkfun Lipo / solar setup if possible rather than a 12v lead/acid if I can. Any experienceof these?

I've attached a picture of the setup so far.  [ You are not allowed to view attachments ]

Offline Crannog

  • Member
  • *
  • Posts: 20
Re: Homemade Weather Station using a Raspberry Pi
« Reply #129 on: August 04, 2016, 07:30:21 AM »
Hi Greg,

Do you have any signal conditioning on your wind speed sensor? I've the Davis anemometer which triggers once per revolution. I've used your edge detect code and software debounce value. I've noticed spurious event detects after cycling FONA power (switch on then off) or when FONA is on. I'm running off 12V DC battery. I've tried re-setting GPIO before turning FONA on  then re-configuring it for the sensor after FONA is switched off but problem persists. 

Have you used any hardware filtering?

Thanks again,

Donall

Offline thorn

  • Senior Member
  • **
  • Posts: 51
Re: Homemade Weather Station using a Raspberry Pi
« Reply #130 on: August 04, 2016, 06:02:36 PM »
Hi, I didn't put anything on the wind sensor. It has 8 pulses per rotation. I have not noticed anything wrong vs the rain got false signals. I'm still trying to get it to work. On it I have a RC filter. I shortened the wire and it's not reading it at all now, there may be a short in the wire. I took it off and I need to put it on the display it came with. I short the gipo and it reads the rise OK.

I have a Pi 3 for another project that's been running the wifi for a couple of weeks without any trouble. I may swap the wx pi2 with a 3 and try the wifi. I have a router in with the wx pi outside for now.

I did get the solar working for the wx pi, I'll post some photos soon. I have a 40w panel. The battery is overkill too (it weighs 70lbs), but it was free.  :-)

Greg

Offline Crannog

  • Member
  • *
  • Posts: 20
Re: Homemade Weather Station using a Raspberry Pi
« Reply #131 on: August 21, 2016, 05:21:22 PM »
That would be great. I put a RC filter on the wind counter to no effect. I got it working by running the FONA switching and uploading on a separate script. The same way the WeeWx driver works. Not sure why!

I tried the Pi3 Wifi earlier. It works great but I found the range is limited. The  radio transmitters looked very interesting.

I still have the old issue of the BMP180 pressure reading crashing (IO error ) occasionally when turning on the PPP connection. I fixed this before by stopping readings when uploading but can't do this with separate programs.
I think it is a power dip or CPU overload (hits 70% when turning on PPP!)

Could I use a capacitor on 5V supply to damp out dips? Any idea what size? I've read Davis use a super capacitor to power transmitter over night when there is no power from the solar array.

Is there a way to "handle" a IO error and carry on to next reading cycle?

I picked up a 7Ah 12V battery, controller and 20Wsolar panel which I calculate should work. I've it put together and will post a picture shortly.

Donall



Donall

Offline Crannog

  • Member
  • *
  • Posts: 20
Re: Homemade Weather Station using a Raspberry Pi
« Reply #132 on: August 26, 2016, 06:15:06 AM »
A 1000uF across the solar panel controller load supply seems to have fixed all BMP180 & I2C issues. I upped it to 4700uF for the final build. I've to change the sensor connections from the Davis RJ12 to basic wires to fit through IP68 cable glands. It's going to be pretty wet where its going.

The 20W panel seems to be able to re-charge the battery after overnight running. It'll be interesting to see how it manages on dull & wet days.  I'm working on reducing power usage to help panel & battery.

Attached are some pic's of work to date.

 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]  

Offline thorn

  • Senior Member
  • **
  • Posts: 51
Re: Homemade Weather Station using a Raspberry Pi
« Reply #133 on: September 22, 2016, 07:47:19 AM »

That looks good, nice and compact. Mine takes up a lot more space. I still need to take some photos. I have been busy and have not had time. I still need to work on my rain gauge.
Thanks for posting.

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Homemade Weather Station using a Raspberry Pi
« Reply #134 on: September 22, 2016, 07:51:27 AM »
When it comes to mechanical stuff I am an absolute anti-talent so it always amazes me when someone is able to build something like this. I made my own DYI solar shield which I have on my PWS and thats about the best and most sophisticated thing i can "create" :D

Offline Crannog

  • Member
  • *
  • Posts: 20
Re: Homemade Weather Station using a Raspberry Pi
« Reply #135 on: September 27, 2016, 04:10:43 PM »
Thanks guys,

The 20W panel seems to be able to re-charge battery ok. I've attached a picture of the overall setup. The pole will be attached to pillar on rock with steel cables. We hope to install this weekend. :grin:
 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]

Offline thorn

  • Senior Member
  • **
  • Posts: 51
Re: Homemade Weather Station using a Raspberry Pi
« Reply #136 on: September 27, 2016, 06:41:56 PM »
Here's my setup. I have 2 water proof boxes, one has a router/bridge and the other the Pi WX station. I have a fan that the one smaller panel powers to force air past the temp/humidity sensor. I need to out it on a Pi 3 so I can use the built in wifi instead of the router. The last image is the battery in a black case with a couple of rocks on top to clock the sun ( I should have taken them off for the photo). It's a large AGM battery that someone gave me, bigger than I need but it works.






« Last Edit: December 16, 2016, 10:32:37 AM by thorn »

Offline johnd

  • Forecaster
  • *****
  • Posts: 4849
    • www.weatherstations.co.uk
Re: Homemade Weather Station using a Raspberry Pi
« Reply #137 on: September 28, 2016, 12:57:19 PM »
Hmm. I'm getting a malware warning when I open this particular forum page. Infected jpegs maybe?
Prodata Weather Systems
Prodata's FAQ/support site for Davis stations
Includes many details on 6313 Weatherlink console.
UK Davis Premier Dealer - All Davis stations, accessories and spares
Cambridge UK

Sorry, but I don't usually have time to help with individual issues by email unless you are a Prodata customer. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Offline thorn

  • Senior Member
  • **
  • Posts: 51
Re: Homemade Weather Station using a Raspberry Pi
« Reply #138 on: September 28, 2016, 01:01:35 PM »
Hmm. I'm getting a malware warning when I open this particular forum page. Infected jpegs maybe?

I have a free DNS name for my website. It sometimes gives people warnings. I guess I should use the numeric IP address. Or is there a better way to post images?

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7549
    • Eagle Bay Weather
Re: Homemade Weather Station using a Raspberry Pi
« Reply #139 on: September 28, 2016, 02:00:35 PM »
Crabdance.com is on the known malware supporters list.
Need low cost IP monitoring?  http://wirelesstag.net/wta.aspx?link=NisJxz6FhUa4V67/cwCRWA or PM me for 50% off Wirelesstags!!

Offline Crannog

  • Member
  • *
  • Posts: 20
Re: Homemade Weather Station using a Raspberry Pi
« Reply #140 on: October 04, 2016, 06:09:00 PM »
Looks good, any issues with overheating? From initial analysis the BMP180 inside the box is 10 Deg C higher than outside and pi is running 10 Deg C higher again. I fear it may cook in the summer. I like the idea of a separate cooling fan and panel.

We installed last weekend  :grin:


Offline thorn

  • Senior Member
  • **
  • Posts: 51
Re: Homemade Weather Station using a Raspberry Pi
« Reply #141 on: October 07, 2016, 07:48:29 PM »

It gets warmer than outside, inside it got up to 101F this summer, but so far no problems. The fan blows from the bottom up past the temp sensor into the box and there are vents on the sides to let air and heat out.

I used a DC-DC buck converter connected directly to the solar panel for the fan:

http://www.riorand.com/riorand-lm2596-dc-dc-buck-converter-step-down-module-power-supply-output-1-23v-30v-1pcs-lm2596.html

I got them cheaper on Amazon.

Greg

Offline Crannog

  • Member
  • *
  • Posts: 20
Re: Homemade Weather Station using a Raspberry Pi
« Reply #142 on: November 19, 2016, 05:13:26 PM »
Hi,

Station has been up and running for 7 weeks.   Solar panel seems to be working OK. I'll probably take it down over Christmas and see if I can get camera upload to work with Gprs and add the SHT11 sensor. I noticed that the temp above lake at night is 4 degrees C warmer than surrounding area. It would be interesting to put temperature probe in lake water as well.

Offline weathernick

  • Senior Member
  • **
  • Posts: 90
Re: Homemade Weather Station using a Raspberry Pi
« Reply #143 on: February 24, 2017, 03:54:51 PM »
Just another update on my station.  The temperature/Humidity sensor failed a month ago. Turns out corrosion destroyed the sensor. I have since installed a second sensor and have sprayed the board with a conformal spray (I covered the humidity sensor naturally as I didn't want to coat that). Everything is back together and working great. The station is working so well I am placing most of my energy these days on my four homemade weather cameras. Amazing what you can do with Raspberry pi and now the new zero!

As for stability I have gone 6 months without the system rebooting. Would have gone another month had I not lost the temp/rh probe. Solar sensor is still working although I expect that sensor to failed here sometime.

Nickolas
PWS: Custom built with Raspberry Pi collecting the data from the sensors.
CWOP: EW5462
Wunderground: KAZYUMA27
Personal WX page: http://mccolls.weewx.s3-website-us-east-1.amazonaws.com/

Offline thorn

  • Senior Member
  • **
  • Posts: 51
Re: Homemade Weather Station using a Raspberry Pi
« Reply #144 on: March 04, 2017, 11:36:50 AM »

I had got an extra sensor just in case.

Mine has been running fine. The solar panel has been keeping the batt.  charged. I still need to setup the rain gauge.

How does your wifi work? I have not had much luck before with another Pi.

I need to get that going. I have a wifi router in the station.  :grin: But thunderstorm season will be here soon.

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7549
    • Eagle Bay Weather
Re: Homemade Weather Station using a Raspberry Pi
« Reply #145 on: March 04, 2017, 04:18:32 PM »
I have 4 Pi 3s and the wifi is rock solid.  Far better than my experience with Pi using external USB wifi
Need low cost IP monitoring?  http://wirelesstag.net/wta.aspx?link=NisJxz6FhUa4V67/cwCRWA or PM me for 50% off Wirelesstags!!

Offline thorn

  • Senior Member
  • **
  • Posts: 51
Re: Homemade Weather Station using a Raspberry Pi
« Reply #146 on: March 04, 2017, 05:09:28 PM »

I just got 2 more Pi 3s to experiment with, I wonder if I could just put the card I have from the Pi 2 to a Pi3? And then setup the wifi. I guess I could make a copy and try it.


I have 4 Pi 3s and the wifi is rock solid.  Far better than my experience with Pi using external USB wifi

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7549
    • Eagle Bay Weather
Re: Homemade Weather Station using a Raspberry Pi
« Reply #147 on: March 04, 2017, 05:32:40 PM »
Yup!  Will work - BTDT.  Then use raspi-config or the graphic version to set up wifi/
Need low cost IP monitoring?  http://wirelesstag.net/wta.aspx?link=NisJxz6FhUa4V67/cwCRWA or PM me for 50% off Wirelesstags!!

Offline weathernick

  • Senior Member
  • **
  • Posts: 90
Re: Homemade Weather Station using a Raspberry Pi
« Reply #148 on: March 05, 2017, 06:20:02 PM »
With the new Raspberry Pi Zero W released I am going to have to grab one of those and try out the wifi. I have my doubts I can make them work in my application but perhaps they will surprise me. If my weather station dies I will replace it with a Raspberry Pi 3 but hopefully that won't be for a while.

Nickolas
PWS: Custom built with Raspberry Pi collecting the data from the sensors.
CWOP: EW5462
Wunderground: KAZYUMA27
Personal WX page: http://mccolls.weewx.s3-website-us-east-1.amazonaws.com/

Offline thorn

  • Senior Member
  • **
  • Posts: 51
Re: Homemade Weather Station using a Raspberry Pi
« Reply #149 on: March 05, 2017, 07:30:12 PM »

I saved an image of my pi wx station, just in case. When I booted up it went into simulation mode for some reason. The fileparse was not the default in teh conf file. I'm not sure how it changed.

 I'll try swapping the Pi 3 when I get a chance. I setup the wifi on the new pi 3 and it seems to go 20ft with a good signal.

I got one the of the $5 zeros a while back to play around with, the wifi version would be much easier to use.

 

anything