Arduino Fan Control using High Frequency 25kHz PWM // 4-Wire CPU Fans

  Рет қаралды 76,825

Science Fun

Science Fun

Күн бұрын

Join Science Fun on Facebook @ / sciencefun4u
In a previous tutorial, I showed you how to control 2-wire, 3-wire, and 4-wire CPU fans using an Arduino. With 2-wire fans and 3-wire fans, speed control is possible using an N-channel MOSFET and PWM. With 3-wire fans and 4-wire fans, it is possible to measure the fan speed using an Arduino input and a pull-up resistor. With 4-wire fans, speed control is possible directly with a PWM Arduino channel without the use of a transistor or MOSFET.
However, some CPU fans require high frequency (25kHz) PWM in order to function properly. In this video I will demonstrate how to control a 4-wire CPU fan using 25 kHz PWM on the Arduino

Пікірлер: 198
@du_fox
@du_fox 3 жыл бұрын
RAD! I was just looking for a good guide to arduino PWM fan control! I'm also excited to see the huverkraeft! :D
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Hope you enjoyed it!
@solosailorsv8065
@solosailorsv8065 2 жыл бұрын
Congratulations for covering the topic in sufficient detail, without using the "scary" words of, "Timers" or "Registers" !!
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
Glad you liked it!
@interiorterrier
@interiorterrier Жыл бұрын
Great work, this is the first sketch that works with my 25kHz fans 👍
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Glad it was helpful!
@podunkis
@podunkis 3 жыл бұрын
Nice video. I had read that the 25 KHz signal was required, so I planned to code for that without checking. Obviously that wouldn't hurt, but it's good when someone checks more thoroughly, as you have done. Bring on the hovercraft, of course!
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Thanks! Hope to get started on the hovercraft soon.
@martinadamczyk6628
@martinadamczyk6628 2 жыл бұрын
this was great! it worked (second time), for me the yellow and blue wire functions were swapped, so if it doesnt work for you swap the wires, i did that aftert checking the fan product description.
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
Excellent!
@livnenir
@livnenir 3 жыл бұрын
Congratz for getting 1k subscribers:) keep it up
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Thank you so much 😁
@franklinronan3158
@franklinronan3158 3 жыл бұрын
Not sure if anyone gives a shit but if you're bored like me during the covid times you can watch all of the new series on instaflixxer. I've been streaming with my girlfriend recently :)
@tobiasbenson3234
@tobiasbenson3234 3 жыл бұрын
@Franklin Ronan Yup, have been using InstaFlixxer for months myself =)
@Megalomon
@Megalomon 3 жыл бұрын
Exactly the video I searched for. Thanks :D
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Glad I could help!
@TheJavaSync
@TheJavaSync 3 жыл бұрын
@@ScienceFunInnovations Me, too ... but no code available on the discription :'(
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
@@TheJavaSync It is on my Facebook page @sciencefun4u
@TheJavaSync
@TheJavaSync 3 жыл бұрын
@@ScienceFunInnovations sure, I'll go for that :) Thank You
@TheJavaSync
@TheJavaSync 3 жыл бұрын
@@ScienceFunInnovations so, if I use pwm directly to drive gate of the N mosfet (to drive another DC motor), it will work, right?
@dmytro95
@dmytro95 Жыл бұрын
Very useful video, its so hard to find clear and understandable info about the fan controll, many are just copypasta other sources
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Glad it helped
@germang.4514
@germang.4514 3 жыл бұрын
I am sending the hardware data from my PC to the Arduino ( CPU and GPU Load, Temperature, Frequency, etc) using C# and this is what I need to control the fans. The motherboard simply has very few fan outputs so the Arduino will take care of the rest. Thank you very very much.
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Sounds great!
@ShmeegleSon
@ShmeegleSon 9 ай бұрын
Awesome and thank you so much, just subbed
@ScienceFunInnovations
@ScienceFunInnovations 9 ай бұрын
Awesome thank you!
@Striderr10
@Striderr10 2 жыл бұрын
This video is very useful for me thank you sir!!!
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Glad to hear that
@ultra2050
@ultra2050 Жыл бұрын
Thank you for the video. Don't you also have to set the WGM12 bit in the TCCR1B register? Without it being set you actually don't use fast PWM but the regular dual-slope phase correct PWM.
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Wow. Been too long since I did that video to remember. But sounds like you know more about it than I do. :-)
@facundogloria1376
@facundogloria1376 Жыл бұрын
hi! what a great video.i have a question, for the comand "TCCRIA" of the second code (25khz) what library did u include. it doesn't compile sorry. and i look foward for our reply.
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
TCCRIA is not part of a library. It is a command related to timer 1 register A. Did you try to copy my code from facebook.com/ScienceFun4u ?
@MikeHammonds804
@MikeHammonds804 2 жыл бұрын
This is exactly what I need, How can I include the temperature controls in the void loop() as you did in your previous tutorial?
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
It has been so long since I looked at that code, but I imagine that it would be very similar. Best wishes.
@ggsggo
@ggsggo 3 жыл бұрын
I came to learn about fan control and and this went just the right speed for me; and learned what I came to learn. It sparked my curiosity about the hovercraft design. Are these just fans you had available or are they specifically chosen because of their air movement physics per amp hours of power consumption say over a propeller, blower, etc. It looked like it was coming along well and never would have thought of a computer fan. I would have used the motor and propeller from quadcopter drones or centrifugal blowers; more than likely a common newbie mistake lol.
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
It really is just about airflow. These are high flow fans (approx 100 cubit feet per minute). A quad copter motor and propeller would work as well, but would probably drain the batteries a little faster. I had this on hand, so I used it. :-)
@aliens1192
@aliens1192 3 жыл бұрын
Thanks, man! With an Arduino, it worked perfectly. I really needed this info... :D Now, I must figure out, how I can do the same with an ESP32 safely... :D
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Glad I could help!
@klausnielsen1537
@klausnielsen1537 3 жыл бұрын
Hi Hamidreza. I just saw this video by Gary Explains : kzbin.info/www/bejne/h368mYmnn6ebgbM where he uses a different program called PlatformIO for the programming. That program letts him program in arduino IDE language and export to a whole host of other devices like esp32. Just saw your comment and thought this might help you. Best of luck.
@fredydominguez9782
@fredydominguez9782 2 жыл бұрын
Hello, how did you learn how to establish these connections specifically how did you know to use a 10K Ohm resistor as a pull-up resistor to your Tacho wire. Also, did you provide a specific current from your voltage source?
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
10k is just a standard pullup. I would probably work with anything in between 1K and 100K. As far as the power source, I didn't limit the current, but these fans don't pull much anyway.
@house123ization
@house123ization 3 жыл бұрын
Thank for this video . My fan (25 kHz) behaved exactly as you illustrated. I am however finding it a struggle to intergrate this high frenquency code with the code for the Lm 34 sensor. on the previous video..Any guidance would be very much appreciated.
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Hmmm. Is it not giving you a reading? Or is it giving you a weird reading?
@house123ization
@house123ization 3 жыл бұрын
@@ScienceFunInnovations No the fan is working perfectly using the the circuit up as above. But I now wish to set up the circuit and code with the lm 34 thermistor controlling the fan.Do I still use pin 9 (instead of pin 3 as it was in your the June 1st video) for the pwm signal. Insofar as the code ,is it a case of inserting the code, here that set up the 25 khz, into the June 1st code. Thanks
@mrstanlez
@mrstanlez 3 жыл бұрын
Nice tutorial, Thank you. What about 4-wire(blue, green, black, yellow) CPU intel Fan DC12V 0.28A NIDEC ?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Blue: Control (PWM), Green: Tach, Yellow: 12V, Black: Ground
@matthewhoward8996
@matthewhoward8996 3 жыл бұрын
Great Video!! For configuring Timer 2 to do the same, how do we do that?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Does this help? www.arduino.cc/en/Tutorial/SecretsOfArduinoPWM
@cameronross3608
@cameronross3608 3 жыл бұрын
Hi there, great video! I was wondering how you derived a pulse width of 320? I am assuming this was calculated assuming a duty cycle of 50 percent? Thanks.
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
You can set it to different values. 320 just works well with the clock frequency.
@ultra2050
@ultra2050 Жыл бұрын
You can lookup the formula in the datasheet of the ATmega uC: The timer use an I/O clock base that is half the main cpu clock frequency. In the arduino case the main cpu clock frequency is 16MHz, so the I/O clock is 8MHz. The CS* bits control the prescaler. It is set to 1 here. The PWM frequency formula is: f_PWM = f_IO / ( prescaler * ( 1 + ICR1 ). With a value of 320 for ICR1 you get around 25 kHz. With a value of 319 you would get exactly 25 kHz.
@user-ci1ne3sd2h
@user-ci1ne3sd2h 3 жыл бұрын
Hi! Thanks to the video. It is help-full when I learn arduino. I have one question. 2:30 why *30 (or *60/2) to count RPM? You said yellow-wire(pin2) make(?) 2 pulse, but I can't understand why interrupt pin receive two pulse in a second...
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
It depends on the fan, but most produce 2 pulses per revolution.
@primozeteoaceret4153
@primozeteoaceret4153 2 жыл бұрын
Hello, I'm also using arduino to control the speed of my blower fan (delta - model: BFB1012VH-7P03). I am using your code (but changed some parts for the potentiometer) and same schematic (the only difference is that my power supply is connected to the arduino power jack and im accessing it through the Vin pin obviously). However, i cant control the speed with the potentiometer and the blower fan just goes to full speed. i also cant read the speed/rpm in the serial monitor. Why is that?
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
Are you able to see a pulse using a multimeter? Also try wiring your control wire to gnd and 5v to see if the fan responds to the signal. Hope you figure it out.
@greggyoung7419
@greggyoung7419 3 жыл бұрын
This is awesome, I have a few questions for you. 1. If I was using a 5v fan do I skip the resistor in the wiring diagram? 2. You are adjusting the frequency on pin 9 and 10 but appears you are only using pin 9. Is this a copy & paste issue?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
1. Even with a 12V fan, some of my viewers have been successful without the resistor. You could definitely try without. 2. The configuration setup changes both pins 9 & 10 to high frequency PWM, but yes I only used one pin for this demo. Thanks for watching!
@AmnesiaPhotography
@AmnesiaPhotography 3 жыл бұрын
It depends how the fan is wired internally I believe. I read something online saying the pull up is required for the transistor in the open collector... but I don’t recall why it’s so important.
@kobladoures
@kobladoures 3 жыл бұрын
Thank you so much for this tutorial! Keep up the good work! I have tried to reproduce it with 4 different 25khz pwm pc fans and 3 different arduino micro-controllers (2 uno and 1 nano) but the same strange things happened each time .. 1)I got funny tachometer values ( most of them are negative or very large values). 2)When i have disconnected the 10k ohm pull up resistor from the D2 port (Yellow wire), the produced pwm from the D9 port stops controlling the fan's speed ( the fans seem to run at max speed), even if the tach cable is not connected. ( I don't have an oscilloscope in order to measure the produced PWM from the arduino) 3)The fans doesn't seem to run at max speed when they are controlled from arduino. ( They produce more noise and wind when they run only with 12 volts from power supply ).
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Check out some of the comments. Many other viewers have had the noise issue and were able to eliminate it with a low pass filter and/or Schmidt trigger. Good observations. Thanks for the feedback!
@gangger89
@gangger89 3 жыл бұрын
hi, thx for the video. i made it running on a silent fan. i have a question: how can I controll the fan to stop, if rpm=0 doesent make him?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
The only way would be to use a relay, MOSFET, or transistor to completely shut off the power.
@gangger89
@gangger89 3 жыл бұрын
@@ScienceFunInnovations thx, tried it an works.
@sehabshaikh
@sehabshaikh 3 ай бұрын
Can you show me what the hardware connection would look like? I am trying to connect a 12 V 4 wire Fan to Arduino I understand Arduino only takes 5V wouldn’t the power supply fry the circuit?
@ScienceFunInnovations
@ScienceFunInnovations 3 ай бұрын
Have you seen my other fan videos? I think those would answer your questions. The fan would need its own power supply.
@marcosbuydid
@marcosbuydid 2 жыл бұрын
Hi friend. I appreciate so much your time for sharing this code and the video to the community. Personally in my opinion is really valuable. I have 2 questions regarding to the code. The first is what's the purpose of the while sentence inside loop? [while ((millis() - start_time) < 1000) {}] because inside it it's empty and probably it can be deleted. My second question is how can revert the default pwm configuration on pins 9 and 10 of the arduino (490hz) after configuration of pins with 25khz. Thanks so much
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
1st question. The code sets a 1 second timer that allows void counter to keep running in the background. If I used delay(1000) I don't think it would work. 2nd question. Just load a blank sketch and it will revert to default. Thanks for watching.
@greggyoung7419
@greggyoung7419 3 жыл бұрын
I missing something with the 25kHz code, I'm getting 'TCCR1A' was not declared in this scope but I do not see where you are declaring their types. I was able to get the non-25kHz to work but my fan achieves full speed.
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Hmmm. Not sure what's happening with that.
@discutiadinweekend6183
@discutiadinweekend6183 3 жыл бұрын
Hello! I have a little question. Does this code work the same for arduino DUE? If not, can you help me with it please? (I have a DUE)
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
I'm not sure. I've never used a DUE. It likely will work, but I am not sure if the pin numbers will be the same. I am not as familiar with the C code as the C++ code. Still learning myself... Thanks for watching.
@Trevor.Morrice
@Trevor.Morrice 3 жыл бұрын
Hey Im having an issue where the PWM percentage doesn't affect the fan speed? Its always at full 1320rpm. Ive tried it with two fans and with both of your example codes in this video no luck :( Is there anything that i could be missing? seems like the RPMs are reading and the code is running in the serial just the RPMs never change they go full speed as soon as i plug them in.
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Weird. Try connecting the control wire straight to ground. The fan should drop to a very low speed. That would at least test that the fan is working. If the fan works, try putting a voltmeter on the Arduino PWM pin and see if that is working. Hope this helps. Let me know if you figure out the issue.
@Trevor.Morrice
@Trevor.Morrice 3 жыл бұрын
@@ScienceFunInnovations Ive found that when i unplug the arduino from the 12v ground the PWM works! but then the RPM stops working.
@CollinBaillie
@CollinBaillie 3 жыл бұрын
@@Trevor.Morrice are you using 3-wire or 4-wire fans?
@bishoyiskandar1606
@bishoyiskandar1606 2 жыл бұрын
Thanks for the video, very helpfull i have a question please.. Why is it important to connect the ground of the fan to the ground of the arduino ? otherwise PWM doesn't work thanks in regards
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Just so both have a common reference voltage.
@bbrown_sc
@bbrown_sc 3 жыл бұрын
I'm using a StarTech 4-wire PWM fan (FAN8025PWM), using the circuit provided here, but can't read the tachometer pin reliably because the PWM frequency (25kHz) noise is present in the square wave of the tach pin. Is there a way to filter the PWM frequency noise from the tach pin with either software or hardware?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Try a low pass RC (resistor capacitor) circuit. Set the frequency slightly higher than the max expected fan square wave frequency. kzbin.info/www/bejne/hXOwZodrlNCamqs
@bbrown_sc
@bbrown_sc 3 жыл бұрын
@@ScienceFunInnovations Thanks for the quick response. I'll try that. The max rpm of the fan is ~2500. 2 pulses per revolution on the tach is 83Hz. I'll try adding a .15uF ceramic to the existing 10k resistor to make the low pass filter for a cutoff at 106Hz. Hopefully that will work for the default low frequency (490Hz) of the Arduino all the way to 25kHz.
@bbrown_sc
@bbrown_sc 3 жыл бұрын
That didn't work. I needed to add a schmitt trigger along with the low pass filter to gat an accurate RPM.
@fredydominguez9782
@fredydominguez9782 2 жыл бұрын
@@bbrown_sc how did that go? I’m having a similar issue.
@paulpixzy5297
@paulpixzy5297 2 жыл бұрын
Thanks for the video...but how can I make pin 9 & 11 share 25khz with the same duty cycle and time.that is simutanius pwm...please am using it for my inverter charging on means...please helpp
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
Not sure on that one. Hopefully you figured it out?
@WolferAlpha
@WolferAlpha Жыл бұрын
Leaving as a suggestion... How would it be if you use the DBPF1238B8G cooler on the hovercraft?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
I'm not familiar with that part. I'll have to check it out.
@WolferAlpha
@WolferAlpha Жыл бұрын
@@ScienceFunInnovations Check it out on my channel I have a recent video showing it, soon there will be a video of something I will do with it
@WolferAlpha
@WolferAlpha Жыл бұрын
and of course, my video is the only one on youtube about this fan
@PHM_Tech
@PHM_Tech Жыл бұрын
How i can made ir on my 24V noctua fan? -24V Black +24V Yellow PWM Blue RPM Green
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Should work with 24v or 12v
@datboi7722
@datboi7722 Жыл бұрын
This circut works with a raspberry pi too right? I just wanna double check to make sure I don't break anything.
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Should be fine with raspi.
@rajduttninadpatil2810
@rajduttninadpatil2810 Жыл бұрын
Hi I found it useful Im working with battery fuel sensor IC bq34z100 that senses the charge of the battery and it must be on continuously to detect battery charge status. The supply im providing to FAN is same for IC Hence i keep ic on my fan must be off how it would be possible further pls help
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Check out my other fan videos... I use a MOSFET to turn the fan off.
@vasupodila1149
@vasupodila1149 Жыл бұрын
Thank you for the tutorial. can I know how you wrote default commands like for TCCR1A and TCCR1B. can you please explain me. Because for my project I am looking for pwm frequency of 16KHz to 20KHz. I am very happy if you respond. Thank you in advance.
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
I believe those are C commands, not C++. I found another code that used them. I am not too familiar myself...
@probability300
@probability300 Жыл бұрын
Hello, thanks for this tutorial. I have a 24V 25kHz PWM 4-wire fan. How should I control this fan through the Arduino Uno? Thank you!
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Same way, just use a 24V power supply and connect PWM to the Arduino.
@JurekPrzezdziecki
@JurekPrzezdziecki Жыл бұрын
Grat video! I understand, that blue and yellow wires are PWM - and PWM +?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
There should only be a PWM+, GND would act as PWM negative.
@martinmacko7297
@martinmacko7297 3 ай бұрын
Great help! Thx, any chance to tell me how to do it with ESP32 ? Thx!
@ScienceFunInnovations
@ScienceFunInnovations 3 ай бұрын
Sorry, no. I haven't worked with ESP32 before.
@Drinu1985
@Drinu1985 3 жыл бұрын
How would it be possible to control 4-wire CPU fans using a PWM Speed Controller without using an Arduino ?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
You can connect the red and black to a PWM Speed Control. Just don't take the PWM signal too low or you can ruin the fan. The internal PWM control on the fan prevents the fan from turning to slowly.
@AmnesiaPhotography
@AmnesiaPhotography 3 жыл бұрын
Was able to implement the code, but hit a snag. I seem to be getting PWM noise on the tach line as I’m controlling the fan.
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
The high frequency can do that. You may need a low pass filter and/or Schmidt trigger.
@AmnesiaPhotography
@AmnesiaPhotography 3 жыл бұрын
@@ScienceFunInnovations Yes it sure can. After a lot of experimentation with resistors and capacitors, I found that in my case, just a 220k ohm resistor was best. No capacitor at all. I could put a 3pf cap, but it made minimal difference to the scope. Now comes the fun of trying to understand why that was better than including a cap. I'm thinking it's because the cap modifies the square wave too much for the Arduino, or if it's just I had the wrong cap value.
@pirespaulo6281
@pirespaulo6281 Жыл бұрын
Nice video. Why when the PWM is equal to 0, the fan cooler does not stop (rpm = 0)?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
There is a minimum speed built in to the fan to protect it. They can be damaged if they go to slow.
@martenkl-71
@martenkl-71 5 ай бұрын
@@ScienceFunInnovations Then it should not spin at all, normally PC fans starts spinning at around 15-20%, your fan or code is not up to spec.
@deanzhao278
@deanzhao278 3 жыл бұрын
How can I control the turning off of the fan? When PWM=0, the speed also maintains 1015RMP
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
In order to completely stop the fan you need to interrupt the power using a MOSFET, transistor, or relay. The fan will not drop to low/off RPM using PWM because turning at really low speeds will damage the motor on the fan. Thanks for watching!
@deanzhao278
@deanzhao278 3 жыл бұрын
@@ScienceFunInnovations Oh, I get it, Thank you for your reply.
@Dinesh-Bhardwaj
@Dinesh-Bhardwaj Жыл бұрын
Can i use 3,5 and 6 no. pin to control 3 pwm fans?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
You should be able to control multiple fans.
@BrentRoberts01
@BrentRoberts01 Жыл бұрын
Thank you for posting this. I'm using the 4_Wire_High_Speed_PWM code, and for some reason the Serial Monitor is showing PWM 0%, 25%, 50%, 75%, 100% AND 125%. Everything works fine until the PWM gets to 125% and the speed returns a negative value and the fan turns off. Then turns back on at PWM 0% and repeats the steps. What's causing the PWM to try 125%? Any way to make it stop at 100%? PWM 0% also shows 0 RPM but the fan is running (slowly) as expected. Thanks for your help!
@BrentRoberts01
@BrentRoberts01 Жыл бұрын
EDIT - I fixed the problem with the map showing 125% (forgot to change 255 to 320), but now the same issue arises. The 100% shows a negative value and turns off the fan. 0% still shows a speed of 0 RPM as well.
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Hmmm. Any luck figuring it out?
@EasternCarolinaSafetyUpfitting
@EasternCarolinaSafetyUpfitting Жыл бұрын
@@ScienceFunInnovations nope. Unfortunately I wasn't able to figure it out. I'm still in need of a solution if you can think of anything off the top of your head. Thank you!
@eijikong1660
@eijikong1660 Жыл бұрын
is it safe to connect cpu fans to power supply or battery directly?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Yes.
@guillaumemasure2657
@guillaumemasure2657 7 ай бұрын
Thank you very much for your interesting video's and explanation 😇. I wonder if you could share the models(link to purchase website) of the fans ? Additionally, I wonder if you have good websites for buying DC power supplies as I do not posess one yet. Thank you very much for your feedback!
@ScienceFunInnovations
@ScienceFunInnovations 6 ай бұрын
Most of my components come from eBay, Amazon, or AliExpress. I don't remember where I got the fans as it was a very long time ago. Good luck, and thanks for watching!
@rajduttninadpatil2810
@rajduttninadpatil2810 Жыл бұрын
Sir how did you decide 360 pls can you tell me in detail
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
I did that a very long time ago and don't quite remember... but it is in the C code and you can change the number.
@slip0n0fall
@slip0n0fall 3 жыл бұрын
Often the higher speed PWM is to get it just outside of audible range (whine otherwise at lower freq's)
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Definitely! I have had many a motor buzz at me with low freq PWM. Better to drive the dog nuts instead with the high freq.
@davebutler3905
@davebutler3905 Жыл бұрын
Thanks for the video! Very interesting. Can I download your sketch from somewhere?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
That one should be on my Facebook page: facebook.com/ScienceFun4u/
@33samogo
@33samogo 2 жыл бұрын
The PWM controllers generate acoustic noises if the PWM frequency is within the acoustic spectrum (20Hz to 20KHz), that is why 25khz fan is more quiet
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
That makes sense.
@user-wh8cy2ru5v
@user-wh8cy2ru5v Жыл бұрын
if I want to maintain the RPM for 1200, how can I change the code?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
If speed < 1200, increase PWM. If speed >1200, decrease PWM.
@sebastientrepka1771
@sebastientrepka1771 Жыл бұрын
// I tried that with mega 2560 and the bequiet Silent Wings 3 fan does not move , could you help me ? thanks #define pinVentilateur 9 // La broche qui contrôle le ventilateur void setup() { pinMode(pinVentilateur, OUTPUT); // Définit la broche du ventilateur en mode sortie TCCR1B = TCCR1B & 0b11111000 | 0x02; // Configure le Timer 1 pour un PWM à 25kHz } void loop() { for (int i = 0; i
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
I haven't ever used a Mega. Not sure why it wouldn't work...
@ricksflicks-
@ricksflicks- 3 жыл бұрын
Thanks for the info! Really wish I could grab this code somewhere....
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
I have the code in the comments on my Facebook page @ScienceFun4u. Thanks for watching!
@ricksflicks-
@ricksflicks- 3 жыл бұрын
@@ScienceFunInnovations Thanks for the response! I just typed it out from looking at the video which was good practice. But that's great to know.
@pointofinterest5981
@pointofinterest5981 3 жыл бұрын
Sir Can You Pls help Me?? I just want to run the fan at the highest speed using an arduino Waiting for your Reply
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
This video may help as well. kzbin.info/www/bejne/i3uuY318bdyCq5o For highest speed you can just use a digitalOut on a 4 wire fan. For a 2 or 3 wire fan, you would need a MOSFET, transistor, or relay as disguised in the other video. Good luck!
@vionom2627
@vionom2627 3 жыл бұрын
How can I remove the timer? Because I want the fan to run at a constant speed
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
For full speed, you can use a digitalWrite command or give any PWM signal for a constant speed.
@vionom2627
@vionom2627 3 жыл бұрын
@@ScienceFunInnovations Thanks for your answer. Can I control the speed of two fans at the same time with a single Arduino?
@user-wh8cy2ru5v
@user-wh8cy2ru5v Жыл бұрын
and can I also use low speed fan code for high speed fan?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Yes. The speed of fan should not matter.
@DexBerry
@DexBerry 3 жыл бұрын
can you change the code to control the fan with potentiometer?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Yes. Just use the map function to convert the 0 to 1023 input into a 0 to 255 output.
@mtraven23
@mtraven23 2 жыл бұрын
i mean great, it works, but the whole point of using interrupts, is to not block out huge sections of time waiting to readings. oh and "count" should be a "volatile int" since you modify it inside an interrupt function.
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
Thanks for the tips.
@douglasflores70
@douglasflores70 2 жыл бұрын
Thanks for the content! can i control 5x FAN 12v 5A 47w 5000 maximum rpm(ea) (DELTA FAN (SERVER)) (i wanna use in maximum 3000rpm) with this solution? One more time, thanks for sharing!
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
It really depends on the fan. If they are 4 wire, probably yes. But if they are 2 or 3 wire you may need to use MOSFETS.
@memo667788
@memo667788 2 жыл бұрын
thank you very much for this tutorial can i get the link to the codes
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
I don't have that exact code posted, some of my other files are here. sciencefuninnovation.gumroad.com/
@giostechnologygiovannyv.ri489
@giostechnologygiovannyv.ri489 2 жыл бұрын
Ah it was you XD haha, ok I left you a question on the other video :D thanks!
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
No worries! Did all your questions get answered?
@MrDhilishkumar
@MrDhilishkumar Жыл бұрын
Can you make Arduino code for specific frequency
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Yes. Based on clock commands, but I am not that good writing in C...
@bwigmytch
@bwigmytch 3 жыл бұрын
niice
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Thanks!
@bwigmytch
@bwigmytch 3 жыл бұрын
@@ScienceFunInnovations I made this, but i have a question regarding the 4 pin, It's detailed here in this tweet twitter.com/BwigMytch/status/1346411533824364545?s=19 Thanks
@josephchamness9915
@josephchamness9915 3 жыл бұрын
Link to the first video would be nice :P
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Here it is kzbin.info/www/bejne/i3uuY318bdyCq5o
@dvdganon0812
@dvdganon0812 10 ай бұрын
were are the source files please ?
@ScienceFunInnovations
@ScienceFunInnovations 10 ай бұрын
facebook.com/ScienceFun4u/
@mtzmechengr5781
@mtzmechengr5781 Жыл бұрын
Is this Arduino code available?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
Not sure if I posted it here or not sciencefuninnovation.gumroad.com/?recommended_by=search
@gabribotha2403
@gabribotha2403 2 жыл бұрын
This video gives me dejavu
@ScienceFunInnovations
@ScienceFunInnovations 2 жыл бұрын
?
@thespencerowen
@thespencerowen Жыл бұрын
Is this code available?
@ScienceFunInnovations
@ScienceFunInnovations Жыл бұрын
That one should be on my Facebook page: facebook.com/ScienceFun4u/
@tommasoclini9902
@tommasoclini9902 3 жыл бұрын
can you leave the code you used here?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
It should be on my Facebook page @sciencefun4u
@tommasoclini9902
@tommasoclini9902 3 жыл бұрын
@@ScienceFunInnovations Thank you so much
@markgreco1962
@markgreco1962 3 жыл бұрын
Will you share the code?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
I just added it to my Facebook page @ScienceFun4u . Thanks!
@markgreco1962
@markgreco1962 3 жыл бұрын
@@ScienceFunInnovations thanks
@Slap_it_in
@Slap_it_in 5 ай бұрын
no copy and paste???
@ScienceFunInnovations
@ScienceFunInnovations 3 ай бұрын
facebook.com/ScienceFun4u/
@martenkl-71
@martenkl-71 5 ай бұрын
Something is not right when 0% gives 780 RPM. My guess is that the fan you are testing with does not follow PC-fan spec. 0% means no rotation, 0 rpm.
@ScienceFunInnovations
@ScienceFunInnovations 5 ай бұрын
Some fans have minimum speeds so that the motors do not overheat.
@nrwgamer9971
@nrwgamer9971 3 жыл бұрын
Please data code Skript
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
The code is posted on my Facebook page @ScienceFun4u. Thanks for watching!
@felipe.verasay
@felipe.verasay 3 жыл бұрын
Where is the code?
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
I have the code in the comments on my Facebook page @ScienceFun4u. Thanks for watching!
@felipe.verasay
@felipe.verasay 3 жыл бұрын
@@ScienceFunInnovations the link is your facebook page, not the proyect code, please upload the code
@manishsingh6524
@manishsingh6524 3 жыл бұрын
give me code
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
I may have posted it on my Facebook page @sciencefun4u
@CollinBaillie
@CollinBaillie 3 жыл бұрын
Since PWM controls 'on' and 'off' duration, I don't see how it matters if you use the low speed or the high speed PWM. Unless you are changing that duty cycle very quickly, on is on and off is off, it won't make a difference. I think the difference is how quickly you wish to change that duty cycle... 500 times a second or 25,000 times a second? Seems like overkill. I guess it does allow you finer control of the duty cycle... so 4000 steps vs 500 steps? Also seems like overkill.
@ScienceFunInnovations
@ScienceFunInnovations 3 жыл бұрын
Good question... Not sure why some fans require the high frequency, but if you Google "cpu fan pwm frequency" you will find that many fans do require 25kHz to operate properly. My fan seems to work either way, so I'm going to stick with the low frequency PWM. Another advantage to high frequency PWM is that it is out of the audible range. With many motors, you can hear the low frequency buzzing sound caused by the PWM signal. I've had stepper motors singing like a tweeter without even spinning the motor. The high frequency PWM makes it as quiet as a mouse to a human, but might annoy the dog instead. :-)
@EvoPortal
@EvoPortal 2 ай бұрын
Just use a 555 timer. Why bother with all this unreliable nonsense???
@ScienceFunInnovations
@ScienceFunInnovations Ай бұрын
Because a 555 timer does not have a brain. Let's see you vary the speed of a fan based on temperature using a 555. :-)
@EvoPortal
@EvoPortal Ай бұрын
@@ScienceFunInnovations Are you kidding me? That is SO simple to do with a 555 timer. You obviously know nothing about the 555.
LFC#191 - 3pin DC Fans vs 4pin PWM Fans
18:13
Adamant IT
Рет қаралды 109 М.
Arduino Basics Change your PWM Frequency
7:35
learnelectronics
Рет қаралды 87 М.
(#0033) 4-Wire Computer Fan Tutorial
6:25
High Voltage Hot Dog
Рет қаралды 338 М.
Hacking a PWM PC fan with Arduino
9:12
aka: Matchstic
Рет қаралды 17 М.
How PWM works | Controlling a DC motor with a homemade circuit
10:01
Cheap Temperature PWM Fan Controllers from Aliexpress
17:43
ESPHome Fan v3: Variable Speed (PWM) and Temperature Control
9:57
Speak to the Geek
Рет қаралды 15 М.
2 vs 3 vs 4 Pin Computer Fans Explained (and Which Should You Buy?)
11:33
Creating a quiet and efficient room fan with an Arduino
6:50
Adrian's Digital Basement
Рет қаралды 60 М.
Choose a phone for your mom
0:20
ChooseGift
Рет қаралды 7 МЛН
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 415 М.
Самые крутые школьные гаджеты
0:49
iPhone socket cleaning #Fixit
0:30
Tamar DB (mt)
Рет қаралды 15 МЛН
Какой ноутбук взять для учёбы? #msi #rtx4090 #laptop #юмор #игровой #apple #shorts
0:18
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 6 МЛН