{"id":163344,"date":"2024-11-05T15:30:09","date_gmt":"2024-11-05T15:30:09","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=163344"},"modified":"2024-11-05T16:25:06","modified_gmt":"2024-11-05T16:25:06","slug":"arduino-anemometer-measure-wind-speed","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/arduino-anemometer-measure-wind-speed\/","title":{"rendered":"Arduino with an Anemometer: Measure Wind Speed"},"content":{"rendered":"\n<p>In this guide, you&#8217;ll learn how to use an anemometer with the Arduino board to measure wind speed. We&#8217;ll cover how to power and connect the sensor to the Arduino and write a simple code to get wind speed values in different units.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-Sensor-Tutorial.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino with an Anemometer: Measure Wind Speed\" class=\"wp-image-163346\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-Sensor-Tutorial.jpg?w=1920&amp;quality=100&amp;strip=all&amp;ssl=1 1920w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-Sensor-Tutorial.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-Sensor-Tutorial.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-Sensor-Tutorial.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-Sensor-Tutorial.jpg?resize=1536%2C864&amp;quality=100&amp;strip=all&amp;ssl=1 1536w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<p><strong>Table of Contents:<\/strong><\/p>\n\n\n\n<p>Throughout this guide, we&#8217;ll cover the following topics:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#anemometer-intro\" title=\"\">Introducing the Anemometer<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#anemometer-details\" title=\"\">Anemometer Technical Details<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#anemometer-pinout\" title=\"\">Anemometer Pinout<\/a><\/li>\n\n\n\n<li><a href=\"#anemometer-wiring-arduino\" title=\"\">Connecting the Anemometer to the Arduino<\/a><\/li>\n\n\n\n<li><a href=\"#anemometer-arduino-code\" title=\"\">Arduino with the Anemometer &#8211; Measure Wind Speed Code<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"anemometer-intro\">Introducing the Anemometer<\/h2>\n\n\n\n<p>An anemometer is a device that allows us to measure wind speed. It is commonly used in weather stations.<\/p>\n\n\n\n<p>Using this sensor is quite easy. It outputs an analog signal, whose voltage is proportional to the wind speed. We&#8217;re using an anemometer with three cups like the one in the picture below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Wind-Sensor-Anemometer.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Wind Sensor Anemometer\" class=\"wp-image-163185\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Wind-Sensor-Anemometer.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Wind-Sensor-Anemometer.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"anemometer-details\">Anemometer Technical Details<\/h3>\n\n\n\n<p>Depending on the manufacturer and model, the anemometer may have different characteristics. For example, these are the characteristics of the anemometer used in this guide:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Input voltage: 12-24V DC<\/li>\n\n\n\n<li>Output voltage: 0-5V<\/li>\n\n\n\n<li>Measurement range: 0-32.4m\/s<\/li>\n\n\n\n<li>Resolution: +\/- 0.3m\/s<\/li>\n<\/ul>\n\n\n\n<p>This means that when the analog signal is 0, the wind speed is 0. However, in my case, I noticed that when the anemometer was not moving, the output voltage was 0,054V and not 0V.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Measure-Voltage-Wind-Sensor-no-wind.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino Measure Voltage from Wind Sensor with no wind\" class=\"wp-image-163351\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Measure-Voltage-Wind-Sensor-no-wind.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Measure-Voltage-Wind-Sensor-no-wind.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>So, I consider this to be the lowest value measured when the sensor is not moving. I recommend you do the same and figure out the minimum value read from the sensor using a multimeter.<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">These details might be different for your specific model<\/span>. So, you need to take that into account when converting the analog signal to wind speed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"anemometer-pinout\">Anemometer Pinout<\/h2>\n\n\n\n<p>The anemometer comes with three wires:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><span class=\"rnthl rntcblue\">Blue Wire<\/span><\/td><td>Signal<\/td><\/tr><tr><td><span class=\"rnthl rntcblack\">Black Wire<\/span><\/td><td>GND<\/td><\/tr><tr><td><span class=\"rnthl rntcbrown\">Brown Wire<\/span><\/td><td>Power<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/anemometer-pinout.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Anemometer, Wind Sensor Pinout\" class=\"wp-image-163187\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/anemometer-pinout.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/anemometer-pinout.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"anemometer-wiring-arduino\">Connecting the Anemometer to the Arduino<\/h2>\n\n\n\n<p>The anemometer we&#8217;re using requires an input voltage of at least 12V. So, you can&#8217;t power it directly from the Arduino, you need an external power source.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/12VDC-Power-Adapter.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"12V DC Power Adapter\" class=\"wp-image-163182\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/12VDC-Power-Adapter.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/12VDC-Power-Adapter.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>We&#8217;re powering the sensor using a 12V power adapter and connecting it to the anemometer using a power jack. You can use any other suitable power source.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/DC-Power-Jack-Adapter.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"DC power jack adapter\" class=\"wp-image-163181\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/DC-Power-Jack-Adapter.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/DC-Power-Jack-Adapter.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"voltage-regulator\">Wiring the Circuit: Arduino with Anemometer<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-with-anemometer-circuit.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino with Anemometer Circuit\" class=\"wp-image-163350\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-with-anemometer-circuit.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-with-anemometer-circuit.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>Here&#8217;s a list of the parts you need for this tutorial:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/compatible-arduino-uno-r3-board\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Arduino board<\/a> &#8211; read <a href=\"https:\/\/makeradvisor.com\/best-arduino-starter-kits\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Best Arduino Starter Kits<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/anemometer-wind-speed-sensor\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Anemometer<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/12v-2a-power-adaptor-dc-jack\/\" target=\"_blank\" rel=\"noopener\" title=\"\">12V DC Power Adapter<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/dc-power-male-plug-jack-adapter-2-1mm\/\" target=\"_blank\" rel=\"noopener\" title=\"\">DC power jack adapter<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/mb-102-solderless-breadboard-830-points\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Breadboard<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Jumper wires<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/best-multimeters-under-50\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Multimeter<\/a><\/li>\n<\/ul>\n\n\n\n<p>Wiring the sensor to the Arduino is quite simple. You just need to connect the data signal to an analog pin of the Arduino and connect the GNDs together.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-wind-sensor-circuit.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"425\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-wind-sensor-circuit.png?resize=750%2C425&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino with Wind Sensor Anemometer Circuit Diagram\" class=\"wp-image-163353\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-wind-sensor-circuit.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-wind-sensor-circuit.png?resize=300%2C170&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/figure><\/div>\n\n\n<p> In my case, I need to power the sensor using an external 12V power source.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><span class=\"rnthl rntcblack\">Black Wire<\/span><\/td><td>GND of the Arduino and GND of the power source<\/td><\/tr><tr><td><span class=\"rnthl rntcblue\">Blue Wire<\/span><\/td><td>Connect to an analog pin. We&#8217;re using <strong>A0<\/strong><\/td><\/tr><tr><td><span class=\"rnthl rntcbrown\">Brown Wire<\/span><\/td><td>12V power source (+)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"anemometer-arduino-code\">Arduino with the Anemometer &#8211; Measure Wind Speed Code<\/h2>\n\n\n\n<p>The following code reads the analog signal from the anemometer and converts it into wind speed.<\/p>\n\n\n\n<p>You can upload the following code to your Arduino board. You may need to modify some of the variables depending on the parameters of your anemometer.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos &amp; Sara Santos - Random Nerd Tutorials\n  Complete project details at https:\/\/RandomNerdTutorials.com\/arduino-anemometer-measure-wind-speed\/\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Softwar\n*********\/\n\n\/\/ Constants (Change the following variables if needed)\nconst int anemometerPin = 0;  \/\/ analog pin 0 (A0)\nconst float minVoltage = 0.054;  \/\/ Voltage corresponding to 0 m\/s\nconst float maxVoltage = 5;  \/\/ Voltage corresponding to 32.4 m\/s (max speed)\nconst float maxWindSpeed = 32.4; \/\/ Maximum wind speed in m\/s\n\n\/\/ Conversion factors\nconst float mps_to_kmh = 3.6;   \/\/ 1 m\/s = 3.6 km\/h\nconst float mps_to_mph = 2.23694; \/\/ 1 m\/s = 2.23694 mph\n\nvoid setup() {\n  Serial.begin(9600);  \n}\n\nvoid loop() {\n  \/\/ Read analog value from anemometer (ADC value between 0-1023 on Arduino for 0-5V)\n  int adcValue = analogRead(anemometerPin);\n  \n  \/\/ Convert ADC value to voltage (Arduino ADC range is 0-5.0V)\n  float voltage = (adcValue \/ 1023.00) * 5.0;\n  \n  \/\/ Ensure the voltage is within the anemometer operating range\n  if (voltage &lt; minVoltage) {\n    voltage = minVoltage;\n  } else if (voltage &gt; maxVoltage) {\n    voltage = maxVoltage;\n  }\n  \n  \/\/ Map the voltage to wind speed\n  float windSpeed_mps = ((voltage - minVoltage) \/ (maxVoltage - minVoltage)) * maxWindSpeed;\n\n  \/\/ Convert wind speed to km\/h and mph\n  float windSpeed_kmh = windSpeed_mps * mps_to_kmh;\n  float windSpeed_mph = windSpeed_mps * mps_to_mph;\n\n  \/\/ Print wind speed\n  Serial.print(&quot;Wind Speed: &quot;);\n  Serial.print(windSpeed_mps);\n  Serial.print(&quot; m\/s, &quot;);\n  Serial.print(windSpeed_kmh);\n  Serial.print(&quot; km\/h, &quot;);\n  Serial.print(windSpeed_mph);\n  Serial.println(&quot; mph&quot;);\n  \n  delay(1000); \n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/Arduino\/Arduino_Anemometer_Wind_Sensor.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How does the Code Work?<\/h3>\n\n\n\n<p>First, define the pin where you&#8217;re reading the sensor (in our case A0), the minimum and the maximum output voltage of the sensor, and the maximum wind speed.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Constants (Change the following variables if needed)\nconst int anemometerPin = 0;  \/\/ analog pin 0 (A0)\nconst float minVoltage = 0.054;  \/\/ Voltage corresponding to 0 m\/s\nconst float maxVoltage = 5;  \/\/ Voltage corresponding to 32.4 m\/s (max speed)\nconst float maxWindSpeed = 32.4; \/\/ Maximum wind speed in m\/s<\/code><\/pre>\n\n\n\n<p>These are the parameters for our sensor. Yours might be different. When the sensor is not moving, it outputs a voltage of 0.054V, so we consider that the minimum value.<\/p>\n\n\n\n<p>Then, we have the conversion factors to convert the wind speed from m\/s to km\/h and mph.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Conversion factors\nconst float mps_to_kmh = 3.6;   \/\/ 1 m\/s = 3.6 km\/h\nconst float mps_to_mph = 2.23694; \/\/ 1 m\/s = 2.23694 mph<\/code><\/pre>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">setup()<\/span>, we initialize the Serial Monitor.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>void setup() {\n  Serial.begin(9600);  \n}<\/code><\/pre>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">loop()<\/span>, we get new readings from the sensor every second.<\/p>\n\n\n\n<p>First, we read the value on the ADC pin and convert it to a voltage value. The maximum value read on the Arduino ADC pin is 1023 that corresponds to 5V. So, we can convert the value to a voltage using the following line:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Read analog value from anemometer (ADC value between 0-1023 on Arduino for 0-5V)\nint adcValue = analogRead(anemometerPin);\n  \n\/\/ Convert ADC value to voltage (Arduino ADC range is 0-5.0V)\nfloat voltage = (adcValue \/ 1023.00) * 5.0;<\/code><\/pre>\n\n\n\n<p>Then, we have the following condition to check if the values read are within the defined range.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>if (voltage &lt; minVoltage) {\n  voltage = minVoltage;\n} else if (voltage &gt; maxVoltage) {\n  voltage = maxVoltage;\n}<\/code><\/pre>\n\n\n\n<p>Next, we can easily map the obtained voltage to a wind speed value (alternatively, you can use the Arduino <span class=\"rnthl rntliteral\">map()<\/span> function).<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>float windSpeed_mps = ((voltage - minVoltage) \/ (maxVoltage - minVoltage)) * maxWindSpeed;<\/code><\/pre>\n\n\n\n<p>Then, we convert the values obtained to km\/h and mph.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Convert wind speed to km\/h and mph\nfloat windSpeed_kmh = windSpeed_mps * mps_to_kmh;\nfloat windSpeed_mph = windSpeed_mps * mps_to_mph;<\/code><\/pre>\n\n\n\n<p>Finally, we print the obtained results.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>  \/\/ Print wind speed\n  Serial.print(\"Wind Speed: \");\n  Serial.print(windSpeed_mps);\n  Serial.print(\" m\/s, \");\n  Serial.print(windSpeed_kmh);\n  Serial.print(\" km\/h, \");\n  Serial.print(windSpeed_mph);\n  Serial.println(\" mph\");\n  \n  delay(1000); \n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Testing the Code<\/h2>\n\n\n\n<p>Upload the code to your Arduino board. Make sure you have the sensor wired and powered properly.<\/p>\n\n\n\n<p>Open the Serial Monitor at a baud rate of 9600.<\/p>\n\n\n\n<p>Spin the sensor to mimic some wind, and see the values being printed in the Serial Monitor every second.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"766\" height=\"377\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-speed-Testing-Serial-monitor.png?resize=766%2C377&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Testing Wind Sensor with Arduino - Serial Monitor Demonstration\" class=\"wp-image-163345\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-speed-Testing-Serial-monitor.png?w=766&amp;quality=100&amp;strip=all&amp;ssl=1 766w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-speed-Testing-Serial-monitor.png?resize=300%2C148&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 766px) 100vw, 766px\" \/><\/figure><\/div>\n\n\n<p>And that&#8217;s it. Now, you can read the wind speed with your Arduino board. You can now add an anemometer to your weather station.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial, you learned how to interface an anemometer with the Arduino board. This is a fundamental sensor to add to your weather station to get wind speed data.<\/p>\n\n\n\n<p>We have tutorials for more than 30 sensors with the Arduino board. You can check them below:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/arduino-free-guides-sensors-modules\/\">Arduino: 39 Free Guides for Sensors and Modules<\/a><\/li>\n<\/ul>\n\n\n\n<p>We hope you found this tutorial useful. You may also like other related tutorials:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/arduino-bh1750-ambient-light-sensor\/\">Arduino with BH1750 Ambient Light Sensor<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/arduino-bmp388\/\">Guide for BMP388 Altimeter with Arduino (Pressure, Altitude, Temperature)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/bme680-sensor-arduino-gas-temperature-humidity-pressure\/\">Guide for BME680 Environmental Sensor with Arduino (Gas, Temperature, Humidity, Pressure)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/bme280-sensor-arduino-pressure-temperature-humidity\/\">Guide for BME280 Sensor with Arduino (Pressure, Temperature, Humidity)<\/a><\/li>\n<\/ul>\n\n\n\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you&#8217;ll learn how to use an anemometer with the Arduino board to measure wind speed. We&#8217;ll cover how to power and connect the sensor to the Arduino &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Arduino with an Anemometer: Measure Wind Speed\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/arduino-anemometer-measure-wind-speed\/#more-163344\" aria-label=\"Read more about Arduino with an Anemometer: Measure Wind Speed\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":163346,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[303,267,2,302,245,264],"tags":[],"class_list":["post-163344","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-0-arduino","category-arduino-project","category-arduino","category-0-guide","category-arduino-ide","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/10\/Arduino-Wind-Sensor-Tutorial.jpg?fit=1920%2C1080&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/163344","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=163344"}],"version-history":[{"count":8,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/163344\/revisions"}],"predecessor-version":[{"id":163767,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/163344\/revisions\/163767"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/163346"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=163344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=163344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=163344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}