DIY Optical Motor Encoder

 

PyroElectro has built an interesting motor Optical Motor Encoder system that allows a sled to move back and forth using optical feedback to know where the sled is. A L298 DC Motor Controller is used to drive the simple DC motor that is used to precisely position the sled. You may remember this CD-ROM Read Head Actuator Head Scratcher article from earlier in the year where I was wondering how a simple DC motor could be used to precisely position a CD-ROM read write head.

"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)."