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!
38 Comments
8 months ago
any arduino will generate the necessary pulses instead of going back to the days of the 555
Reply 8 months ago
Yes, it can be done. I just wanted to try another approach of controlling a stepper motor that would not require any programming.
2 years ago
Hi,
I am building this project to motorize a video camera slider and I have some doubts:
on the speed only project there is a connection between pin 2 and pin 6 of the IC 555 but in the project of the speed + direction with 2 555 IC's that connection is not present on the schematic (see photo attached) is the schematic correct or should those pins from IC 1 also be connected in the speed + direction project?
Also I am going to change the standard micro switches switches to a couple of lever arm limit switches so that the slider can function in loop from one direction to another... this should work withou any modification to the circuit right?
thank you in advance for your help in this matter :)
Reply 2 years ago
Actually, pins 2 and 6 need to be connected in this project as well which is required to generate the pulse on the output of the 555 timer IC. I had added a note after the picture, but now it looks like I have to update the picture.
Talking about the limit switches, yes, you can use them so that when the motor bumps into a switch, its direction is changed and the motor starts to move back to bump into another switch and change its direction again.
All the best for the project build!
Reply 2 years ago
all the best
Reply 2 years ago
Great to know. Happy to help.
Reply 2 years ago
Hi, KushagraK7 so I did the project, unfortunatly I was not able to get it to work properly... I wonder if you can help me :) only one of the swiches is working and changes the direction but when it reverses the direction the motor acts erratically and sometimes goes back to the opposite direction... I have reviewed all the conections and everything checks... on your first project without direction you have the DIR pin of the connected to ground in this project the DIR pin is connected only to pin 3 of the second 555 IC shoult it also connected to ground as well as pin 3? also I'm using a A4988 stepper motor driver does the SLP and RST must be tied to +5V like someone refered in the comments? I only have them connected to each other like in your schem... if not what can it be? any idea why aren't both switches working? Can you help? Thank you
3 years 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.
Reply 3 years 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.
Reply 3 years ago
I meant connecting pins 2 and 6 of 555(1), without that connection 555(1) will not generate pulses.
Reply 2 years ago
Oh right, sorry. I had made the connections in TinkerCAD and it seems to have hidden the wire behind the IC.
Question 2 years 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
Answer 2 years ago
Here is the project in action:
You can find the circuit diagram here:
https://open.lbry.com/@TheMotorChannel:2/ButtonCon...
I hope this is what you were looking for.
Reply 2 years 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
Reply 2 years ago
I am glad you like it. All the best for the project!
Answer 2 years ago
This seems to be interesting. Please give me some time to figure out the circuit and I will let you know soon.
Reply 2 years 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 :)
Question 3 years 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?
Answer 3 years 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.
Reply 3 years ago
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: