Controlling fan speed with mosfet and Arduino

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии • 294

  • @jamestrujillo5195
    @jamestrujillo5195 5 лет назад +18

    Out of millions of RUclips videos that ive seen, this is the only RUclips video where it explains what a transistor really is with great explanation

  • @RexxSchneider
    @RexxSchneider 2 года назад +17

    At 5:26 you mistakenly state that "the MOSFET doesn't need 12V for the gate; it only needs 0.7V". You've unfortunately confused the MOSFET with a bipolar junction transistor (BJT). The BJT does indeed need only 0.7V at its base (but requires several mA of current), but the IRF530 needs between 2V and 4V on its gate to begin to conduct, and rather more than that to turn it on fully (although it needs almost no current into the gate). Some samples of IRF530 may not even turn on properly with the output of the Arduino, and you are much better off using an IRL530. The 'L' indicates a logic-level MOSFET which will turn on fully when supplied with 5V. A lot of logic circuits use 5V as their high level, and the Arduino is one of them.
    It's worth also noting that you should add a series resistor of about 270R between the Arduino output pin and the gate of the MOSFET to limit the transient current into the MOSFET's gate capacitance as the Arduino switches its output from low to high. That value will ensure that any momentary current drawn is no more than 20mA, which is the maximum allowed from the I/O pin.
    Finally, the fan is an inductive load and should be bypassed by a reversed diode (e.g. a 1N4001), which is needed to absorb the transient spike that is generated when current is abruptly cut off from an inductor. This will prevent the possibility of damage to the MOSFET and reduce the radio-frequency interference generated by the switching.

    • @lordplenty
      @lordplenty 2 месяца назад

      Quite s simplification and conflation, EBC / SGD, PNP vs NPN etc.

  • @billb8744
    @billb8744 5 лет назад +13

    Brilliant!!! Einstein once said if you can't explain something simply then you don't understand it. Well sir, you definitely understand it and I appreciate you sharing your knowledge as well as your delightful ''style''. It's fun to learn with a smile.
    Thank you.

  • @ultrarageman2956
    @ultrarageman2956 5 лет назад +32

    When this dude explains it better than teacher in school👏👏

  • @gregoryskoczek5357
    @gregoryskoczek5357 6 лет назад +3

    Your sense of humor is great. Continue making more movies please!

  • @iskramalinovski7605
    @iskramalinovski7605 4 года назад

    What is that resistor that you've placed on the breadboard, when you've hooked up the Arduino? And why is it there? You don't mention anything about it in the video, nor within the project page that you've linked.

    • @nenioc187
      @nenioc187  4 года назад +1

      It should unsure that the Gate is pulled to LOW. Without the Arduino the Gate would stay open. But if you connect it to the Arduino and pull the pin to LOW, you don't have to use the resistor.

  • @adeshkumar5534
    @adeshkumar5534 4 года назад +1

    plz make a video which uses potentiometer to set duty cycle of the pwm signal

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

    I have been trying to figure this out all day. This is the clearest most complete answer I have been able to find.

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

    Thx, could you please explain how to use third wire(yellow =hall sensor out put ) for feedback control

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

    First you have a resistor above the mosfet? then it has dissepear? did you not need it anymore?

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

    Silly question. Can i use this to PWM a DC fan then? Why can't any DC fan run PWM mode from a motherboard of fan controller then? They sell PWM fans and DC fans as separate models. Sorry, I'm quite new to this.

  • @GoodMods
    @GoodMods 4 года назад

    Excuse me, I'm a beginner, what resistor is that when you connected the gate to the arduino, how is it connected and why is it there?

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

    "You don't know how it works? Well, I didn''t know it either so I had to look it up" this is the type of tutorial I like

  • @shibuma1064
    @shibuma1064 4 года назад

    Should I use data pin instead of pwm signal.

  • @josephkreifelsii6596
    @josephkreifelsii6596 7 лет назад +2

    I am having a hard time seeing where you placed the resistor. Can you give a more detailed diagram also with the resistor specs?

    • @nenioc187
      @nenioc187  7 лет назад +2

      There is a corresponding project page to this video. rohling-de.blogspot.de/2017/10/controlling-fan-speed-with-your-arduino.html
      The resistor is a pull-down resistor for the PWM port of the Arduino. Although it is not really necessary because the Arduino should be capable to pull the pin internally to GND.

  • @lethaldriver
    @lethaldriver 4 года назад

    for the analogWrite, he used the values 300 and 1000.
    How come in the Arduino website, it says that the values should range only from 0 to 255?
    It still worked though.....???
    for analogRead, he can get between 0 and 1023.

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

    Can you use a bipolar juntion transistor instead of the mosfet? For example the PN2222 bjt to control a 12V pc fan

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

      It depends on how much current the fan takes. You need current to drive the base of the 2N2222 and the Arduino can only supply 20mA maximum, which limits the available collector current to about 200mA for driving the fan. MOSFETs are much better for this particular job as they draw almost no current into their gate.

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

    I think 0.7v is for most bipolar junction transistors, for irf530 gate threshold minimum is 2v.

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

    spettacolare, volevo chiedere, si può controllare una ventola a 24v con lo stesso sistema???

  • @afm4807
    @afm4807 5 лет назад

    There was no talk of the 10h resistor of the gate connected to the source. But it was one of the best videos I saw because it helped me in the resistor. Loved your video. Thank you very much.

    • @nenioc187
      @nenioc187  5 лет назад +1

      The resistor was original for the purpose to automatically closing the gate. With an Arduino connected it becomes obsolete. But I forgot to remove it ;-)

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

      @@nenioc187 It's not a bad idea to leave it in place as it provides a fail-safe if the connection from the Arduino to the gate is accidentally disconnected.

  • @ronremondini7045
    @ronremondini7045 7 лет назад +6

    Great job! you did a wonderful job explaining and demonstrating the use of a MOSFET and PWM.

  • @shvideo1
    @shvideo1 4 года назад

    You seem to have a 3 wire fan. Isn’t the 3rd wire for speed control with a PWM? Or is it feedback?

    • @nenioc187
      @nenioc187  4 года назад

      Not sure. I needed a fan for demonstration and that one was the only one laying around.

  • @jumbo999614
    @jumbo999614 5 лет назад

    In my country i can only find IRF540N. Can i do the same as this video?
    Anyway 3rd wire (yellow) of the fan is not important right?

    • @nenioc187
      @nenioc187  5 лет назад +1

      That depends on your needs. Check the datasheet. The IRF540N can handle a max. 100V @ 33A.

  • @pqcamh228
    @pqcamh228 5 лет назад +1

    for someone that is trying to use it with 3.3v operating board(like esp32),this will not work cause irf530m need at least 4v to drive the gate,use other with lower max VGS(th) instead like irl3713 ,this one needs 2.5v

  • @S0K0N0MI
    @S0K0N0MI 4 года назад

    I'm getting a lot of whine from the fan when its not going full speed, is there a way to silence that?

  • @fixitmakeit72
    @fixitmakeit72 5 лет назад

    I have a 12v 0.18a 3wire blower dc blower fan, I want to slow the speed down for long periods but need the full speed for initial start up for a couple of minutes. Can you advise me on which type of small speed controller I should buy for the well being of my blower. Have seen vids on transistor/ potentiometer methods but would rather buy the right tool for the right job so to speak. Thankyou. Great video.

  • @heemlo649
    @heemlo649 6 лет назад +2

    How are you using 300 and 1000 in analog write? I thought it had to be 0 to 255?

    • @KjartanAndersen
      @KjartanAndersen 6 лет назад +1

      @@theaurumtheory If you watched the video you would clearly see that he used analogWrite(Gate, 300) and analogWrite(Gate, 1000). My guess is that Arduino ignores the bits it cant use and reads them as 44 and 232 (300 mod 256 and 1000 mod 256 respectively).

    • @li-on1
      @li-on1 5 лет назад +1

      @@theaurumtheory Still think Kjartan is right.
      Have a look at the definition of Arduinos "analogWrite" function: www.arduino.cc/en/Tutorial/PWM
      Quotation: "A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) requests a 100% duty cycle (always on) [...]"
      Also, having a look at the source code reveals that for values (other than 0 or 255), a function named "sbi" is called which is defined as:
      "#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))"
      Soo now I was wondering bc. just using bitwise OR operations would not stop the actual "number" from being more than one byte.
      Then I found this interesting blog post: www.txplore.com/blog/16248/10-min-pwm-overflow
      Long story short, he tells that the Atmega used by the Arduino Uno has an 8 bit register for PWM.
      Using 8 bits (1 byte) the maximum number possible in decimal is 255 (= binary: 11111111) and more bits will just "overflow" and wont be used.
      In this video, he uses 1000 which is 1111101000.
      Taking the first 8 bits only, we get 11101000 which is equal to using the value 232.

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

    is it pwm controller or voltage reducing?

  • @huythinhnguyen3873
    @huythinhnguyen3873 4 года назад

    can we control the direction of the motor? I'm trying with your circuit but unable to control direction

    • @nenioc187
      @nenioc187  4 года назад

      What you are looking for, is called a H-Bridge.
      ruclips.net/video/97fj8j3fvfo/видео.html

    • @huythinhnguyen3873
      @huythinhnguyen3873 4 года назад

      @@nenioc187 I am trying to apply PID to control my DC motor, so we have to use H-bridge instead of just a single mosfet right?

  • @wegro585
    @wegro585 4 года назад

    how about 12v button with led ? connected to pc ?

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

    you didn't tell about resistor on board ? can you explain it please why use resistor ?

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

      It's a pull-down resistor. It was for the manual testing with the battery. Because the drain wouldn't close itself once opened. If you hook the MosFet to the Arduino, you won't need that resistor anymore.

  • @lezzetlideneyimler2746
    @lezzetlideneyimler2746 5 лет назад

    What happen if we send signal by using yellow signal wire direcly to the fan from the arduino without using mosfet.

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

    if am use use 2 temperature sensor and 5 pc fan for cooling purpose
    is it possible to run at separate and whole fan at same time..?
    am lot of double actually is possible if not
    how did i done this project..?

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

      Of course you can control multiple fans separately. You'll need a separate PWM pin and a mosfet for each fan.

  • @rapunzeleh546
    @rapunzeleh546 5 лет назад

    perhaps you can tell me because i can't seem to figure it out and can't find anything or google, and nobody has answered the question. if you used a 5v fan, how would you wire it?

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

      Exactly the same, except you'd need a 5V supply for the positive wire of the fan.

  • @hidayahawalludin8855
    @hidayahawalludin8855 7 лет назад

    Understand clearly. Thanks.
    One question, in order to put temperature sensor (LM35DZ), just install its VCC to the 12V, GND to Ground and the Output to Arduino ANALOG IN.
    Is it correct?

    • @nenioc187
      @nenioc187  7 лет назад +1

      I've read the datasheet of the LM35. It's operating range is from 4-20V. So you can even connect it's VCC to the VCC of the Arduino. GND to GND of the Arduino - of course. And the Output to an analog input of an Arduino, that's correct.
      But without a library for it, you won't get Celcius or Fahrenheit, but Voltage. You have to calculate the temperature for yourself.
      I've made 3 Vids about temperature sensors. Maybe there is one you would prefer to use ;-)

    • @hidayahawalludin8855
      @hidayahawalludin8855 7 лет назад +1

      Thank you so much for the reply. Much appreciated. Will watch the videos later. Thanks.

  • @FOATE
    @FOATE 5 лет назад

    I've seen some transistors have source, gate and drain and others have collector, base and emitter, is there a difference?

    • @nenioc187
      @nenioc187  5 лет назад

      Usually you're using collector, base and emitter when referring to transistors and source, gate, drain when you're talking about MOS-FETs

  • @brettpillemer2141
    @brettpillemer2141 5 лет назад +1

    great tutorial but I think its a bit confusing as you used a 3 wired fan and I thought the yellow wire was for the PWM. I read more and see that the 3rd wire just reads the frequency of the fan. I also was wondering if the mosfet would overheat but I think in this example no as you not using too many W - But very nice tutorial

  • @jeanchrinot
    @jeanchrinot 7 лет назад

    Is the DC power supply necessary? Why? Could we use just the Vcc of Uno instead?

  • @brettgralinski5824
    @brettgralinski5824 7 лет назад

    can you tell me please what transistor is needed and if it can be used with a 4 pin pwm 12 fan? What is the amps about in a transistor? I notiice mosfet transistors with wide range of amperage and the same volts. Thanks

    • @nenioc187
      @nenioc187  7 лет назад

      4 pin fans work a little different. I'll put this topic on my video-bucket list. The amps on the transistor indicates the maximum current that the transistor can handle before blowing up ;-)

    • @brettgralinski5824
      @brettgralinski5824 7 лет назад +1

      thanks man

  • @SimmonS2679
    @SimmonS2679 7 лет назад

    Could I get the same result if I used the 12V power supply of the UNO (Vin) and connected it to the + terminal of the fan and GND to the source of the transistor?

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

      Yes, assuming that the 12V supply you're using to power the UNO has enough current capacity to also power the fan.

  • @moon-of-uk
    @moon-of-uk 6 лет назад

    or we have to attach another Arduino with it to perform another function?

  • @martinsabo1933
    @martinsabo1933 6 лет назад

    Hi, great manual, but wont works with 3,3A fan. Need for start about 5,4V and controlling between 5,4V and 8-9V. Any idea? (using IRF540N mosfet)

    • @nenioc187
      @nenioc187  6 лет назад

      Corresponding to the datasheet of the mosfet, it can handle up to 33A @ 10V. So it still would suitable for your needs. Don't know your fan, but if 9V is max, you can use 10V as a source input. From there it is easy. To achieve 5.4Volts you need a duty cycle of bout 54%. For 9V a duty cycle of 90%. That's easy as that ;-)

    • @martinsabo1933
      @martinsabo1933 6 лет назад

      Hi, my fan is VA450DC model V34809-90 (12V DC 3,3A). analogWrite(Gate, 255) gives me now 5,7-5,8V max. Source is PC power source.

    • @nenioc187
      @nenioc187  6 лет назад

      My guess: you've connected accidentally to the 5V output of the PC power. Or, you've really used a 12V output that can't handle 3.3 amps. So the voltage drops.

    • @martinsabo1933
      @martinsabo1933 6 лет назад

      Just tested - its from yellow (metered 11,8V from source). Tested fan straight from PC source - goes full. My schema is axweb3.info/jet/20180530-i41-91kb.png

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

      My guess is that the output from the Arduino isn't enough to turn on your sample of the IRF540, which is normally used with 10V to drive the gate. Use an IRL540 instead, which is specified for logic-level use and will perform properly with gate voltages of 5V.

  • @MANGIACARRUBE
    @MANGIACARRUBE 6 лет назад +3

    finally a good tutorial for 3 pin fans, thank you!

  • @mpampissougidis9880
    @mpampissougidis9880 6 лет назад

    Very good video! I dont understand the last thing you do. I understand that we use mosfet like a switch , so when we give +voltage to Gate the circuit is closed and when we connect Gate to Ground the circuit is open (and the fan stops). If we give analogWrite(Gate,300) and analogWrite (Gate, 1000) we give a voltage bigger than the Vthreshold to the Gate. In both ways we activate the circuit. But the Gate is like a switch so what exactly increases the fan speed?

    • @nenioc187
      @nenioc187  6 лет назад +1

      Since we are not using a analog pin, but a digital PWM pin, we don't change the voltage on the gate. It's always 5V. PWM turns the 5V on and off again, very fast. If we using analogWrite(Gate,300), means that 300/1024 of the time of a duty circle the 5 V is applied. The rest of the time, it is set to GND.
      It works like the part, where I connect and disconnect the 12V of the battery to to fan manually very fast ruclips.net/video/Pw1kSS_FIKk/видео.html .

    • @mpampissougidis9880
      @mpampissougidis9880 6 лет назад +1

      I understand , thank you very much.

    • @fantominsider2860
      @fantominsider2860 5 лет назад

      @@nenioc187 Just to elaborate the my question.. in other videos the the code is explained as analogWrite(Pin, DutyCycle).. so Pin is the digital pin no. to which the Mosfet gate is connected(here, pin no 10).. and the dutyCycle should be max 255.. but in the code, it is written as 300 which you said 300/1024 of the time... now my question is if i write 255 instead of 300.. will it count as 255/1024 of the time or the highest dutyCycle value for the gate..? and why.. It will be a great help if you pls explain. Thanks.

  • @namename7235
    @namename7235 6 лет назад

    Besides in programming, does the Arduino need to be plugged in for everything to function

    • @nenioc187
      @nenioc187  6 лет назад

      The Arduino needs to be plugged in for:
      - Programming
      - Output to the serial monitor on your PC
      - Or just for powering the µC (you could also power the Arduino differently)

  • @AlejandroCastiblanco171
    @AlejandroCastiblanco171 6 лет назад

    hello, I followed your tutorial, but the LED does not shine at 100%, and try the irfz44n, irf540n, irlz44n, irl540n and the tip120, but none makes the led shine 100%, but when connected directly to the 12v, it lights up a lot , I do not know what to do anymore, I'm thinking about giving up

    • @nenioc187
      @nenioc187  6 лет назад

      The MOSFETs have a internal resistance. So you got a voltage drop depending on the level of resistance. You can check the values in the datasheet of the MOSFETs. If you have a 12V LED and want to archive the full brightness you can either calculate the voltage drop and add the missing voltage on the supply side, or you can use a relay.
      And: Never. Give. Up.

    • @sabinchaulagain99
      @sabinchaulagain99 6 лет назад

      Alejandro Castiblanco for simple LEDs using a bjt would be better only high current application would be suitable for MOSFETs

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

      @@nenioc187 The IRL540 is specified to have a resistance (Rds_on) of 0.077 ohms maximum with 5V on the gate. You're going to be passing an awful lot of current to see a significant voltage drop in that case. If the LED isn't at 100%, then I would check the code used in the Arduino. Perhaps just set the digital pin HIGH as a test. I assume that everybody has figured out that the maximum duty cycle is obtained with a value of 255?

  • @skytecrobotics422
    @skytecrobotics422 6 лет назад

    And the motor drivers are too heavy...which mosfet would u recommend for a 3.7 v motor..
    Thanks for help..😊

  • @vladhristov2316
    @vladhristov2316 6 лет назад

    You have some resistor. What is the measure of it, and which pins is connected to do? Thx

  • @daniesubsiak8031
    @daniesubsiak8031 7 лет назад

    how to control the speed of an electric fan based on the temperature of the room using a 3 relay for speed? thanks for project purpose

  • @MoschosKoupoukis
    @MoschosKoupoukis 4 года назад

    Great video thank you so much! Only that I did exactly the same circuit and used the same Mosfet but the analogWrite(..) does not work. While digitalWrite works and turns on off the fan, when I try to use slower speed by using analogWrite the fan goes OFF completely :(
    My problem is that the fan is quite loud and i want it to operate at slower speed and that is perfect with analogWrite.... I used also the GATE 10. Any ideas?
    For the moment with this code is quite silent but i need analogwrite to work, don't know... will check it more....
    #define Gate 10
    void setup() {
    pinMode(Gate,OUTPUT);
    }
    void loop() {
    digitalWrite (Gate, HIGH);
    delay (200);
    digitalWrite (Gate, LOW);
    delay (1200);
    }

    • @nenioc187
      @nenioc187  4 года назад

      Have you tried using value range from 0-255?

  • @softa74
    @softa74 7 лет назад

    Hi, nice explanation. I'm on a project and I use the IRF540N over which I shoot 12v, but the problem is that when the gate is open at the exit of the drain at 11.45v and the transistor heats up when it drops the voltage on the gate. How do I get rid of it?

    • @nenioc187
      @nenioc187  7 лет назад

      You'll always get a voltage drop with a MOSFET. They have a inner resistance value. There are MOSFETs with lower resistance, but you won't get the exact same voltage you'll put in. That's also the reason the MOSFETs are heating up. You should use them with a heat sink.
      When the output voltage is essential, you should use a relay, if possible.

    • @softa74
      @softa74 7 лет назад

      Thanks for the reply, I will definitely put a cooler, I need to adjust the fan speed and adjust the voltage on the gate using the arduino PMW.

    • @nenioc187
      @nenioc187  7 лет назад

      Usually a fan doesn't mind if it's 12V or 11.45V. Alternatively you could provide a little more than 12V on source.

  • @justinfielding
    @justinfielding 7 лет назад

    Instead of a MOSFET I have an L298N H-Bridge module. When I try to control the speed of the fan with PWM I can seem to achieve some speed control, but the PWM causes a squealing noise. If I use a MOSFET instead will I avoid this problem or is the issue with the fan itself?

  • @CharmVibe24
    @CharmVibe24 6 лет назад

    hi nenioc187,
    Still need +12V battery supply? because i think the fan's positive terminal has to connect the +12V battery supply.
    Thank you for your video.

    • @nenioc187
      @nenioc187  6 лет назад

      Since the fan runs on 12 Volts, you'll probably need 12V to run it.. Unless you have a fan that runs on a different voltage

    • @CharmVibe24
      @CharmVibe24 6 лет назад

      I see. Nenioc. Thank you for your reply.

  • @benjaminnguyen5964
    @benjaminnguyen5964 7 лет назад

    Hi! I tried building the same circuit but using a usb power supply cable instead. Would this circuit work if I used a 9v USB power supple cable and 8 amp transistor instead of the 17 amp transistor u used? Thanks so much

    • @benjaminnguyen5964
      @benjaminnguyen5964 7 лет назад

      The fan I am using is a 12 v 4 wire fan

    • @nenioc187
      @nenioc187  7 лет назад

      The reason I used this MosFet is, because it was the only one I had ;-). Well I also have a 12V computer-fan, which I power with only 9V. It works. But it won't rotate fast.

    • @benjaminnguyen5964
      @benjaminnguyen5964 7 лет назад

      Thank you for the reply and . If I use a TIP102, should I be fine? I keep trying the circuit and it isn't working for me. When I touch the gate to the positive end of the power supply cable, nothing happens. Thanks!

    • @benjaminnguyen5964
      @benjaminnguyen5964 7 лет назад

      and the weird thing is when i connect the drain to the gate, the fan spins. Any suggestions? thanks

  • @fishraviolli4373
    @fishraviolli4373 5 лет назад +4

    Oh god, thank you. Spend 3 days on this trying different transistors and mosfets :P

  • @ISLAMguidanceful
    @ISLAMguidanceful 7 лет назад

    what about the pwm wire from fan (the yellow one), we dont need to use that?

    • @nenioc187
      @nenioc187  7 лет назад +1

      Not in this test. The fan speed is controlled by supplying the voltage and removing it again with help of the mosfet, that is controlled by the Arduino. If you're interested in controlling it through the yellow cable, I'll put it on my bucket list.

    • @ISLAMguidanceful
      @ISLAMguidanceful 7 лет назад

      Yes please do so, that would be very helpful, also i am using an NPN transistor with a 1n5408 diode across the motor, is that connection safe?

    • @nenioc187
      @nenioc187  7 лет назад

      Thanks for the hint, Joe! I think, I also have one of those 4-wire fans somewhere.

  • @josemichaelsanjuan4424
    @josemichaelsanjuan4424 7 лет назад

    Sir how do i insert the buttons to increase or decrease the speed of the fan???
    Tnx...

  • @yura979
    @yura979 4 года назад +1

    You have very unique and calm approach. I like it.

  • @emastino6152
    @emastino6152 5 лет назад

    Hey y’all
    Just started arduino and was curious as to how he input a value of 1000 in the analogWrite function. I thought this only took values from 0-255. Thank you!

    • @nenioc187
      @nenioc187  5 лет назад +1

      You're right. It's 0-255. A glitch in making this video.

  • @moon-of-uk
    @moon-of-uk 6 лет назад

    how many processes a single Arduino UNO board can do at a time?

    • @nenioc187
      @nenioc187  6 лет назад

      The Arduino Uno has six PWM pins. So six.

    • @moon-of-uk
      @moon-of-uk 6 лет назад

      nenioc187 at what capacity these 6 pins can be used?

    • @nenioc187
      @nenioc187  6 лет назад

      Each pin has a maximum output of 40 mA

    • @moon-of-uk
      @moon-of-uk 6 лет назад

      nenioc187 thanks so much for your response.

  • @rachmita.h
    @rachmita.h 7 лет назад

    please made video with clearly, i'm lil bit confused, such us the resistor, you use that? or not?

    • @nenioc187
      @nenioc187  7 лет назад

      No resistor in the video. No resistor used.

    • @Manndollina
      @Manndollina 7 лет назад +1

      Form 5:39 to 6:02 resistor next to the mostef

    • @nenioc187
      @nenioc187  7 лет назад

      Oops. My bad.
      Yes, there is a resistor between the gate and GND. Because if you open the gate by connecting it to positive, it will stay open ruclips.net/video/Pw1kSS_FIKk/видео.htmlm55s until you connect it to GND. The resistor between GND and Gate will automatically close the Gate if it is not connected to the positive.
      However, when the Arduino sends the LOW-value to a pin, it means that it is internally pulled to GND. So technically you don't need a resistor with an Arduino.
      I recommend to use a high value resistor anyway, because I noticed that some cheap Arduino clones don't always put out a good 0V- on LOW.

  • @nenadtosic6008
    @nenadtosic6008 4 года назад

    Why did u put resistor here and whch resistor u use?

    • @nenioc187
      @nenioc187  4 года назад

      It should insure that the Gate is pulled to LOW. Without the Arduino the Gate would stay open. But if you connect it to the Arduino and pull the pin to LOW, you don't have to use the resistor.

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

      A value of 10K will be fine. it's not critical.

  • @santonio7283
    @santonio7283 5 лет назад

    Nice video Nenioc187, thanks for that. How can we control multiple fans, say 5-6 of them? Shall we use 5-6 mosfets on the breadboard? Anything else to control them via a temperature sensor? Appreciate your help

    • @nenioc187
      @nenioc187  5 лет назад

      You could use one mosfet for all Fans, if they all should rotate in at the same speed. If you want to control them all differently, go for one mosfet/fan. And think about using a diode to prevent the fan inducting current to the controller.

    • @santonio7283
      @santonio7283 5 лет назад

      nenioc187 One mosfet and one diode will be enough to control 6*12V fans, right? What type mosfet and what type diode?

    • @nenioc187
      @nenioc187  5 лет назад

      Depends on the fans, you're using. Check the current consumption of the fans in total and search for a mosfet/diode, that can handle these values.

    • @santonio7283
      @santonio7283 5 лет назад

      @@nenioc187 My fans consuming 0.3*6=1.8Amps and my mosfet is IRFZ44. Where and how shall I connect the diode?

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

      @@santonio7283 The flyback diode is connected across the fans, but reverse biased, so that its anode is connected to the MOSFET drain and its cathode to the 12V supply.

  • @benjaminnguyen5964
    @benjaminnguyen5964 7 лет назад

    Can you do this with a npn bjt transistor? instead of a mosfet?

    • @nenioc187
      @nenioc187  7 лет назад

      If it matches the requirements of your fan - sure.

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

    Hello how are you? Could you send me the code if it's not too much trouble?

  • @rgmtb
    @rgmtb 4 года назад +11

    Great job on this! Well under 10mins and I learned exactly what I wanted. Thank you very much for this!

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

    Thank you. This is the most simple explanation i have watched

  • @SoulfulDirection
    @SoulfulDirection 7 лет назад

    Hi there, I want to make IR remote controlled regulator for my A.C. fan. Kindly give suggestion or links if you have.

    • @nenioc187
      @nenioc187  7 лет назад +1

      First of all: Be careful! Mains power is very dangerous!
      You can use this videos technique the same way. But instead of a MOSFET, you should use a solid state relay.

    • @SoulfulDirection
      @SoulfulDirection 7 лет назад +1

      nenioc187 thanks a lot..i will ensure the safety and try this out.

  • @TheSilkStudio
    @TheSilkStudio 7 лет назад

    can you please tell me the cost of the fan used in your experiment

    • @nenioc187
      @nenioc187  7 лет назад +1

      I savaged it from an old computer. So it didn't really cost me anything. If you search for "12v pc fan" on eBay, you'll get many hits from 1€ up to 20€. But that one for 1€ will do.

    • @TheSilkStudio
      @TheSilkStudio 7 лет назад

      nenioc187 thanks for the information

  • @P-7
    @P-7 3 года назад +1

    I thought analogwrite only went from 0-255, not to 1000

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

      That's correct! It's a mistake in the video. Sorry.

  • @이수빈-l9e
    @이수빈-l9e Год назад

    is 300 and 1000 speed of RPM?

  • @CarolinaCowboys
    @CarolinaCowboys 4 года назад +1

    Good video, thank you! I don't have a mosfet but was able to do it with an NPN transistor

  • @alchemy1
    @alchemy1 4 года назад

    I loved this guy in the first 45 seconds. Rare wonderful exceptional person. Thank you for who you are. Top number 1 subscription.

    • @nenioc187
      @nenioc187  4 года назад

      On ... Off... On... Off... OnOffOnOffOnOff

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

    Great Video. I made this exact circuit just as an experiment; however, my fans are turning very slow. Any suggestions - How could I draw more current into the fan? Or how could I decrease the overall resistance?

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

      First of all, you need to discover why the fans are turning slowly. Try disconnecting the gate of the MOSFET from the Arduino and connecting it to a higher voltage, but no more than 10V. If that solves the problem, then it shows that your IRF530 isn't turning on fully with just 5V. It's not guaranteed to do so, and you are always better using an IRL530 when driving it from a microcontroller. The 'L' signifies a logic-level MOSFET and the IRL530 is guaranteed to turn on with a maximum resistance of 0.16 ohms and supply up to 15A when it has 5V on its gate.

  • @RajarajanPanneerselvam
    @RajarajanPanneerselvam 4 года назад

    Wish I had a teacher like you. It's never late anyway. You are my teacher now 😀

    • @nenioc187
      @nenioc187  4 года назад +1

      It would be an honor!

  • @yogendraperdeshi9581
    @yogendraperdeshi9581 5 лет назад

    can we apply 220VAC across drain to source

    • @ctbully
      @ctbully 5 лет назад +1

      No, Mosfets are DC Devices and besides that the Voltage is WAY too HIGH. If you want to switch AC devices you need to use a TRIAC instead of a MOSFET Transistor. Google Triacs and Arduino

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

    Great video! Finally, I grasped this concept. Thank you!

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

    Hi great video. Can you control 3 fans at different speeds with one arduino? Cheers

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

      Yes. You need 3 PWM pins for the MosFets.

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

      @@nenioc187 thanks!

  • @SkorpionZA
    @SkorpionZA 7 лет назад

    Very nicely explained! -I might have something for your bucket list though :) -How would you control a device (a peltier for instance) that does not stand the PWM ripple well, while also introducing a lot of noise in sensitive devices around?.. -Is there a way to 'smooth' that ripple or simply use/create a continuous/proportional signal for control?..

    • @nenioc187
      @nenioc187  7 лет назад

      Usually you can use a capacitor to smooth the PWM signal a little. I haven't tried it yet to control a peltier element - although I've laying them around for quite a while.

    • @SkorpionZA
      @SkorpionZA 7 лет назад

      Yup, that could also work I guess... Thanx! -Since I see you've worked with several different temperature sensors, you might (also:)) want to try a peltier+fan based temperature control project; see how stable around the set point you can get ;) -Cheers!

    • @nenioc187
      @nenioc187  7 лет назад +1

      Using peltier and fan to create a controlled environment? Hmm... sounds interesting. That will go to my bucket list. Damn, my bucket list is becoming huge.

    • @SkorpionZA
      @SkorpionZA 7 лет назад

      :D

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

      @@nenioc187 If you use a capacitor on the MOSFET gate to smooth the PWM signal, then you must include a resistor between the I/O pin and the capacitor to prevent the initial charge current on switching from exceeding the rated 20mA for an Arduino pin. A minimum of 270R would be needed. However, once you've smoothed out the PWM signal, you're operating the MOSFET in its linear region, rather than switching it, so it will get hot and may need a heatsink. If you use a (much larger) capacitor across the load, you'll probably want to add some series resistance between the drain and load as well to limit current spikes as the MOSFET switches.

  • @i3dgearmarine908
    @i3dgearmarine908 6 лет назад

    A PWM (pulse width modulation) dimmer is not suitable for a fan motor speed controller. They are typically used for LED dimming, but it causes the squealing many people are hearing on their fans when trying this circuit. This fan motor in this video seems to be okay with it, but almost all fans will not like it and will squeal LOUDLY. It's also hard on the fan motor. The MOSFET circuit here in the video is okay for on/off control, although it really should have a flyback diode on it as well to protect the MOSFET from back inductance when the fan shuts down:
    en.wikipedia.org/wiki/Flyback_diode
    To properly control the speed you need to convert the PWM square wave signal to a DC voltage using an RC filter coupled to an op amp driving an LM317 voltage regulator. You can find this circuit on the internet in various places, like this:
    www.edn.com/design/analog/4363990/Control-an-LM317T-with-a-PWM-signal

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

      The problem with the LM741/LM317 circuit is that the output voltage range is limited to between around 1.25V to around 10V or perhaps less.
      You would be better off with a more modern opamp that can swing its output rail-to rail and a normal NPN medium power transistor like a BD135 or BD235 depending on how much current you need.

  • @voiceoftruth1O1
    @voiceoftruth1O1 6 лет назад +4

    I can't find code. Plz tell me the codes. Thanks

    • @nylen_1142
      @nylen_1142 4 года назад

      Do you talk about the transistor code or the code in the arduino, if it’s the transistor code, a link is in the description

  • @xXKeightbestXx
    @xXKeightbestXx 5 лет назад

    Haben Sie sich schonmal an einem "automatischen Gewächshaus" versucht?

    • @nenioc187
      @nenioc187  5 лет назад

      Schon mal darüber nachgedacht. Aber nie umgesetzt.

  • @SZMBudo
    @SZMBudo 7 лет назад

    is it possible to scale this up with multiple fans?

    • @nenioc187
      @nenioc187  7 лет назад

      +Jackson as long as you have free PWM pins available you can contol multiple fans at once

    • @SZMBudo
      @SZMBudo 7 лет назад

      sweet so 6 on an UNO? can you make each one independently react to separate sensors? for example 6 thermos impacting 6 fans?

    • @nenioc187
      @nenioc187  7 лет назад

      +Jackson Sure

  • @robertmarkham6558
    @robertmarkham6558 7 лет назад

    Could someone possibly right me a scriypt i'm wanting to use a arduino as a indicator relay on my old mans classic bike, so i would be using an arduino and 2 relays anyone able to help out? Thanks

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

    Thank God you explain so good , you are a life saver, a subscriber from now on

  • @MrJsp181
    @MrJsp181 7 лет назад

    Hello where do you bought this blueprint ?

    • @nenioc187
      @nenioc187  7 лет назад

      +NOUVELLE CHAÎNE ; TOBITHD Found it in eBay. They are available in green and blue

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

    Very nice and enjoyable presentation. I'm going to save this for teaching my grandchildren!

  • @mayus9552
    @mayus9552 7 лет назад

    Gutes Video. Kann man das nicht auch mit einem Relais machen?

    • @nenioc187
      @nenioc187  7 лет назад

      Thanks! Sure you can do this with relays. But you should go for the solid state relays. They are more reliable, faster and more quite ;-)

  • @adityaraj-mn8dt
    @adityaraj-mn8dt 7 лет назад +13

    Thank you so much, bro! You explained it so well, now I am able to control a motor with Arduino! All because of you. *brofists*

    • @nenioc187
      @nenioc187  7 лет назад

      +aditya raj My pleasure. I'm glad to help!

  • @redlord5504
    @redlord5504 7 лет назад +3

    Keep making videos your very good at it. This video helped me with my project

  • @kratostube1
    @kratostube1 4 года назад

    Uiiiiiuuuiiiiiuuuuiiiiiuuuu! Explains better than any other video

  • @joshuaneve9271
    @joshuaneve9271 4 года назад

    Hi nenioc187, great video, thank you! Could I ask, what is the maximum voltage for a fan or any output for that matter that could be controlled using this sort of transistor? Could I use a fan that is 220-240V (100mA) to reduce its RPM? And if not, why not? :) Many thanks!

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

      I assume that your fan is 220-240V AC, so this circuit is not suitable as it is intended for DC applications. Mixing mains voltage with microcontrollers is fraught with problems and usually requires the use of an opto-isolator and a triac to control AC mains devices along with many precautions in layout. That really isn't suitable for a beginner.
      For DC use, the IRL530 is rated at 100V and 15A (although not both at the same time), but again, high voltages are not suitable for beginners, and I'd strongly recommend investigating projects that require no more than 24V and a few amps while learning.

  • @ricard-oeis1199
    @ricard-oeis1199 3 года назад

    Hi neioc187, awesome work here. Ordered some IRF530N Mosfits and got it up and running just as you showed us. I have tried two different fans and both make a buzzing sound anything less then 1000. Is this a normal function of controlling the rpm with a Mosfit or is there a way to get rid of the buzz ?

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

      I would suggest getting some IRL530s next time as they are made for interfacing with logic-levels of 5V or less (unlike the IRF530, which is intended for use with 10V gate voltages). A capacitor and a reversed diode across the fan to suppress the transients might reduce the buzzing. If that fails, then maybe try putting a resistor in series with the fan to reduce the maximum voltage across it. It will lower the maximum fan speed but should make lower speeds smoother. You'll have to determine the resistor value by trial-and-error, but you could perhaps start with a 33R 0.5W resistor and see what happens.

  • @skytecrobotics422
    @skytecrobotics422 6 лет назад

    Can we control a micro motor with it

    • @nenioc187
      @nenioc187  6 лет назад

      The fan is a motor. So yeah. But for motor controlling I would rather recommend using a PWM enabled H-bridge.

  • @HomeAutomationTECH
    @HomeAutomationTECH 5 лет назад

    How to control ac fan speed with ir remote control system plse make a videos

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

    Great !
    I could relate the concept of the video to PWM chopper signal.

  • @sbm168
    @sbm168 6 лет назад

    Listening to this as a mech e i appreciate the pipe analogy. Thanks!

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

    i Love you so much i didnt understand the part of common ground in the third leg in other videos and you enlighted me

  • @fernandomiranda8125
    @fernandomiranda8125 4 года назад

    You are very good at teaching my friend. Keep going. Thanks for sharing this.

  • @nirmalparihar4368
    @nirmalparihar4368 6 лет назад

    This Can control our ceiling big fans?

    • @nenioc187
      @nenioc187  6 лет назад

      I don't know your ceiling fans. But I guess it'll be a little more complex.