Control a Stepper Motor with an Arduino, Joystick, Easy Driver and Limit Switches - Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 มิ.ย. 2024
  • In this follow up tutorial we will control a stepper motor using an Analog Joystick but we will also limit the travel using Limit Switches and also control the speed.
    Check out our tutorials page at : brainy-bits.com/tutorials/ to get the schematic and more information on this tutorial.
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @kraken3d718
    @kraken3d718 4 ปีที่แล้ว +2

    Damn good explanation especially for a basic guy like myself. Thanks for uploading and taking the time to share.

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

    Amazing man! I've been looking for such a tutorial for a long time. Finally I can build a camera slider :-)

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

      Always cool to hear that the video are helping others! Thanks for watching!

    • @bestprint4817
      @bestprint4817 7 ปีที่แล้ว +2

      not only that, , it can help also to our DTG printer Project... Great job Mr. Brainy-Bits

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

    Thanks , i enjoy your videos , regards from Sweden

  • @arsalanmoheyuddin7980
    @arsalanmoheyuddin7980 5 ปีที่แล้ว

    must say great work . so many other gates opened for me after watching this video . Much much appreciated. Thank you!
    Please if you can tell me or guide me to a relevant project where i can use the same principle but just need a small detail to be altered where i can just toggle the joystick up/down for the movement. No need to keep on holding the joystick up to keep going up. If i toggle it up it should keep going up till the limit switches and the same for when pulled down. would really appreciate it .

  • @anthonycruz4435
    @anthonycruz4435 8 ปีที่แล้ว

    Another great vid(this is the one I needed) if I do not add limit switches will it still work? I just want the speed control and stop and go. Keep it up sir!!

  • @bullmonkey
    @bullmonkey 5 ปีที่แล้ว

    Hi, another great video. Roughly how long do you think the Arduino battery pack would last assuming the steppers have a separate supply?

  • @stampedestudios7043
    @stampedestudios7043 5 ปีที่แล้ว

    Wow, this is the perfect video to help me with my school project! Is there any way the joystick can be replaced with a variable resistor?

  • @BeetleJuice1980
    @BeetleJuice1980 8 ปีที่แล้ว +4

    great job !
    it would be nice to have a dedicated pot to change the speed of the stepper (on the fly or not). what way , this project would be an excellent "stepper motor x axis controller with variable speed".
    also you could use the lcd shield wich is cheep and has the buttons to control the stepper and you could display and dial the speed of the stepper.
    thank you!

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +Konstantinos Nanopoulos I will keep the pot in mind for a future tutorial that uses stepper motors. Will make more projects or tutorials which use LCD's in the future also. Thanks for watching and the suggestion!

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

    Thank you for share this project with us. Very good explained and code included ..... perfect for an Beginner like me. Please let me ask: In your wiring diagram is an stepper control included by "A3967" - Is it possible to Change to stepper driver "A4988"? What for changes are for this needed? Thank you very much for your friendly Support,

  • @LuisFernandoSanmiguelA
    @LuisFernandoSanmiguelA 5 ปีที่แล้ว

    Very Very Great! Thanks! God Bless You

  • @salmankhan24
    @salmankhan24 4 ปีที่แล้ว

    hey there...thats really awesome tutorial it really helped me in controlling my system...thanks for making such an informative tutorial. i want to use an ultrasonic sensor with my system using the same configuration but i couldn't do that plz guide me how to do that?...

  • @larileveybrandt6632
    @larileveybrandt6632 7 ปีที่แล้ว

    This is great. How would you connect a L298N Motor Drive Controller Board Module Dual H Bridge rather than the Easy Driver?

  • @Spongeee
    @Spongeee 7 ปีที่แล้ว

    Great video. Can you do a Tutorial about how to control a stepper with NODEMCU over a webpage with acceleration ?

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

    Hi, Thanks for video.
    I have a question.
    How can make continuing rotation? I wanna start turn when I push joystick left or right and want still turn motor until push limit switch, if limit switch is active motor is stop. How can we make it?
    Thanks

  • @pnvsatya
    @pnvsatya 6 ปีที่แล้ว

    Can you please provide the link for previous tutorial that you have talked about, in the beginning

  • @muhammadwaqasfarooq8321
    @muhammadwaqasfarooq8321 5 ปีที่แล้ว +2

    @Brainy-Bits, Hello Sir can I use Adafruit motor driver shield for this project. i hope you replay soon

  • @Pixel1274
    @Pixel1274 7 ปีที่แล้ว

    Hi, great job man. I worked on your project an i wish to know if can be possible to make it "portable", using an external battery pack.Thanks

    • @bullmonkey
      @bullmonkey 5 ปีที่แล้ว

      Hi, did you ever find an answer? I would really like to know how long the battery pack would power the Arduino.

  • @abdulrhmanalzoman1169
    @abdulrhmanalzoman1169 8 ปีที่แล้ว

    Great work!
    I would like to ask you if you're able to do a tutorial about controlling lcd by a rotary encoder like a LCD menu, I will appreciate that.

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

      +Abdulrhman Alzoman Thanks for watching! We will put it on the list of upcoming tutorials :)

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +Abdulrhman Alzoman If you want, you can have a look at our latest tutorial: th-cam.com/video/OJJsu3M7Vzk/w-d-xo.html where we use the Rotary Encoder with an LCD to control the reset menu of the project! Not a full menu but might help! Thanks again!

  • @boowonder888
    @boowonder888 7 ปีที่แล้ว

    I just started with Arduino. I made a pump jack using a stepper. I want to add the led sequential blinking to the same Arduino. Is it possible to run 2 sketches on the same Arduino at the same time?

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

    HI
    thank you
    how can I increase speed motor?
    my stepper motor works slowly.

  • @marrksr3971
    @marrksr3971 5 ปีที่แล้ว

    if I want to control 5 or 6 stepper motors (nema 17 in this case) can I use a cnc shield?

  • @Statistician0407
    @Statistician0407 5 ปีที่แล้ว

    Can u apply it to car break. For disabled people for easy breaking with switch on steering

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

    Hi!! how can make the motor to go faster if the limit of the fastest speed is 1?? Cant go lower than that,right?

  • @bonnevillegarage
    @bonnevillegarage 5 ปีที่แล้ว

    could you a selector dial for speed instead of push button the joystick?

  • @electron1ful
    @electron1ful 8 ปีที่แล้ว

    Dear Friend, good video. I'd like to do a similar project. I'm new to Arduinos and sketches. Do I use the Stepper h. program?

    • @xavierantunez163
      @xavierantunez163 8 ปีที่แล้ว

      library* but yes sir use the #stepper.h library

  • @kraken3d718
    @kraken3d718 4 ปีที่แล้ว

    What if you wanted to control a stepper motor at a set rpm to rotate in only one direction with no joystick involved? Any help with that and the easy driver? I did not see anything on your tutorial pages.

  • @tbltorres
    @tbltorres 7 ปีที่แล้ว

    Is it possible to make the movement start and stop with acceleration and deceleration?

  • @kraken3d718
    @kraken3d718 4 ปีที่แล้ว

    Ever tried the movement with a bit more advanced stepper driver such as a TMC 2209 for a more quiet operation?

    • @BrainybitsCanada
      @BrainybitsCanada  4 ปีที่แล้ว

      Haven't tried it yet, but I will getting my hands on one to test it out. Will make a video when I had a chance to play with it. Thank you for bringing it to my attention. Cheers!

  • @18minimus18
    @18minimus18 5 ปีที่แล้ว

    can you replace the analog stick with a toogle switch so you basicly off with be 200 step (eg) and on with be the other direction and 200 steps? how would you go about doing this in the code thanks in advance

  • @maddavedomino
    @maddavedomino 8 ปีที่แล้ว

    I am working on a project trying to do a similar version of what you are doing here, but instead of using a joystick i want to use a load cell to control the speed of the stepper motor. I.e the higher the load, the faster the stepper motor speed. When load equals zero (or less than say 100g). the stepper motor will return to the start point at a fixed speed. I'd be interested to see if you could do a tutorial on this. P.S many thanks for all your other tutorials!

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +David Calder Hi David, can you show me the load cell you would use, since I don't have any of those on hand? I'll look for your comment and get back to you. Thanks for watching!

    • @maddavedomino
      @maddavedomino 8 ปีที่แล้ว

      +Brainy-Bits Thanks for your reply! Here's a link to the load cell I want to use: www.aliexpress.com/item/Digital-Portable-Electronic-Kitchen-Scale-Load-Cell-Weight-Weighing-Sensor-20KG-FZ1439/32298801534.html - its a 4 wire load sensor commonly used in kitchen scales. I'm using a Bipolar Nema 8 stepper motor: www.aliexpress.com/item/NEMA-8-Stepper-Motor-1-96oz-in-28mm-0-6A-for-3D-Printer-RepRap-Makerbot-Arduino/32454837819.html. Appreciate your help. Dave.

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +David Calder I will try to get my hands on one of those and make a tutorial video on it! Thanks for watching and the suggestion!

  • @C4pn.K1rk
    @C4pn.K1rk 6 ปีที่แล้ว

    Not sure why my previous question showed up, but with this code, an Arduino Nano, Easy Driver, Nema 17 Stepper, and some mechanical limit switches (Vcc, Out, Gnd) the motor will only run if the switches are activated. If I let up on the switch, the motor stops. How do I fix this?

  • @worldwiderecordsinternatio9744
    @worldwiderecordsinternatio9744 3 ปีที่แล้ว

    what limitswiches do you use? and the secific board

  • @H2Oredfirefox
    @H2Oredfirefox 5 ปีที่แล้ว

    I know this is an old video about controlling stepper motors through Arduino and such so my question is can you use the same joystick controller a second stepper motor assuming you need a second easy driver i'd really appreciate your advice cos I'm intending to use it as a set up to control parts of a costume

    • @BrainybitsCanada
      @BrainybitsCanada  5 ปีที่แล้ว

      I've made another video and tutorial on controlling 2 steppers using one joystick to create a camera slider, you can check it out here: www.brainy-bits.com/dual-axis-camera-slider-using-joystick-in-and-out/ Hope it helps and thanks for watching!

  • @JMWConceptsTheOfficial
    @JMWConceptsTheOfficial 7 ปีที่แล้ว

    Is there a way to make the end stop reverse the motor direction? I'm needless to say, very new to this. I got my first motor movement last night! 😂

  • @krisc1243
    @krisc1243 7 ปีที่แล้ว

    when motor is not in motion current drains near 1A causing the chip getting so hot. If stepper is in motion, it drains less(0.2A). I think it has to do with programing. Any idea?

  • @phon72able
    @phon72able 8 ปีที่แล้ว

    Dear friend. Thanks for the reply. Could you help me with my project lock on the door. I want to open the door of a stepping motor by using RFID tags. But I can't solve the problem of the limit switches. Must be interrupted by circuit breakers in case of a malfunction or the ARDUINO in case of voltage drop or malfunction of the stepper motor. I mean if the motor will make more steps than when driving in the right or left. This is an accident.

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +Druid Sorry for the delay, didn't see your comment there. Do you mean a malfunction of one of the Limit switches? You could always count the number of steps needed to go over your limit, so that if the limit switch fails then the stepper would not go to far after that if you are keeping track of the steps. You can have a look at this video I did here: th-cam.com/video/cYIL5gxRogM/w-d-xo.html where I believe I keep track of the position of the stepper by counting the number of steps. Hope that helps! Thanks again for watching!

  • @davem4217
    @davem4217 7 ปีที่แล้ว

    Great piece of work. I would like to use this for a telescope focuser project I'm working on. Is there a way to:
    1. Unlock the motor when the joystick is centred (so not to waste power or overheat the stepper).
    2. Instead of using the Joystick switch, I'd like to use a 3 way toggle switch so I know which speed the stepper is in (low, med, high).
    Can you point me in the right direction code-wise please?
    Thanks.

  • @SocrasPt
    @SocrasPt 7 ปีที่แล้ว

    Im trying to make this, but instead of controlling the velocity with the switch, i want to controll it with the actual x axis. Speed and direction with joystick x

  • @baileytaylor6731
    @baileytaylor6731 7 ปีที่แล้ว

    Can u make a limit switch turn on a servo

  • @shirlyiang969
    @shirlyiang969 3 ปีที่แล้ว

    excelent

  • @phon72able
    @phon72able 8 ปีที่แล้ว

    Please tell me I understand the algorithm of the stepper motor? If the motor moves in the right then he stops short and right can not move to the right of the limit switch, and can only move to the left. Conversely analogous with the left side?

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +Druid Yep that's it! As long as one of the Limit switches (right or left) is engaged, the motor will not be able to move in that direction until the limit switch in question is released and vise versa. Hope that helps and thank for watching!

  • @LowEndStrings
    @LowEndStrings 7 ปีที่แล้ว

    I have a question (I'm really new to arduino): will the sliding part go back to its home position when you turn of the arduino and back on again? For my project I would need the sliding part to stay where I moved it no matter if I turn it on or off.
    Thanks in advance for your help :-)

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

      I've just released a new tutorial video on how to do homing of a stepper at startup: th-cam.com/video/3odRT6zdzqk/w-d-xo.html Hope it helps... Thanks for watching!

    • @LowEndStrings
      @LowEndStrings 7 ปีที่แล้ว

      Brainy-Bits thanks. I've just seen it :-) so in other words in this project here, the stepper motor won't home by itself? :-)

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

      In this one, the limit switches are only used to limit the movements of the stepper on either side, but you could add the code from that new video in the SETUP portion of the code, to set the HOME position by either using the left or right limit switch... Hope that makes sense :)

    • @LowEndStrings
      @LowEndStrings 7 ปีที่แล้ว

      Brainy-Bits alright nice! I might need to use this slider for a microphone instead of a camera. So it's important the stepper motor won't move after I turn it off :-) thanks again! Great channel, good quality stuff! :)

  • @KurioTechSphere
    @KurioTechSphere 4 ปีที่แล้ว

    I wants to control 2 stepper motor with joystick but i wants to control the speed of the motor with another knob can u plz help me its my project to do

  • @simonrydell5433
    @simonrydell5433 8 ปีที่แล้ว

    Hi!
    I have a problem with the vibrations in the motor. I think I have connected everything as described. But when I move my joystick the motor is really just shaking in the direction instead of a smooth spin. Is there an easy solution for this kind of problem?

  • @AP-nb7yq
    @AP-nb7yq 8 ปีที่แล้ว

    Hey!
    I'm really struggling about the smooth start and end of the stepper motor. So the start and the end should not be so abrupt. Do you know how to do that? Greetings from Austria!

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +Amar Pipic We have a new tutorial coming out tomorrow, where we will be using a library for acceleration and speed of the stepper. Thanks for watching!

    • @AP-nb7yq
      @AP-nb7yq 8 ปีที่แล้ว +1

      Thanks for the fast reply. Your tutorials are awesome :)

  • @aaronbarnes102
    @aaronbarnes102 7 ปีที่แล้ว

    Anyone have any insight on how to change the speed and torque in the sketch? This works great as a power feed on a mini mill. Except it won't turn the screw.....

    • @BrainybitsCanada
      @BrainybitsCanada  7 ปีที่แล้ว

      Hi Gary, I'm looking into it :) Will let you know. Thanks for watching btw.

  • @horstdieblume2
    @horstdieblume2 8 ปีที่แล้ว

    Are the endstops sending a HIGH when they are activated? If so, I don't understand why there is the else in this part of the code. I would think that it was correct without "else" or without !
    if(!digitalRead(Limit01)) {}
    else {
    digitalWrite(dir_pin,LOW); ....

    • @horstdieblume2
      @horstdieblume2 8 ปีที่แล้ว

      +horstdieblume2 got it. the endstops are sending a LOW when activated

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +horstdieblume2 You are correct :) When the code detects that a limit switch has been clicked or activated, it sets the dir_pin to LOW. Great that you figured it out. Thanks for watching!

  • @shirlyiang969
    @shirlyiang969 3 ปีที่แล้ว

    is the limit switch normaly closed?

  • @luciusmaximus524
    @luciusmaximus524 5 ปีที่แล้ว

    Hi, is it possible to put potentiometer to control the speed of the stepper motor ?

    • @victoramaya525
      @victoramaya525 5 ปีที่แล้ว

      yes it should be possible.

    • @luciusmaximus524
      @luciusmaximus524 5 ปีที่แล้ว

      @@victoramaya525 Yes, I know, but I don't know how to do... :)

  • @frobinson2413
    @frobinson2413 6 ปีที่แล้ว

    I am a total noob honest am just poking wires everywhere. I have never written code ever so I am learning still. If I wanted to add a y axis to your code do you just repeat what is there for the X axis but call it y? And if you don't want the limit switches can you just leave them out?

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

      I've made other videos abouth stepper motors, this one here is using 2 of them: th-cam.com/video/lvP5xMOstus/w-d-xo.html also check out the tutorials on my website brainy-bits.com to get more information like the code, library used etc... Hope that helps and thank you for watching!

    • @frobinson2413
      @frobinson2413 6 ปีที่แล้ว

      Brainy-Bits Thank you it makes sense, I think I need too learn some more. Your video's are really good thank you.

  • @martinnahuellarrosamaurer9481
    @martinnahuellarrosamaurer9481 6 ปีที่แล้ว

    I have a problem dude, my easy driver module get so hot in about 20 seconds, I'm using a 12v power supply.

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

      This is quite normal, but don't worry the driver chip has a temperature protection set at around 165 degrees Celsius, so it wont' burn out. You can also lower the current the Easy Driver provides to your stepper motor, which will make it run cooler. Turn the little Potentiometer that's on the ED to adjust it from 150mA to 750mA. Hope that helps! Thanks for watching btw :)

  • @vicozambrana3109
    @vicozambrana3109 8 ปีที่แล้ว

    HELLO FRIEND, YOUR PROJECT IS VERY GOOD.
    HE COULD PLEASE HELP WITH MY PROJECT ???
    I WANT TO ATTACH TO A SYSTEM RHEOSTAT YOUR PROJECT BUT NOT USE A DIGITAL OR Joystick POTENSIOMETRO. TO BE IN RHEOSTAT DESPLASE in 5 stages.

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +Victory Zambrana Hi, can you give me more information on your project? Do you have a link for the Rheostat you want to use? Thanks for the comment and watching!

  • @phon72able
    @phon72able 8 ปีที่แล้ว

    Please explain in the video did not really visible. You just do not limit switches allow the motor to move, or they stop the engine while driving?

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +Druid Once a Limit Switch is activated, it will prohibit the stepper motor from moving in that direction, doesn't matter if it's already moving or at rest. So if the motor is moving and the limit switch is activated then it will stop. If the motor is not moving and the limit switch is activated, then the motor will not move is that direction even if you push the joystick in that direction. Hope this helps! Thanks for watching!

    • @phon72able
      @phon72able 8 ปีที่แล้ว

      +Brainy-BitsMany thanks.

    • @BrainybitsCanada
      @BrainybitsCanada  8 ปีที่แล้ว

      +Druid You are welcome! Thanks again for watching!

    • @ToukoHelanen
      @ToukoHelanen 8 ปีที่แล้ว

      +Brainy-Bits Could the limit switches be used for bouncing the object back to the other direction automatically instead of stopping it?

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

      +Touko Helanen Great Idea, i will be really glad if you share solution of this

  • @worldwiderecordsinternatio9744
    @worldwiderecordsinternatio9744 3 ปีที่แล้ว

    is there an email we can get a respond back?

  • @rebelstudios9640
    @rebelstudios9640 7 ปีที่แล้ว

    are those joysticks out of the controller of a ps3?

    • @BrainybitsCanada
      @BrainybitsCanada  7 ปีที่แล้ว

      No these are Joystick modules made for testing ( brainy-bits.com/products/joystick-module ), they are easy to connect since they have headers. But a Sony or Xbox can work also but you would need to do some soldering. Thanks for watching!

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

      Well i tryed to get one out but you need to heat up all the pins and pull it off (at the same time) hahaha, its hell of a job!! since i just found out that the all the Arduino components are relatively cheap, i wont continue that struggle.

    • @OregonDARRYL
      @OregonDARRYL 6 ปีที่แล้ว

      Rebel, on Ebay, search for Arduino joystick...

  • @ShahramMeretiun-sm3sj
    @ShahramMeretiun-sm3sj ปีที่แล้ว

    Pl

  • @tvnsi8556
    @tvnsi8556 3 ปีที่แล้ว

    No code can be found on your web site. Not properly structured trainings

  • @emanuelcusto5524
    @emanuelcusto5524 4 ปีที่แล้ว

    Hi!! how can make the motor to go faster if the limit of the fastest speed is 1?? Cant go lower than that,right?