Measure wind speed with the anemometer

FunduinoPublished on

Ein Schalenanemometer auslesen und den Messwert in km/h umrechnen

Ein Schalenanemometer ist im Grunde ein kleiner Generator: Der Wind dreht die Halbschalen, die Drehbewegung treibt einen Gleichstrommotor an, und je stärker der Wind weht, desto höher ist die Spannung. Genau diese Spannung liest der Arduino ein.

In dieser Anleitung schließt du das Anemometer an, lässt dir den rohen Sensorwert anzeigen und rechnest ihn anschließend über einen selbst ermittelten Referenzwert in eine Windgeschwindigkeit um.

Cup anemometer with three hemispherical cups next to an Arduino
The cup anemometer in the setup

You need this

Anemometer - wind speed meter for Arduino Anemometer - wind speed meter for Arduino 26,18 € *Item no. F23107149About the product — Anemometer - wind speed meter for Arduino
Funduino Nano R3 Microcontroller - ATmega328P, CH340, Soldered Funduino Nano R3 Microcontroller - ATmega328P, CH340, Soldered 9,18 € *Item no. FUN-1010562About the product — Funduino Nano R3 Microcontroller - ATmega328P, CH340, Soldered
Expansion board for Arduino Nano R3 - screw terminals, 30 pins Expansion board for Arduino Nano R3 - screw terminals, 30 pins 2,43 € *Item no. F23106779About the product — Expansion board for Arduino Nano R3 - screw terminals, 30 pins
Screw terminal shield - 20 I/O pins, for Arduino UNO R3 Screw terminal shield - 20 I/O pins, for Arduino UNO R3 4,00 € *Item no. F23108559About the product — Screw terminal shield - 20 I/O pins, for Arduino UNO R3

All 4 parts together 41,79 € *

* All prices include statutory VAT, plus shipping costs.

How a cup anemometer works

An anemometer is one of several instruments used to measure airflow speed. Its design is usually very simple.

We use a cup anemometer, also called a cup wheel or spherical cup anemometer. The wind is caught by the hemispherical cups and drives the vertical rotor shaft. Thanks to the shape of the cups, the assembly always rotates in the same direction, no matter where the wind comes from. A shaft transfers the rotational motion to a DC motor, where the generator effect produces direct current. The faster the rotor spins, the higher the voltage.

Cup anemometer with three hemispherical cups next to an Arduino
The cup anemometer in the setup

Connect the anemometer

The Arduino has analog inputs that can read a voltage. Even in strong winds, our anemometer generates less than 5 volts, so you can connect it directly without any additional modules.

We also use a screw terminal shield to make it easier to connect the cable ends. In the sketches, the anemometer is connected to analog pin A7.

Note when choosing a board: The analog pin A7 is available on the Arduino NANO, but not on the UNO, where the analog inputs end at A5. If you’re using an UNO, connect the anemometer to an available analog pin and enter that pin in the sketch instead of A7.

Anemometer on Arduino NANO with expansion board for screw terminals
Connection via a screw terminal shield

Read sensor value

Programming is just as straightforward: The sketch only measures the voltage at the analog pin and outputs it. The raw sensor value is displayed in the serial monitor first.

Serial monitor with the anemometer sensor readings
The raw sensor value in the serial monitor
Read the anemometer sensor value
// Das Anemometer wird am analogen Pin A7 angeschlossen.
// Wir nennen den Pin ab jetzt "Sensor".
int Sensor = A7;
// Unter der Variablen "sensorwert" wird der Spannungswert des Sensors gespeichert.
int sensorwert;
// Der Wert fuer "t" gibt die zeitlichen Abstände zwischen den Messungen vor.
int t = 500;

void setup()
{
  // Im Setup beginnt die serielle Kommunikation. Über sie sendet das Board die
  // Messwerte an den Computer. In der Arduino-Software startest du den seriellen
  // Monitor unter "Werkzeuge", um die Messwerte zu sehen.
  Serial.begin(9600);
}

void loop()
{
  sensorwert = analogRead(Sensor);  // Auslesen des Sensorwertes
  delay(t);                         // Nach jeder Messung eine kurze Pause

  Serial.print("Sensorwert des Anemometers: ");
  Serial.println(sensorwert);
}

From Sensor Reading to Wind Speed

The numbers shown are not wind speeds yet, just sensor readings. To convert them into a speed, you need the map command—and first, a reference value: you need to know which sensor reading corresponds to which speed.

An example from our test: We put the setup and laptop in a car and held the sensor out of the window at 50 km/h. The reading was 500. We enter these two numbers in the map command.

Your own reference values will differ—determine them once and add them to the sketch.

Serial monitor with the converted wind speed
After conversion: the wind speed
Convert the sensor reading into a wind speed
// In der neuen Variablen "Wind" speichern wir die Windgeschwindigkeit.
int Wind = 0;
// Das Anemometer wird am analogen Pin A7 angeschlossen.
int Sensor = A7;
// Unter der Variablen "sensorwert" wird der Spannungswert des Sensors gespeichert.
int sensorwert;
// Der Wert fuer "t" gibt die zeitlichen Abstände zwischen den Messungen vor.
int t = 500;

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

void loop()
{
  sensorwert = analogRead(Sensor);  // Auslesen des Sensorwertes
  delay(t);                         // Nach jeder Messung eine kurze Pause

  // Der Sensorwert 500 entspricht in unserem Test 50 km/h.
  // Diese beiden Werte stehen hinten im map-Befehl.
  Wind = map(sensorwert, 0, 500, 0, 50);

  Serial.print("Windgeschwindigkeit: ");
  Serial.println(Wind);
}
Rate the instructions

Comments

2 posts
Funduino TeamTeam

Hallo Norman, gute Frage! Durch die Form der Halbschalen dreht sich das Anemometer bei Wind immer in dieselbe Richtung, egal woher er kommt. Im normalen Einsatz läuft es also nicht rückwärts. Anders ist es, wenn die Schalen mechanisch rückwärts gedreht werden: Dann kehrt der eingebaute Generator die Polarität um, und an A7 liegt eine negative Spannung an. Die liegt außerhalb dessen, was der Analogeingang des NANO laut Spezifikation verträgt. Wenn das in deinem Aufbau vorkommen kann, schütze den Eingang, zum Beispiel mit einer Schottky-Diode von A7 nach GND (Kathode an A7) und einem Vorwiderstand von etwa 1 kΩ.

Funduino Team

Norman Buschmann

Was mache ich, wenn das Anemometer später im Einsatz mal rückwärts läuft? Kann der Nano dadurch beschädigt werden?

Ask a question or share an experience

Contact us if something doesn’t work. Please include your board and the error message.

We review every comment before publication. Your email address remains with us.