Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
BETTESWORTHConstruction
Anemometer

DIY Arduino Wind Speed Meter: Build a Cup Anemometer

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

The simplest practical DIY Arduino wind-speed meter uses a three-cup rotor, one magnet, and a reed switch or Hall-effect sensor. As the cups rotate, the magnet creates one electrical pulse per revolution. The Arduino counts those pulses, calculates rotational frequency, and converts it to an estimated wind speed.

This project is excellent for a weather station, construction-site monitoring prototype, classroom, or comparative measurement system. It is not automatically a certified meteorological instrument: a homemade rotor must be calibrated, protected from weather, and kept away from safety-critical decisions.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How an Arduino anemometer works

An anemometer measures wind speed. The Arduino does not measure wind directly; it measures the rotor’s behavior.

  1. Wind pushes three cups around a horizontal rotor.
  2. A magnet fixed to the rotor passes a stationary reed switch or Hall-effect sensor.
  3. Each passage creates one digital pulse.
  4. The Arduino counts pulses during a fixed time window.
  5. A calibration factor converts pulse frequency into wind speed.

A cup anemometer measures speed, not direction. Add a separate wind vane and angle sensor if direction is required.

Popular on Amazon
Weather Meter Kit | Station includes Analog sensors Wind vane Cup anemometer Tipping bucket rain gauge RJ11 terminated cables
  • Kit represents the three core components of weather measurement: wind speed, wind direction and rainfall.
  • It uses sealed magnetic reed switches and magnets so you'll need to source a voltage to take any measurements.
  • All of the sensors in the weather meter kit are passive components. This means you will need a voltage source in order to measure anything with them.
  • Sensors include Wind vane, Cup anemometer, Tipping bucket rain gauge. RJ11 terminated cables.
  • Stand: Two-part mounting mast, Rain gauge mounting arm, Wind meter mounting bar, 2x Mounting clamps and 4x Zip ties.

Choose the sensor arrangement

Reed switch: the easiest DIY option

A reed switch is a sealed mechanical contact that closes when a magnet passes nearby. It needs no sensor power, so one lead can connect to an Arduino input and the other to ground using the Arduino’s internal pull-up resistor.

This is the lowest-cost and easiest arrangement for a beginner. Its weaknesses are contact bounce, mechanical wear, and susceptibility to noise on long outdoor cables. SparkFun’s pulse-output anemometer uses this general arrangement and publishes a conversion of 1.492 mph, or 2.4 km/h, for one switch closure per second. That is a product-specific factor, not a universal formula for homemade rotors. See the SparkFun anemometer specifications.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Hall-effect sensor: better for durable builds

A Hall-effect sensor detects the magnet electronically, eliminating mechanical contacts. It generally requires power, ground, and an output connection. Some devices have open-collector outputs and need a pull-up resistor; others are modules with a built-in pull-up.

Check the exact part’s voltage range, pin order, output polarity, and required magnet spacing before wiring it. A Hall sensor can be more durable and cleaner at high speed, but it is not automatically more accurate: rotor balance, bearings, airflow, and calibration remain decisive.

Analog commercial sensor: least mechanical work

An analog-output anemometer avoids fabricating the rotor. Adafruit’s documented sensor specifies a 0.4–2.0 V output, 7–24 VDC supply, a stated testing range of 0.5–50 m/s, 0.2 m/s starting wind speed, and 0.1 m/s resolution. Its published worst-case accuracy specification is 1 m/s. Consult the manufacturer’s product documentation for the current specifications.

