Shop by category
Shop all componentsMotors & mechanics
Counts per rev = PPR × decoding × gear ratioDistance per count = π × diameter ÷ counts per revSpeed = counts ÷ counts per rev ÷ timeAn 11 PPR encoder, 4× decoding and a 30:1 gearbox gives 11 × 4 × 30 = 1320 counts per wheel turn, so a 65 mm wheel moves 0.155 mm per count. 330 counts in 100 ms is 150 RPM, or 0.51 m/s.
A quadrature encoder has two output channels offset by a quarter cycle, which lets a microcontroller detect direction and count four times per pulse. Encoders on a geared motor spin at motor speed, so the gearbox multiplies the resolution seen at the wheel.
Count pulses with interrupts or the ESP32’s hardware PCNT, not by polling. Speed from counts in a fixed sample time is noisy at low speed, so use a longer sample or measure the time between pulses.
PPR is pulses per revolution per channel. With 4× quadrature decoding, CPR = 4 × PPR.
π × wheel diameter ÷ counts per rev. A 65 mm wheel with 1320 counts per rev moves about 0.15 mm per count.
Encoders on the motor shaft turn faster than the wheel, so counts per wheel revolution are multiplied by the gear ratio.
Counts per rev = PPR × decoding × gear ratio; Distance per count = π × diameter ÷ counts per rev; Speed = counts ÷ counts per rev ÷ time.
An 11 PPR encoder, 4× decoding and a 30:1 gearbox gives 11 × 4 × 30 = 1320 counts per wheel turn, so a 65 mm wheel moves 0.155 mm per count. 330 counts in 100 ms is 150 RPM, or 0.51 m/s.
Geekobot builds that use it include DIY tachometer, Fan speed checker, Conveyor belt speed meter and Tachometer needle dial. Each has the full parts list, wiring and code.
Results are estimates for design and learning. Check critical designs against the component datasheet. Made by the Geekobot Learning Team. How we write our calculators