Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Anemometor - inductor measurement

Status
Not open for further replies.
Yes you can.
Do you have a unit to hack or are you starting from scratch?
Is there a measurable voltage at the inductor?
If so, what is the minimum voltage and maximum when spinning fast?
 
Welcome to ETO.

Can you post a picture of the inductor? My guess is that the inductor, if it really is one, is producing pulses, not a continuous change in inductance.
 
I bought mine for $12.00 For $12.00 you couldn't even make the fan.
The fan is magnetic. The magnet is in the hub. The magnetic flux is picked up by a Hall device.
 
Doesn't a magnet moving over a coil of wire make a generator? The output voltsge should be proportional to speed.
 
Yes. But the coil is an alternator and you pick up the pulses. Dealing with the output voltage is far too difficult.
 
Yes you can.
Do you have a unit to hack or are you starting from scratch?
Is there a measurable voltage at the inductor?
If so, what is the minimum voltage and maximum when spinning fast?

So I attached the circuit that the wind meter has and you can see the inductor on the top. I bought similar inductors from Amazon and when I measure the the ac voltage with a multi meter while blowing on a fan and having the inductor next to the fan the voltage is between 0-10mili volts. Can I convert this ac voltage to a digital pulse and read it with arduino?
 

Attachments

  • Capture (1).JPG
    Capture (1).JPG
    58 KB · Views: 140
Image from page 2 of the LM111/211/311 datasheet

Full datasheet can be found here: https://www.ti.com/lit/ds/symlink/lm311-n.pdf

Hello Sir, I made this circuit and I have a small fan with a magnet and was blowing to the inductor and was getting pulses on the oscilloscope, faster blowing more pulses. Attached photos. To count it with the arduino and translate it to a wind meter how do I do it? I mean I'm counting the pulses with pulseIn() but how do I translate it fast slow?
 

Attachments

  • 1.JPG
    1.JPG
    113.9 KB · Views: 136
  • 2.JPG
    2.JPG
    108.6 KB · Views: 144
  • 3.JPG
    3.JPG
    111.3 KB · Views: 129
  • 6.JPG
    6.JPG
    103.1 KB · Views: 135
  • 7.JPG
    7.JPG
    105.5 KB · Views: 127
  • 8.JPG
    8.JPG
    103.5 KB · Views: 137
  • fan-circuit.JPG
    fan-circuit.JPG
    97.5 KB · Views: 132
Last edited:
It depends on how many pulses you need to detect in say 20mS.
You "open the gate" and count in the background 20mA. Store the number of pulses detected.
Hold the fan outside the window of the car. Drive at 49km/hr.
Use this as a reference.
It's so easy.
 
Rather than count the number of pulses in a set period, I suggest timing single pulses. You can set an interrupt or flag for an edge (rising or falling) and capture the time between those events. At least that is how I would do it with a PIC and presumably arduino has the same capabilities.
 
Rather than count the number of pulses in a set period, I suggest timing single pulses. You can set an interrupt or flag for an edge (rising or falling) and capture the time between those events. At least that is how I would do it with a PIC and presumably arduino has the same capabilities.
Hmm I like this ideq, I know how to measure the pulses in a period of time but how do I do what you suggested? I understood to put a flag when the rising pulse occurs let's say 1 but how do I know when it's falling and becomes zero?
 
The difference between the methods is the responsiveness. Take your slow frequency which had a period of about 40 ms. If you counted ten cycles, it would take 400 ms and the counting error would be approximately +/- 10%. If you timed a single cycle ( or several cycles), your response time would be cut considerably and the MCU timer would easily give 1 part in 1000 (2^10) precision.

The arduino is based on an Atmel chip, which is manufactured today by the same company that makes PIC's. They all seem to have very similar functionality -- including the ability to start and stop timing on a transition (low-to-high or high-to-low or both), and the timer runs at a few MHz. Of course, there are pre- and post-scalers for those counters, so you can adjust the timer to get the number of counts you want. I know how to do that with a PIC, which is quite easy. Unfortunately, I have never touched an arduino, but I suspect it is at least and probably more easy to do.

Someone with that experience will surely chime in.

John
 
Last edited:
I made a very accurate tachometer for a Yanmar diesel that had a hall effect sensor getting signals from the ring gear teeth on the flywheel. I adjusted the timer to reset after it counted 2000 teeth at 2000 RPM and it was accurate throughout the entire range. No math or lookup tables. Just count pulses until the timer times out, display that number and start counting again. In this case, it counted the right number of teeth in about 1/2 second.

So in your case, set your timer to count pulses for 1 second and like was said earlier, hold it out your car window at 50 MPH. If it is reading 90 MPH, shorten the count time. If it is reading 40 MPH, lengthen the count time.
 
