How to control speed of Stepper motor by potentiometer + arduino + A4988 Tutorial

  • Hello friends,

In this tutorial we will learn how to run and control speed of Stepper motor using Arduino, A4988 driver IC and Potentiometer.

You can watch the following video or you can continue to read this post for complete tutorial.

 

OVERVIEW

A4988 is a Microstepping driver IC to control bipolar stepper motors, A4988 Driver is so easy to use because it needs only two control pin from microcontoller to control steps and direction of stepper motor.  we can configure A4988 IC for full step, half step, quarter step, eight step & sixteen steps,

 

PIN DETAILS OF A4988 DRIVER IC

A4988 DRIVER IC PIN DETAIL
A4988 DRIVER IC PIN DETAIL
  1. ENABLE :- Enable pin is used to enable and disable stepper motors, like in some applications if you don’t need to engage motors while in rest position means you don’t need holding torque, so we just disable steppers during this rest position and enable them again when it required, in this why motors will not draw current in holding position and and heating of motor avoids. it is not always compulsory to used this pin. Enable pin is low motors are enable, Enable pin is high motors are disable.
  2. MS1, MS2, MS3 :- This pins are used to configure Microstepping study below table to get idea how to configure required micostepping.
    A4988 Microstepping table
    A4988 Microstepping table

     

  3. RESET :- Turn off all the FET outputs till when reset pin is high all steps are ignored.
  4. SLEEP :- When set low minimize the power consumption and and A4988 went in sleep mode.
  5. STEP :- Step pin connected with digital pin of microcontroller to run stepper motor as per the numbers of step signals from microcontroller, speed of stepper motor depends upon the the frequency of step signal more the delay in step signal lower the RPM & vice versa. step signal delay is universally prepositional to the speed of stepper motor.
  6. DIR :- Direction pin set high or low to run stepper motor in either direction.
  7. V MOT :-  Power supply for Motors (8-35V DC).
  8. GND :-  System ground.
  9. 1A,1B,2A,2B :- Connection pin for motor connection.
  10. VDD :- Logic power supply (3V – 5.5V).
  11. GND :-  System ground.

Basic wiring drawing to run Stepper motor

Following is the arduino code to run stepper motor one step in forward direction and one step in reverse direction.

Wiring drawing to control speed of Stepper motor with potentiometer

Following is the code to control speed of stepper motor by using 10k ohm potentiometer

 

Low cost PCB on PCBWay - only $5 for 10 PCBs and FREE first order for new members

PCB Assembly service starts from $88 with Free shipping all around world + Free stencil 

PCBWay 2nd PCB Design Contest

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *