Motion control with Analog sensor

Hello guys,

I am new on here with my little Arduino Uno.
I have a Mega on the way and should be with me tomorrow. So if any of you experts are feeling like sharing your knowledge I would much appreciate it!!
I am trying to control a stepper motor using a Magnetoresistive sensor. I have a driver DRV8825 - Pololu - DRV8825 Stepper Motor Driver Carrier, High Current and am able to step the motor in different directions.
Do any of you know how i can control the motor speed forwards and backwards to mirror the sensor position and speed of movements? :confused:

Can you be more specific, provide a sketch of your device?

Which sensor, what position, how is the sensor related to the position?

Hi DrDiettrich,

As you move the sensor forwards and backwards it gives a signal out of between 0 to 5 Volts. I am gonna use that as the analog input into the arduino. This in turn will need to vary the speed and direction of the stepper motor. The sensor is on a slide on a single axis(Like you would find on a lathe axis for machine head position).

i.e. you want e.g. full speed left with 0V, and full speed right with 5V from the sensor?

Or in terms of ADC values (analogRead), 512 is stop, lower is this direction, higher is opposite direction.