Gigabyte2
Posts: 94
Joined: Thu Jan 31, 2013 9:15 pm

Reading anemometer in Python

Wed May 28, 2014 2:42 pm

Hi! I'm making a little weather station, I've written a python script for reading DHT22 and BMP085 sensors.
Now I want to add wind speed value.
I've found this inexpensive sensor but I have to say how should I plug it in the Pi and how I can read the wind speed value in a Python script.

The sensor: http://www.maplin.co.uk/p/maplin-replac ... 96gy-n09qr#

Thanks

User avatar
DougieLawson
Posts: 37069
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Reading anemometer in Python

Wed May 28, 2014 2:56 pm

I assume it's a simple tacho (one pulse per revolution), so you'll need to make a pulse counter.
http://www.raspberrypi.org/forums/viewt ... 72&t=33113
Then it's just some maths to convert your pulse count to a wind speed.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Reading anemometer in Python

Wed May 28, 2014 4:45 pm

You will probably have searched already and know that there is a long (185 Posts) thread concerning the Weather Station of which this is a component here - http://www.raspberrypi.org/forums/viewt ... 37&t=14777 The anemometer is mentioned several times, but maybe only in the context of its intended use.

Otherwise, a search came up with:

http://www.raspberrypi.org/forums/viewt ... er#p534000

http://www.raspberrypi.org/forums/viewt ... er#p458561
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Gigabyte2
Posts: 94
Joined: Thu Jan 31, 2013 9:15 pm

Re: Reading anemometer in Python

Wed May 28, 2014 11:07 pm

I don't find what I need in these threads :|

User avatar
cyrano
Posts: 714
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Reading anemometer in Python

Wed May 28, 2014 11:36 pm

I'm guessing the anemometer is wireless?

If so, it's probably based on a 433 MHz chip and you need to find out which one. There aren't that many ways to communicate with these. Usually, it is serial 9600 bps. But you need a 433 MHz receiver. These are easy and cheap, fortunately.

Could you open up the sensor maybe?

Gigabyte2
Posts: 94
Joined: Thu Jan 31, 2013 9:15 pm

Re: Reading anemometer in Python

Thu May 29, 2014 6:40 am

The anemometer is wired :)

Gigabyte2
Posts: 94
Joined: Thu Jan 31, 2013 9:15 pm

Re: Reading anemometer in Python

Thu May 29, 2014 5:28 pm

The sensor should be plugged with a pull up 10K resistor.
I suppose (I haven't the sensor at home yet) that I should measure the revolutions in a time range and calculate wind speed.
I'd like to measure 10 sec and get the max wind gust and wind speed in this time interval.
But how should I choose the time range and how I can get the revolution value?

User avatar
DougieLawson
Posts: 37069
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Reading anemometer in Python

Sun Jun 01, 2014 3:04 pm

To calibrate it get a car moving at a known velocity. Stick your anemometer out of the window and take a reading. Do that for every 5Km/h from 5Km/h to 35Km/h so you get a range of counts (pulses per second). Turn round do the same sequence of readings going in the opposite direction (that should negate any errors from it not being a flat calm day). Rinse and repeat until you get enough readings to draw a line on a graph.

You can also get an approximate average wind speed from your nearest airport or airfield. For example you can get the weather at London Heathrow with http://aviationweather.gov/forecast?id=EGLL
I can get the weather for RAF Station Odiham from http://aviationweather.gov/forecast?id=EGVO
Or from Farnborough at http://aviationweather.gov/forecast?id=EGLF
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Gigabyte2
Posts: 94
Joined: Thu Jan 31, 2013 9:15 pm

Re: Reading anemometer in Python

Mon Jun 02, 2014 10:08 am

It's possible to find some code examples? I'd like to have a precise measurement as better as possible.
Thanks :)

Return to “Interfacing (DSI, CSI, I2C, etc.)”