Control a DC Motor with Arduino (Lesson #16)

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 พ.ค. 2024
  • Science Buddies Electronics Kit for Arduino: www.homesciencetools.com/prod...
    Learn how to control a DC motor with an Arduino and a transistor and an external power supply. This approach only lets you spin the motor in one direction - check out the next video in our series to learn how to make the motor reverse directions with an H-bridge. See our complete playlist of Arduino tutorials here: • How to Use an Arduino and the Science Buddies website for cool science projects you can do with an Arduino: www.sciencebuddies.org/search...
    0:00 introduction
    0:32 revisiting LED code
    2:03 adding a motor to the circuit
    2:51 transistor (MOSFET)
    5:49 external batteries
    8:19 simulation
    9:10 controlling motor speed
    12:02 capacitor
    12:33 diode
    Science Buddies also hosts a library of instructions for over 1,500 other hands-on science projects, lesson plans, and fun activities for K-12 parents, students, and teachers! Visit us at www.sciencebuddies.org to learn more.
    #STEM #sciencebuddies #arduino #electronics #programming
    *******************************
    Connect with Science Buddies:
    TWITTER: / sciencebuddies
    FACEBOOK: / sciencebuddies
    INSTAGRAM: / scibuddy
    PINTEREST: / sciencebuddies

ความคิดเห็น • 106

  • @tedbastwock3810
    @tedbastwock3810 22 วันที่ผ่านมา

    TY very much for the capacitor and diode demo. Yes, this is more EE, but much needed for those trying to make real world circuits.

  • @EQencrypted
    @EQencrypted 6 หลายเดือนก่อน +6

    This is a phenomenal video. So clear, thank you 🙏

  • @BenParisi
    @BenParisi 8 หลายเดือนก่อน +3

    Super helpful, exactly the information I needed. Thanks

  • @VocesSinFronterass
    @VocesSinFronterass 11 หลายเดือนก่อน +2

    Thank you I was struggling about how to make my electric little car, unfortunately my arduino broke before I realized of this video, now I know how to do it

  • @godwinowusufrimpong2050
    @godwinowusufrimpong2050 ปีที่แล้ว +1

    I love your lessons is simple and powerful

  • @ingenierocivilizado728
    @ingenierocivilizado728 2 หลายเดือนก่อน +2

    The explanations are very clear and simple, which allows us to understand well what we are doing. Thank you very much for sharing these videos.

    • @wadebrewer7212
      @wadebrewer7212 2 หลายเดือนก่อน

      Yup....just getting started in this mess. About 1000 hours living in VBA certainly helps for the thinking process....but is still a lot to take in. These videos are amazing.

    • @user-ft3rs2tu8o
      @user-ft3rs2tu8o 29 วันที่ผ่านมา

      1

  • @k9slover
    @k9slover 3 หลายเดือนก่อน

    Very good video, well explained and helpful.

  • @YoutubeMcode
    @YoutubeMcode หลายเดือนก่อน +1

    THANK YOU SO MUCH!!! SUCH AN AMAZING VIDEO, AND IT WORKS!!😀😀😃

  • @emberjaxx585
    @emberjaxx585 4 หลายเดือนก่อน

    Great video man, I appreciate it!

  • @jimmy2times
    @jimmy2times 4 หลายเดือนก่อน

    Amazing way to explain

  • @heheihyh1595
    @heheihyh1595 9 หลายเดือนก่อน

    Thank you so much

  • @aaronalquiza9680
    @aaronalquiza9680 2 หลายเดือนก่อน

    I could listen to your lessons all day. i could listen to it for sleep aid too.

  • @silambam_karthi
    @silambam_karthi หลายเดือนก่อน

    So nice very usefull this videos

  • @supremeleader5516
    @supremeleader5516 หลายเดือนก่อน

    thanks

  • @_nandu_729_
    @_nandu_729_ 3 วันที่ผ่านมา

    can i use a BC 548B transistor?
    and a 9v battery with resistors?

  • @emanuelepedivellano3820
    @emanuelepedivellano3820 8 หลายเดือนก่อน

    Nice video! How can I choose the size of the capacitor?

    • @Science.Buddies
      @Science.Buddies  8 หลายเดือนก่อน +1

      We don't have a simple answer for this because it can depend on the motor and power supply you're using - you might want to do some more research on more electronics-specific forums for this one.

  • @SynisterFour
    @SynisterFour 8 หลายเดือนก่อน +2

    Thank you. Though if I may ask, is there any way to power the arduino with the same power supply without risk of short circuiting? I've made a similar configuration which works just fine but just like in the video, the arduino is still uses power from the USB.

    • @SynisterFour
      @SynisterFour 8 หลายเดือนก่อน

      I was thinking of connecting the Vin port to the positive rail that's connected to the power supply. Currently unsure as I am still new to arduinos and don't wanna break my components. Some answers would be helpful, cheers.

    • @Science.Buddies
      @Science.Buddies  8 หลายเดือนก่อน +3

      We have a new video that is all about different ways to power your Arduino project! th-cam.com/video/I7MrL5Q7zvY/w-d-xo.htmlsi=ONWYTIxMbwE16vR7. You will also find this official help page useful: docs.arduino.cc/learn/electronics/power-pins. But the short answer is yes, you can use a single power supply and connect it to both the Arduino's Vin pin and the motors to power everything at once. That way the power for the motors comes directly from the power supply and not through the Arduino. Here's an example of a project on our site that uses this configuration - an ROV powered by a single LiPo battery: www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p052/robotics/arduino-underwater-ROV

  • @diego7425
    @diego7425 13 วันที่ผ่านมา

    Hello! Very good explanation, I just want to know if the exact same logic applies to a physical project programmed on assembly, thank you!

    • @Science.Buddies
      @Science.Buddies  12 วันที่ผ่านมา

      Hi - the same concepts would apply to controlling a motor regardless of what programming language you're using. We don't have any of our own tutorials on assembly though!

  • @toxickanndy2558
    @toxickanndy2558 9 หลายเดือนก่อน +1

    Question! What kind of DC motor do you recommend for more hard / motor heavy projects

    • @Science.Buddies
      @Science.Buddies  9 หลายเดือนก่อน +1

      These motors are internally geared: www.amazon.com/Dagu-HiTech-Ele-DG01D-W-Breadboard/dp/B01KHWFD16/ and are very popular for a variety of robotics projects like our jumping robot www.sciencebuddies.org/science-fair-projects/project-ideas/Robotics_p047/robotics/rubber-band-jumping-robot and our bluebot kit: www.homesciencetools.com/product/bluebot-4-in-1-educational-robotics-kit/. The type of motor shown in this video has a very high speed, so works well for projects like our artbot, junkbot, or brushbot: www.homesciencetools.com/product/bristlebot-robots-kit/, but the motors can't really drive wheels directly.

  • @brotherx6205
    @brotherx6205 5 หลายเดือนก่อน

    Great video!
    One thing that I've been struggling to understand is the purpose of the "common ground". Why does this need to happen in these types of circuits?

    • @Science.Buddies
      @Science.Buddies  5 หลายเดือนก่อน +1

      It's a bit much for us to explain in a single TH-cam comment. The very short answer is that voltage is measured between two points, so all parts in the circuit need a "common" or reference level. Think of it like using sea level as a reference for "zero" elevation everywhere in the world. If you search TH-cam for videos about "what is ground in a circuit?" you will find some more detailed explanations.

    • @brotherx6205
      @brotherx6205 5 หลายเดือนก่อน

      @@Science.Buddies my problem with this has been that when you have an external power source, you need to connect it to a common ground (with the Arduino) when the external power source already has a potential difference between its poles. Ill have to keep building to understand why this connection needs to happen.

  • @natural_klassicart
    @natural_klassicart 8 หลายเดือนก่อน +2

    which SOFTWARE is being used in this tutorial to simulate

    • @Science.Buddies
      @Science.Buddies  8 หลายเดือนก่อน +1

      The software is called Tinkercad, we have a tutorial about it here: th-cam.com/video/9RF_BZ1Cg4k/w-d-xo.htmlsi=LwDVK2XtAwbA-SlM

  • @frioX3N
    @frioX3N 7 หลายเดือนก่อน +3

    Sir. How about pressing a button to start the motor for a period of time rather than using a potentiometer?

    • @Science.Buddies
      @Science.Buddies  7 หลายเดือนก่อน +1

      You could do this by detecting the button press (see video on buttons earlier in our tutorial series), turning the motor on, using a delay() command for a set amount of time, and then turning the motor off. The disadvantage here is that the code cannot do anything else while it is stuck in the delay() command. There are other ways to keep track of elapsed time on the Arduino, like the millis() command. We do not have a video on it but you can look it up on the Arduino website.

  • @hammoudaadel2680
    @hammoudaadel2680 7 หลายเดือนก่อน

    What's the software program you used??

    • @Science.Buddies
      @Science.Buddies  7 หลายเดือนก่อน

      The program is called Tinkercad Circuits, available at www.tinkercad.com. We have a tutorial video about it here: th-cam.com/video/9RF_BZ1Cg4k/w-d-xo.htmlsi=2agLPUXS-H3lGFo1

  • @TheHcJanni
    @TheHcJanni 7 หลายเดือนก่อน

    I am trying to build an ardunio that can pull my curtains up/down. Is a DC motor enough and is it possible to control that thing via bluetooth/ an app?

    • @Science.Buddies
      @Science.Buddies  7 หลายเดือนก่อน

      Hi - we don't have our own video on it, but you should be able to find many tutorials out there on using Arduino with Bluetooth and controlling things with apps. DC motors come in many different sizes and whether one is "enough" will also depend on whether there is a mechanism, such as gears or pulleys, that create a trade-off between speed and torque. This topic is a little more advanced than what we cover in this video but again you should be able to find other TH-cam tutorials about it.

  • @jhyland87
    @jhyland87 7 หลายเดือนก่อน +2

    7:23 I use to think that the electricity flowed out of the positive terminal as well, but recently I learned that in a typical use case such as this, they flow out the negative and in the positive. Apparently the logic behind this was that the + side is "gaining" electrons and the - side is "losing" them.
    Very backwards from everything I learned playing with electronics as a kid, lol.

    • @Science.Buddies
      @Science.Buddies  7 หลายเดือนก่อน +1

      The convention was defined before scientists really knew about electrons as the mobile charge carriers - for better or worse, that's what we've stuck with!

  • @reanimatedmoose6509
    @reanimatedmoose6509 8 หลายเดือนก่อน

    would it work with a 9.V battery (I'm very new to everything)

    • @Science.Buddies
      @Science.Buddies  8 หลายเดือนก่อน

      The very short answer is that technically it would work but 9V batteries are not a good choice for powering a motor. We have a more detailed video about powering your Arduino projects here: th-cam.com/video/I7MrL5Q7zvY/w-d-xo.htmlsi=FHJb_28Zbzr-_sZF

  • @SBAKDOWJ
    @SBAKDOWJ 12 วันที่ผ่านมา

    i wanted to do this but i dont have any n-channel mosfet and h-bridge integrated, where did you buy those/ where do you think i could buy cheap ones?

    • @Science.Buddies
      @Science.Buddies  11 วันที่ผ่านมา

      These parts are available on Amazon and electronics vendors like SparkFun, Adafruit, Digikey, Jameco, Mouser, etc.

  • @floppyglot
    @floppyglot 7 หลายเดือนก่อน

    why would my motor be humming/whining I used a similar setup using a IRF520 MOSFET, a potentiometer, and a 9V battery as the motor's power source

    • @Science.Buddies
      @Science.Buddies  7 หลายเดือนก่อน

      Depending on the motor, you may near a humming or whining noise when changing the speed with analogWrite. analogWrite does not allow you to adjust the frequency of the PWM signal, and different motors will respond differently to different frequencies.

  • @360101
    @360101 9 หลายเดือนก่อน

    Will it work with 2 other trigger button & 2 dc motor?????

    • @Science.Buddies
      @Science.Buddies  9 หลายเดือนก่อน

      Yes - the Arduino UNO has 13 I/O pins, so you have plenty of room to add more buttons and motors.

    • @360101
      @360101 9 หลายเดือนก่อน

      Thx, I can modify my big mouth billy bass Fish

  • @LiamFarleyMA
    @LiamFarleyMA 6 หลายเดือนก่อน

    Are there external power supplies that just connect to another 9v power cable? If you want to do a project that doesn't need to be portable and would be useless to have batteries on it seems like there should be a way to bypass the batteries.

    • @Science.Buddies
      @Science.Buddies  6 หลายเดือนก่อน

      Check out this video that is all about powering Arduino projects, it may help: th-cam.com/video/I7MrL5Q7zvY/w-d-xo.htmlsi=3vHons6WmIVFZP39

  • @sofiafssnnnn7389
    @sofiafssnnnn7389 7 หลายเดือนก่อน

    I am trying to build a system with a humidity sensor that will detect the low temperature and then activate the DC motor. Can I combine this project using the same arduino?
    Please help me.

    • @Science.Buddies
      @Science.Buddies  7 หลายเดือนก่อน +1

      Hi - yes, you can combine pretty much whatever sensors and motors you want with an Arduino, at least until you run out of pins. We do not have our own tutorials for temperature or humidity sensors yet, but you should be able to find plenty on TH-cam.

  • @lerdings
    @lerdings หลายเดือนก่อน +1

    Hello guys i was wondering why is the black wire leading to the ground pin necessary?

    • @Science.Buddies
      @Science.Buddies  หลายเดือนก่อน

      It's important for the entire circuit to have a "common ground" - this is a bit more than we can explain in a TH-cam comment, but you can find other tutorials online about what "ground" means in a circuit and why it's important.

    • @lerdings
      @lerdings หลายเดือนก่อน

      Interesting, however I find it confusing because doesn't the motor already have a ground? When I don't use Arduino for example, and I just use wires and a motor, the motor runs just fine; however in this with the Arduino it doesn't work? Can you explain why this is?

    • @Science.Buddies
      @Science.Buddies  25 วันที่ผ่านมา

      Hi - this is a little more than we can explain in a TH-cam comment, you may want to start with a TH-cam intro to electronics lecture series if you want to get deeper into these topics.

  • @user-cq6po3en6g
    @user-cq6po3en6g 2 หลายเดือนก่อน +1

    How would I change the code so that on a single press of the button the motor constantly spins until the button is pushed again?

    • @onebruno
      @onebruno หลายเดือนก่อน

      create a flag that will hold the last value. By default it is 0 and when you press you assign it to 1. on second press you have you have to assign to 0 and vice versa. and use that variable to turn on and off the motor.

  • @cesarbeast2323
    @cesarbeast2323 3 หลายเดือนก่อน +1

    Why isn't the button being connected to the 5v of the arduino as shown in you button LED video? :(

    • @Science.Buddies
      @Science.Buddies  3 หลายเดือนก่อน

      In our button video, we use an external pull-down resistor to ground so the button is low when not pressed, and wire the other side of the button to 5V so it is high when pressed. This approach is a little more intuitive when first learning buttons (pressed = high/on, not pressed = low/off). However, the Arduino also has an internal *pull-up* resistor that you can set using INPUT_PULLUP as shown in the code. If you do this, then you only need to wire the button to ground externally and not 5V. It's a little less intuitive because the input will be high when *not* pressed and will go *low* when you press the button, but it requires fewer external parts and wires. Sorry for not explaining that clearly in the video!

  • @mrspook4789
    @mrspook4789 4 หลายเดือนก่อน

    Could you just put two transistors one for forward and one for reverse and put diodes in between so you don't put power through another transistor when not in use. But they are connected to the same motor they just output a different polarity.

    • @Science.Buddies
      @Science.Buddies  4 หลายเดือนก่อน +1

      You can build an H-bridge using discrete transistors yourself but it actually requires four transistors, not two. This allows you to reverse the direction of current through the motor. We don't have our own tutorial on it, but you can find example circuit diagrams online. It's easier to make a mistake when building a circuit with multiple transistors though, so at that point you might as well just use an H-bridge IC.

  • @danidimitrov6644
    @danidimitrov6644 2 หลายเดือนก่อน

    Do i need to place 10k Resistor between Gate and Ground and 220Ohm Resistor between Gate and Arduino Pin?

    • @swaggybanana6909
      @swaggybanana6909 2 หลายเดือนก่อน

      Yes or MOSFET will stay on

  • @q7085ghvuaif
    @q7085ghvuaif 3 หลายเดือนก่อน

    No matter how often I watch your Tutorial, I just can‘t manage to shut the motor off.
    On PWM 255 it looks like it‘s at full speed. However, if I PWM 0, the Motor just keeps spinning slightly slower.
    What have I been missing? My setup is exactly the same, except that I‘m using an arduino r4 minima instead of a r3.

    • @Science.Buddies
      @Science.Buddies  3 หลายเดือนก่อน

      This code should work the same on an R4 as it does on an R3. There may be something wrong with your circuit or code but we can't say for sure without seeing them. If you are a K-12 student working on a school science project, you can ask for help in the Ask an Expert forums on our website, where we have volunteers to help answer questions: www.sciencebuddies.org/science-fair-projects/ask-an-expert-intro. Unfortunately we are a small organization and cannot provide support beyond that, but you could try asking for help in the official Arduino forums or other forums like Stackexchange or Reddit.

  • @koponstanley4
    @koponstanley4 หลายเดือนก่อน

    How can I use a microphone instead of a button to control the motor with the voice?

    • @Science.Buddies
      @Science.Buddies  หลายเดือนก่อน

      Hi - we have a microphone tutorial as part of our Arduino series (playlist linked in the description) but on its own that only works for basic loudness detection, not voice recognition. If you search our channel you will also find several videos about voice recognition.

  • @MartissLLL
    @MartissLLL 2 หลายเดือนก่อน

    Hello, how make a dc motor position with potenciometer?

    • @lauthomas7179
      @lauthomas7179 หลายเดือนก่อน

      Use a proportional control (P control) circuit to do that.

  • @planet_whale
    @planet_whale 8 หลายเดือนก่อน

    Why we meed transistors. Can we avoid

    • @Science.Buddies
      @Science.Buddies  8 หลายเดือนก่อน +2

      The Arduino's I/O pins can only supply 20 milliamps each, which is enough to drive a small load like an LED, but not enough to drive a motor directly. The transistor acts as an electronic "control valve" that lets you control more current flowing from a power source like the Arduino's 5V pin for an external battery.

  • @hamkazx
    @hamkazx 10 หลายเดือนก่อน

    what if you add 4 motors? how do you connect?

    • @Science.Buddies
      @Science.Buddies  10 หลายเดือนก่อน

      You would need to use a separate Arduino pin and transistor for each motor.

  • @523atharvganer5
    @523atharvganer5 5 หลายเดือนก่อน

    Please help me to replace the button with ultrasonic sensor

    • @Science.Buddies
      @Science.Buddies  5 หลายเดือนก่อน

      We have a separate video in our Arduino tutorial series (linked in the description) about using an ultrasonic sensor.

  • @rehmanazhar6517
    @rehmanazhar6517 2 หลายเดือนก่อน

    what is this software to draw?

    • @Science.Buddies
      @Science.Buddies  2 หลายเดือนก่อน

      The software is called Tinkercad Circuits and we have a tutorial about it here! th-cam.com/video/9RF_BZ1Cg4k/w-d-xo.htmlsi=jFo8k2vp6V7eUPOU

  • @SeakMenh
    @SeakMenh 3 หลายเดือนก่อน

    what app you use ?

    • @AidinZolghadr
      @AidinZolghadr 2 หลายเดือนก่อน

      Tinkercad

    • @AidinZolghadr
      @AidinZolghadr 2 หลายเดือนก่อน

      th-cam.com/video/9RF_BZ1Cg4k/w-d-xo.html

    • @yazanjarjous1872
      @yazanjarjous1872 หลายเดือนก่อน

      Tinkercad

  • @b06condesquenraver.18
    @b06condesquenraver.18 2 หลายเดือนก่อน

    Bro what is the model number of that mosfet

    • @Science.Buddies
      @Science.Buddies  2 หลายเดือนก่อน

      www.amazon.com/gp/product/B07CTF1JVD/

  • @glutinous974
    @glutinous974 หลายเดือนก่อน

    how can i connect TWO dc motors with arduino?

    • @Science.Buddies
      @Science.Buddies  หลายเดือนก่อน

      You just need to duplicate the setup shown in this video using an additional pin.

  • @user-kf5mt4zh7d
    @user-kf5mt4zh7d 2 หลายเดือนก่อน

    What is the name of the software

    • @Science.Buddies
      @Science.Buddies  2 หลายเดือนก่อน

      The simulation software we use in this video is called Tinkercad Circuits: th-cam.com/video/9RF_BZ1Cg4k/w-d-xo.htmlsi=anM2bLtx0hgG71lF

  • @chennojurahuldev1756
    @chennojurahuldev1756 6 หลายเดือนก่อน

    What's the transistor number

    • @Science.Buddies
      @Science.Buddies  6 หลายเดือนก่อน

      The transistor is an N-channel MOSFET, something like this or equivalent will work: www.adafruit.com/product/355

  • @mellonhead9568
    @mellonhead9568 5 หลายเดือนก่อน

    i will make a Drone and it will be awsome!!!!!!!!!

  • @Chan-og3yk
    @Chan-og3yk 7 หลายเดือนก่อน

    Hey, i've copied everything exactly from this project but when I use analogwrite in an attempt to control the speed of the motor, it's not working. I'm not using a potentiometer, but here's my code:
    const int MOTORPIN = 3;
    void setup() {
    // put your setup code here, to run once:
    pinMode(MOTORPIN, OUTPUT);
    analogWrite(MOTORPIN, 0);
    }
    void loop() {
    // put your main code here, to run repeatedly:
    analogWrite(MOTORPIN, 0);
    }
    I've ensured that pin 3 is indeed a PWM pin, and my circuit setup is exactly the same as yours, I've double and triple checked. What could be the problem? Thanks in advance!

    • @Science.Buddies
      @Science.Buddies  7 หลายเดือนก่อน

      Hi - since you have analogWrite(MOTORPIN,0), you are setting the speed to 0 and the motor will not spin. Does it spin if you change the 0 to a different number, between 0-255?

    • @Chan-og3yk
      @Chan-og3yk 7 หลายเดือนก่อน

      @@Science.Buddies sorry I should have clarified, when I set the speed to 0 with the analogWrite it still spins. It doesn't stop. No matter what number I put it spins at the same speed.

    • @Science.Buddies
      @Science.Buddies  7 หลายเดือนก่อน

      Ok - this could be a problem with your circuit and not your code. You could test with an LED instead of a motor to make sure the analogWrite function is working properly, since wiring an LED does not require a transistor and is less complicated than wiring a motor. We have videos earlier in our tutorial series about controlling LEDs.

  • @aleksvitek798
    @aleksvitek798 3 หลายเดือนก่อน

    This doesn't make any sense, an ordinary mosfet has a minimum voltage threshold on the gate, which allows it to open, so lower voltage values from the potentiometer won't even open it, causing the motor to be left turned off, and high enough voltage values from the potentiometer will exceed the gate's threshold, causing it to open, causing the motor to run at full speed. A mosfet can be either open or closed, so the motor will either run at full speed or not run at all, so please explain what am I missing here

    • @Science.Buddies
      @Science.Buddies  3 หลายเดือนก่อน

      The voltage from the potentiometer is not going directly to the MOSFET's gate. It is going to an analog input pin on the Arduino, which is read with the analogRead command, and then converted to a pulse-width modulation value and sent to one of the Arduino's output pins using the analogWrite command. The trick is that the UNO R3 does not have a true analog output - it is a pulse-width modulation (PWM) signal that just alternates between high and low (fully on or fully off, as you noted). By adjusting the duty cycle (percentage of each period the signal is high) you can control the motor speed.

  • @spectatorsturner
    @spectatorsturner 3 หลายเดือนก่อน

    I need to learn how to connect a sound module to a dc motor.

    • @Science.Buddies
      @Science.Buddies  3 หลายเดือนก่อน

      What exactly do you mean by "sound module"? We have a tutorial about using a microphone here: th-cam.com/video/bMs5J4bJOD0/w-d-xo.htmlsi=DTllbdrN_A78mYcU

    • @spectatorsturner
      @spectatorsturner 3 หลายเดือนก่อน

      @@Science.Buddies I need the motor running and the sound module playing music at the same time

  • @aleksdeveloper698
    @aleksdeveloper698 5 หลายเดือนก่อน

    I literally understood nothing from this video.
    I am not saying it to just be mean, I personally could not understand how it is done.

    • @Science.Buddies
      @Science.Buddies  5 หลายเดือนก่อน +2

      We would recommend starting at the very beginning of our Arduino tutorial playlist instead of jumping right to this video, which is more advanced. You can find the entire playlist here: th-cam.com/play/PLlBVuTSjOrclb0iCMSRpS_H1lSrlSVeEm.html&si=Mk1cQfK7YIpuIpq0

  • @machine-code
    @machine-code 2 หลายเดือนก่อน

    Use PWM, this hurts my brain

  • @kamilhorvat8290
    @kamilhorvat8290 5 หลายเดือนก่อน +9

    Really? Using analogWrite to control motor speed? That's a bit dumb. I guess it could work, but it's going to burn part of battery energy on mosfet. Better way of controlling motorspeed is using PWM signal.

    • @Science.Buddies
      @Science.Buddies  5 หลายเดือนก่อน +20

      The Arduino UNO R3 does not have a true analog output, it's actually generating a PWM signal. We glossed over that in this video. Note that the new Arduino R4 *does* have a true analog output available, but you would still use PWM on a digital pin to control motor speed.