Wind Direction Measurement

Introduction

This experiment shows how to measure the wind direction using an anemometer or wind vane connected to an Arduino.

Wind Direction Sensor

Components Needed

Circuit Setup

  1. Connect the wind vane sensor’s output pin to an analog input pin on the Arduino.
  2. Ensure the power and ground pins are connected properly to the 5V and GND pins of the Arduino.

The wind vane sensor detects the direction of the wind and sends a signal to the Arduino, which processes the data and calculates the wind direction.

Wind Direction Circuit Setup

Code for Wind Direction Measurement

Upload the following code to your Arduino to measure wind direction:


const int windPin = A0;

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

void loop() {
  int windDirection = analogRead(windPin);
  Serial.print("Wind Direction: ");
  Serial.println(windDirection);
  delay(1000);
}
            

Explanation

The wind vane sensor detects the angle of the wind, and the Arduino reads the signal to calculate the direction of the wind.

Troubleshooting