Homebrew Shaft Encoder

24 July 2011

This is something I did many moons ago but just recently found the photos, which appear to be of reasonable quality, so I thought I’d share…

We’ve probably all seen an article or two on how to construct your own optical encoder discs for a rotary motor, well, here’s an approach which doesn’t require printing out your own disc. All you need is an old computer mouse!

Step one: Salvage an encoder wheel and optical transmitter/receiver pair from an old computer mouse.

Step two: Cut the shaft of the encoder wheel and drill a hole to fit to the motor shaft. You’ll probably want to use a motor with the shaft protruding at the back end so a light-proof cap can easily be fitted if need be (some decoders are just dual photodiodes and don’t employ conditioning circuitry to attenuate ambient light).

Step three: Construct a simple PCB to mount the components and provide convenient access to the motor terminals. Why not include a snubber, inrush current limiting, or even an entire driver circuit!

Step four: Marvel at your creation!

The pictured wheels have 36 slots which give 144 counts per revolution if clocking on both edges of both channels (36×4). So while a resolution of 2.5° might not suit an application requiring precise position stepping, it does provide a relatively high level of precision when it comes to most low or moderate speed control applications.

You may want to shop around for the ideal mouse (not literally / good luck finding a ball mouse for sale) as you may prefer optical decoders with a fully conditioned, clean, square, push-pull output. The ones pictured are just photodiodes. I had to use a toilet paper roll and some tinfoil to block out interfering ambient light.