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

Поделиться
HTML-код
  • Опубликовано: 5 июл 2024
  • 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 года назад +1

    RAD! I was just looking for a good guide to arduino PWM fan control! I'm also excited to see the huverkraeft! :D

  • @solosailorsv8065
    @solosailorsv8065 2 года назад

    Congratulations for covering the topic in sufficient detail, without using the "scary" words of, "Timers" or "Registers" !!

  • @interiorterrier
    @interiorterrier Год назад

    Great work, this is the first sketch that works with my 25kHz fans 👍

  • @livnenir
    @livnenir 3 года назад +4

    Congratz for getting 1k subscribers:) keep it up

    • @ScienceFunInnovations
      @ScienceFunInnovations  3 года назад +1

      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 =)

  • @podunkis
    @podunkis 3 года назад +4

    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!

  • @Megalomon
    @Megalomon 3 года назад +2

    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?

  • @ShmeegleSon
    @ShmeegleSon 8 месяцев назад

    Awesome and thank you so much, just subbed

  • @martinadamczyk6628
    @martinadamczyk6628 2 года назад +1

    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.

  • @Striderr10
    @Striderr10 Год назад

    This video is very useful for me thank you sir!!!

  • @ultra2050
    @ultra2050 Год назад +1

    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  Год назад +1

      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 ?

  • @dmytro95
    @dmytro95 Год назад

    Very useful video, its so hard to find clear and understandable info about the fan controll, many are just copypasta other sources

  • @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.

  • @mrstanlez
    @mrstanlez 3 года назад +2

    Nice tutorial, Thank you. What about 4-wire(blue, green, black, yellow) CPU intel Fan DC12V 0.28A NIDEC ?

  • @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 года назад +1

      You can set it to different values. 320 just works well with the clock frequency.

    • @ultra2050
      @ultra2050 Год назад +2

      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.

  • @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.

  • @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

  • @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. :-)

  • @matthewhoward8996
    @matthewhoward8996 3 года назад +1

    Great Video!! For configuring Timer 2 to do the same, how do we do that?

  • @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...

  • @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.

  • @greggyoung7419
    @greggyoung7419 3 года назад +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

      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 года назад +1

      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.

  • @marcosbuydid
    @marcosbuydid 2 года назад +1

    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 года назад +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.

  • @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 года назад +1

      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.

  • @kobladoures
    @kobladoures 3 года назад +2

    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 года назад +1

      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!

  • @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 года назад +1

      Hi Hamidreza. I just saw this video by Gary Explains : ruclips.net/video/QMYhVqjBhKQ/видео.html 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.

  • @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

  • @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...

  • @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.

  • @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!

  • @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

  • @JurekPrzezdziecki
    @JurekPrzezdziecki Год назад

    Grat video! I understand, that blue and yellow wires are PWM - and PWM +?

  • @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 года назад +1

      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.

  • @bbrown_sc
    @bbrown_sc 3 года назад +2

    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. ruclips.net/video/OBM5T5_kgdI/видео.html

    • @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.

  • @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.

  • @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

  • @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

  • @Trevor.Morrice
    @Trevor.Morrice 3 года назад +1

    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?

  • @martinmacko7297
    @martinmacko7297 3 месяца назад

    Great help! Thx, any chance to tell me how to do it with ESP32 ? Thx!

  • @davebutler3905
    @davebutler3905 Год назад

    Thanks for the video!
    Very interesting.
    Can I download your sketch from somewhere?

  • @datboi7722
    @datboi7722 Год назад

    This circut works with a raspberry pi too right? I just wanna double check to make sure I don't break anything.

  • @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  2 месяца назад

      Have you seen my other fan videos? I think those would answer your questions. The fan would need its own power supply.

  • @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!

  • @pirespaulo6281
    @pirespaulo6281 Год назад +1

    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.

  • @slip0n0fall
    @slip0n0fall 3 года назад +2

    Often the higher speed PWM is to get it just outside of audible range (whine otherwise at lower freq's)

    • @ScienceFunInnovations
      @ScienceFunInnovations  3 года назад +2

      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.

  • @PHM_Tech
    @PHM_Tech Год назад

    How i can made ir on my 24V noctua fan?
    -24V Black
    +24V Yellow
    PWM Blue
    RPM Green

  • @eijikong1660
    @eijikong1660 Год назад

    is it safe to connect cpu fans to power supply or battery directly?

  • @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!

  • @Drinu1985
    @Drinu1985 3 года назад +1

    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.

  • @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 года назад +1

    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 года назад +1

      This video may help as well. ruclips.net/video/UJK2JF8wOu8/видео.html
      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!

  • @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.

  • @Dinesh-Bhardwaj
    @Dinesh-Bhardwaj Год назад

    Can i use 3,5 and 6 no. pin to control 3 pwm fans?

  • @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 года назад +1

      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.

  • @33samogo
    @33samogo 2 года назад +1

    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

  • @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.

  • @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/

  • @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.

  • @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.

  • @user-wh8cy2ru5v
    @user-wh8cy2ru5v Год назад

    and can I also use low speed fan code for high speed fan?

  • @bwigmytch
    @bwigmytch 3 года назад +1

    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

  • @giostechnologygiovannyv.ri489
    @giostechnologygiovannyv.ri489 2 года назад

    Ah it was you XD haha, ok I left you a question on the other video :D thanks!

  • @josephchamness9915
    @josephchamness9915 3 года назад +1

    Link to the first video would be nice :P

  • @user-wh8cy2ru5v
    @user-wh8cy2ru5v Год назад

    if I want to maintain the RPM for 1200, how can I change the code?

  • @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?

  • @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.

  • @gabribotha2403
    @gabribotha2403 2 года назад

    This video gives me dejavu

  • @MrDhilishkumar
    @MrDhilishkumar Год назад

    Can you make Arduino code for specific frequency

  • @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

  • @markgreco1962
    @markgreco1962 3 года назад +1

    Will you share the code?

  • @mtzmechengr5781
    @mtzmechengr5781 Год назад

    Is this Arduino code available?

    • @ScienceFunInnovations
      @ScienceFunInnovations  Год назад

      Not sure if I posted it here or not sciencefuninnovation.gumroad.com/?recommended_by=search

  • @thespencerowen
    @thespencerowen Год назад

    Is this code available?

  • @nrwgamer9971
    @nrwgamer9971 3 года назад

    Please data code Skript

    • @ScienceFunInnovations
      @ScienceFunInnovations  3 года назад

      The code is posted on my Facebook page @ScienceFun4u. Thanks for watching!

  • @dvdganon0812
    @dvdganon0812 9 месяцев назад

    were are the source files please ?

  • @tommasoclini9902
    @tommasoclini9902 3 года назад

    can you leave the code you used here?

  • @Slap_it_in
    @Slap_it_in 4 месяца назад

    no copy and paste???

  • @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.

  • @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

  • @CollinBaillie
    @CollinBaillie 3 года назад +1

    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 года назад +1

      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. :-)

  • @manishsingh6524
    @manishsingh6524 3 года назад

    give me code

  • @EvoPortal
    @EvoPortal Месяц назад +1

    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.