Close

Stepper motor and analogRead()

A project log for mail2code

Mail your code to my microcontroller and see what happens via webcam. One hardware setup for many students, availability: Worldwide 24/7

norbert-heinzNorbert Heinz 04/29/2023 at 09:130 Comments

Another module for the Arduino UNO is a bipolar stepper motor with a DRV8825 driver so that the movement can be controlled by step / direction signals. The blue arrow visualizes the movement of the motor shaft:

On top of the motor shaft I have glued a magnet:

The position of the magnet and so the motor shaft is detected via an AS6500 Encoder:

The sensor outputs the degree of rotation by a pulse-width signal. With a low pass filter the pulse-width signal is transformed into an analog voltage between 0 an +5V. With that, the shaft position can be used by an analogRead() statement in your code.

Discussions