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

Picture of 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

Picture of Hardware Required

Hardware Required :

- 10k Potentiometer

Step 3: Circuit & Connections

Picture of 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

Picture of Programming

Step 5: If I Was Helpful

Picture of 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

georgegeorge01 (author)2016-10-17

how much the program

KISELIN (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.

flyingfarm (author)KISELIN2016-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.

KISELIN (author)flyingfarm2016-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).

MertArduino (author)KISELIN2016-10-09

I understood why did you this comment :/

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

KISELIN (author)2016-10-09

Mark them step's for me that you don't understand, and I try to help you through them

KISELIN (author)2016-10-09

Gee... You'r right. My grammatchical in wroten Finnish/ English that didn't come up before the 8'th grade in school. All the people around the world should learn to speak/ write in ENGLISH or U:K:. (United Kingdom) or G.B (Great Britain) or (England, just another part of them Kingdom's ). Then they emigrated to a wonderlad with boat a named "May Flower " etc.. And then WE all can be the UNITED STATES OF AMERICA all we 8 , (8,000,000,000 billion people) and then YOU can require them to write grammatically correct with YOUR "nativ" language, (I'll read /wright perfectually in 3 languages, not english included, how about You?)

About This Instructable

30,386views

252favorites

License:

Bio: For more project and tutorial visit my YouTube channel Mert Arduino and Raspberry Pi
More by MertArduino:XY Plotter Drawing Robot | Arduino | PolargraphArduino - Balance - Balancing Robot | How to Make?Arduino - MPU6050 GY521 - 6 Axis Accelerometer + Gyro (3D Simulation With Processing)
Add instructable to: