Weather Station idea


19 posts
by frasmacon » Sat Mar 30, 2013 4:47 pm
OK, first, I'm guessing this has been answered before but I couldn't find a topic, if someone just gives me a good topic, then I'll be fine but in case they don't:

For a school project, I need to make observations on the weather over a week, however due to the activities we will be doing on the week, it will not be reliable to check them manually as we are away from the centre most of the day and so can't get good readings.

My plan was to hook up various sensors like temperature, pressure, maybe humidity and try and build something for a wind speed/direction meter. I don't know how yet...

I was then going to write a program that takes measurements from said sensors and records them in a file, probably on a USB stick or something to avoid too many writes to the SD card and breaking it (We're talking a write every 10 minutes for 7 days and I don't want to break the card).

Power wise, I don't know about the power situation there, so what I had planned to do was to run the Pi off a battery which gets charged from a solar panel (or two). So charge battery and power the Pi by day with the panel, then power the Pi from the battery overnight.

So there are a few questions I'd like to ask:
  • Does anyone know of any good reliable sensors (I know a few, just from searching around on SparkFun and Adafruit and stuff) that I can connect through I2C or SPI or something?
  • Does anyone have any good ideas on how to measure wind speed? (I had in mind a motor hooked up to a ADC so the faster the wind the more power generated)
  • Wind direction doesn't really matter but if someone has a way to help it would be great.
  • Finally, how would I actually power the Pi with batteries and charge them up like I planned?

I am 14 so some of this stuff confuses me but I am a fast learner and understand the majority. The man thing that confuses me as the power stuff. I can understand how to power the Pi with the batteries. Just hook up 5V worth of batteries capable of powering the Pi current/watts wise to the 5V and GND pins on the power port. But apart from that I'm clueless.

Any help at all with the above issues would be greatly appreciated.

Thanks,
Fraser

TL;DR: Making weather station. Need suitable ideas for sensors like temp, pressure and humidity. Need ideas for device to measure wind speed and maybe direction. Need a way to power the Pi with a battery that gets charged in the daytime and then powers the Pi at night. TY in advance.
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by gordon77 » Sat Mar 30, 2013 5:43 pm
Hi,

To get started try a search on here with 'weather stations'.

Heres' one result that may help

viewtopic.php?f=37&t=14777&p=318044&hilit=weather+station#p318044

Gordon77
Posts: 722
Joined: Sun Aug 05, 2012 3:12 pm
by frasmacon » Sat Mar 30, 2013 7:17 pm
gordon77 wrote:Hi,

To get started try a search on here with 'weather stations'.

Heres' one result that may help

viewtopic.php?f=37&t=14777&p=318044&hilit=weather+station#p318044

Gordon77


So those Sint Wind Pi things are Pi powered weather stations?

It's interesting but not really what I'm looking for. I was looking for help with the things I said about in those bullet points.

However I did get ideas for the wind speed and direction things. For wind speed have a spinny thing (like those things with the cup things on) and every full turn it connects a switch. The program then calculates the speed in RPM by timing the intervals between the pulses.

For a direction, I was thinking of a wind vane connected to a rotary switch (which in turn might have to be connected to an IO Expander (running out of ports here :lol: )), and of course each position is a different direction.

Any help regarding those other things would be brilliant!
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by rpdom » Sat Mar 30, 2013 7:32 pm
frasmacon wrote:For a direction, I was thinking of a wind vane connected to a rotary switch


One way to do that, seeing as you will probably only need 16 directions, is to have a four-pole binary coded rotary switch. You could possibly make one by etching a pcb with a hole in the middle for the spindle and five sprung contacts. That will need 4 gpio pins total.

You'll probably need quite a big solar panel and battery to make sure you can supply enough power to run a Pi, especially in winter when there isn't much sun. A 12V lead acid battery should do it, and a switched power regulator to give you a constant 5V can be got very cheaply on ebay and will give fiarly good conversion efficiency.
Posts: 3117
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by frasmacon » Sat Mar 30, 2013 8:27 pm
rpdom wrote:
frasmacon wrote:For a direction, I was thinking of a wind vane connected to a rotary switch


