Introduction: Arduino : How to Control a Stepper Motor With Potentiometer

This instructable is the written version of my "Arduino : How To Control a Stepper Motor with Potentiometer" YouTube video that I've uploaded recently. I strongly recommend you to check it out.

My YouTube Channel

First, you should see the following Instructable:

How to Control a Stepper Motor With L293D Motor Driver

Step 1: Tutorial

This tutorial is all about tuning the speed of a stepper motor using a potentiometer. The idea is to up or down the speed of a stepper motor using with analog read. Theoretically analog input to a digital output, we're going to use this concept to control the speed of a running stepper motor.

Step 2: Hardware Required

Hardware Required :

- 10k Potentiometer

Step 3: Circuit & Connections

The Stepper motor used here is a rusty old EPOCH (5 wires) stepper motor, which is a unipolar stepper.

Use the analog input with the help potentiometer to control the delay in-between each steps of the stepper motor. Shorter the delay in-between each steps - faster the stepper motor runs and vice-versa.

Step 4: Programming

Step 5: If I Was Helpful

First of all, I would like to thank you for reading this guide ! I hope it helps you.

If you want to support me, you can subscribe my channel and watch my videos.

My YouTube Channel

Comments

author
georgegeorge01 made it! (author)2016-10-17

how much the program

author
KISELIN made it! (author)2016-10-09

I've been "migrated" for some time now of them steppermotor's actually work's? That I know that they go on steps of two, via an H-bridge, (or ewen a half-H-bridge). Nothing about how to actuate them, no. But in the "deep.. deep beyound", don't YOU need a feedback of it's accurate position, (actually after ewery "click"?).

Usually they use a microswitch in both "home" and "end" position's and then calculate the "relative" position by counting the number of pulses sent?

There's many ways to owercome this "dumb" way of control. A Pot-feedback, works but not good enough. An optical, (IR-tranceiver), good enough for "most" feedback, Gray-code coders, (they actually are 100% mechanically, even they are sold in a form of a potentionmeter, check it out on Goo). There's (for real) them 16-bit and higher Gray-coders. Imagine: to get a feedback of a steppermotor making 1 step and the feedback will tell you that, easy to keep the count. Me, a newbe with Arduino, made a routine from my previous project's written in Assambler, and translated it to c++, Java, I'll DIY it later on, timegenerator using the benefit of a prosessor genereting both a microsecond and a millisecond to be read during your process of something. The downside with these functions is that the normal command for them is: "delay(xx)", and thats exactly what it does, it actually "halt's" the execution of your program for the delay time, (nothing else happends during that delay). So, back to stepper's, if you use my timegenerator you'll get a timewindow of a millisecond to be totally controlled, (You can make this timewindow to be 1 microsecond, but really??). This my timer is "dynamic", that is because the processor itself generates a "timer-interrupt internally" and executes that, my timer "just" reads the result of that. After that it's a peace of cake to multiply that 1 millisecond to whatewer. Again, back to steppers, you can use them cheep 2-bit Graycoders to be fedbacker's, could write a whole book on object.

author
flyingfarm made it! (author)flyingfarm2016-10-14

Hi Kiselin. You have some good insight into stepper motor powered devices. Most of the stepper motor devices I am familiar with are open loop control. With open loop you send the signal to the stepper and hope it does what it is supposed too. Closed loop systems require feedback of what actually happened. Closed loop systems are a lot harder to implement.

author
KISELIN made it! (author)KISELIN2016-10-14

Thank You for your comment. I'll later on making a DIY-feedback solution, with a Gray-coder. I try to do it with a low-cost 2- or 4-bitcoder. And gonna use my "own" time-generator code to it in the software. I'll publish it later on here in Instr's as a DIY, both the code and testresults, aren't having the coder's yet, (have ordered them).

author
MertArduino made it! (author)MertArduino2016-10-09

I understood why did you this comment :/

author
tacomamactech made it! (author)tacomamactech2016-10-10

I'm sure it takes a lot less effort for someone who is interested in this to understand it, than the effort it took for you to write it. Thanks for your effort!

Joe

About This Instructable

25,206views

242favorites

License:

Bio: For more projects and tutorial visit my YouTube channel Mert Arduino and Tech
More by MertArduino:Arduino - MPU6050 GY521 - 6 Axis Accelerometer + Gyro (3D Simulation With Processing)NodeMCU ESP8266 - WiFi Robot Car Controlled by Application (Wifi Bot / Android / IoT)Arduino - Programmable Robotic Arm (Record and Repeat of the Servo Positions)
Add instructable to: