0% found this document useful (0 votes)
226 views3 pages

Using Stepper Motor As Rotary Encoder - 2

This document describes how to use a stepper motor as a rotary encoder by detecting the pulses generated when the stepper shaft is turned. The circuit triggers on the motor's pulse signals to produce an output similar to a rotary encoder. An Arduino code example is provided to interface with the stepper encoder. While the encoder can lose steps if rotated very slowly, it works well for many applications.

Uploaded by

Jasharat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
226 views3 pages

Using Stepper Motor As Rotary Encoder - 2

This document describes how to use a stepper motor as a rotary encoder by detecting the pulses generated when the stepper shaft is turned. The circuit triggers on the motor's pulse signals to produce an output similar to a rotary encoder. An Arduino code example is provided to interface with the stepper encoder. While the encoder can lose steps if rotated very slowly, it works well for many applications.

Uploaded by

Jasharat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

instructables

Using Stepper Motor As Rotary Encoder

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.

Using Stepper Motor As Rotary Encoder: Page 1


Step 2: Demonstration

In this video shown how encoder works with arduino. rel="nofollow">Adafruit_NeoPixel.h


In this example, I used stepper motors from old
printer but you can use any stepper motors. Circuit diagram with stepper motor and driver a4988:

Code of these examples you can find here: https://drive.google.com/file/d/1GCRXKmik49xVYwpi


rRgTCWHo17r8T0BW/view?usp=sharing
Stepper motor example;
I'm currently freelancer. For hiring, you can contact
Neopixel example; me at about.prototype@gmail.com

Necessary libraries:
Encoder.h

https://www.youtube.com/watch?v=fQ19661UGx8

Please click on the images to get a full view.


I used an Arduino Leonardo microcontroller and modified the code to simulate up and down arrow
keys of the keyboard for the stepper motor's rotation. You can check out the video here:
https://youtu.be/foR3_3igMm8

Using Stepper Motor As Rotary Encoder: Page 2


Cool project! Tried it and works great.

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

I use the stepper-encoder to focus a GoPro Zoom Lens:

https://www.youtube.com/watch?v=bdl6JS5T-qs

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

Using Stepper Motor As Rotary Encoder: Page 3

You might also like