Maker Pro
Maker Pro

How to find RPM of motor using KY-040 Rotary Decoder Encoder

I tried many online tutorials but I couldn't get any program that is working for calculating rpm using KY-040 Rotary Decoder Encoder. Some one can please tell me the formula for it. I am using Beaglebone and Python Adafruit library for coding.
 
Seems like a simple quadrature encoder, I have used plenty of encoders but not the libraries you refer to.
It also looks like alot of examples out there on the web i would think you could adapt.
M.
 
You will need to count the pulses from the encoder over a fixed period of time. If I recall correctly, the KY-040 produces 20 pulses per revolution, so assuming the encoder shaft is directly connected to the motor shaft, and you count pulses for 1 second, then RPM= count/20 * 60 = count*3. You will only need to count pulses from one output of the encoder.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
A rotary encoder seems like overkill just to count pulses and convert them to RPM.

Chris
 
In most instances a simple opto slot detector will work with one or two P/rev.
Usually quadrature encoders are used where precise positioning is required.
M.
 
Top