Do not connect its 7–24 V supply wire to an Arduino input or attempt to power it from a 5 V logic pin. Only the signal wire goes to the analog input, with a shared ground and a suitable separate supply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Also popular on Amazon
Sale
Handheld Anemometer Wind Cup 93MPH, AIOMEST 881M Air Flow Speed Meter Gauge
  • INDOOR & OUTDOOR WIND METER: AIOMEST AI-881M Handheld cup anemometer measures higher air velocity 1.5-93 mph (0.7~42m/s) with 0.1 resolution and ±4% accuracy; Instantly switch wind speed between MPH, Knots, KM/H, or M/S. Essential windspeed meter for HVAC airflow CFM balancing, drone flying, sailing, boat fishing and backyard weather monitoring.
  • WHY AIOMEST CUP ANEMOMETER: 360° sensitive wind cup sensor—Easier and more reliable than most hand held vane anemometers that must be pointed straight into the air flow.​ Just hold the AI-881M windmeter upright​ near an HVAC vent or outdoors; the anemometro cups spin from any horizontal direction to test slight breeze. This means faster diagnostics for HVAC technicians​ and easier monitoring for drone pilots/boating.
  • Wind Chill, Temperature & Beaufort Scale: Hand held wind gauge AI-881M wind tester shows real-time, max and average wind speed with air temperature (14°F ~ 113°F) , wind chill indicator and BFT scale display together, helping you judge comfort, safety and wind force at a glance. 1.61" HD backlit LCD stays crystal clear whether you're checking CFM air flow condition indoor AC vents​ in a dim basement or monitoring outdoor wind​ at day.
  • TRIPOD MOUNTABLE & BUILT-IN COMPASS: Identify wind direction instantly with the top compass. The 1/4" thread mounts to most tripod for hands-free wind monitoring—AI-881M wind measurement device ideal for long-term indoor air quality testing​ for HAVC system, household air balance, workshop’s dust collection system or tracking outdoor storm gusts in hunting/shooting, golf RC plane flying and wind surfing etc.
  • HANDHELD HVAC WIND METER: Compact size(165×51×38mm) and 116g lightweight (4 oz) with a portable wind reader carrying case included to protect it during travel or job site visits. Features Data Hold, Auto Power-Off, and Low Battery Alert. Backed by a 365-Day Warranty. It’s built to be your go-anywhere weather station—delivering precise wind speed data, unlike windsock​ that only indicates wind direction.

Parts and tools

  • Arduino Uno R3, Nano, or compatible 5 V board
  • Three lightweight cups, such as plastic hemispheres, table-tennis-ball halves, small containers, or 3D-printed cups
  • Rigid hub and straight shaft
  • Two low-friction bearings
  • Small neodymium magnet
  • Reed switch or digital Hall-effect sensor
  • Weather-resistant enclosure, cable glands, and outdoor-rated cable
  • Mast or mounting bracket
  • Wire, connectors, and a 5 V regulated supply
  • Optional 100 nF capacitor, display, SD-card module, or wireless board

The Uno R3 is a convenient reference platform because it has 14 digital I/O pins, six analog inputs, and external interrupts on digital pins 2 and 3. See the official Uno R3 documentation.

Build the cup rotor

  1. Space three arms 120 degrees apart. Equal spacing helps the rotor respond consistently.
  2. Use identical cups. Match their size, weight, angle, and opening direction.
  3. Make the hub rigid. Flexing arms change the rotor’s balance and calibration.
  4. Install a straight shaft. Support it with low-friction bearings rather than letting it rub directly against a hole.
  5. Balance the assembly. Spin it by hand and look for wobble or a heavy side.
  6. Mount one magnet to the rotor. Fix the sensor to the stationary frame so the magnet passes it once per revolution.

All cups must face the same rotational direction. Unequal cup angles or masses can cause vibration, poor low-speed starting, and different readings as wind direction changes.

For a reed switch, place the magnet close enough to create one reliable closure but not so close that the switch stays closed. For a Hall sensor, verify the output changes state once per revolution and that the sensor does not chatter near its switching threshold.

Wire a reed switch to an Arduino Uno

Component Arduino Uno
Reed-switch lead 1 D2
Reed-switch lead 2 GND
Optional 100 nF capacitor Across the switch or near the input, only if needed