One way to do that, seeing as you will probably only need 16 directions, is to have a four-pole binary coded rotary switch. You could possibly make one by etching a pcb with a hole in the middle for the spindle and five sprung contacts. That will need 4 gpio pins total.

You'll probably need quite a big solar panel and battery to make sure you can supply enough power to run a Pi, especially in winter when there isn't much sun. A 12V lead acid battery should do it, and a switched power regulator to give you a constant 5V can be got very cheaply on ebay and will give fiarly good conversion efficiency.


Ummm to the first paragraph.... I am so confused by it words cannot describe it (I'm fourteen you see :lol: )

For the batteries and solar panels and such, I just thought of a way to work it out and I would like it if someone who knows what they're on about to confirm this for me.

So my Model B 512MB Pi draws around 700mA, leaving whatever the input current is minus 700mA to be drawn from the GPIOs and it needs 5 volts. So that's 3.5 watts being drawn. However adding stuff onto the GPIOs will increase the current draw and so the wattage.

This is the bit I need confirmation with: So to power the Pi for H hours, I need a battery that supplies 5V with a max of 5W being drawn. The capacity of this battery in amp-hours would be H amp-hours then because 5V at 5W is 1A.

That may read absolutely terribly... So I have a picture of the equation I just did.I think :?

Image

For the solar panel, to charge the battery whilst the battery is powering the Pi, the solar panel I believe needs to pump more into the battery that the battery is giving out although I don't know in what. Like does the panel need to give out more current, more voltage, more what? So any other help on this topic and maybe some suggestions for other sensors would be lovely.
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by gordon77 » Sat Mar 30, 2013 8:44 pm
Posts: 722
Joined: Sun Aug 05, 2012 3:12 pm
by PaulCheffus » Sat Mar 30, 2013 9:05 pm
frasmacon wrote:I was then going to write a program that takes measurements from said sensors and records them in a file, probably on a USB stick or something to avoid too many writes to the SD card and breaking it (We're talking a write every 10 minutes for 7 days and I don't want to break the card).


Hi

I wouldn't worry I have had my weather station running for the last three months writing to the SD card every five minutes and it still going.

Cheers

Paul
Procrastination - The Thief of Time.
Posts: 372
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK
by frasmacon » Sat Mar 30, 2013 9:16 pm
PaulCheffus wrote:
frasmacon wrote:I was then going to write a program that takes measurements from said sensors and records them in a file, probably on a USB stick or something to avoid too many writes to the SD card and breaking it (We're talking a write every 10 minutes for 7 days and I don't want to break the card).


Hi

I wouldn't worry I have had my weather station running for the last three months writing to the SD card every five minutes and it still going.

Cheers

Paul


Oh OK, I may do it anyway just to save a bit of space, I've got this tiny USB stick that would fit perfectly.
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by frasmacon » Sat Mar 30, 2013 9:27 pm


It's helped a bit although it's really not suited to what I need.

Is a solar regulator really necessary?
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by gordon77 » Sat Mar 30, 2013 9:39 pm
I believe so to stop the battery being overdriven

Gordon77
Posts: 722
Joined: Sun Aug 05, 2012 3:12 pm
by frasmacon » Sat Mar 30, 2013 10:16 pm
gordon77 wrote:I believe so to stop the battery being overdriven

Gordon77


With some clever pre-thinking could you maybe rig it up in such a way in which it only just reaches maximum charge when the panel turns off. Or calculate how long it takes to charge the battery then disconnect the solar panel when it gets dark or when it's estimated it's full.

On a side note, what kind of batteries should I use. To be charged to near 100% in the day then run down again to be charged once more?

EDIT: Found this regulator: http://www.maplin.co.uk/solar-charging-regulator-37774 for only £17
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by winfried » Sat Mar 30, 2013 11:40 pm
Here you find everything about 1-Wire Sensors:

http://www.homechip.com/catalog/
http://owfs.org/

e.g.
- LinkUSB - 1-wire controller
- OW Environmental sensor Temp/Humidity/Light/Pressure Relay
Posts: 5
Joined: Sun Jul 29, 2012 1:08 pm
by frasmacon » Sun Mar 31, 2013 12:26 am
OK, So so far I have achieved the following.
  • Established most of the sensors I want to use (BMP085 for temp/pressure/altitude)
  • Found out how I'm going to measure wind speed (3 cups that spin round and trigger a pulse, find wind speed with an equation I'll find later
  • Measure wind direction with a 16 position binary coded rotary switch (I worked out what they are)
  • Found a solar controller to monitor/charge battery

So now I just need to get some batteries and buy components and stuff and start assembling and coding.

Any battery suggestions or humidity suggestions would be fantastic!

Thanks
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by sharix » Sun Mar 31, 2013 12:28 am
My weather station is recording data to the SD card every 10 minutes for more than 8 months now, accumulating over 10 MB or 400k lines of data, and still working flawlessly. So no worries here ;)
For humidity I suggest RHT03 (or DHT22, same sensor), which is well documented on the forums. Here is the code I'm using: https://github.com/technion/lol_dht22
Posts: 164
Joined: Thu Feb 16, 2012 11:29 am
Location: Slovenia
by frasmacon » Sun Mar 31, 2013 10:00 am
sharix wrote:My weather station is recording data to the SD card every 10 minutes for more than 8 months now, accumulating over 10 MB or 400k lines of data, and still working flawlessly. So no worries here ;)
For humidity I suggest RHT03 (or DHT22, same sensor), which is well documented on the forums. Here is the code I'm using: https://github.com/technion/lol_dht22


