Hi masters...i have created an anemometer using a PC fan...i need help with how to code it to convert voltage to m/s. I would appreciate your help.
have you connected a voltmeter to it and checked what voltage you get when it spins (use a hair dryer to blow some air in the cups or remove the cups and use a small electric drill to spin the fan.
IF voltage is relevant and compatible with your Arduino's limits, using analogRead() would be a way to get that voltage into your arduino and then you can do the relevant maths
One way to calibrate the system is to connect it to your arduino (again if voltage is within correct bounds) and get in a car / on a motorbike with your gig exposed to the air flow and note the voltage you get for a given speed of your vehicle.
Thank you...my fan is a 12volt dc pc fan..let me try analog read...whats the simple code to.let me use that? Positive on A0 and negative on ground right? What simple code would i need to use serial monitor....again thank u..im a complete beginner on this.
If your fan creates more than 5V it will destroy your Arduino.
So first thing is to measure the maximum voltage that occurs.
If it is more than 5V some additional parts are nescessary to make it work.
The microcontroller-world is not superstandardised like USB-devices. You have to take care about much more things than
"does the plug fit into the socket?"
best regards Stefan
Hi Stefan...thank u..i understand..my fan is more than 5volts..if u have the time please guide me what i must do...i am new at this.

This is a schematic of a normal 12V fan (Except the mosfet goes south of the motor!!!)
, you'll need to source its own power somehow! Turning it on in code with a digital PWM pin on the arduino. digitalWrite(in1, ON); ....
Using the tach signal out into an input on your arduino you'll be able to calculate your voltage to m/s from analogRead();. I haven't done this so might need some help from some others, make sure its 5V or less before putting it into your arduino!
post a very clear picture of your fan and the wires coming out of it. if you have the exact specs of the fan, put a link.
After i was kindly told a 12volt fan is too much for Arduino...i took out this from my old pc...its 5volts DC.
If you want to use the fan for measuring wind-speed you don't feed elctrical power into the fan. You feed in mechanical power through the wind. As you can easy imagine from real slow turning there will be only a tiny bit of energy created. With faster turning more electrical energy is created and the voltage will rise to higher values.
What number the voltage will be reached depends on a lot of factors. But not at all on the 12V supply-voltage.
This is the reason why you shall measure the voltage that comes out of the fan if you let it turn as fast as your maximum expected windspeed.
And even with a 5V fan if you just let it turn fast enough you can exceed the 5V.
And as I have mentioned in an earlier post. WIth some adaptive circuitry you can even measure 400Volts with an Arduino.
It all depends on the circuitry.
If you have only a little bit of knowledge about electronics in general I recommend learning at least the basics like Ohms-Law.
If programming and electronics are new to you. I recommend not to work on this wind-measuring project as the very first project.
If you do so you will have to ask every five minutes a new question and somebody has to take you by the hand for each step.
What you can do is measuring the voltage with a digital multimeter.
If you have no digital mutlimeter you are almost lost as soon as some kind of wiring error occurs. Even if you just use a display or some LEDs you need to have a multimeter. Any digital multimeter in the $20-30 range will do.
If you can spend a little more take one that has can measure 20A, Frequency and %-dutycycle, and capacity
I would recommend this one
very good price perfomance ratio
best regards Stefan
You should be able to feed 5V to the fan and GND the PWM input to prevent powered rotation. The tach output will be an open-collector/drain; you'll need an external pull-up resistor (such as setting an Arduino pin to INPUT_PULLUP).
The output will be a square wave, the number of pulses per revolution being dependent on the number of poles in the fan. I couldn't find a datasheet for that fan (which is weird since it's a Delta unit...) so you might need to experiment. Set it up on a bench and have your Arduino count input pulses. Turn the blade one revolution and see how many pulses were counted. Or turn it ten times and see how many pulses were counted.
To convert your fan's tach output to a wind speed you'll need to calibrate your anemometer against a known standard for as many different wind speeds as you can get. You'd end up with a "cloud" -- hopefully narrow and linear -- of points on a graph showing calibrated m/s versus tach pulse frequency. Fit a best line through it and then apply that to your pulse measuring code on the Arduino.
Hey Stefan.. thanks for the time....as for electronics i have pretty advanced knowledge of that...i build my own turbines and solar projects....i know abit of that....but on Arduino that's kinda new for me..so i get .i will do my homework then.....so i dont ask every minute as u say...i guess in any new field we are bound to ask dumb questions ar first be it ever so little.
I understand..let me try it...thank u
If that is a brushless motor, I doubt it will push any sensible voltage backward through the motor controller and the 2 power wires.
Hi Paul,
you are free to ask as many questions as you like. As long as your postings deliver detailed information of what you do there is a high chance to get answers each time.
If the details what you have done are missing your potential helpers have to ask back. To have to ask back for details is annoying. It is not annoying to read 20 sentences of a detailed description . If you format your posting into paragraphs. like this one.
I meant the following:
If you have no knowledge about electronics (in spite which you have some knowledge about electronics ) and no knoweldge about programming there will be a lot of questions.
To emphasize that: It is totally OK to be a newbee about electronics and programming.
Anyway it is a good idea to inform the forum about your knowledge level.
From what you have asked so far I can conclude that you are still a newbee about electronics.
@ JCA34F :
You are right backwards through the ESC there won't be coming out a voltage. I made the practical test with a RC-airplane brushless motor: If you rotate it and measure between two wires a AC-voltage is generated.
Though a brushless fan has a plus and minus wire because the ESC that generates the 3.phase AC is build in. If th fan can be opened and the wires to the coils are accessibe this would be a way to get your hands on the AC-voltage. Though this "signal" from the motor-cols needs conditioning
before you can feed it into an Arduino.
So what Blackfin suggested will be easier if a tacho-output is there.
I did a quick search about re-using an old harddisc-spindel-motor
and found this one
At low rpms the generated voltage is pretty low 0.4V. Hard to use for measuring windspeed.
But the video shows interesting basic principles how a 3-phase AC-motor works and how you determine the wiring and how to transform a 3-phase AC into DC.
best regards Stefan
Hi,
Do you have a DMM?
Have you measured the output of the fan when you spin the blades.
I think you will not get much or none at all.
What does your anemometer in your first post generate?
A BLDC motor is not like a normal DC Brushed motor or an induction motor.
Tom...
![]()
thanks for the pictures, it would be nice to see if you do have a tach output, then as explained by @Blackfin that will make your life easier and not worry about voltage generated or not by the spinning fan.
Alright...thank you guys....i really appreciate it... will see what i can do.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.



