Projects / Cup anemometer for wind speed

Cup anemometer for wind speed

Intermediate3.3 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. NANO

    Print the parts

    Print the cups, hub, disc and a frame with two bearing seats.

  2. NANOBEARIN

    Fit the bearings and shaft

    Check it spins freely with a light breath.

  3. NANO4.98V

    Mount the sensor

    Place the disc so it passes through the sensor gap.

  4. NANO12.8 mASSD1306

    Wire the Nano

    Connect the sensor and OLED as in the table.

  5. NANO

    Upload the sketch

    Spin the cups by hand and watch the value change.

  6. NANO

    Calibrate

    Hold it out of a car window at 20 and 40 km/h on an empty road, with a passenger reading the speed.

  7. NANO

    Adjust K

    Change K until the reading matches at both speeds.

  8. NANO

    Install

    Mount it high and clear of walls and trees.

In short

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

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Slot sensor VCCNano 5VPower
Slot sensor GNDNano GNDGround
Slot sensor DONano D2Pulse output, one per slot
OLED VCCNano 5VPower
OLED GNDNano GNDGround
OLED SDANano A4I2C data
OLED SCLNano A5I2C 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.

CheckExpected
Cups spun gently by handSmall speed shown
Cups spun fasterHigher speed and more rev/s
Car window at 20 and 40 km/hReading close to the car speed after calibration
Still airZero

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 →

Ask Lark AI

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.