Control a DC Motor with Arduino (Lesson #16)

  Рет қаралды 291,107

Science Buddies

Science Buddies

Күн бұрын

Пікірлер: 181
@tedbastwock3810
@tedbastwock3810 9 ай бұрын
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.
@ingenierocivilizado728
@ingenierocivilizado728 10 ай бұрын
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 10 ай бұрын
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.
@6789-p9i
@6789-p9i 9 ай бұрын
1
@VocesSinFronterass
@VocesSinFronterass Жыл бұрын
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
@JillRhoads
@JillRhoads 3 ай бұрын
This is the best description of a mosfet I have heard! It makes so much more sense now.
@Golias372
@Golias372 3 ай бұрын
Bro, Thank you very much! I was in troble traying make these circuit. I'm from Brazil and here, we don't have videos in this quality!
@BenParisi
@BenParisi Жыл бұрын
Super helpful, exactly the information I needed. Thanks
@skystarmusic1902
@skystarmusic1902 Ай бұрын
You teach perfectly. It's work successful. Lot of thanks.
@EQencrypted
@EQencrypted Жыл бұрын
This is a phenomenal video. So clear, thank you 🙏
@ThayatY
@ThayatY 8 ай бұрын
The best explanation i have ever seen ❤
@godwinowusufrimpong2050
@godwinowusufrimpong2050 Жыл бұрын
I love your lessons is simple and powerful
@YoutubeMcode
@YoutubeMcode 9 ай бұрын
THANK YOU SO MUCH!!! SUCH AN AMAZING VIDEO, AND IT WORKS!!😀😀😃
@aaronalquiza9680
@aaronalquiza9680 11 ай бұрын
I could listen to your lessons all day. i could listen to it for sleep aid too.
@pierpa_76pierpaolo
@pierpa_76pierpaolo 6 ай бұрын
Ok vary the speed with PWM (to be adjusted for the motor you have to manage). But how to do to vary the 'amplitude?
@Science.Buddies
@Science.Buddies 6 ай бұрын
The Arduino's digital pins operate at 5V so the output will always be either 0V or 5V. The newer Arduino UNO R4 has a true analog output that can vary the output voltage.
@Logan_TheFell
@Logan_TheFell 12 күн бұрын
You change amps by changing resistance.
@shakejones
@shakejones 3 ай бұрын
Brilliant! Well done mate 🙏🏻
@orelsimahov5672
@orelsimahov5672 7 ай бұрын
Hi I was recently exposed to your channel and I really liked your videos you really explain everything the best way I have a question I came across a motor with three ports how am I supposed to use it and what does the third port mean thank you very much❤❤❤
@Science.Buddies
@Science.Buddies 7 ай бұрын
Hi - we can't really tell without seeing the motor, you may be able to get an answer to your question on the official Arduino forums or another electronics forum on a site like Reddit or Stackexchange.
@JamieDaze-fg1gj
@JamieDaze-fg1gj 26 күн бұрын
Thanks btw, but I have a question, how do I make it stay but turns off because its timer automated like it doesnt need a button to turn it on
@œøǔÿ
@œøǔÿ 3 ай бұрын
Why did that my transistor is low level trigger I do not get it. I followed every single instruction. It might be the wrong transistor, but you said any type of transistor Mine looks like an MOS like in the video it said TO 692. Could you please help
@Science.Buddies
@Science.Buddies 3 ай бұрын
You need to look up the pinout diagram for your transistor, not all transistors have the same pin locations.
@cesarbeast2323
@cesarbeast2323 Жыл бұрын
Why isn't the button being connected to the 5v of the arduino as shown in you button LED video? :(
@Science.Buddies
@Science.Buddies Жыл бұрын
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!
@_nandu_729_
@_nandu_729_ 8 ай бұрын
can i use a BC 548B transistor? and a 9v battery with resistors?
@Dwight-o4g
@Dwight-o4g 13 күн бұрын
I'll subscribe. You made it clearer I'm just assuming how everything should work but it's dum risky.
@RunTheProgram
@RunTheProgram 8 ай бұрын
how do we know how much current the transistor is controlling and allowing into the motor?
@Science.Buddies
@Science.Buddies 8 ай бұрын
You can connect a multimeter in series with the motor to measure the current: kzbin.info/www/bejne/qqSTdomZbtuLmdUsi=RWhOz3Z-QDKvApzs
@RunTheProgram
@RunTheProgram 8 ай бұрын
@@Science.Buddies In the video you mentioned that the motor would require more current than than the LED, so when you connected the transistor into the circuit does that mean the transistor automatically drew the correct amount of current for the motor? If so, can you adjust the amount of current the transistor draws for the motor?
@Science.Buddies
@Science.Buddies 8 ай бұрын
Hi - this is a little more than we can explain in a KZbin comment, you might want to look up some intro electrical engineering tutorial series.
@Hadeshinai1
@Hadeshinai1 4 ай бұрын
what is the voltage requirement of the motor to power in the diagram?
@mullacnacnud
@mullacnacnud 11 ай бұрын
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 10 ай бұрын
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.
@emberjaxx585
@emberjaxx585 Жыл бұрын
Great video man, I appreciate it!
@teganheffernan1635
@teganheffernan1635 3 ай бұрын
So this may be a long shot commenting on this video. But I was wondering if you need that transistor? Im trying to get my motor to spin but dont have transistors at my disposal. I need to use a button as well.
@Science.Buddies
@Science.Buddies 3 ай бұрын
The Arduino's I/O pins cannot provide enough current to drive a motor directly, so yes you need the transistor.
@MatheusHenrique-lv9yb
@MatheusHenrique-lv9yb 2 ай бұрын
Ty! but isn't much easier just to line the middle output of the potentiometer with the CC motor? u would be able to control the cc motor by regulating the batterie's tension you would have to connect the batteries on the Vin btw
@Science.Buddies
@Science.Buddies 2 ай бұрын
Hi - the short answer to your question is "no, don't connect the motor directly to the potentiometer." The reason that doesn't work is a little more than we can explain in a KZbin comment and requires understanding some introductory physics and circuits concepts like Ohm's Law.
@taymhamdan-nm5ir
@taymhamdan-nm5ir 6 ай бұрын
thanks so much this video help me so much😃
@T3chAnalogy
@T3chAnalogy 2 ай бұрын
Thank you! Quick question though: how did you determine the potentiometer's range. Is that found in a data sheet by the provider or is it across all potentiometers that value?
@Science.Buddies
@Science.Buddies 2 ай бұрын
The maximum resistance will be in the product name when you buy the part, sometimes just abbreviated for example as "10K potentiometer" which means 10 kilo-ohm potentiometer.
@T3chAnalogy
@T3chAnalogy 2 ай бұрын
@Science.Buddies ahh ok I see. Thank you very much!
@moonmonoar5000
@moonmonoar5000 4 ай бұрын
Hi, 1 question, with the switch why am I sending negative or, GND to the digital input pin and not positive?
@sigma-x3y7d
@sigma-x3y7d Ай бұрын
i am making a motor system that is controlled uniquely by code and not involving buttons. ChatGPT is being quite unhelpful, so how would I get around to wiring this in the simplest way possible? Great video by the way!
@Science.Buddies
@Science.Buddies Ай бұрын
We recommend asking your question in the official Arduino forums, we can't provide much help with code in KZbin comments.
@McCapper
@McCapper Ай бұрын
How do I code it for a time component? Like say, I want it to spin for 30 seconds after I press the button one time and then stop after 30 seconds?
@Science.Buddies
@Science.Buddies Ай бұрын
If you are new to Arduino, we recommend checking out the beginning of our Arduino tutorial playlist (linked in the description), which will show you how to use the delay command to turn things on or off for a certain amount of time.
@k9slover
@k9slover Жыл бұрын
Very good video, well explained and helpful.
@AadamZafar
@AadamZafar 2 ай бұрын
Hi there, thanks a lot this is helpful for a project I am doing. I had a quick question, what components are you using in the real life circuit at the start, i.e. what are the power ratings of them so that I am able to purchase accordingly to produce a working circuit? Thank you!
@Science.Buddies
@Science.Buddies 2 ай бұрын
Hi - these are common components available in many Arduino starter kits. We do not have exact links for the parts used in this video.
@jimmy2times
@jimmy2times Жыл бұрын
Amazing way to explain
@natural_klassicart
@natural_klassicart Жыл бұрын
which SOFTWARE is being used in this tutorial to simulate
@Science.Buddies
@Science.Buddies Жыл бұрын
The software is called Tinkercad, we have a tutorial about it here: kzbin.info/www/bejne/b4OpkHWQZqiaas0si=LwDVK2XtAwbA-SlM
@SynisterFour
@SynisterFour Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
We have a new video that is all about different ways to power your Arduino project! kzbin.info/www/bejne/f2iwo39rhpytrLssi=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
@logeshwarip7442
@logeshwarip7442 3 ай бұрын
hi ! thanks this was so helpful, i am working on a artificial pancreas project and there i have a 12 volt pump to be controlled. do i have to use the diode there as well? is it necessary ?
@Science.Buddies
@Science.Buddies 3 ай бұрын
A flyback diode is generally recommended when dealing with any DC motor or pump.
@Rust_bucket3000
@Rust_bucket3000 3 ай бұрын
Can I use a 9 volt external battery source instead of the 6 volt one in the video?
@Science.Buddies
@Science.Buddies 3 ай бұрын
It depends on the voltage rating of your motor. 9V batteries will also drain rather quickly when powering motors.
@Rust_bucket3000
@Rust_bucket3000 3 ай бұрын
@@Science.Buddies ok thanks
@calebnorman9923
@calebnorman9923 7 ай бұрын
Any idea why my digital pwm pins seem to be getting shorted out with too much current via this configuration?
@Science.Buddies
@Science.Buddies 7 ай бұрын
This isn't really something we can troubleshoot in a KZbin comment - we'd recommend checking out a forum dedicated to electronics (the official Arduino forum, Reddit, Stackexchange, etc) where you can post pictures of your circuit.
@BookOwl-t6o
@BookOwl-t6o Ай бұрын
Is the transistor necessary?
@Science.Buddies
@Science.Buddies Ай бұрын
Yes, the Arduino's digital pins cannot provide enough current to drive a motor directly.
@silambam_karthi
@silambam_karthi 10 ай бұрын
So nice very usefull this videos
@TanayKarn20147_alt
@TanayKarn20147_alt 3 ай бұрын
I don't have the transistor, is there anyway to do it without it?
@Science.Buddies
@Science.Buddies 3 ай бұрын
The Arduino's I/O pins will not be able to provide enough current to drive the motor directly without a transistor or another part called an H-bridge or motor driver (we have tutorials for those if you search our channel).
@TanayKarn20147_alt
@TanayKarn20147_alt 3 ай бұрын
@@Science.Buddies Alright thanks :D
@jcoop9200
@jcoop9200 2 ай бұрын
Can you connect multiple motors to one Arduino?
@Science.Buddies
@Science.Buddies 2 ай бұрын
Yes, as long as you are using an external power supply to power the motors.
@sayba_production
@sayba_production 10 күн бұрын
What software are you using to draw that circuit
@Science.Buddies
@Science.Buddies 9 күн бұрын
It's called Tinkercad Circuits and we have a tutorial about it here: kzbin.info/www/bejne/b4OpkHWQZqiaas0si=F5llF16hKmOuLTwD
@toxickanndy2558
@toxickanndy2558 Жыл бұрын
Question! What kind of DC motor do you recommend for more hard / motor heavy projects
@Science.Buddies
@Science.Buddies Жыл бұрын
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.
@danidimitrov6644
@danidimitrov6644 11 ай бұрын
Do i need to place 10k Resistor between Gate and Ground and 220Ohm Resistor between Gate and Arduino Pin?
@swaggybanana6909
@swaggybanana6909 11 ай бұрын
Yes or MOSFET will stay on
@anandh1967
@anandh1967 4 ай бұрын
Where can i get the code and circuit diagram?
@Science.Buddies
@Science.Buddies 4 ай бұрын
For some of our tutorials we have a Tinkercad Circuits link in the description - unfortunately we don't have one for this one, so you will need to pause the video to see the code and diagram.
@arunchandrakumar8145
@arunchandrakumar8145 5 ай бұрын
Hai sir you video is extremely useful and very clear . The mode of presentation is also amazing. Sir let me know , which software you used to simulate the circuit. Is it free to access or not? Once again I am waiting for new informative videos, Thanku sir
@Science.Buddies
@Science.Buddies 5 ай бұрын
The simulation software is called Tinkercad Circuits and we have a tutorial video about it here: kzbin.info/www/bejne/b4OpkHWQZqiaas0si=Wy9w0gLgvEahz0VD
@diego7425
@diego7425 9 ай бұрын
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 9 ай бұрын
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!
@عبداللهالمغربي-غ6ج
@عبداللهالمغربي-غ6ج 7 ай бұрын
Hello, Could you please tell the name of the software you are using to simulate this circuit ? Thank you
@Science.Buddies
@Science.Buddies 7 ай бұрын
It's called Tinkercad Circuits and we have a tutorial about it here! kzbin.info/www/bejne/b4OpkHWQZqiaas0si=VHRhSg4prsutotVv
@bagelinpond2433
@bagelinpond2433 3 ай бұрын
Can you provide us with a diagram for an artificial pancreas thats using a 12v pump so it needs an external battery?
@Science.Buddies
@Science.Buddies 3 ай бұрын
The process to connect a pump with an external power supply is the same as what is shown in this video around 5:50 to connect the motor with an external battery. In your case you would have an external 12V power supply instead of the 6V 4xAA battery pack, but the connections to the MOSFET and Arduino are the same.
@BradenTheBeaverHTF
@BradenTheBeaverHTF Жыл бұрын
Will it work with 2 other trigger button & 2 dc motor?????
@Science.Buddies
@Science.Buddies Жыл бұрын
Yes - the Arduino UNO has 13 I/O pins, so you have plenty of room to add more buttons and motors.
@BradenTheBeaverHTF
@BradenTheBeaverHTF Жыл бұрын
Thx, I can modify my big mouth billy bass Fish
@jhyland87
@jhyland87 Жыл бұрын
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 Жыл бұрын
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!
@frioX3N
@frioX3N Жыл бұрын
Sir. How about pressing a button to start the motor for a period of time rather than using a potentiometer?
@Science.Buddies
@Science.Buddies Жыл бұрын
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.
@hydraawan8911
@hydraawan8911 Ай бұрын
Rating of npn mosfet and potentiometer
@SBAKDOWJ
@SBAKDOWJ 9 ай бұрын
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 9 ай бұрын
These parts are available on Amazon and electronics vendors like SparkFun, Adafruit, Digikey, Jameco, Mouser, etc.
@LiamFarleyMA
@LiamFarleyMA Жыл бұрын
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 Жыл бұрын
Check out this video that is all about powering Arduino projects, it may help: kzbin.info/www/bejne/f2iwo39rhpytrLssi=3vHons6WmIVFZP39
@koponstanley4
@koponstanley4 9 ай бұрын
How can I use a microphone instead of a button to control the motor with the voice?
@Science.Buddies
@Science.Buddies 9 ай бұрын
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 11 ай бұрын
Hello, how make a dc motor position with potenciometer?
@lauthomas7179
@lauthomas7179 10 ай бұрын
Use a proportional control (P control) circuit to do that.
@pastpianist
@pastpianist 8 ай бұрын
Newbie here: can you have the battery pack also power the Arduino so that nothing needs to be plugged in?
@PulseRBX
@PulseRBX 5 ай бұрын
This isnt a official answer pls do some research im not that smart but i think by creating four wires (2 positive 2 negative) and connecting the first pair cable to the Vin pin and one to the gnd DONT SWITCH THE POLARITY It will deef fry ur board, and the two other wire pairs to the breadboard buses AGAIN PLEAAASE DO SOME RESEARCH ABOUT THIS METHOD , it will prob work idk😅😊
@brotherx6205
@brotherx6205 Жыл бұрын
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 Жыл бұрын
It's a bit much for us to explain in a single KZbin 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 KZbin for videos about "what is ground in a circuit?" you will find some more detailed explanations.
@brotherx6205
@brotherx6205 Жыл бұрын
@@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.
@q7085ghvuaif
@q7085ghvuaif Жыл бұрын
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 Жыл бұрын
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.
@WenyingXu-g5r
@WenyingXu-g5r 6 ай бұрын
Which MOSFET are you using?
@Science.Buddies
@Science.Buddies 6 ай бұрын
It is a generic N channel MOSFET such as www.amazon.com/gp/product/B07CTF1JVD
@MODEH7
@MODEH7 4 ай бұрын
How did the MOSFET not lower down the voltage since Arduino's digital pin can only provide 2.5V which doesn't fully open the MOSFET
@Science.Buddies
@Science.Buddies 4 ай бұрын
Arduino digital pins can provide 5V which is enough to turn the MOSFET fully on.
@MODEH7
@MODEH7 4 ай бұрын
@@Science.Buddies I tried with real life projects and Tinkercad and it did measure 2.5V 🤷
@b06condesquenraver.18
@b06condesquenraver.18 11 ай бұрын
Bro what is the model number of that mosfet
@Science.Buddies
@Science.Buddies 11 ай бұрын
www.amazon.com/gp/product/B07CTF1JVD/
@rehmanazhar6517
@rehmanazhar6517 11 ай бұрын
what is this software to draw?
@Science.Buddies
@Science.Buddies 11 ай бұрын
The software is called Tinkercad Circuits and we have a tutorial about it here! kzbin.info/www/bejne/b4OpkHWQZqiaas0si=jFo8k2vp6V7eUPOU
@TheHcJanni
@TheHcJanni Жыл бұрын
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 Жыл бұрын
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 KZbin tutorials about it.
@PersonalmailPavan
@PersonalmailPavan 10 ай бұрын
What is the name of the software
@Science.Buddies
@Science.Buddies 10 ай бұрын
The simulation software we use in this video is called Tinkercad Circuits: kzbin.info/www/bejne/b4OpkHWQZqiaas0si=anM2bLtx0hgG71lF
@Ovreen098
@Ovreen098 10 ай бұрын
how can i connect TWO dc motors with arduino?
@Science.Buddies
@Science.Buddies 10 ай бұрын
You just need to duplicate the setup shown in this video using an additional pin.
@sofiafssnnnn7389
@sofiafssnnnn7389 Жыл бұрын
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 Жыл бұрын
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 KZbin.
@mrspook4789
@mrspook4789 Жыл бұрын
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 Жыл бұрын
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.
@523atharvganer5
@523atharvganer5 Жыл бұрын
Please help me to replace the button with ultrasonic sensor
@Science.Buddies
@Science.Buddies Жыл бұрын
We have a separate video in our Arduino tutorial series (linked in the description) about using an ultrasonic sensor.
@planet_whale
@planet_whale Жыл бұрын
Why we meed transistors. Can we avoid
@Science.Buddies
@Science.Buddies Жыл бұрын
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.
@reanimatedmoose6509
@reanimatedmoose6509 Жыл бұрын
would it work with a 9.V battery (I'm very new to everything)
@Science.Buddies
@Science.Buddies Жыл бұрын
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: kzbin.info/www/bejne/f2iwo39rhpytrLssi=FHJb_28Zbzr-_sZF
@heheihyh1595
@heheihyh1595 Жыл бұрын
Thank you so much
@floppyglot
@floppyglot Жыл бұрын
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 Жыл бұрын
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.
@hammoudaadel2680
@hammoudaadel2680 Жыл бұрын
What's the software program you used??
@Science.Buddies
@Science.Buddies Жыл бұрын
The program is called Tinkercad Circuits, available at www.tinkercad.com. We have a tutorial video about it here: kzbin.info/www/bejne/b4OpkHWQZqiaas0si=2agLPUXS-H3lGFo1
@SeakMenh
@SeakMenh Жыл бұрын
what app you use ?
@AidinZolghadr
@AidinZolghadr 11 ай бұрын
Tinkercad
@AidinZolghadr
@AidinZolghadr 11 ай бұрын
kzbin.info/www/bejne/b4OpkHWQZqiaas0
@yazanjarjous1872
@yazanjarjous1872 10 ай бұрын
Tinkercad
@rigoluso9146
@rigoluso9146 2 ай бұрын
Here is his LED button code: const int LEDpin = 9; const int butpin = 2; int state; void setup() { pinMode(LEDpin, OUTPUT); pinMode(butpin, INPUT_PULLUP); } void loop() { state = digitalRead(butpin); if(state == HIGH) { digitalWrite(LEDpin, LOW); } else { digitalWrite(LEDpin, HIGH); } }
@hamkazx
@hamkazx Жыл бұрын
what if you add 4 motors? how do you connect?
@Science.Buddies
@Science.Buddies Жыл бұрын
You would need to use a separate Arduino pin and transistor for each motor.
@chennojurahuldev1756
@chennojurahuldev1756 Жыл бұрын
What's the transistor number
@Science.Buddies
@Science.Buddies Жыл бұрын
The transistor is an N-channel MOSFET, something like this or equivalent will work: www.adafruit.com/product/355
@emanuelepedivellano3820
@emanuelepedivellano3820 Жыл бұрын
Nice video! How can I choose the size of the capacitor?
@Science.Buddies
@Science.Buddies Жыл бұрын
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.
@aleksvitek798
@aleksvitek798 Жыл бұрын
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 Жыл бұрын
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.
@yousefail-cv3vc
@yousefail-cv3vc 2 ай бұрын
اين الخريطة والكود
@spectatorsturner
@spectatorsturner Жыл бұрын
I need to learn how to connect a sound module to a dc motor.
@Science.Buddies
@Science.Buddies Жыл бұрын
What exactly do you mean by "sound module"? We have a tutorial about using a microphone here: kzbin.info/www/bejne/mH7WZn1ql6-CepIsi=DTllbdrN_A78mYcU
@spectatorsturner
@spectatorsturner Жыл бұрын
@@Science.Buddies I need the motor running and the sound module playing music at the same time
@Chan-og3yk
@Chan-og3yk Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
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.
@supremeleader5516
@supremeleader5516 10 ай бұрын
thanks
@DavidWellsBootBoss
@DavidWellsBootBoss 8 ай бұрын
My code keeps getting stuck on line 17
@balaramvetapalem-wc5wx
@balaramvetapalem-wc5wx 5 ай бұрын
Code sir
@Amit-p5j
@Amit-p5j 6 ай бұрын
Thank you for helping me in theis journey was i was able yto do this and not commit suicide, LOLZ
@aradashrafi846
@aradashrafi846 5 ай бұрын
Bro He said transistor instead of M etal O xide S emiconductor F ield E ffect T ransistor
@mellonhead9568
@mellonhead9568 Жыл бұрын
i will make a Drone and it will be awsome!!!!!!!!!
@aleksdeveloper698
@aleksdeveloper698 Жыл бұрын
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 Жыл бұрын
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: kzbin.info/aero/PLlBVuTSjOrclb0iCMSRpS_H1lSrlSVeEm&si=Mk1cQfK7YIpuIpq0
@skystarmusic1902
@skystarmusic1902 Ай бұрын
🤟🏻
@littlefrank90
@littlefrank90 2 ай бұрын
This video desperately needs a list of parts to buy.
@machine-code
@machine-code 10 ай бұрын
Use PWM, this hurts my brain
@œøǔÿ
@œøǔÿ 3 ай бұрын
The Arduino pins can handle only 20mA, the motor is >50mA… You’ll fry it…
@lazarosapatsidis9561
@lazarosapatsidis9561 Ай бұрын
Go for it if you want to burn your arduino
@yobtnirp3D
@yobtnirp3D 19 күн бұрын
@œøǔÿpwm through a mosfet
@le_dalaiat
@le_dalaiat 2 ай бұрын
is proportional integral derivative possible with this setup?
@Science.Buddies
@Science.Buddies 2 ай бұрын
You can do PID control with an Arduino but this requires a sensor to measure the motor's rotational speed, called an encoder, which is not included in this video. This setup is "open loop" meaning there is no feedback signal that you can use for control.
DC Motor Control with an H-Bridge and Arduino (Lesson #17)
19:16
Science Buddies
Рет қаралды 105 М.
Make a TINY Arduino Drone with FPV Camera - Will It Fly?
20:26
Max Imagination
Рет қаралды 1,6 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
How to Control a 12V Motor with Arduino: Easy Wiring & Code Examples
44:13
This Car Travels Farther Than You Push It
13:42
Tom Stanton
Рет қаралды 3,8 МЛН
How PWM works | Controlling a DC motor with a homemade circuit
10:01
Inside the V3 Nazi Super Gun
19:52
Blue Paw Print
Рет қаралды 2,5 МЛН
Control DC Motors with Arduino and Joystick - Step-by-Step Guide
20:09
Rachel De Barros
Рет қаралды 13 М.
Electromagnetic Aircraft Launcher
15:09
Tom Stanton
Рет қаралды 2,6 МЛН
Let's build a voltage multiplier!
16:32
Ben Eater
Рет қаралды 2,3 МЛН
The BEST Mechanical Display You've EVER Seen!!!
13:51
Tin Foil Hat
Рет қаралды 576 М.
MOSFETs and Transistors with Arduino
40:50
DroneBot Workshop
Рет қаралды 1,1 МЛН
Beginner's Guide to Controlling Stepper Motors with Arduino
9:59
Rachel De Barros
Рет қаралды 45 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН