A4988 Stepper Motor Controller - Arduino & NodeMCU

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 มิ.ย. 2024
  • In this video we will go over how to use the A4988 Stepper Motor Controller with Arduino UNO and NodeMCU. We will learn about the basics of the A4988, how to use the microstepping function of the A4988, how to set the current limit to avoid exceeding your motor current limit, how to connect to Arduino and NodeMCU, and we will go over several examples.
    Related Blog Post:
    www.diyengineers.com/2022/05/...
    Items used in this video (affiliate links):
    *As an Amazon Associate I earn from qualifying purchases.
    A4988 Stepper Motor Controller
    amzn.to/3Jtsu1h
    Arduino UNO
    amzn.to/3U7xAoT
    NodeMCU
    amzn.to/3wdcFbU
    NEMA 14 - 14HS10-0404S Stepper Motor
    amzn.to/4aKwQgD
    Breadboard (Elenco 9440)
    amzn.to/4b5Onzq
    Amprobe AM-510 Multimeter:
    amzn.to/44gy2WE
    Amprobe TL35B Test Leads with Alligator Clips
    amzn.to/3Utf8s0
    Intro: 0:00
    A4988 Module Pins 3:01
    Setting current limit on A4988 7:49
    Connecting A4988 to Arduino UNO 11:03
    Connecting A4988 to NodeMCU 13:09
    Installing A4988 Arduino Library 14:28
    A4988 Examples with Arduino 15:33
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @DennisMurphey
    @DennisMurphey 5 หลายเดือนก่อน +4

    I came back to report I watched all the videos you have on Steppers and have finally completed my design for a Mini MIll. I used a Dremel Drill Press and MicroLux X Y Table, Arduino, CNC Shield, A4988 driver, and Old 3D Printer Steppers, -plus 3D Printed adapters. Oh and UGC to get my shapes to G code and GRBL to run the Arduino. Just yesterday I got it all assembled and operational for jogging the axis. Last night I design a slot cavity I need in my Model Train Engine Chassis for more Digital Tech. Today I plan to cut out the shape in a piece of wood. All your videos were helpful and encouraging me to keep going. Tools have emerged in the last years that help us hobbyist to build useful and required tools for our hobby. I have wanted a CNC Mill for 50 Years. No it is not a full size Bridgeport but its mine and I make it and it will do exactly what I need. Thank You so much When i cut the shape in wood I will send you the You Tube video link. Thank You So Much, Dennis

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

      th-cam.com/video/zXT_pcRUGxU/w-d-xo.html

  • @LUSEJA
    @LUSEJA ปีที่แล้ว

    dude.. you are THE ONE!!!

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

    Nice video, i have one question, where did you do your squematic?

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

    It worked. I love you bro

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

      Glad I could help

  • @dr.robbackstein2348
    @dr.robbackstein2348 ปีที่แล้ว +1

    Hi again. My understanding is that a stepper motor needs to be accelerated up to the desired RPM. For example, the AccelStepper library has a setacceleration function. Does the library used in your video do this automatically?

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

    Amazing❤

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

    Interesting video but at time stamp 7:30 I think you've labeled 1A and 1B in the wrong positions (looking at the board labels). One question, should you have the stepper motor connected or disconnected when adjusting the voltage? I watched a different video in which he says it has to be connected otherwise you'll burn out the driver (which didn't happen with yours). Thank you for the informationl video.

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

    Hope you all enjoy this video! Let me know if you have any suggestions for future projects / examples you would like to see 😀

    • @symontorres3952
      @symontorres3952 2 ปีที่แล้ว

      Does it heat up easily?

    • @symontorres3952
      @symontorres3952 2 ปีที่แล้ว

      If not what V and amp should i use as a power supply

    • @diyengineers
      @diyengineers  2 ปีที่แล้ว

      @@symontorres3952 Stepper motors do heat up easily due to the nature of the stepper motor operation (stepper motor drive is supply current to keep the motor at the target position, even if not rotating). Options to stop from getting excessively hot are using the sleep command/pin (okay if motor is not in use at the time and holding an exact stationary position is not critical). The other option is to make use of heat sinks and fans as needed. You might notice that some 3D printers use a heat sinks + fans to cool the stepper motor that takes care of the extrusion. The other 3D printer stepper motors sent to be fixed to a large metal frame that can act as a heat sink absorbing a large amount of the motor's heat.

    • @diyengineers
      @diyengineers  2 ปีที่แล้ว

      @@symontorres3952 The V of the power supply should match the motor voltage requirement and should not exceed the driver/system voltage limit. The current capacity of the supply should exceed what's needed by the motor, but the motor current should not exceed the driver's limit or the limit of the rest of the system.

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

      Can this be used with relays so you can use a larger stepper motor ?

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

    Thank You‼️ (November-23 from Norway) I just got my first steppers to play with, and this is big help 😊
    BUT - one important detail I do not think is correct in the video. You say "since it is a 12V motor, you choose 12V on VMOT".
    I have a low voltage stepper (3,8V), but I can still use connect 8V-35V on VMOT. The driver will regulate the CURRENT to the motor so that it will not be overpowered anyway.
    The motor's voltage is not really relevant, unless you have a •direct• connection from power source to the motor •without• a driver inbetween.
    (Sorry for bad explanation… for anyone interested.. google the subject for better explanation)

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

      I think it's less likely to miss steps if the voltage is higher.

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

    Absolutely Brilliant. Thank you so very very much. Can't say it enough. Thank you... Thank you.

  • @fin3125
    @fin3125 ปีที่แล้ว

    Everyone shows the Sleep connected to the Reset. What is if I want to use the Sleep pin? I want to use this on shades.

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

    There appears to be several methods to calculate V ref. Where did you get this instruction? My motors are jerky so I know something is wrong. Using CNC Shield with Uno so I will search that Shield exactly, with 4AA4988. Thanks you speak clearly and show good demos to support the lecture. Dennis

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

      Upgrade your controller to grbl 1.1f to stop the steppers buzzing or jerking.

  • @sadanandnayak4638
    @sadanandnayak4638 ปีที่แล้ว

    Any idea how to control the motor using Blynk with NodeMCU?

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

    Is it true that you should not connect a4988/drv8255 to step motor while adjusting the current?

  • @derrickharvey451
    @derrickharvey451 ปีที่แล้ว

    Hi how are you thanks for the tutorial I have a question can you connect two motor drivers to the same single Arduino Uno that you applied in your tutorial thank you have a nice day

    • @diyengineers
      @diyengineers  ปีที่แล้ว

      Hi, yes you can. You could even use an Arduino UNO CNC Shield and not use the GRLB software but simply reference the appropriate pins on the arduino and use regular Arduino code. This would allow you to control up to 4 A4988 drivers from one Arduino UNO. Thanks for watching.

  • @dr.robbackstein2348
    @dr.robbackstein2348 2 ปีที่แล้ว +1

    Hi. Nice video. Can you tell me how change the stepper RPM to different values at different points in the sketch?

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

      Hi, thanks for watching! Use keyword "setRPM" to set the RPM. You might also want to check out one of the examples that comes with the library: "SpeedProfile". To get to it go to Files -> Examples -> Find the Library (StepperDriver) -> then select the example "SpeedProfile" or any other example.

    • @dr.robbackstein2348
      @dr.robbackstein2348 2 ปีที่แล้ว +1

      @@diyengineers Awesome, thank you.

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

      @@dr.robbackstein2348 No problem!

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

    if you use Vmot and Vlogic from the same supply there is a problem called BACK EMF that will destroy the logic elements,always use a seperate power supply for the VMotor and insure their is a big capicator across to supply lines. yes I know there is one on the board but you need to insere another one for safety.

  • @daveyhom1526
    @daveyhom1526 2 ปีที่แล้ว

    Thanks for the video! I had a question... for my project, I am trying to drive 4 stepper motors at the same time, what do you think would be the best way to go about that?

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

      Hi Davey! Thanks for watching. Would all motors move the exact same way, meaning you want them to all move them same way all the time? Or do you want them to move independent from one another?

    • @daveyhom1526
      @daveyhom1526 2 ปีที่แล้ว

      @@diyengineers all the same time and in the same direction!

    • @diyengineers
      @diyengineers  2 ปีที่แล้ว

      I haven't done that myself, but I recommend reading the following: electronics.stackexchange.com/questions/127116/can-i-control-multiple-stepper-motor-drivers-from-one-controller
      Good luck!

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

    VREF ​= I​ x 8 x Rsense?
    The red A4988 has 2 resistors ranging from 0.05 up to 0.2 Ω.
    If you have for example 0.1Ω shouldn't vRef be 0,4x8x0,1? 0,32V?

  • @tanaraj4396
    @tanaraj4396 27 วันที่ผ่านมา

    can i get coding to control direction using push button

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

    can we also run 24 v thought the driver for the motor?

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

    Hi there, I want to run a stepper motor rated for 2A current, other than the heat sink it comes with what specific cooling precautions should I take? Or should I return this driver for a different type?

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

      a device rated for x amps may not require the max x amps to work ,I learned in school that if you are running a device at more than 2/3 of its max rating than you need a different device example a resistor has a max current rating of 10 amps and the circuit pulls normally pulls 7 amps than the peak could be over the amperage rating of 10 amps so to be on the safe side you need a bigger resistor.

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

    Hey i have a question. I am tring this on a elegoo 2560 `arduino, but when i wire it and uploud the code, the motor engages, but will not move. Do you know a posible solution for this? Also great video

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

      you should always use a sepoerate power supply for the Vm(motor powe) and in you situation the motor is not getting enough power eithe in amps or voltage or both.

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

    hi I have a strange problem here, I set things up as explained and the motor start rotating but stops randomly. sometimes it will stop after few rotation, another time it will stop few times per revolution. It can stop for a sport fraction of a second or be blocked for few seconds. I've been using different motors and A4988 controllers but keep getting same problem. Any idea where to look for the root cause of the issue ?

  • @LUSEJA
    @LUSEJA ปีที่แล้ว

    Is it possible to create a code that makes the speed upward? I mean that instead of going from 0 to 1, go from 0 to 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 and Velmax 1?? Thank you

    • @diyengineers
      @diyengineers  ปีที่แล้ว

      You can define the acceleration and max speed.

  • @henning7378
    @henning7378 ปีที่แล้ว

    does it matter if its pwm or normal digital pin? do i need pwms for the microstepping pins?

  • @ahsantahir6624
    @ahsantahir6624 2 ปีที่แล้ว

    I have to use TM4C123 instead of Arduino. Hope it works out.

    • @diyengineers
      @diyengineers  2 ปีที่แล้ว

      Thanks for watching. Good luck!

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

    Can I use 12v 10amp power supply for a4988 drive?

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

    Hey where did you make the wiring diagrams?

    • @Drunken.Sailor
      @Drunken.Sailor 7 หลายเดือนก่อน

      Looks like Fritzing.

  • @qnaman
    @qnaman 17 วันที่ผ่านมา

    so many pins for single steepper motor. How to amke robotic arm with arduino?!?!?!

  • @user-cb4dl8it7f
    @user-cb4dl8it7f ปีที่แล้ว

    Can i use nema 23?

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

      Yes, as long as within the electrical rating of the controller.

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

    V = I / R? How?

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

    For NEMA 23 Stepper Motor and above ,that is working under high load ,A4988 Driver is not applicable, Instead use TB6600 driver .

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

    Step pin must go from low to high to low for the motor to step ,DIR pin (direction) controlls weather the motor moves forward or reverse. you really need to look at the internal wiring diagram of the motor to understand how it works your labels are wrong the motor has 2 sets of coils group 1 and group 2 ,the start of group 1 is1A and the end of group 1 coil is 1B. The same for coil 2 and the wiring for each coil must be wired correctly the start of group 1 and group 2 coils is know as 1A and !B and the end of the coils must be 1B and 2B if these are mixed up the motor will do all kinds of crazy stuff example motor will move 1 step forward and 2 steps backward when commanded to move forward 1 step or it might do the reverse 2 steps backward and 1 step forward and it will be impossible to control.

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

    No need to connect Reset and MS1 MS2 MS3 to Arduino