How to Use an Adafruit Anemometer Sensor With Arduino
by CyberFantasies in Circuits > Arduino
9824 Views, 7 Favorites, 0 Comments
How to Use an Adafruit Anemometer Sensor With Arduino
Hello!
I am here to explain how to use an Adafruit anemometer and an Arduino sensor to pick up wind speed!
An anemometer is a sensor instrument for measuring the speed of the wind, or of any current of gas.
This technology can be utilized to create your amateur own weather station for measuring wind speed.
Please watch my video for further explanation of the syntax for the code below!
Supplies
- 1 Arduino Uno
- 1 USB cable
- 3 Male to Male jumper cables
- 1 Adafruit Anemometer
- 1 9V battery
Connections
The power and data for the Adafruit anemometer are run through a military-grade three-strand cable. The cable contains a Black (GROUND), Brown (POWER 7V-24V), and Blue (VOLTAGE OUTPUT) wire. You will notice the end of each wire coming from the anemometer has a small amount of cable sticking out. You will take this end and wrap it around the end of one MALE to MALE jumper cable (Using the matching colors helps). Do this for each strand in the three-stranded anemometer cable.
Connect to Arduino
Step 2. After you have wrapped each wire you will connect the other ends of the MALE to MALE jumper cables to the appropriate headers on your Arduino Uno. Here are the coordinating wires and headers:
-Blue (VOLTAGE OUTPUT) wire ---> A0
-Brown (POWER 7V-24V) wire ---> VIN
-Black (GROUND) wire ---> GND
Power
Step 3. Once you have made those connections onto the Arduino Uno board, you will take your USB cable and plug it into the appropriate input on the Arduino Uno to receive your data. The other USB end will go into your computer USB port. You will then proceed to also connect your 9V battery and snap-on battery connector to the power supply on your Arduino Uno.
Code
Step 4. Now you will upload the provided code (below) onto your Arduino Uno using the (FREE) Arduino coding software.
Code: Sampled from author Joe Burg on http://www.hackerscapes.com/anemometer/
float sensorVoltage = 0;
float windSpeed = 0;
float voltageConversionConstant = .004882814;
int sensorDelay = 1000;
float voltageMin = .4;
float windSpeedMin = 0;
float voltageMax = 2.0;
float windSpeedMax = 32;
void setup() { Serial.begin(9600); }
void loop() { sensorValue = analogRead(sensorPin);
sensorVoltage = sensorValue * voltageConversionConstant;
if (sensorVoltage <= voltageMin) { windSpeed = 0; }
else { windSpeed = (sensorVoltage - voltageMin)
*windSpeedMax/(voltageMax - voltageMin); }
Serial.print("Voltage: ");
Serial.print(sensorVoltage);
Serial.print("\t");
Serial.print("Wind speed: ");
Serial.println(windSpeed);
delay(sensorDelay); }
Find Wind!
Step 5. Take your setup somewhere windy, or blow on the anemometer to mimick wind.
Measurements
Step 6. Open the Serial Monitor in your Arduino software (Tools>Serial Monitor) to view the current MPH measurement from your anemometer.