Stepper Motor Speed and Direction Control Without a Microcontroller

18,951

152

23

Introduction: Stepper Motor Speed and Direction Control Without a Microcontroller

In one of my previous Instructables, I showed you how to control a stepper motor's speed using a 555 timer. This project is an upgrade of that one and you will get to know how to control the motor's direction using another 555 timer IC. So, without any further ado, let's get started!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Get All the Stuff!

Here is what you will need:

  • An A4988 stepper motor driver
  • 2 555 timer ICs
  • A prototype breadboard
  • A 12-volt power supply
  • A 5-volt power supply(Conversely, you can also use a voltage regulator with 5-volt output such as an LC805CV)
  • A 1kΩ resistor
  • 2 10kΩ resistors
  • 3 LEDs(Optional)
  • 3 330Ω resistors(Optional, for the LEDs)
  • A capacitor(0.3uF to 10uF, try experimenting with different capacitors in this range. Capacitors above this range will cause the stepper motor to move very slowly and ones below the range will not allow the motor to move at all. Make sure the capacitors are rated for voltages above 10 volts.)
  • A 100kΩ potentiometer
  • 2 push-buttons(normally open ones)
  • A lot of male to male jumper wires

Step 2: Start by Plugging on the A4988 Motor Driver on the Breadboard

After plugging on the motor driver, connect the VDD(or VCC) pin to +5vols, GND to, obviously GND and, VMOT to 12 volts. Don't forget to connect the SLP and RST pins together! I used a small jumper for that.

Step 3: Get Help From the Circuit Schematic

Please note:- For the IC(1), the pin6 needs to be connected to pin 2 of the chip.

Please move to the next step before starting making the circuit.

Step 4: Wire Up and Test the Speed Controller

Set up and wire only the speed controller. Connect the DIR pin of the motor driver to either GND or +5 volts while testing. Power up your circuit and check whether it is working properly. If there is any problem, the troubleshooting will be easier than it would be after wiring the direction controller.

Step 5: Wire Up and Test the Direction Controller

Step 6: It's DONE!

I hope you enjoyed making this project. I would like to see your what you built. Suggestions are welcome!