The input is normally HIGH and becomes LOW when the switch closes. The circuit uses the Arduino’s internal pull-up:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
pinMode(ANEMOMETER_PIN, INPUT_PULLUP);

Use D2 or D3 on a classic Uno. Use digitalPinToInterrupt() rather than assuming interrupt numbers, because pin mappings vary between boards. The relevant Arduino interrupt documentation lists the supported mappings.

Wire a Hall-effect sensor

Hall sensor Arduino Uno
VCC Sensor-rated 5 V or 3.3 V
GND GND
OUT D2

Do not assume every three-pin module uses the same pin order. Confirm its datasheet and determine whether the output is active LOW or active HIGH. If it uses an open-collector output without an onboard pull-up, add an appropriate pull-up resistor or enable a compatible internal pull-up.

Also popular on Amazon
MOBUTOFU Replacement Anemometer Cup 3-Cup Wind Measurement Sensor for Wind Speed Meter Gauge Air Flow Meter Weather Station Monitoring 6.69 X 6.69 X 1.96 in 1 Pack
  • Core Measurement: This replacement anemometer cup is designed for wind speed measurement and wind direction-related monitoring, helping support use in weather station setups, outdoor anemometer applications, and airflow meter replacement needs
  • 3-Cup Design: the wind gauge cup uses a 3-cup structure with small rotational resistance, which supports responsive turning in moving air and helps the sensor capture wind conditions with consistent motion during daily use
  • Compact Build: Measuring 6.69 x 6.69 x 1.96 in, this wind measurement sensor is small and lightweight for easier carrying, handling, and assembly, making it suitable for replacement tasks where space and setup convenience matter
  • Practical Material: Made with premium and sturdy materials, this wind sensor is built for safe use and steady performance, offering a replacement option for equipment that needs a reliable anemometer cup in outdoor or monitoring environments
  • Replacement Only: Package includes 1 x replacement 3-cup sensor with no base, making it a direct-fit option for replacing a worn wind measurement cup, and a practical choice for maintenance of wind speed meter and weather station equipment

Upload a pulse-counting sketch

The following sketch uses an interrupt, a five-millisecond software debounce interval, and a one-second measurement window. It uses the SparkFun factor as an initial example only; replace the constants after calibrating your own rotor.

const byte ANEMOMETER_PIN = 2;

// Published for the specified SparkFun anemometer:
// 1 closure per second = 1.492 mph
const float MPH_PER_HZ = 1.492;
const float KMH_PER_HZ = 2.4;
const float MS_PER_HZ  = 0.6669;

volatile unsigned long pulseCount = 0;
volatile unsigned long lastPulseMicros = 0;
const unsigned long DEBOUNCE_US = 5000;

void countPulse() {
  unsigned long now = micros();
  if (now - lastPulseMicros >= DEBOUNCE_US) {
    pulseCount++;
    lastPulseMicros = now;
  }
}

void setup() {
  Serial.begin(9600);
  pinMode(ANEMOMETER_PIN, INPUT_PULLUP);

  attachInterrupt(
    digitalPinToInterrupt(ANEMOMETER_PIN),
    countPulse,
    FALLING
  );

  Serial.println(F("Arduino wind-speed meter"));
}

void loop() {
  static unsigned long lastMeasurement = 0;
  const unsigned long measurementPeriod = 1000;
  unsigned long now = millis();

  if (now - lastMeasurement >= measurementPeriod) {
    lastMeasurement += measurementPeriod;

    noInterrupts();
    unsigned long pulses = pulseCount;
    pulseCount = 0;
    interrupts();

    float seconds = measurementPeriod / 1000.0;
    float frequencyHz = pulses / seconds;
    float windMph = frequencyHz * MPH_PER_HZ;
    float windKmh = frequencyHz * KMH_PER_HZ;
    float windMs  = frequencyHz * MS_PER_HZ;

    Serial.print(F("Pulses: "));
    Serial.print(pulses);
    Serial.print(F(" | Hz: "));
    Serial.print(frequencyHz, 2);
    Serial.print(F(" | Wind: "));
    Serial.print(windMs, 2);
    Serial.print(F(" m/s, "));
    Serial.print(windKmh, 2);
    Serial.print(F(" km/h, "));
    Serial.print(windMph, 2);
    Serial.println(F(" mph"));
  }
}

