How to Run a Stepper Motor with an Arduino + L293D IC

Sdílet
Vložit
  • čas přidán 8. 09. 2024
  • Hi I am Eric and with this video I gonna show you how to Run/Drive a Stepper Motor with an Arduino using a Motor driver IC L293D.
    You can find the code and more details about the project on CircuitMagic.com, below is the link for a project page.
    Link:
    www.circuitmagi...

Komentáře • 129

  • @hannahhelms4032
    @hannahhelms4032 Před 5 lety +2

    I cannot possibly thank you enough!! I watched countless videos and tried 10+ hookups and codes with none of them working. I was so discouraged and ready to give up until this video. It works perfectly. Thank you sooo much!!!
    I now just need to figure out how to program it to go back and forth continuously for about a minute...

    • @khaoulaboutiche2967
      @khaoulaboutiche2967 Před 5 lety

      plllllllz how did u find the library

    • @rehaansengupta8851
      @rehaansengupta8851 Před 4 lety

      @Hannah Helms same here

    • @rehaansengupta8851
      @rehaansengupta8851 Před 4 lety

      @@khaoulaboutiche2967 go to sketch>include library>stepper

    • @blmb4274
      @blmb4274 Před 3 lety

      @@khaoulaboutiche2967 Just look at the datasheet and look at the excitation protocol or something like that

  • @milehidude
    @milehidude Před 7 lety +2

    Good Stuff Eric! I always appreciate a nice and sucinct tutorial! With your link, you've made this very thorough. Thanks
    I'd like to see about generating a code whereby I can control a stepper with a joystick, utilizing it's neutral position as a 'neutral'; meaning a left move of the joystick reverses and a right produces a forward revolution. Or perhaps (more easily) the joystick's push switch activates a reverse mode. - All with the Arduino, of course.

  • @thedenus
    @thedenus Před 4 lety +1

    Exactly what I was looking for... Thanks!

  • @sameerk12982
    @sameerk12982 Před 4 lety +1

    Thank you very much for this video... Appreciated.

  • @niksatange9630
    @niksatange9630 Před 6 lety +1

    thanks for sharing Eric.... keep going...

  • @leohamelinck3524
    @leohamelinck3524 Před 2 lety +1

    Nice and instructive explanation, thank you! Can you also control the speed with a L293D with a potentiometer?
    So in addition to this sketch ?????

  • @Come_with_me9
    @Come_with_me9 Před 7 lety

    hey m using 6 wire motor, first 2 winding check with meter, it's working enjoy it :)

  • @mustafaglnr8780
    @mustafaglnr8780 Před 6 lety +1

    we may use this circuit for driving to Stepper motor 28BYJ-48

  • @maimaitinhthankhoinghiepma297

    thanks for your video, can you show me how to run 2 stepper Motor with an Arduino and 2 L293d IC, i want to control 2 stepper Motor but don't know how

  • @bandukamadumal1844
    @bandukamadumal1844 Před 5 lety +4

    good work bro.... but how can i find {"#include <Stepper.h>"} library file

  • @MrBoi96969
    @MrBoi96969 Před rokem +1

    hey can i run my 12v dc 2 amp stepper motor with this method plz tell

  • @AO-yw3gz
    @AO-yw3gz Před 9 lety

    great video very simple and informative

  • @aghilsoleimani8796
    @aghilsoleimani8796 Před 5 lety

    Please check the direction and speed control of DC motor in fully automatic form with just coding without the use of keys and ... Using atmega8 micro control and l298 module

  • @saeeddessouky1680
    @saeeddessouky1680 Před 3 lety

    thanks for your great explanation i have a question can we connect 2 DC motor instead of stepper motor with keeping the configuration for the input and power connections or we will need to modify?? thanks in advance

  • @justaplumber7783
    @justaplumber7783 Před 7 lety +1

    Hey in your schematic on your site you have +5 volts for power supply and - ground to the same rail NOT GOOD on bread board

  • @WhoWantsToKnow81
    @WhoWantsToKnow81 Před 9 lety

    Thank you very much for the tutorial!

  • @mefugoenmicarro
    @mefugoenmicarro Před 7 lety

    Great video Eric! Thanks for sharing! :D

  • @muaathe78
    @muaathe78 Před 8 lety

    Hi, many thanks for this, I want to control a NEMA 17 to do few loops clockwise and retune back anticlockwise with same number of loops and so on can I use this driver? Additionally I have purchase a lead shine DM442 drive can I use it instead of both arduino and the L293D? regards

  • @SpiceyMachineGun
    @SpiceyMachineGun Před 6 lety +2

    Hello everyone, I have determined an easy way to see which wires connect to a winding. Plug in an LED to a breadboard, and plug in a pair of wires from the stepper to each terminal of the LED, and spin the shaft of the stepper motor both directions. Keep switching combinations of the wires until the LED turns on, when it does, that pair of wires is connected to one winding

  • @davidnk673
    @davidnk673 Před 6 lety

    Do you need a forward diode to protect your driver and a capacitor to make the circuit more stable

  • @schoolexamhelp1440
    @schoolexamhelp1440 Před 3 lety

    Guys you have write
    #include
    In the starting

  • @jtcp27031
    @jtcp27031 Před 7 lety

    Just what I needed, thanks!

  • @liamcarmody6649
    @liamcarmody6649 Před 6 lety

    is there a way to tell the motor how many steps to take without using the serial monitor? Like can you just put the number of steps into the code itself?

  • @FunStudios
    @FunStudios Před 4 lety

    My stepped motor only moves back and forth one step clock wise and one the other direction. Any suggestions?

  • @v-hrdr9704
    @v-hrdr9704 Před 5 lety

    I'm having a problem... Apparently, cannot plug the +5v from Arduino to pins EN 1-2, EN 3-4 & Vcc1. Because it causes to off Arduino board. Independently of if the Vcc2 is connected or not (9v motor power).

  • @MatthewScope
    @MatthewScope Před 8 lety

    Hey man, really good job!
    I have a question about RPMs of stepper motors, how much rpms are max which u operate with?
    I can get only like 240rpms with my Nema 23 425oz, If i go faster, the motor just stops and produces strange noises and vibrations. What to do?
    All the thing is with no load on the motor shaft.

  • @dixit-rohit
    @dixit-rohit Před 6 lety

    Nice work.
    But i want to know something.
    1. Can i use it with Toy car circuit without using arduino or raspberry pi.
    2. I want to make a wireless remort control robo car with 6 motion arm. What i want to do or
    If you give me answer of q.1 than i can make it wireless + arm.
    If it can control buy toy car than i use 4 different module remote control circuit ( 1 is for car control , circuit is 12v wireless kit)..( 3 different control drive toy car remote kit for control the arm).

  • @aziraa6176
    @aziraa6176 Před 8 lety +2

    don't you need capacitor (0,1uf) to protect the driver? please answer me as soon as you read this.
    Greetings.

  • @eyadehabahmed9208
    @eyadehabahmed9208 Před měsícem

    is this safe? would this break my arduino board? should i use diodes. or am i overthinking?

  • @baileytaylor6731
    @baileytaylor6731 Před 7 lety

    How do you make it do certain steps with out using serial port like how to have it already in the code so you could press a button and it woudl do say 3000 steps then it woudl reverse it

  • @FrankLopezx
    @FrankLopezx Před 9 lety

    have you done this with a dc motor and a potentiometer? make work like a DIY servo ? and this chip?

  • @Farazkhan-lm7wf
    @Farazkhan-lm7wf Před 7 lety

    please help me
    how to made a.....traffic light controller and bartier oPening closing by arduino

  • @LeTouffeteur
    @LeTouffeteur Před 6 lety

    Hi and Thanks for your video ! I have a question : what kind of 12v power supply do you use ? I need to know it for an arduino project. Thanks for your response. Cheers and good job

  • @libertlink
    @libertlink Před 7 lety

    Hi, i have a question, is it possible to use a contact switch and everytime you pusch it goes 1 step forward. I want to build a turntable with a stepper motor. Thanks in advance!!

  • @VamsiKrishna-ep1iu
    @VamsiKrishna-ep1iu Před 8 lety

    from where you are connected external 5V and is it possible to run the bigger motor using with L293D IC...?

  • @MrNigel1340
    @MrNigel1340 Před 8 lety

    Very informative thenk you

  • @FrankLopezx
    @FrankLopezx Před 9 lety

    hi there quick question can you or do you already have this setup but using serial to input speed and direction ? all done thru serial?

  • @shahrazatiskandar
    @shahrazatiskandar Před 8 lety

    hello, how the connection if i want to use arduino+motor+relay and 3 pin variable resistor 10K . where would i connected the relay and resistor. Thanks

  • @bilelmani5197
    @bilelmani5197 Před 9 lety

    can i use 2 h-bridge (L293D) and 2 bipolar stepper motor in the same arduino r3 ???

  • @happyisthealero
    @happyisthealero Před 7 lety +1

    What are you using to power the breadboard? Maybe I missed it, anyone can answer if I missed it. Do you have a video of a 5 or 6 wire setup?

    • @Circuitmagic
      @Circuitmagic  Před 7 lety

      I have used 5v power supply. here is the link for the video position where I am connecting power supply to the breadboard. czcams.com/video/hZNF7tAJmfk/video.html - right now I don't have video for 5 or 6 wire setup, but I will make and upload it.

  • @Spiceman333
    @Spiceman333 Před 9 lety

    can this be done with a 12VDC motor instead? using the same chip?

  • @incodewetrust8862
    @incodewetrust8862 Před 9 lety

    which motor is used in drone ?? stepmotor or brushlless motor or brushed ??

  • @thghho
    @thghho Před 7 lety

    Hi, can any one guide me what kind of ready-made Circuit kit I should buy from the market which can ablr to perform following action:
    A circuit kit, which can able to detect RPM of a rotating object (lets say object 'A') via IR.
    Then Circuit Kit gives signals and set the same RPM to a attached 12v DC running motor (lets say object 'B')
    Conclusion: What so ever will be the RPM of object 'A', Circuit Kit will automatically set SAME RPM for object 'B'
    Thanks!

  • @12Keat12
    @12Keat12 Před 8 lety +3

    Thanks man!!! Is there a way I can do this with a 6 wire motor?

    • @Circuitmagic
      @Circuitmagic  Před 7 lety

      we will upload the video for 6 wire setup soon!

    • @abdulalimbaig3286
      @abdulalimbaig3286 Před 5 lety

      Circuit Magic have you done that yet?

    • @sameerk12982
      @sameerk12982 Před 4 lety

      In six wire join common wire from both windings and apply positive motor supply to them

  • @HarshCreatives
    @HarshCreatives Před 7 lety

    in coil A can we connect any wire to 3 and 6?
    please reply

  • @gerardoseptien855
    @gerardoseptien855 Před 7 lety +2

    I need torque, if i use 12v in the power supply of the L293D, i get more? I mean "power input for motor" in your diagram

    • @willianwcz
      @willianwcz Před 7 lety

      Torque and a lit bit speed, yes you will do

  • @boltbolte2084
    @boltbolte2084 Před 7 lety

    hi all, i need the proteus and arduino with the stepper connections and the code to run a specific angle when i input that angle and to turn on that.
    because i have not the hard wares all but i need to understand how it works . since it confuses me on the proteus how it can works with the
    #define STEPS 200
    Stepper motor(STEPS, in1Pin, in2Pin, in3Pin, in4Pin);
    if (Serial.available())
    {
    int steps = Serial.parseInt();
    motor.step(steps);
    }

  • @igorsambura9429
    @igorsambura9429 Před 5 lety +2

    Спасибо большое !

    • @smokepascal9974
      @smokepascal9974 Před 3 lety

      В русском сегменте сети рассказывают о этих драйверах на примере DC двигателей, а этот чувак на пальцах показал как работать с шаговыми движками да еще и через ком порт!!!

  • @vibinjgerald5863
    @vibinjgerald5863 Před 6 lety

    this video saved me!!!!

    • @Circuitmagic
      @Circuitmagic  Před 6 lety +1

      Thanks, Please subscribe to our channel and press the notification bell!

  • @larttv518
    @larttv518 Před 8 lety

    can you program push buttons to rotate the stepper in certain steps? if so, can you make a diagram and code pls. thanks! :D

    • @thomzz3449
      @thomzz3449 Před 8 lety

      do you still need the code? i could maybe make a simple code for you. as for the diagram, i'm not good at that

  • @virajdesai6336
    @virajdesai6336 Před 8 lety

    is the stepper motor used here is Nema17?

  • @shubham_ram5377
    @shubham_ram5377 Před 6 lety

    can i add power supply to arduino uno instead of breadboard

  • @khaoulaboutiche2967
    @khaoulaboutiche2967 Před 5 lety

    how can i find the library plz

  • @veerasalam1
    @veerasalam1 Před 8 lety

    i have problem with coding....it shows error " while ( ! serial ) ; not matched "when try to run the motor....help....thank you

  • @kewkawa
    @kewkawa Před 6 lety

    hello, is the L293D recommended if my motor takes a current of 300mA and requires a voltage of 24 volt ? also is the L293D reliable if my motor is power on for a very long time.

    • @Circuitmagic
      @Circuitmagic  Před 6 lety

      Hi I recommend you L298N motor driver module, It work 5 to 35 volt, if you are using more then 12 volt then don't forget to remove 5 volt regulator jumper. For more info please watch this video. czcams.com/video/dyZolgNOomk/video.html

  • @Kushpatel9047
    @Kushpatel9047 Před 7 lety

    Will it work with any other IC? I have SN74HC595N. Stepper motor is kind of new for me. Thank you

  • @tanvir2toufiq
    @tanvir2toufiq Před 6 lety

    Can i use 12 v on external input?

  • @andrespefia7379
    @andrespefia7379 Před 6 lety

    Is there a methode to transform a stepper motor with 6 wires to a stepper motor with 5 wires ????

  • @RedJonathon719
    @RedJonathon719 Před 7 lety

    how can you attach a stepper motor with 5 pins

  • @ReplicateReality
    @ReplicateReality Před 6 lety +2

    it worked

  • @nibumathew3427
    @nibumathew3427 Před 4 lety

    Motor vibrating only, not running. Please help

  • @tahmid61
    @tahmid61 Před 6 lety

    How to run 5 wires stepper motor with L293d?

  • @harshitpanjeta6546
    @harshitpanjeta6546 Před 6 lety

    sir my ic is getting heated up and now the motor has stopped what should i do.

  • @incodewetrust8862
    @incodewetrust8862 Před 9 lety

    what camera do you use ??

  • @rahulmistry7668
    @rahulmistry7668 Před 7 lety

    hello sir I am from India
    I want to know how to operate 220v stteper motor with arduino pls tell me

    • @Thefireguru1
      @Thefireguru1 Před 6 lety

      you need to run that through a relay switch, the arduino can only handle a certain amount of voltage.

  • @schoolexamhelp1440
    @schoolexamhelp1440 Před 3 lety

    Then it will become the correct code

  • @shubhamchouksey9904
    @shubhamchouksey9904 Před 6 lety

    where will i get the code

  • @virajdesai6336
    @virajdesai6336 Před 8 lety

    from where to take 5V supply?

    • @thomzz3449
      @thomzz3449 Před 8 lety +1

      you could use any 5v power supply with enough current. so not the Arduino. maybe just a wall adapter. if you don't know for sure how much power the motor consumes it's better to be able to supply more current than not enough. (don't forget to connect all grounds together, Arduino and power supply, or you may get Wierd results)

  • @phroot799
    @phroot799 Před 8 lety +1

    Code:
    #include
    int in1Pin = 12;
    int in2Pin = 11;
    int in3Pin = 10;
    int in4Pin = 9;
    // change this to the number of steps on your motor
    #define STEPS 512
    Stepper motor(STEPS, in1Pin, in2Pin, in3Pin, in4Pin);
    void setup()
    {
    pinMode(in1Pin, OUTPUT);
    pinMode(in2Pin, OUTPUT);
    pinMode(in3Pin, OUTPUT);
    pinMode(in4Pin, OUTPUT);
    // this line is for Leonardo's, it delays the serial interface
    // until the terminal window is opened
    while (!Serial);
    Serial.begin(9600);
    motor.setSpeed(20);
    }
    void loop()
    {
    if (Serial.available())
    {
    int steps = Serial.parseInt();
    motor.step(steps);
    }
    }

  • @harshitgoyal3394
    @harshitgoyal3394 Před 8 lety

    can i run a 5 wire stepper with the same program

    • @harshitgoyal3394
      @harshitgoyal3394 Před 8 lety

      i mean the same code

    • @thomzz3449
      @thomzz3449 Před 8 lety

      I think you can run it with the same program. i have done it as well using the stepper library.
      however i don't know for sure if the driver ic in this video is compatible with a 5 wire stepper motor. if it is not you could convert your motor to a 4 pin (i only know it is possible, not the pros and cons)
      you have to cut the common(as described in link) wire loose so the two coils per cable pair act as one coil.
      you'll end up with a motor as in this video [1:20].
      (www.talkingelectronics.com/projects/Stepper%20Motor%20Controller/images/5,6,8,wires-Identification.gif)
      other possibility
      the "ULN2003" driver ic came standard with my 288BYJ-48 which is also is 5 pin but you will have to find out if it can handle the power.
      i hope i was of any use and succes ;)

  • @jinarteimo
    @jinarteimo Před 6 lety

    I tried changing the speed but it made it slower any idea why??

  • @SanjayVerma-gr4wi
    @SanjayVerma-gr4wi Před 7 lety

    for every input the motor is just vibrating not rotating please help anyone ASAP to resolve the problem.
    .

    • @ANANDDESHMUKHanand
      @ANANDDESHMUKHanand Před 6 lety

      Set the speed slow.. If the speed is too high it will only vibrate

  • @advertaCS
    @advertaCS Před 9 lety

    I have a problem... I connect my DVD stepper motor to L293D to arduino, but the motor don't work... just make some noise like "click" "Click"... when I press the shaft it some how moves... I tried with different number for steps, but no result... can you help me pls.

    • @Circuitmagic
      @Circuitmagic  Před 9 lety +1

      Tatjana Hiljadnikova check the connection according to czcams.com/video/hZNF7tAJmfk/video.html or you can check another video czcams.com/video/Fb8b7YQcL1o/video.html

    • @harshitpanjeta6546
      @harshitpanjeta6546 Před 6 lety

      Tatjana Hiljadnikova try to reconnect the connection if your motor that means your connection are wrong

  • @IoTLearner
    @IoTLearner Před 6 lety

    Wrong pin representation in the IC L293D...it's anti-clockwise

  • @scienceengineeringandtechn3635

    if we have 6 wire Stepper motor then how we connect to L293D ic?Please Tell me..

    • @Circuitmagic
      @Circuitmagic  Před 5 lety

      You can use only four wires from that stepper motor. Just leave middle wire of both coils

    • @scienceengineeringandtechn3635
      @scienceengineeringandtechn3635 Před 5 lety

      your means that i have 6 wire stepper motor and L293D IC , 6 wire stepper motor for connect to IC L293D just leave middle wire of both coils and after these connection my 6 wire stepper motor run on IC L293D .Am I right?

    • @Circuitmagic
      @Circuitmagic  Před 5 lety +1

      Ya right just connect four wires with ic. With this ic you can run only small steppers which required upto 600mA. If you have big stepper then use L298N ic module, max current is 2A. You can find the video on my channel.

    • @scienceengineeringandtechn3635
      @scienceengineeringandtechn3635 Před 5 lety

      Can you give me personal Contact?
      My Email:Bilaljem1@gmail.com

  • @ReplicateReality
    @ReplicateReality Před 6 lety

    hey the extra power supply seems to do nothing when i remove it

    • @Circuitmagic
      @Circuitmagic  Před 6 lety

      Ok, then check the IC (L293D) pin no. 8 and pin 16. Pin no 8 is for external power source (up to 12 volts) and Pin no 16 is for 5 volts (from the Arduino). When you remove extra power supply Pin 8 not connected and voltage should be 0 on pin 8 you can check with the multimeter. Hope you understand, try to fix the problem and if you have any doubt just let me know. I am always here to help you.

    • @ReplicateReality
      @ReplicateReality Před 6 lety

      can u help me figure out why?

    • @ReplicateReality
      @ReplicateReality Před 6 lety

      they both add to the power but i dont know why or how it works

  • @lakshmik8
    @lakshmik8 Před 7 lety

    how much does this stepper motor cost?

  • @schoolexamhelp1440
    @schoolexamhelp1440 Před 3 lety

    And delete all lines like this
    // this line is for Leonardo's, it delays the serial interface

  • @Badboy-uf3es
    @Badboy-uf3es Před 7 lety

    5wire stepper motor

  • @karthiprem
    @karthiprem Před 7 lety

    couldn't compile the code pls help

    • @willianwcz
      @willianwcz Před 7 lety

      Try to substitute "#include " for "#include " in the line 5 of the code. (Obviously, all without quotes)

  • @MrDondoerner
    @MrDondoerner Před 6 lety

    I really like your tutorial but your pictures are really hard to see

    • @Circuitmagic
      @Circuitmagic  Před 6 lety

      Please visit circuitmagic.com you will find circuit diagram, find the link in description.

  • @taimoor722
    @taimoor722 Před 8 lety

    any other way to cheaply do that to use it in toys as tous are cheap and arduino is like 3,000 price

  • @schoolexamhelp1440
    @schoolexamhelp1440 Před 3 lety

    You have given our wrong code

  • @benceliz6501
    @benceliz6501 Před 7 lety

    where can i download adruino program?

    • @dhromayjani7911
      @dhromayjani7911 Před 7 lety

      to download arduino software go to the web site given below
      www.arduino.cc/en/main/software

    • @benceliz6501
      @benceliz6501 Před 7 lety

      Tnx bro..

    • @dhromayjani7911
      @dhromayjani7911 Před 7 lety

      hey ben where are you from?

    • @benceliz6501
      @benceliz6501 Před 7 lety

      +dhromay jani im filipino but im here in kuwait..

    • @dhromayjani7911
      @dhromayjani7911 Před 7 lety

      my 12std was just completed and i am really interested to make small projects with arduino , so can you interested to work with me or can you teach me ?
      i am learning arduino and finding a guy or person who can teach me and work with me