Okay this is my first topic in Exhibition forum.
Some months ago, i went over the idea of develop a small anemometer "on the cheap". I know that in this forum and over internet there are thousand of different similar devices, but i made it for my own learning and to increase the sensors of my project.
I developed this cup anemometer based on IR sensor and a rotary encoded wheel. The anemometer is a cup anemometer type.
Here you have the preliminary release. I must change the cups (by hemispherical or conical ones) because those that i used are only used to testing purposes (i need to search for useful things that could works such cups for my device). In the next weeks i will change them, but the other parts of the device will remain.
Here you have a presentation picture:
coin provides an idea of the scale.
and here more detailed pictures of all the parts:
http://dl.dropbox.com/u/5093076/ArduDrop-Web/Pictures/Anemometro.zip (75 Mb)
and here is the example code:
/* QRD1114 IR Sensor on an cups anemometer
* Authors: M.A. de Pablo & C. de Pablo S., 2010
* version: 1.0 20100823
* Wind speed information: http://en.wikipedia.org/wiki/Beaufort_scale
*/
// Pin definitions
# define IR 2 // Receive the data from sensor
# define Led 13 // Light a led
// Constants definitions
const float pi = 3.14159265; // pi number
int period = 10000; // Measurement period (miliseconds)
int delaytime = 10000; // Time between samples (miliseconds)
int radio = 65; // Radio from vertical anemometer axis to a cup center (mm)
char* winds[] = {"Calm", "Light air", "Light breeze", "Gentle breeze", "Moderate breeze", "Fresh breeze", "Strong breeze", "Moderate gale", "Fresh gale", "Strong gale", "Storm", "Violent storm", "Hurricane"};
// Variable definitions
unsigned int Sample = 0; // Sample number
unsigned int counter = 0; // B/W counter for sensor
unsigned int RPM = 0; // Revolutions per minute
float speedwind = 0; // Wind speed (m/s)
unsigned short windforce = 0; // Beaufort Wind Force Scale
void setup()
{
// Set the pins
pinMode(2, INPUT);
digitalWrite(2, HIGH);
pinMode(13, OUTPUT);
// sets the serial port to 115200
Serial.begin(115200);
// Splash screen
Serial.println("ANEMOMETER");
Serial.println("**********");
Serial.println("Based on QRD1114 IR sensor");
Serial.print("Sampling period: ");
Serial.print(period/1000);
Serial.print(" seconds every ");
Serial.print(delaytime/1000);
Serial.println(" seconds.");
Serial.println("** You could modify those values on code **");
Serial.println();
}
void loop()
{
Sample++;
Serial.print(Sample);
Serial.print(": Start measurement...");
windvelocity();
Serial.println(" finished.");
Serial.print("Counter: ");
Serial.print(counter);
Serial.print("; RPM: ");
RPMcalc();
Serial.print(RPM);
Serial.print("; Wind speed: ");
WindSpeed();
Serial.print(speedwind);
Serial.print(" [m/s] (+/- 0.07 m/s); Wind force (Beaufort Scale): ");
Serial.print(windforce);
Serial.print(" - ");
Serial.println(winds[windforce]);
Serial.println();
delay(10000);
}
// Measure wind speed
void windvelocity(){
speedwind = 0;
counter = 0;
digitalWrite(Led, HIGH);
attachInterrupt(0, addcount, CHANGE);
unsigned long millis();
long startTime = millis();
while(millis() < startTime + period) {
}
digitalWrite(Led, LOW);
detachInterrupt(1);
}
void RPMcalc(){
RPM=((counter/2)*60)/(period/1000); // Calculate revolutions per minute (RPM)
}
void WindSpeed(){
speedwind = ((2 * pi * radio * RPM)/60) / 1000; // Calculate wind speed on m/s
if (speedwind <= 0.3){ // Calculate Wind force depending of wind velocity
windforce = 0; // Calm
}
else if (speedwind <= 1.5){
windforce = 1; // Light air
}
else if (speedwind <= 3.4){
windforce = 2; // Light breeze
}
else if (speedwind <= 5.4){
windforce = 3; // Gentle breeze
}
else if (speedwind <= 7.9){
windforce = 4; // Moderate breeze
}
else if (speedwind <= 10.7){
windforce = 5; // Fresh breeze
}
else if (speedwind <= 13.8){
windforce = 6; // Strong breeze
}
else if (speedwind <= 17.1){
windforce = 7; // High wind, Moderate gale, Near gale
}
else if (speedwind <= 20.7){
windforce = 8; // Gale, Fresh gale
}
else if (speedwind <= 24.4){
windforce = 9; // Strong gale
}
else if (speedwind <= 28.4){
windforce = 10; // Storm, Whole gale
}
else if (speedwind <= 32.6){
windforce = 11; // Violent storm
}
else {
windforce = 12; // Hurricane (from thi point, apply the Fujita Scale)
}
}
void addcount(){
counter++;
}
It is 5714 bytes when compiled. Developed and tested under Arduino Alpha 0017 for windows XP.
The sensor that i used is a QRD1114, IR emitter/sensor, reading a coded wheel (half black, half white).
The circuit was based on this idea:
http://itp.nyu.edu/physcomp/sensors/Reports/QTILineSensor
and this one:
http://nutsvolts.texterity.com/nutsvolts/200910/?pg=19#pg19
The code measure the interrupts by changing the color, calculate revolutions per minute, calculate wind velocity in m/s, and returns the wind force based on standard Beaufort scale:
Here you have an Excel file where you could see how i made the calculations and the high accuracy of the calculations done by arduino:
http://dl.dropbox.com/u/5093076/ArduDrop-Web/Encoder/RPM.xls
This anemometer will be part of the next release of my ArduDrop project:
http://ardudrop.jottit.com/
in which webpage i will post new releases on code, schemes, circuits and pictures from the anemometer in the future.
I hope you could find this anemometer useful. I really appreciate any comment about the device and the code.
Enjoy it!