Overview
In this guide, we will be interfacing NPN Pulse Output Anemometer Sensor with Arduino and measuring the Wind Speed. An anemometer is a device used for measuring wind speed and direction. It is also a common Weather Station instrument.
In one of our previous project, we measured Wind Speed using Adafruit Anemometer sensor & also display the Wind Speed in Gauge on TFT LCD Display. But Adafruit Anemometer is an analog anemometer and requires a power of more than 7V for operation. Therefore we will be using a digital Anemometer in this project which has NPN Pulse Output. The NPN pulse output anemometer result is good & are also cost-effective & they operate at 5V only.
In this project, we will interface NPN Pulse Output Anemometer with Arduino & display the measured wind speed on a 16×2 LCD Display. This anemometer is capable of measuring wind speeds up to 70 m/s or 156 mph which should be adequate for our location.
Bill of Materials
Following are the components that we need for making this project. You can purchase all the components easily online from Amazon. Check the purchase link below.
| S.N. | Components Name | Quantity | Purchase Links |
|---|---|---|---|
| 1 | Arduino UNO Board | 1 | Amazon | AliExpress |
| 2 | Anemometer Sensor NPN Pulse | 1 | Amazon | AliExpress |
| 3 | I2C LCD Display | 1 | Amazon | AliExpress |
| 4 | Jumper Wires | 15 | Amazon | AliExpress |
| 5 | Breadboard | 1 | Amazon | AliExpress |
What is Anemometer?
An anemometer is a device used for measuring wind speed and direction. It is widely used for measuring the speed of airflow in the atmosphere, in wind tunnels, and in other gas-flow applications. The term is derived from the Greek word anemos, which means wind, and is used to describe any wind speed instrument used in meteorology.
The most widely used Anemometer for wind-speed measurements is the revolving-cup electric anemometer. The revolving cups drive an electric generator. The output of the generator operates an electric meter that is calibrated in wind speed. Three-cup anemometers are currently used as the industry standard for wind resource assessment studies & practice. You may use Ultrasonic Anemometer if you don’t want movable parts.
The cup-type anemometer consists of 3 or 4 hemispherical cups mounted on horizontal arms, which were mounted on a vertical shaft. The airflow past the cups in any horizontal direction turned the shaft at a rate that was roughly proportional to the wind speed. Therefore, counting the turns of the shaft over a set time interval produced a value proportional to the average wind speed for a wide range of speeds.
Anemometer with NPN Pulse Output
The NPN Pulse Output Anemometer Sensor is a Three-cup type anemometer that is capable of measuring wind speed up to 70m/s or 156mph. It is composed of a shell, the wind cup, and the circuit module.
After testing many types of anemometers, we found out this NPN pulse output anemometer quality is best as well as cost-effective. Unlike the analog output version anemometer, this anemometer output pulse reflects the wind speed more accurately. Besides, this anemometer is totally Waterproof, with a stable installation design, and suitable for outdoor applications.
In working, if the anemometer turns one round in one second, the transmitter will output 20 pulses, which means the wind speed is 1.75m/s.
Features & Specifications
- Power: 5V~30V DC
- Communication: pulse output
- Resolution: 0.0875 m/s (that is, if 20 pulse detected in 1s, the wind speed is 1.75 m/s, and 3.5m/s if 40 pulse detected)
- Accuracy: ±(0.2+0.03V)m/s
- Measuring range: 0~70m/s
- Output: NPN
- Working environment: -20℃~60℃,0%RH~80%RH
Internal Circuitry of the Sensor
NPNR OUTPUT(RL=5.1K)
Wiring & Pinout
The Anemometer has a special connector that has four wires of different colors.
| Wires | Mark | Definition |
| Brown line | VCC | Power supply |
| Black line | GND | Grounding |
| Green line | (PNP)OUTPUT | Pulse output |
| Blue line | (NPNR)OUTPUT | Pulse output |
Interfacing NPN Pulse Output Anemometer with Arduino
Now let us interface the NPN Pulse Output Anemometer with Arduino & measure the wind speed. Check the schematic or circuit below.
The Anemometer works between 5-30V DC. Therefore there is no need of any external power supply as we can connect this sensor directly with Arduino. The connection between the Anemometer Senor and Arduino UNO Board is given below.
| Arduino UNO | Anemometer |
| 5V | VCC (Brown Wire) |
| GND | GND (Black Wire) |
| D2 | (NPNR)OUTPUT (Blue Wire) |
For displaying the wind speed, we are using a 16×2 I2C LCD Display. Connect the SDA & SCL Pin of LCD Display to Arduino A4 & A5 Pins. Similarly, connect the VCC & GND Pin of LCD to Arduino 5V & GND Pin.
Source Code/Program
Here is a simple program for Interfacing Anemometer (NPN Pulse Output) with Arduino. The code requires a I2C LCD Library for compilation.
Copy the following code and upload it to the Arduino UNO Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
#include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x3F for a 16 chars and 2 line display unsigned long lastDebounceTime = 0; // the last time the output pin was toggled unsigned long debounceDelay = 1000; // the debounce time; increase if the output flickers int pinInterrupt = 2; int Count = 0; void onChange() { if ( digitalRead(pinInterrupt) == LOW ) Count++; } void setup() { Serial.begin(115200); //Initialize serial port pinMode( pinInterrupt, INPUT_PULLUP);// set the interrupt pin //Enable attachInterrupt( digitalPinToInterrupt(pinInterrupt), onChange, FALLING); lcd.init(); lcd.clear(); lcd.backlight(); // Make sure backlight is on lcd.setCursor(3, 0); lcd.print("Anemometer"); delay(3000); lcd.clear(); } void loop() { if ((millis() - lastDebounceTime) > debounceDelay) { lastDebounceTime = millis(); Serial.print((Count * 8.75)/100); lcd.setCursor(0, 0); lcd.print("Wind Speed"); lcd.setCursor(0, 1); lcd.print((Count * 8.75)/100); Count = 0; Serial.println("m/s"); lcd.print("m/s"); } delay(1); } |
Measuring Wind Speed & Testing the Device
Once you upload the code to the Arduino Board, the LCD Display will start displaying the wind speed. When the anemometer cup is stable the LCD will show a speed of around 0m/s. The speed will vary or increase when the sensor is taken in a windy region.
The speed variation increases or decreases depending upon the cup rotation.
This is how you can make DIY Arduino Anemometer Project for measuring wind speed.















3 Comments
I would like to use this in a marine sailboat application. Have you seen a similar project for WIND DIRECTION?
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: “Arduino Nano, ATmega328P”
C:\Users\rmako\OneDrive\Documents\Arduino\sketch_may14a\sketch_may14a.ino: In function ‘void setup()’:
sketch_may14a:26:7: error: ‘class LiquidCrystal_I2C’ has no member named ‘init’
lcd.init();
^~~~
exit status 1
‘class LiquidCrystal_I2C’ has no member named ‘init’
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.
Can you please make a post on how to interface the same NPN anemometer with ESP32? It would be a great help.