Using Stepper Motor As Rotary Encoder

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.


Step 2: Demonstration

In this video shown how encoder works with arduino. In this example, I used stepper motors from old printer but you can use any stepper motors.

Code of these examples you can find here:

Stepper motor example;

Neopixel example;

Necessary libraries:
Encoder.h

Adafruit_NeoPixel.h

Circuit diagram with stepper motor and driver a4988:


If this instructable was interesting and useful you can support me on Patreon.

My page on Patreon: https://www.patreon.com/AndrewF1

Share

    Recommendations

    • Plastics Contest

      Plastics Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Optics Contest

      Optics Contest

    3 Discussions

    0
    None
    Pierrick

    4 months ago

    Interesting project. Same question as NeoStallion, are you able to detect a step slippage during motion?

    0
    None
    NeoStallion

    Tip 4 months ago

    Can that Stepper motor also be rotated in a normal fashion ? and know the exact location where it stopped. because in many practical applications I need to know where it is now and rotate the same.

    0
    None
    acheide

    4 months ago

    Now my small scavenged steppers have a purpose. To post the code here would complete the Instructable. Thanks.