Tuesday, January 15, 2013

Creating an Arduino Weather Center

I had some quick thoughts for a weather station addition to the Arduino, and didn't have anywhere else to put them.

Barometric Pressure :

Sparkfun has a breakout board that you can easily tie into your Arduino project.


Not sure how to use it yet as I don't have one.  (I'll figure it out if someone wants to contribute one to the cause.)

Temperature :

This is the easiest one of all.  There are numerous additions, but it's simple enough to use a thermistor on an analog input, and then calculate the formula.  It's actually fairly accurate.

Humidity :

Again, Sparkfun to the rescue.  They have a breakout board for a humidity sensor :


Once more, I've never tried it so I really don't know how to implement, but if someone wants to contribute one, I'll figure it out.

Wind Speed :

3D print an anemometer, and tie it to a DC motor or an optical rotary encoder.  It's a rather simple principle.  I grabbed a 3D file definition from Thingiverse (http://www.thingiverse.com/thing:19439), and had a buddy print it out :

Notice that there were some holes in it.  Once you have the basic form, use some epoxy-resin to give a smooth outside shape and fill in any holes.  Simply tie this to either a rotary encoder (higher resolution lets you detect slower wind speeds) and count the ticks as it rotates.

Or, with a DC motor, check the voltage output of the DC motor.

Of the two options, an optical rotary encoder may have less wear and tear, and give you a measurement that is accurate if you average the last three readings (because you don't know how long between the detents you were when starting the count or ending the count).  Not as accurate as a DC motor, but still a workable number (and easier to use - just tie the encoder to the interrupt, use the interrupt function to increment an internal count, and that will tell you how far you've rotated).  A real-time clock might be necessitated if you want true accuracy (e.g. https://www.sparkfun.com/products/99 ).

However, that mandates requiring the use of the interrupt pin, or putting a counter in the circuit.  I'd rather keep things simple, and also (rather than keeping a running sample) would rather have an instantaneous result.  I don't want a real-time clock, so I'm going with the DC motor design.  There are two kinds of DC motors.  A motor with brushes will be the easiest circuit to implement, but it also has a little friction in it due to it's design.  A motor without brushes will have less friction (and therefore a smaller measurement of wind speeds will be available), but their output is not constant (voltage will drop/spike over time).

I'm going with a Brushless DC motor, and adding in a capacitor inline to filter out the spikes.  That is then fed into a voltage divider to give me exactly what I need on an Arduino analog input pin.

Just as an FYI, a DC motor is also a generator (but there is an efficiency loss when you reverse it).  Turning the motor won't provide the same DC input that is required to drive the motor.  But, it's still a transducer, and it works.

Wind Direction :

For the wind direction, a 360 degree potentiometer (with no stops) would give you what you need, just look at the resistance.  No need for hall-effects sensors or anything.  You will need to calibrate it with an offset though (once you know true north).  A great 360 degree potentiometer would be available for about $15, from http://www.digikey.com/product-detail/en/6630S1D-B28-A103/6630S1D-B28-A103-ND/3534161 (You can buy in bulk to get cheaper prices, but I'd hope you are in the manufacturing line of work).

Many people think a rotary encoder would work here fairly well, but I disagree.  Unless your device is permanently powered, or you have a re-calibration mechanism set up, you'll start to lose accuraccy as soon as you start losing power to the device and things rotate.  In other words, don't use a rotary encoder for something like this.  A potentiometer will give you an instantaneous measurement you can use, even if you lose power and get it back.

Rainfall / Snowfall :

I haven't figured this one out yet.  If anyone has any ideas, feel free to drop me a line!


  1. Are pressure sensors accurate enough to measure weight of rainwater on a small catchment?

  2. Because it works on balance, it should be able to. Just build your bucket a little smaller. Note that when you do this, you'll get more state changes on the pins because it will move back and forth faster.

    I haven't been able to connect this up yet, because we've had an adoption process taking up all of my time (http://joeandshanadopt.blogspot.com/p/home.html). Let me know how your mileage is!