Turn a Stepper Motor into a hi-res Rotary Encoder
Stepper Motor
Use whatever you have, but I suggest a 200-step (1.8°) motor like the Nema 17 pancake motor.
I use an old stepper from a 5¼” floppy disk drive (39 x 39 x 27.5mm) model no. Teac 14769070-90. It
is a 5-wire unipolar stepper, but 4-wire bipolar steppers work equally well.
When using attachHalfQuad of the ESP32Encoder library, there are 100 steps per revolution. That’s 5
times more steps than with an average rotary encoder. The way I wrote my code, zero to full volume
takes only one revolution. The Muses has many more steps, but I use the map() function to limit it to
100 steps so that I can display from 0% to 100% volume on the screen.
Stepper Signal Amplifier
Uses an LM358 and LED as voltage reference to output standard rotary encoder signals.
Schematic
The circuit is really easy to build. Use a red or yellow LED. I tried a SMD LED and it doesn’t work well
so stick with thru-hole. I’m using a yellow 5mm LED.
Connection
This diagram that I found online explains the connections adequately.
Switch
Obviously there is no switch on a stepper motor. If one is required, mount a micro switch on the back
plate of the motor. The motor shaft is spring loaded and can depress the micro switch when pushed
in.
Power 3.3V to 5V
BOM
Use 0.25W resistors.
Use an old type low intensity red LED.
The connectors are JST-PH 5-way (2mm pitch).
2024 - @Skylar88