Be the First to Share

    Recommendations

    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020

    23 Discussions

    0
    Explos
    Explos

    Question 15 hours ago

    While manipulating the pot, I get a specific spot with the pot where the motor rapidly rattles back and forth until I increase or decrease the pot. I have tried 50k, 100k and 220k pots with different caps, .22uf, 1uf and 10 uf. The problem persists in any configuration. Also, sometimes when first powering up the system, the direction of rotation is random. Any idea how to correct these issues?

    0
    KushagraK7
    KushagraK7

    Answer 10 hours ago

    Please check the following:
    Does that spot occur while speeding up or slowing down the motor?
    Which type of motor is being used?
    Try doing these:
    Check if the motor's wiring connections are correct or not. It could be possible that the stepper motor's wires are not connected in a correct sequence, try changing the sequence of wires connecting the motor and the driver.
    Try using another stepper motor and/or motor driver.

    0
    andy35
    andy35

    Question 4 months ago

    Looking forward to building this and I've noticed that the 'speed only' controller Instructable said unipolar or bipolar stepper motors were OK so is that the case for this one? If so, I have a load of 28BYJ-28s and do I just not connect the red wire or do I need to dismantle and cut the trace as Ardunio projects tend to do? Many thanks

    0
    andy35
    andy35

    Answer 4 months ago

    I have just seen they are about £10 each and I need four so will look at another solution...

    0
    andy35
    andy35

    Reply 4 months ago

    Found some much cheaper on eBay, all back on track. Thank you again. However, isn’t the voltage regulator only allowing 5v into the circuit anyway? Sorry for all the questions

    0
    KushagraK7
    KushagraK7

    Reply 4 months ago

    The voltage regulator supplies 5-volts for the logic circuit of the motor driver and the 555 timer IC. The A4988 driver IC requires at least 8 volts for driving the stepper motor at the 'VMOT' pin.

    0
    andy35
    andy35

    Reply 4 months ago

    Hello, the TMC2208 drivers have just arrived so I'm back at it. thanks again

    0
    KushagraK7
    KushagraK7

    Reply 4 months ago

    You can try Aliexpress to get the TMC2208 stepper motor drivers for low price.

    0
    KushagraK7
    KushagraK7

    Answer 4 months ago

    You can go ahead without modifying the stepper motor and ignoring the center tap(red) wire. Cutting the trace converts the unipolar stepper into bipolar which has greater torque. If you want more torque out of your motor, you can cut the trace but leaving it as it is will not affect the normal operation of the stepper motor.
    Also, make sure that the stepper motors you are using a rated for 12 volts and not 5! A4988 stepper driver can't reach lower than 8 volts, so don't use low voltage stepper motors with it.
    If you want a motor driver similar to the A4988 which can run 5-volt steppers, check out the TMC 2208(https://www.digikey.in/product-detail/en/trinamic-motion-control-gmbh/TMC2208-SILENTSTEPSTICK/1460-1201-ND/6873626).
    I hope this helps.

    0
    andy35
    andy35

    Reply 4 months ago

    Fantastic, thank you! However, they are 5v steppers so will look at the alternative drivers... The torque is fine as I’m only driving a cassette tape

    1
    DirkFG
    DirkFG

    5 months ago

    Connection pin 2 and 6 is missing on the wiring diagram, it can't work without it. 8825 works OK with 100uF cap on motor power and ground right next to the pins. SLP and RST must be tied to +5V.

    0
    KushagraK7
    KushagraK7

    Reply 5 months ago

    Since there is an internal pull-up resistor connected between +5-volts and the RST pin of the A4988 motor driver module, connecting the SLP pin to the RST pin is sufficient to let the driver work. But in the case of the DRV8825, the SLP and RST pins need to be connected to +5-volts.

    1
    DirkFG
    DirkFG

    Reply 5 months ago

    I meant connecting pins 2 and 6 of 555(1), without that connection 555(1) will not generate pulses.

    0
    axelaxel705
    axelaxel705

    Question 8 months ago

    Los componentes son los mismo si uso un DRV8825??? y hay alguna forma de que solo avance y retroceda cuando aprete los pulsadores? y tambien, los pulsos estan predeterminados para 1/32?

    0
    KushagraK7
    KushagraK7

    Reply 8 months ago

    The DRV8825 can be connected in the place of an A4988 motor driver board but there are some differences. You can go in two ways:
    1st way: There is no need to connect +5-volt power to the DRV8825 because that pin doesn't exist on the board, it manages its logic power supply on its own. But you will need to connect the SLP and RST pins together to +5-volt power.
    2nd way: You can simply get away with the same pin connections as done with an A4988 driver. The DRV8825 has a FAULT pin in place for the '+5-volt power in' pin of the A4988 board which is safe to be connected to +5-volt power.

    You can learn more about the differences here:
    http://qqtrading.com.my/blog/key-differences-between-the-drv8825-and-a4988

    I guess the circuit needs to be modified a bit to make the motor run only when we press the direction buttons. That can be a good future project!

    Finally, these motor driver boards have their stepping pulses predetermined for 1 step pulse. The can be changed upto 1/16 in A4988 and 1/32 in DRV8825 drivers by connecting the pins M0, M1, and M2 to +5-volt in some combinations. You can learn more here:
    https://lastminuteengineers.com/drv8825-stepper-motor-driver-arduino-tutorial/

    I hope this helped. All the best for the project build!

    1
    mikey51
    mikey51

    1 year ago

    You may be able to d it with two single pole double throw switches like are used to turn lights on and off from two ends of a hallway.

    0
    KushagraK7
    KushagraK7

    Reply 1 year ago

    Absolutely correct. But, in my project, I wanted to push buttons instead of flicking switches.

    0
    AlexE2
    AlexE2

    Reply 1 year ago

    The problem I have is to invert the current so the motor can change in two directions.

    0
    AlexE2
    AlexE2

    Question 1 year ago

    I will like to ask you if you can explain how to change direction for a 12V DC motor that I will use to open and close a door. The motor has to run in one direction when pressing a button and stop when door is completely open, then run in opposite direction and stop when door is completely closed when pressing another button, or same button. I cannot solve that problem :(

    0
    steveastrouk
    steveastrouk

    Answer 1 year ago

    Here's an old circuit that I did that uses relays.Where I use a changeover switch at the bottom, that can be two separate pushbuttons.

    Hen door.jpg