Controlling fan speed with mosfet and Arduino

Поділитися
Вставка
  • Опубліковано 10 гру 2024

КОМЕНТАРІ • 294

  • @jamestrujillo5195
    @jamestrujillo5195 5 років тому +18

    Out of millions of UA-cam videos that ive seen, this is the only UA-cam 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.

  • @gregoryskoczek5357
    @gregoryskoczek5357 6 років тому +3

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

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

  • @ultrarageman2956
    @ultrarageman2956 5 років тому +32

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

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

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

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

  • @ronremondini7045
    @ronremondini7045 7 років тому +6

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

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

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

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

  • @yura979
    @yura979 4 роки тому +1

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

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

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

  • @rgmtb
    @rgmtb 4 роки тому +11

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

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

  • @MANGIACARRUBE
    @MANGIACARRUBE 6 років тому +3

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

  • @fishraviolli4373
    @fishraviolli4373 5 років тому +4

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

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

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

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

  • @Clavertus
    @Clavertus 4 роки тому +3

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

  • @adeshkumar5534
    @adeshkumar5534 4 роки тому +1

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

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

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

  • @kratostube1
    @kratostube1 4 роки тому

    Uiiiiiuuuiiiiiuuuuiiiiiuuuu! Explains better than any other video

  • @j2abramscav945
    @j2abramscav945 6 років тому +1

    Thank you so damn much this was so helpful this is actually the first time I have ever posted a comment on youtube, actually anywhere a lot of information came out of this simple video

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

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

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

  • @redlord5504
    @redlord5504 7 років тому +3

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

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

  • @CarolinaCowboys
    @CarolinaCowboys 4 роки тому +1

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

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

  • @fernandomiranda8125
    @fernandomiranda8125 4 роки тому

    You are very good at teaching my friend. Keep going. Thanks for sharing 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?

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

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

  • @shibuma1064
    @shibuma1064 4 роки тому

    Should I use data pin instead of pwm signal.

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

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

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

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

  • @lezzetlideneyimler2746
    @lezzetlideneyimler2746 5 років тому

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

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

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

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

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

  • @aurelioimprota482
    @aurelioimprota482 9 місяців тому

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

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

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

  • @ahmedalotaibi4477
    @ahmedalotaibi4477 7 років тому

    The best explanation yet thanks

    • @nenioc187
      @nenioc187  7 років тому

      Thanks. The reason for this video was, that I trouble understanding the use of a mosfet. So I acquired everything I need to know and tried to make the video as clearly as possible.

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

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

  • @al-oh8fq
    @al-oh8fq 7 років тому

    1:05 you know people do this to girls sometimes. it's called a word that originated from german language.

    • @nenioc187
      @nenioc187  7 років тому

      Haha. Yes, sometimes you'll do that to women. But now I'm curious - which german word are you referring to?

  • @justinfielding
    @justinfielding 6 років тому

    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?

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

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

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

  • @K34nuT
    @K34nuT 6 років тому +2

    Super easy to understand, thank you. Subscribed!

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

    is it pwm controller or voltage reducing?

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

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

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

  • @wegro585
    @wegro585 4 роки тому

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

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

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

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

  • @shefinmuhammed5289
    @shefinmuhammed5289 6 років тому +1

    The example was quite good.thank you

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

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

  • @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  6 років тому

      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 6 років тому

      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  6 років тому

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

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

  • @sbm168
    @sbm168 6 років тому

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

  • @jeanchrinot
    @jeanchrinot 7 років тому

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

  • @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 років тому

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

  • @skytecrobotics422
    @skytecrobotics422 6 років тому

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

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

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

  • @vladhristov2316
    @vladhristov2316 6 років тому

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

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

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

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

  • @josemichaelsanjuan4424
    @josemichaelsanjuan4424 7 років тому

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

  • @rapunzeleh546
    @rapunzeleh546 4 роки тому

    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.

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

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

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

    thx, good explanation of the mosfet.

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

  • @이수빈-l9e
    @이수빈-l9e Рік тому

    is 300 and 1000 speed of RPM?

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

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

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

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

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

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

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

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

    • @OurFavourite
      @OurFavourite 7 років тому

      nenioc187 thanks for the information

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

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

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

  • @martinwilligenburg3157
    @martinwilligenburg3157 4 роки тому

    compliments for the clear explanation!!!! thanks!!!!

  • @oneiricj4877
    @oneiricj4877 6 років тому +1

    this is really easy to understand. Thank you!

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

    Very Helpful thank you so much!