Weather Station

Tell us about your projects. Update us regularly.
Post Reply
User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Weather Station

Post by BeJay » Sun Jan 25, 2015 5:23 pm

Hello Makers!

I've decided to revisit my weather station / data acquisition setup, due to some house extensions happening later this year (hopefully?!) to allow for control of open-able skylights and louver windows which has made me think about the hodge podge setup I have now. At the moment i'm using so many different standards it's crazy.

I currently have rs232 for my power logging / temp sensors back to my server via usb - RS232 adapter, USB from a Chinese weather station running pywws to get wind and rain, and humidity and HTTP calls from an arduino with ethernet in the aquaponics for water temp and levels. I want to keep things modular, but not cloud connected like the internet of things these days.

I was thinking of using a Pi as the host sever and running all the weather stuff on that, using an arduino (due to hardware interupts) to poll the wind speed/direction and rain from my existing Chinese outside weather unit without the inside unit. The temp and humidity I was thinking about a DHT22 inside and outside which seem to work well with the arduino library already out there. The question then is do I use I2C to the Pi or serial USB?

So before I embark on this I'd see what you guys use for weather and go from there. Otherwise this could be a good opensource project to play with if there is an interest in it?

Cheers

Bj

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Weather Station

Post by parkview » Mon Jan 26, 2015 10:12 am

I am a BIG fan of the DS18B20 temperature sensors (cheap at under $3each from HK), easy to use and wire up, can be read from a PICAXE, Arduino or RPi. I don't track humidity, but I do use the https://www.adafruit.com/product/391 (which I see has now been superseded). i2c based, so very easy to use.

I don't track wind speed or direction and skip the rain, as I have a small yard, with lost of houses around, so I don't think it's worth it. I live ~ 2km from he BSN airport weather stn, so i have pondered about grabbing the airport xml file from BOM every 10min, and extracting the missing info into my weather DB... one day, most probably after a large storm passes by.

I haven't had a go at connecting an Arduino to a RPi yet, so can't help you out there. Would i2c be more reliable? I detest RS232! It's painful to debug and deal with. In the past I have wasted way to many hours trying to figure out wiring connections etc.

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Weather Station

Post by BeJay » Mon Jan 26, 2015 10:30 am

Yes I am currently using DS18B20's and picaxes pumping out rs232. I used the ol' crusty 9600baud because I have a rain water tank ~40m away and it works well on a CAT5 + power. The issue I suppose is that I need to have sensors all over the place that need to run on CAT5 back to the Pi for processing. I'm not sure how I2C would go on a twisted pair during lightning / electrical noise etc... I suppose I'll have to try it for distance. RS232 has been flawless ;)

The power logger I built for the Brother-in-Law uses Arduino to Pi using USB. It works well in that configuration, just no good if you need multiple arduinos like my current PICAXE arragement that all sit on an RS232 bus.

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Weather Station

Post by parkview » Mon Jan 26, 2015 1:28 pm

Ah, I thought you where asking about whether to use i2c vs. RS232 to connect the Arduino to the RPi. Yes, I would stick with i2c to bring the PICXE info back tot he RPi.

However, why not bring the DS18B20 data directly back to the RPi?

The 1-wire protocol should be able to handle 100m+ (1200' springs to mind) or further on Cat5. As long as they are all on one cable run. I think your allowed a (up to) 1m stub cable per sensor. If you want to use a star topology, then you need to use the 1-wire bus master chip that multiplexes all the cables into one input. I think you can have up to 128 1-wire devices per cable. Note: the RPi by default has a limit of 10 x DS18B20 sensors, but this can be overridden by a setting.

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Weather Station

Post by BeJay » Tue Jan 27, 2015 5:55 pm

Could bring it into I2C, but I still need 2 interrupt driven inputs for rain and wind. I may end up using an arduino for that and outputting I2C to the RPi bus... I'll breadboard that and see if I can get an arduino to do that...

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Weather Station

Post by BeJay » Wed Jan 28, 2015 1:46 pm

I tried an experiment to see how well the DHT22 was vs 2 x DS18b20.. There is a solid 0.3 degress in it over 21 - 38 degrees...

These DHTs aren't too bad considering they do humidity as well! I'm getting around 0.45oC error between the 2 x DS18b20's so they are in spec for +/- 0.5oC

Image

Now for the rain sensor....

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Weather Station

Post by parkview » Wed Jan 28, 2015 9:20 pm

how long does it take to read the DHT22?

That's one disappointing thing about the DS18B20 - the second so it takes to read it at it's highest resolution.

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Weather Station

Post by BeJay » Thu Jan 29, 2015 10:39 pm

over 9600 baud I can run a DHT up to 250ms for both temp an humidity... not bad ;)

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Weather Station

Post by BeJay » Fri Jan 30, 2015 6:05 pm

More testing today...

I2C seems to only go 6-8m unbuffered which is about right at 800 pF, and I2C only allows 400 pF to get the required edge speed.

That blows that idea. Seems RS232 has a bit more going for it or 484 etc. The problem is it will require a MAX232 equiv at each node to communicate with the host on a diode + edge bus. I haven't seen anything yet that is cheap and gives high speed (9600) over 100m..

The tinkering continues!

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Weather Station

Post by parkview » Fri Jan 30, 2015 6:59 pm

Another RPi out at the edge? Serial over Wireless?

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Weather Station

Post by BeJay » Sun Feb 01, 2015 10:34 am

I'd rather not use wireless, as it uses extra power and I have plenty of cables run for just such a project ;)

I've decided to use Serial TTL pull down from the arduino's direct serial interface. It runs happily over CAT5e up to 200m which is perfect. Also because of it's pull down nature (5V nominal) can have multiple Arduino 328Ps on the bus. I tried using the Pi's serial interface, but it will require a buffer to get it's levels up, so intead I used a MAX232 and a USB serial RS232 adapter.

May look at just making a buffer if the Rpi can cut the mustard,,, More testing,.,,

Here it is at 250m:

Image

Not bad really ;)

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Weather Station

Post by BeJay » Thu Feb 19, 2015 9:33 pm

I got the serial comms working using the UART on the Pi plus a couple of FETs... check out my blog for more bits

Here is my level converter:
Image

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Weather Station

Post by parkview » Sun Feb 22, 2015 5:52 pm

not very often you see discrete components these days. Usually one just slaps another chip in to handle the problem. keep the posts coming.

Post Reply