Position control of stepper motor using potentiometers

Introduction 

Today we are going to make a closed-loop stepper motor for accurate position feedback, we are achieving this by coupling potentiometer in perfect synchronization with the stepper motor.
As we all know potentiometer can’t be rotated to one side only, for increasing and decreasing the resistance we used to turn it forwards and backward.
 
So here for this application we want the potentiometers should be fully rotatable, to achieve that what I have done is, I opened the potentiometer and break the lock inside it and put it back inside its case, now it is fully rotatable.
 
But there was a problem with that, when I connected the potentiometer to the analog input of Arduino and reading the values, the potentiometers showing very random values when they reach the point where the lock was situated.
 
So to rectify this issue I have taken one more potentiometer and do the same procedure. Now when one potentiometer reaches that random value position we can get feedback from the other one and vice versa.
 
 
 
 

Hardware Used

  • Potentiometer
  • Arduino
  • Stepper motor
  • Stepper driver

To buy electronic components order from UTSOURCE

Code

3 thoughts on “Position control of stepper motor using potentiometers”

  1. ekaggrat singh kalsi

    hi,
    I didnt understand what the random function is doing. Can you please elaborate on it .. thanks

    1. Hi Ekaggrat, actually I build this for a game. In that game when I press the momentary button the wheel will stop at a random position and the person will win prices or loss

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top