This tutorial explains how to build an anemometer publishing wind speed to Pachube once per minute. It needs no computer - it’s based on an Arduino with and ethernet shield and requires the Inspeed Wind Sensor for callibrated wind speed measurement. There are cheaper ways to do this, but this is the most accurate and easiest for the price.
The Pachube Office wind sensor feed is here: http://www.pachube.com/feeds/7535

Here’s what you will need:
- Arduino Duemilanove, with the non-standard ADAboot bootloader (see below), $30
- Ethernet shield $45
- Inspeed Vortex Wind Sensor ($55) or in the UK
- 12-15K resistor
- Power supply for the Arduino ($6)
- misc. wires
It’s a pretty straightforward process, but there’s a lot of explanation below so that you know exactly what’s going on.
1. Create a Pachube ‘manual’ feed
Login to Pachube and register a feed. There are only two obligatory things to set: the feed type (manual) and the feed title (whatever you want). You can also set your location using the map interface and provide a description, but these are optional. Similarly, you can set up the datastreams if you want to now, but these will be created automatically the first time the sensor publishes.
If you do set up the datastreams now, you need to click ‘add’ and tag the first datastream something like ‘wind speed’ and set the units to ‘metres per second’ (symbol: m/s, type: derived SI) and the second datastream something like ‘updates’ (with no units). This second datastream is going to indicate how many updates in a row have been sent before the unit got reset for some reason.
Note down the feed ID (that’s the number in the URL, e.g. in ‘http://www.pachube.com/feeds/7535’) of your new feed.
2. Program the Arduino
This code, built on dotmancando’s Arduino/Ethernet/DHCP code requires LadyAda’s ADABoot bootloader to be programmed in your board, since it makes use of the watchdog timer to reset the ethernet shield in the case it crashes or loses its internet connection.
You can program this bootloader by following her instructions (which requires an AVR programmer) - or it might just be easier to buy a 328 chip with the bootloader already on it for $6.
Once the bootloader is programmed, download the Anemometer code and edit the following lines:
#define LOCALFEED 7535 // feed number here #define APIKEY "ENTER YOUR API KEY HERE" // replace your pachube api key here
First enter the feed ID of your feed and then paste in your API key (which you will find in your control panel under ‘settings’, i.e. 'http://www.pachube.com/users/[your username]/settings'.
3. Create the reset connection on the Arduino ethernet shield
Your Arduino needs to be able to reset the ethernet shield in case it loses its IP address. In order to do this, we first bend out the ethernet shield pin from the Arduino’s reset input (since we want the Arduino to be able to reset the shield, but not itself)...
... and then connect pin 9 to the ethernet shield’s reset input.
4. Connect the wind sensor
The wind sensor sends (i.e. it closes a connection) one pulse per second for every 2.5 mph of wind measured (or 1.1176 metres per second which is what we want to measure).
So we count the number of closed connections over 60 seconds and then average the number of clicks detected. We use one of Arduino’s interrupts, since this is the quickest way of incrementing numbers, just in case we find ourselves in a tornado and having to measure many hundreds of clicks per second!
That’s the bit of code in setup that says:
attachInterrupt(0, clicker, RISING);
... which calls the function clicker:
void clicker(){
clicks++;
}
In order to count the closed connections though, we need to add a pull down resistor connecting our interrupt pin (interrupt 0 is actually on digital pin 2) to ground, while the wind sensor connects our interrupt pin to 5V.
What happens is that, when no connection is made, pin 2 sees a voltage of 0, via the pull down resistor; then as soon as the wind sensor spins round, it closes its internal contact, making the connection between pin 2 and 5V - and since there is a 12k resistor connecting it also to ground, this ensures that it doesn’t short out.
5. Plug-in power and ethernet
The code includes a DHCP library so the unit should automatically get an IP address when you plug in power and the ethernet cable. You can debug using the Arduino serial window, or go to the Pachube feed page and after a minute or so it should turn ‘live’ and show some values.
That’s it! Have a look at the Pachube anemometer here: http://www.pachube.com/feeds/7535
And of course, let us know how you get on!
| Attachment | Size |
|---|---|
| pachube_anemometer_01.zip | 3.67 KB |




Recent comments
4 days 22 hours ago
5 days 7 hours ago
5 days 7 hours ago
5 days 15 hours ago
6 days 22 hours ago
1 week 1 day ago
1 week 3 days ago
1 week 3 days ago
2 weeks 5 hours ago
2 weeks 6 hours ago