Last edited:
If you wish to use an Arduino you can try the following code sample. You can modify the code to fit your needs. As can be seen the code displays wind velocity expressed in MPH (Miles Per Hour) which can easily be converted to kph or if you like add a line or two of code and display both.
Here is what it looks like in Arduino:
Anamometer 1.png


Anamometer 2.png


The actual code sample:
Code:
int windPin = 2;    //This is the input pin on the Arduino
double windRate;    //This is the value we intend to calculate. 
volatile int count; //This integer needs to be set as volatile to ensure it updates correctly during the interrupt process. 

void setup() {
  // put your setup code here, to run once:
  pinMode(windPin, INPUT);           //Sets the pin as an input
  attachInterrupt(0, Wind, RISING);  //Configures interrupt 0 (pin 2 on the Arduino Uno) to run the function "Wind" 
  Serial.begin(9600);  //Start Serial
}
void loop() {
  // put your main code here, to run repeatedly: 
  count = 0;      // Reset the counter so we start counting from 0 again
  interrupts();   //Enables interrupts on the Arduino
  delay (1000);   //Wait 1 second 
  noInterrupts(); //Disable the interrupts on the Arduino
 
  //Start the math Calculate for mph or kph or both
  //windRate = (count * 5.00);        //Take counted pulses in the last second and multiply by 5.0 
  //windRate = windRate * 60;         //Convert seconds to minutes, giving you Velocity / Minute
  //windRate = windRate / 1000;       //Convert windrate, giving you Velocity/ Hour
  Serial.println(count);  //Print the variable windRate to Serial
  Serial.println("Miles Per Hour"); 
}

void Wind()
{
   count++; //Every time this function is called, increment "count" by 1
}

The last lines of code are remarked out:
//Start the math Calculate for mph or kph or both

These lines allow you to place your math functions in for your pulse count. Less the additional math functions as it is the display is pulses per second displayed.
Serial.println(count); //Print the variable windRate to Serial

Once you have your math worked out that will change to:
SerialPrintln(WindRate); // That will display the eind velocity.

You need a pulse count so I suggest Colin's method. Place the sensor on a vehicle on a calm wind day and get pulse counts for assorted speeds.

Ron
 
If you wish to use an Arduino you can try the following code sample. You can modify the code to fit your needs. As can be seen the code displays wind velocity expressed in MPH (Miles Per Hour) which can easily be converted to kph or if you like add a line or two of code and display both.
Here is what it looks like in Arduino:
View attachment 109328

View attachment 109329

The actual code sample:
Code:
int windPin = 2;    //This is the input pin on the Arduino
double windRate;    //This is the value we intend to calculate.
volatile int count; //This integer needs to be set as volatile to ensure it updates correctly during the interrupt process.

void setup() {
  // put your setup code here, to run once:
  pinMode(windPin, INPUT);           //Sets the pin as an input
  attachInterrupt(0, Wind, RISING);  //Configures interrupt 0 (pin 2 on the Arduino Uno) to run the function "Wind"
  Serial.begin(9600);  //Start Serial
}
void loop() {
  // put your main code here, to run repeatedly:
  count = 0;      // Reset the counter so we start counting from 0 again
  interrupts();   //Enables interrupts on the Arduino
  delay (1000);   //Wait 1 second
  noInterrupts(); //Disable the interrupts on the Arduino
 
  //Start the math Calculate for mph or kph or both
  //windRate = (count * 5.00);        //Take counted pulses in the last second and multiply by 5.0
  //windRate = windRate * 60;         //Convert seconds to minutes, giving you Velocity / Minute
  //windRate = windRate / 1000;       //Convert windrate, giving you Velocity/ Hour
  Serial.println(count);  //Print the variable windRate to Serial
  Serial.println("Miles Per Hour");
}

void Wind()
{
   count++; //Every time this function is called, increment "count" by 1
}

The last lines of code are remarked out:
//Start the math Calculate for mph or kph or both

These lines allow you to place your math functions in for your pulse count. Less the additional math functions as it is the display is pulses per second displayed.
Serial.println(count); //Print the variable windRate to Serial

Once you have your math worked out that will change to:
SerialPrintln(WindRate); // That will display the eind velocity.

You need a pulse count so I suggest Colin's method. Place the sensor on a vehicle on a calm wind day and get pulse counts for assorted speeds.

Ron

Hi there, thank you very much! The program works perfect for what I need. I now just doing a calibration with a good anemometer I have.
 
Once you know the variables of what you have, as in how many pulses per unit and if the pulses are linear then you just remove the // from the lower lines and fill in the math functions. If you want to get fancy have the output display things like wind velocity in kilometers per hour as well as miles per hour. Heck, using an Arduino you can also toss in ambient temperature. :) Good luck with it. Just remember the final lines need to be setup.

Ron
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top