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

Поділитися
Вставка
  • Опубліковано 1 лип 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 👍

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

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

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

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

  • @dmytro95
    @dmytro95 Рік тому

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

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

  • @Striderr10
    @Striderr10 Рік тому

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

  • @ShmeegleSon
    @ShmeegleSon 8 місяців тому

    Awesome and thank you so much, just subbed

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

  • @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 : ua-cam.com/video/QMYhVqjBhKQ/v-deo.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.

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

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

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

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

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

  • @matthewhoward8996
    @matthewhoward8996 2 роки тому +1

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

  • @mrstanlez
    @mrstanlez 3 роки тому +2

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

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

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

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

  • @JurekPrzezdziecki
    @JurekPrzezdziecki Рік тому

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

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

  • @bishoyiskandar1606
    @bishoyiskandar1606 Рік тому

    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

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

  • @martinmacko7297
    @martinmacko7297 3 місяці тому

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

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

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

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

  • @guillaumemasure2657
    @guillaumemasure2657 6 місяців тому

    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  5 місяців тому

      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!

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

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

  • @davebutler3905
    @davebutler3905 Рік тому

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

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

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

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

  • @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 4 місяці тому

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

  • @sehabshaikh
    @sehabshaikh 2 місяці тому

    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.

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

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

  • @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. ua-cam.com/video/OBM5T5_kgdI/v-deo.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.

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

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

  • @datboi7722
    @datboi7722 Рік тому

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

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

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

  • @giostechnologygiovannyv.ri489
    @giostechnologygiovannyv.ri489 2 роки тому

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

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

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

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

  • @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. ua-cam.com/video/UJK2JF8wOu8/v-deo.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.

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

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

  • @Dinesh-Bhardwaj
    @Dinesh-Bhardwaj Рік тому

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

  • @josephchamness9915
    @josephchamness9915 3 роки тому +1

    Link to the first video would be nice :P

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

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

  • @gabribotha2403
    @gabribotha2403 2 роки тому

    This video gives me dejavu

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

  • @user-wh8cy2ru5v
    @user-wh8cy2ru5v Рік тому

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

  • @MrDhilishkumar
    @MrDhilishkumar Рік тому

    Can you make Arduino code for specific frequency

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

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

  • @thespencerowen
    @thespencerowen Рік тому

    Is this code available?

  • @mtzmechengr5781
    @mtzmechengr5781 Рік тому

    Is this Arduino code available?

    • @ScienceFunInnovations
      @ScienceFunInnovations  Рік тому

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

  • @martenkl-71
    @martenkl-71 4 місяці тому

    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.

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

  • @nrwgamer9971
    @nrwgamer9971 3 роки тому

    Please data code Skript

    • @ScienceFunInnovations
      @ScienceFunInnovations  3 роки тому

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

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

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

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