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

Sdílet
Vložit
  • čas přidán 26. 07. 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
  • Věda a technologie

Komentáře • 198

  • @du_fox
    @du_fox Před 3 lety +2

    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 Před 2 lety +1

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

  • @interiorterrier
    @interiorterrier Před rokem +1

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

  • @podunkis
    @podunkis Před 3 lety +5

    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!

  • @livnenir
    @livnenir Před 3 lety +5

    Congratz for getting 1k subscribers:) keep it up

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety +1

      Thank you so much 😁

    • @franklinronan3158
      @franklinronan3158 Před 3 lety

      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 Před 3 lety

      @Franklin Ronan Yup, have been using InstaFlixxer for months myself =)

  • @Megalomon
    @Megalomon Před 3 lety +3

    Exactly the video I searched for. Thanks :D

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety

      Glad I could help!

    • @TheJavaSync
      @TheJavaSync Před 3 lety

      @@ScienceFunInnovations Me, too ... but no code available on the discription :'(

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety

      @@TheJavaSync It is on my Facebook page @sciencefun4u

    • @TheJavaSync
      @TheJavaSync Před 3 lety

      @@ScienceFunInnovations sure, I'll go for that :) Thank You

    • @TheJavaSync
      @TheJavaSync Před 3 lety

      @@ScienceFunInnovations so, if I use pwm directly to drive gate of the N mosfet (to drive another DC motor), it will work, right?

  • @martinadamczyk6628
    @martinadamczyk6628 Před 2 lety +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.

  • @ShmeegleSon
    @ShmeegleSon Před 9 měsíci

    Awesome and thank you so much, just subbed

  • @dmytro95
    @dmytro95 Před rokem

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

  • @Striderr10
    @Striderr10 Před 2 lety

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

  • @germang.4514
    @germang.4514 Před 3 lety

    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.

  • @aliens1192
    @aliens1192 Před 3 lety

    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  Před 3 lety

      Glad I could help!

    • @klausnielsen1537
      @klausnielsen1537 Před 3 lety +1

      Hi Hamidreza. I just saw this video by Gary Explains : czcams.com/video/QMYhVqjBhKQ/video.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.

  • @ggsggo
    @ggsggo Před 3 lety

    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  Před 3 lety

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

  • @MikeHammonds804
    @MikeHammonds804 Před 2 lety

    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  Před 2 lety

      It has been so long since I looked at that code, but I imagine that it would be very similar. Best wishes.

  • @ultra2050
    @ultra2050 Před rokem +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  Před rokem +1

      Wow. Been too long since I did that video to remember. But sounds like you know more about it than I do. :-)

  • @matthewhoward8996
    @matthewhoward8996 Před 3 lety +1

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

  • @kobladoures
    @kobladoures Před 3 lety +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  Před 3 lety +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!

  • @facundogloria1376
    @facundogloria1376 Před rokem

    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  Před rokem

      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 ?

  • @mrstanlez
    @mrstanlez Před 3 lety +2

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

  • @marcosbuydid
    @marcosbuydid Před 2 lety +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  Před 2 lety +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.

  • @cameronross3608
    @cameronross3608 Před 3 lety

    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  Před 3 lety +1

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

    • @ultra2050
      @ultra2050 Před rokem +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.

  • @JurekPrzezdziecki
    @JurekPrzezdziecki Před rokem

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

  • @fredydominguez9782
    @fredydominguez9782 Před 2 lety

    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  Před 2 lety

      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 Před 3 lety

    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  Před 3 lety

      Hmmm. Is it not giving you a reading? Or is it giving you a weird reading?

    • @house123ization
      @house123ization Před 3 lety

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

  • @greggyoung7419
    @greggyoung7419 Před 3 lety +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  Před 3 lety +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 Před 3 lety +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.

  • @user-ci1ne3sd2h
    @user-ci1ne3sd2h Před 3 lety

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

  • @davebutler3905
    @davebutler3905 Před rokem

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

  • @guillaumemasure2657
    @guillaumemasure2657 Před 7 měsíci

    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  Před 6 měsíci

      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!

  • @ricksflicks-
    @ricksflicks- Před 3 lety

    Thanks for the info! Really wish I could grab this code somewhere....

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety

      I have the code in the comments on my Facebook page @ScienceFun4u. Thanks for watching!

    • @ricksflicks-
      @ricksflicks- Před 3 lety

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

  • @bishoyiskandar1606
    @bishoyiskandar1606 Před 2 lety

    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

  • @probability300
    @probability300 Před rokem

    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!

  • @vasupodila1149
    @vasupodila1149 Před rokem

    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  Před rokem

      I believe those are C commands, not C++. I found another code that used them. I am not too familiar myself...

  • @gangger89
    @gangger89 Před 3 lety

    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  Před 3 lety +1

      The only way would be to use a relay, MOSFET, or transistor to completely shut off the power.

    • @gangger89
      @gangger89 Před 3 lety

      @@ScienceFunInnovations thx, tried it an works.

  • @WolferAlpha
    @WolferAlpha Před rokem

    Leaving as a suggestion... How would it be if you use the DBPF1238B8G cooler on the hovercraft?

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před rokem

      I'm not familiar with that part. I'll have to check it out.

    • @WolferAlpha
      @WolferAlpha Před rokem

      @@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 Před rokem

      and of course, my video is the only one on youtube about this fan

  • @martinmacko7297
    @martinmacko7297 Před 4 měsíci

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

  • @giostechnologygiovannyv.ri489

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

  • @slip0n0fall
    @slip0n0fall Před 3 lety +2

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

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety +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.

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

  • @paulpixzy5297
    @paulpixzy5297 Před 2 lety

    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

  • @33samogo
    @33samogo Před 2 lety +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

  • @pirespaulo6281
    @pirespaulo6281 Před rokem +1

    Nice video. Why when the PWM is equal to 0, the fan cooler does not stop (rpm = 0)?

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před rokem

      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 Před 5 měsíci

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

  • @bwigmytch
    @bwigmytch Před 3 lety +1

    niice

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety

      Thanks!

    • @bwigmytch
      @bwigmytch Před 3 lety

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

  • @bbrown_sc
    @bbrown_sc Před 3 lety +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  Před 3 lety

      Try a low pass RC (resistor capacitor) circuit. Set the frequency slightly higher than the max expected fan square wave frequency. czcams.com/video/OBM5T5_kgdI/video.html

    • @bbrown_sc
      @bbrown_sc Před 3 lety

      @@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 Před 3 lety

      That didn't work. I needed to add a schmitt trigger along with the low pass filter to gat an accurate RPM.

    • @fredydominguez9782
      @fredydominguez9782 Před 2 lety

      @@bbrown_sc how did that go? I’m having a similar issue.

  • @primozeteoaceret4153
    @primozeteoaceret4153 Před 2 lety

    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  Před 2 lety

      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.

  • @Trevor.Morrice
    @Trevor.Morrice Před 3 lety +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  Před 3 lety

      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 Před 3 lety

      @@ScienceFunInnovations Ive found that when i unplug the arduino from the 12v ground the PWM works! but then the RPM stops working.

    • @CollinBaillie
      @CollinBaillie Před 3 lety

      @@Trevor.Morrice are you using 3-wire or 4-wire fans?

  • @greggyoung7419
    @greggyoung7419 Před 3 lety

    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.

  • @douglasflores70
    @douglasflores70 Před 2 lety

    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  Před 2 lety

      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.

  • @discutiadinweekend6183

    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  Před 3 lety +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.

  • @memo667788
    @memo667788 Před 2 lety

    thank you very much for this tutorial
    can i get the link to the codes

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 2 lety

      I don't have that exact code posted, some of my other files are here. sciencefuninnovation.gumroad.com/

  • @Drinu1985
    @Drinu1985 Před 3 lety +1

    How would it be possible to control 4-wire CPU fans using a PWM Speed Controller without using an Arduino ?

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety

      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.

  • @datboi7722
    @datboi7722 Před rokem

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

  • @sehabshaikh
    @sehabshaikh Před 3 měsíci

    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  Před 3 měsíci

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

  • @mtraven23
    @mtraven23 Před 2 lety

    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.

  • @pointofinterest5981
    @pointofinterest5981 Před 3 lety +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  Před 3 lety +1

      This video may help as well. czcams.com/video/UJK2JF8wOu8/video.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!

  • @PHM_Tech
    @PHM_Tech Před rokem

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

  • @BrentRoberts01
    @BrentRoberts01 Před rokem

    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 Před rokem

      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  Před rokem

      Hmmm. Any luck figuring it out?

    • @EasternCarolinaSafetyUpfitting
      @EasternCarolinaSafetyUpfitting Před rokem

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

  • @gabribotha2403
    @gabribotha2403 Před 2 lety

    This video gives me dejavu

  • @eijikong1660
    @eijikong1660 Před rokem

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

  • @AmnesiaPhotography
    @AmnesiaPhotography Před 3 lety

    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  Před 3 lety +1

      The high frequency can do that. You may need a low pass filter and/or Schmidt trigger.

    • @AmnesiaPhotography
      @AmnesiaPhotography Před 3 lety

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

  • @rajduttninadpatil2810

    Sir how did you decide 360 pls can you tell me in detail

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před rokem

      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.

  • @josephchamness9915
    @josephchamness9915 Před 3 lety +1

    Link to the first video would be nice :P

  • @Dinesh-Bhardwaj
    @Dinesh-Bhardwaj Před rokem

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

  • @DexBerry
    @DexBerry Před 3 lety

    can you change the code to control the fan with potentiometer?

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety

      Yes. Just use the map function to convert the 0 to 1023 input into a 0 to 255 output.

  • @deanzhao278
    @deanzhao278 Před 3 lety

    How can I control the turning off of the fan? When PWM=0, the speed also maintains 1015RMP

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety

      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 Před 3 lety

      @@ScienceFunInnovations Oh, I get it, Thank you for your reply.

  • @user-wh8cy2ru5v
    @user-wh8cy2ru5v Před rokem

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

  • @vionom2627
    @vionom2627 Před 3 lety

    How can I remove the timer? Because I want the fan to run at a constant speed

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety

      For full speed, you can use a digitalWrite command or give any PWM signal for a constant speed.

    • @vionom2627
      @vionom2627 Před 3 lety

      @@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 Před rokem

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

  • @MrDhilishkumar
    @MrDhilishkumar Před rokem

    Can you make Arduino code for specific frequency

  • @markgreco1962
    @markgreco1962 Před 3 lety +1

    Will you share the code?

  • @sebastientrepka1771
    @sebastientrepka1771 Před rokem

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

  • @nrwgamer9971
    @nrwgamer9971 Před 3 lety

    Please data code Skript

  • @tommasoclini9902
    @tommasoclini9902 Před 3 lety

    can you leave the code you used here?

  • @mtzmechengr5781
    @mtzmechengr5781 Před rokem

    Is this Arduino code available?

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před rokem

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

  • @dvdganon0812
    @dvdganon0812 Před 10 měsíci

    were are the source files please ?

  • @thespencerowen
    @thespencerowen Před rokem

    Is this code available?

  • @Slap_it_in
    @Slap_it_in Před 5 měsíci

    no copy and paste???

  • @martenkl-71
    @martenkl-71 Před 5 měsíci

    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.

  • @CollinBaillie
    @CollinBaillie Před 3 lety +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  Před 3 lety +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. :-)

  • @felipe.verasay
    @felipe.verasay Před 3 lety

    Where is the code?

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 3 lety

      I have the code in the comments on my Facebook page @ScienceFun4u. Thanks for watching!

    • @felipe.verasay
      @felipe.verasay Před 3 lety

      @@ScienceFunInnovations the link is your facebook page, not the proyect code, please upload the code

  • @manishsingh6524
    @manishsingh6524 Před 3 lety

    give me code

  • @EvoPortal
    @EvoPortal Před 2 měsíci +1

    Just use a 555 timer. Why bother with all this unreliable nonsense???

    • @ScienceFunInnovations
      @ScienceFunInnovations  Před 2 měsíci

      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 Před 2 měsíci

      @@ScienceFunInnovations Are you kidding me? That is SO simple to do with a 555 timer. You obviously know nothing about the 555.