A4988 Stepper Motor Controller - Arduino & NodeMCU

Поділитися
Вставка
  • Опубліковано 27 тра 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 4 місяці тому +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 4 місяці тому

      ua-cam.com/video/zXT_pcRUGxU/v-deo.html

  • @juanjosepardopalomino5398
    @juanjosepardopalomino5398 Рік тому +1

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

  • @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?

  • @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.

  • @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.

  • @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.

  • @sadanandnayak4638
    @sadanandnayak4638 Рік тому

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

  • @davidpopatnig8527
    @davidpopatnig8527 9 місяців тому

    It worked. I love you bro

  • @LUSEJA
    @LUSEJA Рік тому

    dude.. you are THE ONE!!!

  • @jumbo999614
    @jumbo999614 5 місяців тому

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

  • @walterhynson2898
    @walterhynson2898 3 місяці тому

    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.

  • @DennisMurphey
    @DennisMurphey 4 місяці тому +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 2 місяці тому

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

  • @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.

  • @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!

  • @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 ?

  • @kaiserclawify
    @kaiserclawify 10 місяців тому

    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?

  • @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 ?

  • @electro7939
    @electro7939 Рік тому +1

    Amazing❤

  • @christianmurray4132
    @christianmurray4132 8 місяців тому

    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 3 місяці тому

      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.

  • @tanaraj4396
    @tanaraj4396 14 днів тому

    can i get coding to control direction using push button

  • @dr.robbackstein2348
    @dr.robbackstein2348 Рік тому +1

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

    • @diyengineers
      @diyengineers  Рік тому +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 Рік тому +1

      @@diyengineers Awesome, thank you.

    • @diyengineers
      @diyengineers  Рік тому +1

      @@dr.robbackstein2348 No problem!

  • @bracesport
    @bracesport Місяць тому

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

  • @mastersullivan
    @mastersullivan Рік тому +1

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

  • @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 3 місяці тому

      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.

  • @henning7378
    @henning7378 Рік тому

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

  • @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.

  • @qnaman
    @qnaman 4 дні тому

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

  • @jerrytpl
    @jerrytpl 7 місяців тому

    Hey where did you make the wiring diagrams?

  • @saptarathiroy8397
    @saptarathiroy8397 11 місяців тому

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

  • @ahsantahir6624
    @ahsantahir6624 2 роки тому

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

  • @user-cb4dl8it7f
    @user-cb4dl8it7f Рік тому

    Can i use nema 23?

    • @diyengineers
      @diyengineers  Рік тому +1

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

  • @walterhynson2898
    @walterhynson2898 3 місяці тому +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.

  • @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 .

  • @ehabahmedyassen
    @ehabahmedyassen Рік тому +2

    V = I / R? How?

  • @felixavshalom2015
    @felixavshalom2015 27 днів тому

    No need to connect Reset and MS1 MS2 MS3 to Arduino