Open the Serial Monitor at 9600 baud. With no pulses, the output should be similar to Wind: 0.00 m/s. With one accepted pulse during a one-second window, the example factor produces approximately 0.67 m/s, 2.4 km/h, or 1.49 mph.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the code is structured this way

  • attachInterrupt() catches an edge even when the main loop is doing other work.
  • volatile tells the compiler that the interrupt routine changes the counter.
  • noInterrupts() briefly protects the multi-byte counter while it is copied and reset on an 8-bit board.
  • millis() keeps timing non-blocking, leaving room for displays, logging, wind direction, or wireless transmission.
  • The debounce interval prevents one reed-switch closure from becoming several pulses.

If your sensor transitions HIGH instead of LOW, change FALLING to RISING. Test the signal by turning the rotor slowly by hand.

Choose the measurement window

A one-second window is easy to understand, but at low wind speeds one pulse causes a large step in the result. For a steadier average, change the period to 5 or 10 seconds:

const unsigned long measurementPeriod = 10000;

A longer window improves low-speed resolution and reduces visible noise, but it responds more slowly and can hide short gusts. A useful weather display can retain a fast raw estimate, a five- to ten-second average, and a maximum gust value separately.

Advanced designs measure the time between pulses and use a relationship such as wind speed = calibration factor / period. Period measurement can resolve slow rotation better, but it needs timeout handling when no pulse arrives and can be destabilized by one false edge or a bounced switch. Window counting is the better starting point.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Also popular on Amazon
60m/s Outdoor 3 Cup Anemometer Sensor Output RS485 4-20MA 0-5V Polycarbon Fiber Wind Speed Direction(0-10V Kit)
  • Anemometers
  • The measuring range is 0-360 °
  • Accuracy: ± 1 °
  • Resolution: 0.1 °
  • Starting wind speed: 0.5 m/s

Calibrate the rotor

Calibration matters more than the Arduino’s numerical resolution. The SparkFun conversion factor applies to that specified product. A homemade rotor’s response depends on cup diameter and depth, cup angle, rotor radius, friction, bearings, magnet placement, imbalance, and airflow around the installation.

Preferred method: compare with a reference

  1. Place the DIY anemometer beside a trusted handheld anemometer or in a calibrated wind tunnel.
  2. Record pulse frequency and reference speed at several points, such as 0.5, 1, 2, 5, and 10 m/s.
  3. Repeat each point and average the readings.
  4. Fit a relationship such as wind speed = slope × frequency + offset.
  5. Use a zero intercept only if testing shows it is appropriate. Startup friction can make the real relationship non-zero at low speed.
  6. Replace the example constants in the sketch with your fitted calibration.

Keep the calibration conditions similar to the final installation. A rotor mounted beside a roof, wall, tree, scaffold, or other obstruction can read differently from one in smooth, unobstructed airflow.

Approximate field comparison

On a calm day, some builders compare the instrument with vehicle GPS speed. Make runs in opposite directions and average them to reduce the effect of ambient wind. Keep the sensor outside disturbed airflow from the vehicle. This is only an approximate comparison, not laboratory calibration, because vehicle aerodynamics, gusts, GPS error, and mounting position all affect the result.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Analog-output alternative

For the Adafruit sensor’s published endpoints, a basic Uno reading can be calculated like this:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const byte WIND_PIN = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int raw = analogRead(WIND_PIN);
  float voltage = raw * (5.0 / 1023.0);

  // Linear interpretation of the published 0.4–2.0 V endpoints.
  float windMs = (voltage - 0.4) * (32.4 / 1.6);
  if (windMs < 0) windMs = 0;

  Serial.print(F("Voltage: "));
  Serial.print(voltage, 3);
  Serial.print(F(" V | Wind: "));
  Serial.print(windMs, 2);
  Serial.println(F(" m/s"));

  delay(500);
}

