Intro
You savaged a fan from an old PC to use it as a ventilator? Just hook it up to 12V and the sucker runs. Well, it runs at a constant speed. Maybe too fast, maybe too noisy. There must be a possibility to slow it down.The idea
When you apply 12 Volts to it and then remove the power supply, it keeps spinning while getting slower. So if you continuously apply and remove the power, you can control the fan of the speed by the duration of the phases when the 12V is on and when it is not.What do we need
The Arduino doesn't supply 12 Volts. So we have to use some sort of switch. An electronic switch. A MOSFET. That's a kind of transistor, that can handle the needed current/voltage needed. I used the IRF530N, because it was the only Mosfet I had and it matches the specification of the vent by far ;-). It's a N-channel Mosfet. That means you can control the connectivity of the negative pole of the power source to the fan by applying a positive voltage.PWM
Pulse Width Modulation is the magic phrase. A digital output pin can only have two possible states. On or off. 1 or 0. HIGH or LOW. While HIGH is typically indicated by an output of 5 Volts (3.3 Volts occasionally) is LOW represented by a 0 Volt output. So how do we simulate an output of 2.5 Volts? Well, simply spoken, if we have a time frame of 10 seconds. Half the time we put out 5 Volts and half the time 0 Volts, we will have an output of 2.5 Volts of the time of those 10 seconds. Wired? Sure. But this is how math works ;-)PWM |
Video
Wiring
IRF530N at Amazon
PWM-Image
https://commons.wikimedia.org/wiki/User:MatthiasDD
this looks cool,
ReplyDeletewanna try it
can u share the code with me.
s.k.alimoestar@gmail.com
thank you.
I love what you are doing with this blog. Could you please send the code to me @ vincentmuchiri1@gmail.com
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteYou helped me supper with you explanation!
ReplyDeleteVery newby in code
But when I'm trying to implement your code I notice the write speeds:
// analogRead values go from 0 to 1023, analogWrite values from 0 to 255
https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/
or do I mis something?
Use map to do this
Deletecan you share your Code to sayemmy007@gmail.com ,please!!!
ReplyDeletecan you share your Code to sayemmy007@gmail.com ,please!!!
ReplyDeleteNo resistors needed?? Is the same wiring if I use a irf 520? Thanks
ReplyDeleteI like this pleasr share your code to hutainaml@gmail.com
ReplyDeletecan you send the code to webberlexx@gmail.com please
ReplyDeleteCould you please send the code to nkaymak2002@yahoo.com please?
ReplyDeletecan you please send the code to crissmuss@yahoo.com? thanks
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteCould you please send the code to lucasbonatelli0@gmail.com
ReplyDeletehi. i love your explanation in the video. it gave me a better understanding. i would love to try it out. could you please share the codes to me @khairinazahar@gmail.com . Thank you sir :)
ReplyDeletegreat video , would you be able to send me the code please to kalotan_mihov@yahoo.com
ReplyDeleteregards
Could you please send the code to eddue662455@gmail.com
ReplyDeleteWorking on a college project involving such motors. Can you please send the codes to nibirranjangogoi@gmail.com . Thank you
ReplyDeleteWould you be able to have the same kind of circuit but with a heater, I want to monitor it with a temperature sensor and then either increase the power into the heater or decrease it so that I can control it. If you could send me your code I am not sure if you do that but it would be appreciated, my email ml545@duke.edu
ReplyDeleteI am working at a similar project. Could you please send me the code to at my email: fotizagl@hotmail.com
DeletePls I need the code johnstanley669@gmail.com
ReplyDeleteHi I thought this blog was extremely helpful! Do you think you could send the code to my email clint.dejesus.2019@mumail.ie ? it would be amazing thank you so much
ReplyDelete