Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Weather & Environmental Monitoring

Wind Direction Sensor: Vane and Potentiometer Arduino Guide

Wind Direction Sensor: Vane and Potentiometer Arduino Guide

March 11, 2026 /Posted byJayesh Jain / 0

A wind direction sensor using a vane and potentiometer with Arduino is a fundamental component of any complete DIY weather station. Knowing wind direction helps farmers predict rainfall patterns, assists drone operators in choosing safe flying times, and provides valuable microclimate data for rooftop solar panel positioning across India. This guide covers the working principle of wind vanes, how to wire a potentiometer-based wind direction sensor to Arduino, and how to display compass directions accurately.

Table of Contents

  • How Wind Direction Sensors Work
  • Types of Wind Vane Sensors
  • Wiring a Potentiometer Wind Vane to Arduino
  • Arduino Code for Wind Direction
  • Converting ADC Values to Compass Directions
  • Calibration for Indian Conditions
  • Logging Wind Direction Data
  • Frequently Asked Questions

How Wind Direction Sensors Work

A wind vane consists of a rotating fin assembly mounted on a bearing. The fin aligns itself with the prevailing wind direction. A transducer converts the rotational position of the fin to an electrical signal. The most common transducer types are:

  • Resistive (Potentiometer): The vane shaft is mechanically coupled to a 360-degree rotary potentiometer. Wind rotation changes the resistance, which changes the voltage at the wiper. Simple, cheap, and works with any ADC.
  • Reed switch array: Used in commercial weather stations (like Davis Vantage). Multiple reed switches trip as a magnet rotates, giving discrete 8-direction or 16-direction output. More reliable long-term but more expensive.
  • Hall effect encoder: Uses a magnetic encoder for true 360-degree digital output. Highest accuracy and longevity but requires specialised ICs.
  • Optical encoder: Uses a slotted disc and photointerrupter. Very accurate but sensitive to dust and moisture—problematic in Indian conditions.

For DIY builds, the potentiometer approach is the most accessible and costs ₹50–₹200 for a suitable 10K 360-degree rotary potentiometer.

Recommended: Wind Speed Sensor (0-5V) Anemometer Kit — Pair this industrial waterproof anemometer with your wind direction vane to build a complete wind measurement system.

Types of Wind Vane Sensors

Several ready-made wind direction sensors are available for hobbyist projects:

  • Sparkfun/Generic Wind Vane (reed switch): 8-directional output using 8 reed switches and a switching resistor network. Popular in Raspberry Pi weather station kits. Costs ₹800–₹1,500.
  • RK100-02 Wind Direction Sensor: Industrial 4-20mA or 0-5V output, IP65-rated, 360-degree continuous rotation. Costs ₹2,500–₹5,000. Best for permanent outdoor installations.
  • DIY Potentiometer Vane: Build your own using a 3D-printed or aluminium fin, a bearing, and a 360-degree potentiometer. Total cost ₹200–₹500.
  • Digital Wind Vane (SPI/I2C): Newer products from DFRobot and Adafruit using magnetic encoders with I2C output. Easier to code but more expensive (₹2,000–₹3,000).

Wiring a Potentiometer Wind Vane to Arduino

For a resistive potentiometer-based wind vane, the wiring is straightforward. The potentiometer has three terminals: two end terminals and one wiper terminal.

Potentiometer Pin Arduino Pin
End Terminal 1 5V (or 3.3V for ESP32)
End Terminal 2 GND
Wiper A0 (Analog Input)

For the reed switch type (like the Sparkfun wind vane), connect one terminal to 3.3V or 5V through a 10K pull-up resistor, the other to GND, and the signal wire to an analog pin. The switching resistor network inside the vane creates different voltage levels for each of 8 or 16 wind directions.

Recommended: Wind Speed Sensor Current Type (4-20mA) Anemometer Kit — Industrial-grade waterproof anemometer for demanding outdoor environments; use alongside your wind vane for complete weather data.

Arduino Code for Wind Direction

// Wind Direction Sensor with Potentiometer
// Reads analog value and converts to compass direction

const int WIND_DIR_PIN = A0;
const int NUM_READINGS = 10;  // Average multiple readings

// Calibration values - adjust for your specific potentiometer
const int POT_MIN = 0;     // ADC value at 0 degrees (North)
const int POT_MAX = 1023;  // ADC value at 359 degrees

String getCompassDirection(float degrees) {
  const char* directions[] = {
    "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
    "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"
  };
  int index = (int)((degrees + 11.25) / 22.5) % 16;
  return String(directions[index]);
}

float readWindDirection() {
  long total = 0;
  for (int i = 0; i < NUM_READINGS; i++) {
    total += analogRead(WIND_DIR_PIN);
    delay(10);
  }
  int avgADC = total / NUM_READINGS;
  
  // Map ADC value to degrees
  float degrees = map(avgADC, POT_MIN, POT_MAX, 0, 359);
  return degrees;
}

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

void loop() {
  float windDegrees = readWindDirection();
  String compass = getCompassDirection(windDegrees);
  
  Serial.print("Wind Direction: ");
  Serial.print(windDegrees, 1);
  Serial.print(" degrees (");
  Serial.print(compass);
  Serial.println(")");
  
  delay(1000);
}

Converting ADC Values to Compass Directions

A standard compass rose divides 360 degrees into 16 named directions (N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW). Each direction spans 22.5 degrees. The getCompassDirection() function in the code above maps a degrees value to the nearest 16-point compass direction.

For the common reed-switch wind vane (8 directions), each direction has a specific resistance value in the internal resistor network. Map these resistance/voltage values to directions:

