Cup anemometer for wind speed
Build it step by step
0 of 8 donePrint the parts
Print the cups, hub, disc and a frame with two bearing seats.
Fit the bearings and shaft
Check it spins freely with a light breath.
Mount the sensor
Place the disc so it passes through the sensor gap.
Wire the Nano
Connect the sensor and OLED as in the table.
Upload the sketch
Spin the cups by hand and watch the value change.
Calibrate
Hold it out of a car window at 20 and 40 km/h on an empty road, with a passenger reading the speed.
Adjust K
Change K until the reading matches at both speeds.
Install
Mount it high and clear of walls and trees.
How do you build a cup anemometer for wind speed?
Three cups spin a shaft with a slotted disc, an optical sensor counts slots and the Arduino turns pulses per second into wind speed. You need Arduino Nano, Optical encoder speed sensor (slot, LM393), Bearings 608ZZ × 2, SSD1306 OLED Display and 3D printer PLA filament 1.75 mm (1 kg). It takes 8 steps and about 200 minutes.
- Level
- Intermediate
- Time
- About 200 min
- Parts
- 5
Parts list
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- Mechanical & HardwareBuyBearings 608ZZ × 2
- DisplaysBuy
- Tools & InstrumentsBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Slot sensor VCC | Nano 5V | Power |
| Slot sensor GND | Nano GND | Ground |
| Slot sensor DO | Nano D2 | Pulse output, one per slot |
| OLED VCC | Nano 5V | Power |
| OLED GND | Nano GND | Ground |
| OLED SDA | Nano A4 | I2C data |
| OLED SCL | Nano A5 | I2C clock |
Code
Print three cups on arms from a hub, with a 20-slot disc on the shaft, and mount the shaft in two 608 bearings so it spins freely. The slot sensor outputs a pulse as each slot passes. Revolutions per second are pulses divided by slots and by the counting time. A cup anemometer turns at only part of the wind speed, so the factor K must be calibrated: take it outdoors on an empty road, hold it clear of the vehicle and a passenger reads the speed at 20 and 40 km/h in still air, then adjust K until the readings agree. The starting value of 4.0 is a rough estimate only. Wind outdoors is gusty, so averages over 3 seconds are reasonable. Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones).
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// Libraries: Adafruit SSD1306 and Adafruit GFX.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const byte SLOTS = 20; // slots in the disc
const float K = 4.0; // km/h per revolution per second, calibrate this
const unsigned long WINDOW = 3000; // count pulses for 3 s
volatile unsigned int pulses = 0;
float gust = 0;
unsigned long gustStart = 0;
void onPulse() { pulses++; }
void setup() {
pinMode(2, INPUT);
attachInterrupt(digitalPinToInterrupt(2), onPulse, RISING);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
oled.setTextColor(WHITE);
gustStart = millis();
}
void loop() {
noInterrupts(); pulses = 0; interrupts();
delay(WINDOW);
noInterrupts(); unsigned int p = pulses; interrupts();
float rps = (float)p / SLOTS / (WINDOW / 1000.0);
float kmh = rps * K;
if (kmh > gust) gust = kmh;
if (millis() - gustStart > 600000UL) { gust = kmh; gustStart = millis(); } // 10 minute gust
oled.clearDisplay();
oled.setTextSize(3); oled.setCursor(0, 0); oled.print(kmh, 1);
oled.setTextSize(1); oled.setCursor(100, 18); oled.print("km/h");
oled.setCursor(0, 36); oled.print("Gust (10 min): "); oled.print(gust, 1);
oled.setCursor(0, 50); oled.print("rev/s: "); oled.print(rps, 2);
oled.display();
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Cups spun gently by hand | Small speed shown |
| Cups spun faster | Higher speed and more rev/s |
| Car window at 20 and 40 km/h | Reading close to the car speed after calibration |
| Still air | Zero |
If it does not work
Zero reading
Check the slot sensor LED blinks as slots pass.
Reading jumps
Check the disc does not wobble in the sensor gap.
Too slow to start
Reduce friction and use light cups.
Reading too high or low
Recalibrate K against a known speed.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the cup anemometer for wind speed?
Arduino Nano, Optical encoder speed sensor (slot, LM393), Bearings 608ZZ × 2, SSD1306 OLED Display and 3D printer PLA filament 1.75 mm (1 kg).
How long does the cup anemometer for wind speed take to build?
About 200 minutes for a intermediate maker, in 8 steps.
How do I know the cup anemometer for wind speed works?
Cups spun gently by hand: Small speed shown. Cups spun faster: Higher speed and more rev/s. Car window at 20 and 40 km/h: Reading close to the car speed after calibration.
Zero reading: what should I check?
Check the slot sensor LED blinks as slots pass.
Reading jumps: what should I check?
Check the disc does not wobble in the sensor gap.
Too slow to start: what should I check?
Reduce friction and use light cups.
Reading too high or low: what should I check?
Recalibrate K against a known speed.
