Linear optical encoder from printer parts

Technology

Here’s a linear optical encoder made from printer parts, a PIC 18F4520 MCU, and an L298 motor controller:

The goal of this tutorial is to create a way to know where the ‘stage’ is, accurate to about 1/4” using optical encoding. The stage is controlled via a 12v motor so we will use an L298 motor controller for controlling the motor via a 18F4520 PIC.

The PIC will use hardware PWM generators to output the correct frequency & duty cycle. The PIC will also take the analog input from the IR detector diode to keep track of how far the stage has moved via an internal analog to digital converter (ADC).


Simple Motor Optical Encoder

More:
How To: DIY quadrature encoder
HOW TO – Make an Optical Encoder

4 thoughts on “Linear optical encoder from printer parts

  1. anachrocomputer says:

    Surely you could get much more accurate positioning by using the optical grating strip and the detector unit from a scrapped ink-jet printer? Most ink-jet printers use a DC motor to move the printhead left/right, and use an optical sensor system to measure its position. Couldn’t that be reverse-engineered and re-used somehow?

    1. mckgyver says:

      yep

      http://mckgyver.pbworks.com/DRO

      Ive used them for a moderate resolution Digital Readout using code by Steve Lindsay (http://www.lindsayengraving.com/other_interests/dro.html) running on a junk 386 laptop. About as cheap as it gets for DRO.

Comments are closed.

Discuss this article with the rest of the community on our Discord server!
Tagged

Gareth Branwyn is a freelance writer and the former Editorial Director of Maker Media. He is the author or editor of over a dozen books on technology, DIY, and geek culture. He is currently a contributor to Boing Boing, Wink Books, and Wink Fun. His free weekly-ish maker tips newsletter can be found at garstipsandtools.com.

View more articles by Gareth Branwyn

ADVERTISEMENT

Maker Faire Bay Area 2023 - Mare Island, CA

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).

FEEDBACK