# How to control stepper motor rotation using voltage

1. ## How to control stepper motor rotation using voltage

Hello all,

I have designed a voltmeter circuit to measure 0 to 5V. I want to display the output on analog display that is, using dial display. For this I plan to use stepper motor to move pointer to correct position. The setup looks as shown in image: . I have written a program to rotate the motor depending on the voltage measured. It doesn't show any error in compilation but when I try to execute the pointer does not move as it should. I have checked voltmeter circuit and it is fine.

The code snippet is attached hereprogram.pdfprogram.pdf.

Regards
Srinidhi

•

2. ## Re: How to control stepper motor rotation using voltage

The stepper pulse pattern doesn't seem to match the hardware configuration (motor connected by 3 wires). Show your circuit schematic and motor datasheet.

3. ## Re: How to control stepper motor rotation using voltage

Indeed, the software seems to output 4 unipolar signals which would require 5 connections to the motor (4 + supply) so how do you have it wired with only 3?

Brian.

4. ## Re: How to control stepper motor rotation using voltage

Originally Posted by FvM
The stepper pulse pattern doesn't seem to match the hardware configuration (motor connected by 3 wires). Show your circuit schematic and motor datasheet.
Below attached is the circuit schematic. Output of voltage divider is given to an ADC pin of Atmega16. stepper motor is connected to micro-controller via L293D motor driver.

•

5. ## Re: How to control stepper motor rotation using voltage

Hi,

GND symbols aren't expensive. Use them to avoid lengthy GND wiring...this makes the whole circuit more easy to read.

Klaus

•

6. ## Re: How to control stepper motor rotation using voltage

Let me put it this way: The circuit schematic (controlling 3 of 4 L293 outputs with connected bipolar stepper motor) neither fits the code (controlling 4 outputs PB1 - PB4) nor the stepper motor photo.

What did you actually test?

7. ## Re: How to control stepper motor rotation using voltage

Stepper motors have more than three wires: your photo shows only three wires.

I do not know how L293 is being used as a stepper motor driver.

Is your motor BLDC type? Then you will need motors with Hall sensors or encoders...

8. ## Re: How to control stepper motor rotation using voltage

It is stepper motor X-25. Datasheets of these motors are hard to find. one of the datasheet I found is attached below.X25 datasheet.pdf

9. ## Re: How to control stepper motor rotation using voltage

I referred to the following webpage for interfacing stepper motor, l293d and amicro-controller: http://rickruling.blogspot.in/2013/1...tor-using.html

10. ## Re: How to control stepper motor rotation using voltage

I referred to the following webpage for interfacing stepper motor, l293d and amicro-controller: http://rickruling.blogspot.in/2013/1...tor-using.html
Not exactly. There's one phase missing in your schematic and the code is accessing the wrong port bits, PB1 - PB4 instead of PB0 - PB3. Also the 3 wire stepper motor photo seems confusing. Is it actually a 3-phase motor (very unusual, but possible)?

11. ## Re: How to control stepper motor rotation using voltage

The motor puzzles me too. Note that the shaft is off center, that usually means there is a gearing mechanism inside it. It certainly doesn't look like a stepper motor and if it is a 3-phase AC motor I've never seen one so small and I can't think of a practical application for one that size.

Drmius, can you show us more information about the motor or at least upload a picture of the other side showing any markings on the connections.

Brian.

12. ## Re: How to control stepper motor rotation using voltage

Originally Posted by betwixt
The motor puzzles me too. Note that the shaft is off center, that usually means there is a gearing mechanism inside it. It certainly doesn't look like a stepper motor and if it is a 3-phase AC motor I've never seen one so small and I can't think of a practical application for one that size.

Drmius, can you show us more information about the motor or at least upload a picture of the other side showing any markings on the connections.

Brian.
Below attached is the datasheet on X-25 motor. Basically these are stepper motors used by GM for instrument Clusters.

•

13. ## Re: How to control stepper motor rotation using voltage

That explains what it is but not why you only have three connections to it when it needs four.

Beware of visiting Junken's web site, it pops up a "Windows Defender" virus alert and warns me not to shut my computer down and to call a support phone number immediately. The funny thing is - I use Linux!

Brian.

--[[ ]]--