This is a linear interpretation of the published endpoints, not a replacement for the supplied calibration curve. Check the current Adafruit documentation before building around the values.

Add a display, logging, or wireless data

  • Local display: Add a 16×2 I2C LCD or OLED and show current speed plus a moving average.
  • Data logging: Add a microSD module and record timestamp, pulse count, average speed, and maximum gust.
  • Wireless monitoring: Use an Uno R4 WiFi or ESP32-class board for MQTT, a web dashboard, or Home Assistant. Many ESP32 boards use 3.3 V logic, so check sensor compatibility.
  • Wind direction: Add a vane with a potentiometer, resistor ladder, magnetic switches, or an electronic angle sensor.

An Uno R4 Minima is a newer 5 V Uno-style option with a 32-bit RA4M1 processor and up to 14-bit analog resolution, but AVR-specific code and libraries written for the Uno R3 may not behave identically. See the official Uno R4 Minima specifications.

Weatherproof the installation

  • Use cable glands and outdoor-rated cable.
  • Create drip loops so water does not run into the enclosure.
  • Protect connectors and sensor junctions from water and corrosion.
  • Support the reed switch or Hall sensor firmly so vibration cannot change alignment.
  • Use low-friction, weather-tolerant bearings and inspect them periodically.
  • Do not hermetically seal an enclosure without accounting for condensation; a suitable ventilated or pressure-equalized enclosure may be better.
  • Mount the rotor where buildings, roofs, trees, walls, and scaffolding do not distort the airflow.

Secure a mast against wind loading, route cables safely, and provide appropriate lightning and electrical protection. Do not use this DIY instrument for crane operations, structural decisions, aviation, official meteorological reporting, or other safety-critical work.

Troubleshooting

The reading stays at zero

  1. Rotate the cups by hand and confirm the magnet passes the sensor.
  2. Test reed-switch continuity with a multimeter.
  3. Check Hall-sensor power, ground, and output polarity.
  4. Confirm the Arduino input is D2 or D3 on a classic Uno.
  5. Try RISING instead of FALLING.
  6. Reduce the sensor gap and confirm the rotor turns freely.

The reading is much too high

Suspect reed bounce, a magnet triggering multiple times per revolution, Hall-sensor chatter, cable noise, or accidentally installed multiple magnets. Increase the gap slightly, verify one pulse per revolution, retain or adjust debounce, and consider shielded or twisted-pair cable, filtering, or a Schmitt-trigger input.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The reading is too low

Look for missed pulses, poor alignment, intermittent outdoor connections, excessive friction, cups that are too small, or interrupts being disabled too long elsewhere in the program. Recheck the calibration factor.

The reading is noisy

Separate mechanical vibration and electrical noise from genuine turbulence. Balance the rotor, improve the mounting, check switch debounce, increase the averaging window, and move the sensor away from obstructions. Preserve raw pulse data if you need to identify gusts.

When buying is better than building

Choice Best for
Homemade cups, magnet, reed switch, Arduino Lowest-cost educational project and full mechanical control
SparkFun individual anemometer Ready-made pulse-output rotor without buying a complete weather station
SparkFun Weather Meter Kit Wind speed, direction, and rainfall in one system, with an associated Arduino library
Adafruit analog anemometer Documented analog output when fabricating a rotor is undesirable
Uno R4 WiFi or ESP32-class board Remote logging, dashboards, MQTT, and Home Assistant integration

Prices and availability change, so check the linked manufacturer pages immediately before purchase. The right choice depends on whether you want to build the rotor, only the measurement electronics, a complete weather station, or a more repeatable commercial sensor.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.