Oh OK, I'll just leave the SD card in then. Thanks for the code but I am trying to keep everything in python. I know how I'm going to program everything else. Is there a cheap-ish I2C or SPI humidity sensor. As I read somewhere that Python might not be fast enough to use the DHT22 as it uses some weird timing mechanism.
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by frasmacon » Sun Mar 31, 2013 10:22 am
I'd rather use this humidity sensor as it's the only relatively cheap one I found that doesn't a) Have some weird interface or b) requires to be bought in bulks of near 4000. It outputs a varying voltage depending on the humidity so could I just hook this up to an ADC?

https://www.sparkfun.com/products/9569
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by sharix » Sun Mar 31, 2013 11:28 am
Unfortunately, python can't be used with DHT22, because of the high speed of communication required (I think). Some more expensive humidity sensors that use a similar interface to I2C are the SHT family: http://www.sensirion.com/en/products/hu ... mperature/
These can also be bought at sparkfun.
Posts: 164
Joined: Thu Feb 16, 2012 11:29 am
Location: Slovenia
by frasmacon » Sun Mar 31, 2013 11:36 am
sharix wrote:Unfortunately, python can't be used with DHT22, because of the high speed of communication required (I think). Some more expensive humidity sensors that use a similar interface to I2C are the SHT family: http://www.sensirion.com/en/products/hu ... mperature/
These can also be bought at sparkfun.


Yeah that's what I thought. I saw those sensors and had a look into those but in searching I found that sensor I posted before your post for cheaper than those ones were. I also already have an ADC or two so this (https://www.sparkfun.com/products/9569) is fine for me.
Posts: 45
Joined: Thu Jan 24, 2013 9:22 pm
by tb63 » Sun Mar 31, 2013 4:42 pm
Have a look at my project.
It is a Sint Wind , a remote weather station with telephone answering capability, data logging, web data publish, webcams , digital cameras .... we use it for Hang Gliding and Paragliding . It support several weather sensors ad also auto build sensors
Image

Documentation and source code in python on
http://www.vololiberomontecucco.it/vlmc/index.php?option=com_content&view=category&layout=blog&id=13&Itemid=169 Use google translator :-)
Posts: 14
Joined: Mon Aug 06, 2012 2:40 pm