Using Stepper Motor As Rotary Encoder - 2
Using Stepper Motor As Rotary Encoder - 2
by Andriyf1
I want to tell you how to make incremental encoder from stepper motor. When we turning shaft of stepper motor it
works like generator. It generates certain impulses on its coils. After some signal processing, we get same
impulses as incremental encoder.
This encoder has one problem, it can drop steps if you turning very slowly. But for many applications, it doesn't
matter.
Step 1: Circuit
Impulses from stepper motor turn on/off this triggers and on output we get signal like rotary encoder.
Necessary libraries:
Encoder.h
https://www.youtube.com/watch?v=fQ19661UGx8
Now my small scavenged steppers have a purpose. To post the code here would complete the
Instructable. Thanks.
The two outputs labeled 'Phase A' and 'Phase B' are just like the 'CLK' and 'DATA' pins of a
regular rotary encoder which you can be used with Arduino. Search for any Arduino rotary encoder
project and upload it on your Arduino board. connect the previously mentioned output pins to the
digital input pins mentioned in the code.
You can find an example code here:
https://howtomechatronics.com/tutorials/arduino/rotary-encoder-works-use-arduino/
you can use a stepper motor as USB-Knob with push button:
https://www.youtube.com/watch?v=9ybnsAmQP3k
https://www.youtube.com/watch?v=bdl6JS5T-qs
Interesting project. Same question as NeoStallion, are you able to detect a step slippage during
motion?