Direction ADC Value (5V, 10K pullup)
North ~790
NE ~406
East ~461
SE ~98
South ~185
SW ~157
West ~541
NW ~666

Calibration for Indian Conditions

Calibration is critical for accurate wind direction readings. In India’s hot, humid conditions, potentiometer resistance can drift with temperature. Follow this calibration procedure:

  1. Mount the vane on a level surface with the fin pointing true North (use a compass app on your phone)
  2. Record the ADC value — this is your North reference
  3. Rotate the vane 90 degrees clockwise (East) and record the ADC value
  4. Continue for South (180 degrees) and West (270 degrees)
  5. If the ADC values are evenly spaced, your potentiometer is linear and a simple map() function works
  6. If values are not evenly spaced, create a lookup table with interpolation

Repeat calibration during summer (April-June) and monsoon (July-September) to account for seasonal resistance drift. A well-calibrated vane should be accurate to within 5-10 degrees.

Logging Wind Direction Data

Wind direction data is most useful when logged over time to identify prevailing wind patterns. For Indian locations, the prevailing winds shift seasonally: southwest monsoon winds in June-September, northeast winds in November-January, and variable conditions in between. Log at least 12 months of hourly data before drawing conclusions about your site’s wind patterns for applications like turbine siting or drone operation planning.

When logging wind direction, use circular statistics (mean circular direction, circular standard deviation) rather than standard arithmetic mean. A simple arithmetic average of 350 degrees and 10 degrees would give 180 degrees (South), which is completely wrong — the true average is North (0/360 degrees). Use the atan2() function with sin/cos decomposition for correct circular averaging.

Recommended: Waveshare BME280 Environmental Sensor — Combine with your wind direction sensor for a comprehensive weather station that also records temperature and pressure correlations with wind patterns.

Frequently Asked Questions

How do I align a wind vane to true North vs magnetic North?

Most compass apps on smartphones show magnetic North. True North (geographic North) differs from magnetic North by the magnetic declination angle, which varies by location in India. For most Indian locations, magnetic declination is approximately 0 to 5 degrees East, which is small enough to ignore for hobbyist applications. Use the declination.gs website to find the exact value for your location if you need precision.

Why does my potentiometer wind vane give erratic readings in the monsoon?

Moisture ingress into the potentiometer causes erratic resistance changes and noisy readings. Use a sealed potentiometer (IP65 rated) or apply conformal coating to the potentiometer body. Alternatively, mount the electronics inside a sealed enclosure and use a longer shaft extension to connect the fin to the potentiometer through a sealed bearing. Silicone-sealed industrial potentiometers rated for outdoor use cost ₹400–₹800 from automation component suppliers.

Can I use a magnetometer (compass IC) instead of a mechanical wind vane?

Yes, this approach uses a small magnet on the wind vane shaft and a fixed magnetometer IC (like the HMC5883L or QMC5883L) to detect the magnet’s orientation. It avoids mechanical contact and is more reliable long-term. The QMC5883L module costs around ₹50–₹100 and communicates via I2C. However, this approach requires careful magnetic shielding from nearby motors or metal structures that could interfere with the magnetometer.

What is the minimum wind speed needed to turn a DIY wind vane?

This depends on the bearing friction, fin weight, and fin surface area. A well-designed vane with quality bearings (ABEC-5 rated) should respond to winds above 1 m/s. Poorly balanced vanes with high-friction bearings may need 3-5 m/s to move reliably. For reference, the Beaufort scale defines Force 1 (light air) as 0.3-1.5 m/s — the threshold where a wind vane should just begin to respond.

How do I integrate wind direction with a weather website or mobile app?

Upload wind direction data from ESP32 to ThingSpeak, InfluxDB, or a custom REST API. Display it using a wind rose chart (a circular chart showing frequency of winds from each direction). Chart.js with the chartjs-chart-windrose plugin creates excellent wind rose visualisations for web dashboards. For mobile apps, MIT App Inventor or Flutter with a canvas widget can render wind direction displays using your ESP32’s data via MQTT or HTTP API.

Shop Weather Monitoring Sensors at Zbotic →

Tags: anemometer, Arduino, weather station, wind direction sensor, wind vane
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Smart Home in India Under 5000...
blog smart home in india under 5000 rs best budget devices 598147
blog can bus connector and wiring automotive and industrial guide 598154
CAN Bus Connector and Wiring: ...

Related posts

Svg%3E
Read more

Climate Education Kit: Build and Learn About Weather

April 1, 2026 0
Table of Contents Weather Education in Indian Schools Designing a STEM Weather Kit Sensor Experiments for Students Curriculum-Aligned Activities Arduino... Continue reading
Svg%3E
Read more

Citizen Science Weather: Contribute Data to IITM Pune

April 1, 2026 0
Table of Contents Citizen Science Weather in India Data Quality Standards for Contribution Setting Up a WMO-Compatible Station Calibration and... Continue reading
Svg%3E
Read more

Weather Station Network: Multiple Stations with Gateway

April 1, 2026 0
Table of Contents Why Build a Weather Station Network LoRa Communication for Sensor Nodes Gateway Design with Raspberry Pi Sensor... Continue reading
Svg%3E
Read more

Cyclone Tracker Display: Real-Time IMD Data on Screen

April 1, 2026 0
Table of Contents Cyclone Tracking in India IMD Cyclone Data Sources ESP32 and TFT Display Setup Fetching and Parsing Cyclone... Continue reading
Svg%3E
Read more

Monsoon Onset Predictor: Historical Data Analysis India

April 1, 2026 0
Table of Contents Understanding Monsoon Onset in India Key Indicators for Monsoon Prediction Sensor Package for Monsoon Monitoring Collecting Baseline... Continue reading

Add comment Cancel reply

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

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now