Arduino to control stepper motor angle in real time with a dial and display feedback

I would like a simple program to rotate 2 4-wire Nema 17 stepper motors independently using 1 or 2 Arduino's, preferably 1, as follows:

Using a dial I would like to be able to change the angle of each stepper motor by 1 degree at a time in either direction and see what the angle is on a display. For stepper 1 the degrees would start from 0 (so plus or minus 1 depending on which way I turn the dial). For stepper 2 the degrees would start from 5). Those numbers could be anything and I chose them because those reference points that make it easier for me to do my testing.

I have the Arduino's and breadboards but would need the program and know what other hardware to buy. Please reply if you can create this program and what it would cost.

It is very difficult to find steppers with 1 degree steps, even with gearboxes. Do your shopping before deciding on the details.

the Arduino's and breadboards

Breadboards are for temporary experiments with low power logic circuitry and cannot be used for power connections to motors, servos or steppers. The tracks will burn.

Really? I did my shopping and already have the steppers and I already wrote an arduino program that rotates them either 1 step, 1/4 step, 1/2 step, etc each direction. Integral to a stepper is being able to do that. I just don't know how to write a program and what parts to by to rotate them as I turn a dial.

Really? That's exactly what I've been doing and what many I see on youtube and websites do. I have been doing it for months. Nothing burned. Works perfectly. Here is just one of numerous examples:

No offense, but it seems you are confused about what stepper motors do and what an arduino can do.

This forum is littered with posts by people who burned their breadboards following the same youtube and Instructable tutorials, which is why we don't recommend them.

Please post a link to the 360 step per revolution motor you found.

Have fun with your projects!

Please explain how you get exact 1.00 degree movement increments with a 200 step per rev stepper motor.

thank you!

Hasn't happened to me in a year.

And thank you I have had fun.

I can't. I just realized I made a typo. English is not my first language. I mean 'a' degree of movement, not exactly 1 degree. So, for example if one used micro-stepping a 1/2 step would be 1.8 deg, 1/4 step 0.9 and so on.

It will.

Can you post data sheets for the motor(s) and motor drivers, please?

What is connected to the dial(s)? A potentiometer, a rotary encoder?

Is it important to establish a starting position for each motor (homing)?

One Arduino can run many stepper motors. There is likely no need for multiple Arduinos.

What sort of display? Serial monitor on the PC, LCD, ... ?

Thanks for your help. Much appreciated.

Hi @eng401,

Welcome to the forum..

Do you mean something like this??
Encoder Controlled Motors

good luck.. ~q

Thank you. I didn't have any potentiometer or rotary encoder connected as that's what I want someone else to design for me. I have no idea about those devices.. I just learned some Arduino programming to spin the motors using Arduino, power supply and a breadboard along with driver chips.

I used a DRV8825 for each hybrid stepper motor (data sheet attached, has 4 wires), located on a breadboard, along with a power supply. I had no problem rotating them.

Yes that would be the idea. I would want to have a dial to control each stepper independently of eachother and also I would want to be able to move a step or 1/2 step at a time, likely a step for one of them each time I turns the dial 1 detent and a 1/2 step for the other one each detent of the dial.

Actually the spurred me on to find something similar on the net. This video shows someone at 11:07 doing exactly what I want to do. Turn a dial and turn the stepper one step as defined in the code. He just doesn't have a display attached to know how many steps he rotated.

[Control a Stepper Motor using an Arduino and a Rotary Encoder - Tutorial - Part 1

There's hundreds of videos and tutorials on the net showing people using stepper with Arduino. I am supposed to believe @jremington when he says they are all at risk of burning their breadboards? Funny I have never seen or heard of a single instance of it. I thought the whole idea behind Arduino was to be able to control motors using breadboards and the like. What am I missing here?

added another encoder to the sim for you..
now each motor has it's own control..

good luck.. ~q

Wow, thanks. Would I be able to turn just one step at a time using each encoder? Also, would both settings show on the display at the same time?

each encoder currently increments and decrements its motor position by 1 and displays any change to either motor instantly..
starting positions are defined and can be changed..
displaying degrees instead of raw position, step display would be easier..
should give you a good starting point anyways.. :slight_smile:

have fun.. ~q

Unfortunately I would not know where even to start with that, where to get the encoders or screen etc. I was hoping to pay someone to do it all for me and hold my hand.

EDIT: I found where to get the encoders.

Now for the display.

motors can require quite a bit of current, motor power lines should be direct to supply..
cheap breadboards won't continuously handle a heavy current load, it will get hot and potentially melt..
so, yes.. be careful always..

good luck.. ~q

Thanks, and yes I have been powering the steppers separately, not through breadboard.

Is there any way to make it so that when the encoder is pushed down the stepper goes back to the starting position?