Stepper Motor Speed and Direction Control Without a Microcontroller

23,246

157

30

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!

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

    • Clocks Speed Challenge

      Clocks Speed Challenge
    • Toys & Games Contest

      Toys & Games Contest
    • Big vs Small Challenge

      Big vs Small Challenge

    30 Comments

    1
    kjmdes
    kjmdes

    Question 5 weeks ago on Introduction

    This looks to be close to what I'm trying to build.
    I want to control let's say a drawer. Using a very simple circuit.
    You push a button, the drawer opens till it hits a limit switch. Push it again, and the drawer closes and stops when it hits another limit switch.
    I've looked all over trying to find a circuit to do this. But being a novice, I'm not able to logic out the required circuit.
    The drawer will require a nema 23 for the required force. I will drive a leadscrew. Speed should be around 75mm/sec. 12vdc supply.
    I believe this is a fairly common desire for many of us. The applications are many. But as i said, I've yet to see an instructable. At least one that doesn't use a micro controller.
    Any help would be greatly appreciated.
    Thanks so much
    Kevin

    1
    kjmdes
    kjmdes

    Reply 4 weeks ago

    Fantastic. Exactly as needed. Thank you so much for the effort.
    I'll build one and install and post back in about a month.
    Cheers
    Kevin

    0
    KushagraK7
    KushagraK7

    Reply 4 weeks ago

    I am glad you like it. All the best for the project!

    0
    KushagraK7
    KushagraK7

    Answer 5 weeks ago

    This seems to be interesting. Please give me some time to figure out the circuit and I will let you know soon.

    1
    kjmdes
    kjmdes

    Reply 5 weeks ago

    Great. My background is mechanical R&D. I can help with application if anyone needs it.
    Just an FWI. This will be used to extend and retract a sink in the head of my sailboat. It stows out of the way to gain access to the toilet.
    I'm thinking it has many drawer type applications for the disabled. Sort of why I'm doing it myself. I live aboard and have arthritis. Just manipulating the stock system is painful. So a little pain to build it, will save a lot of pain down the road :)

    0
    Explos
    Explos

    Question 11 months 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 11 months 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.

    1
    Explos
    Explos

    Reply 11 months ago

    Hi OP, thanks for responding,
    I just want to say I love this circuit, it's simple and does exactly as needed.

    It occurs in either direction and it's always the same spot on the pot. It's literally a matter of 2-3 degrees or so. It happens with another controller as well. Changing motors is not possible. I only have one I'm afraid. It came with it's own cable so getting the windings mixed up is not possible.

    As for the direction randomness on power-up, I can hold in one of the switches to guarantee the direction, alternatively a 3 pin toggle switch can be used instead of push buttons. Still, it would be nice to have a default start direction.

    According to the internet, it seems I have resonance problems with the frequency of the motor. Follow this link: https://www.cnczone.com/forums/stepper-motors-drives/354410-steppers-stall-oscillate-low-feed-rate-high.html. WARNING. They get edgy.

    The motor is a NEMA17 Stepper Motor 34mm. Step Angle:1.8° (200 Steps/Rev) 0.3nm Holding Torque, 1,33A/Phase.

    Additional Motor info:
    • Step Angle(deg) : 1.8
    • Motor Size(mm) : 42X34(Height)
    • Rated Current(A) : 1.33
    • Phase Resistance(Ohm) : 2.1
    • Phase Inductance(mH) : 2.5
    • Holding Torque(N.cm) : 30
    • Detent Torque(N.cm) : 1.6
    • Rotor Inertia(g.cm2) : 35
    • Lead Wire(No) : 4
    • Lead Length : 30cm
    • Motor Weight(g) : 220
    0
    andy35
    andy35

    Question 1 year 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 1 year ago

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

    0
    andy35
    andy35

    Reply 1 year 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 1 year 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 1 year ago

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

    0
    KushagraK7
    KushagraK7

    Reply 1 year ago

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

    0
    KushagraK7
    KushagraK7

    Answer 1 year 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 1 year 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

    1 year 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 1 year 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 1 year ago

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