Simple Motor Optical Encoder: Theory

The Theory
           The actual theory behind how the IR emitter and detector will work is not very complex. If you look at the picture below it probably explains it to you in mere seconds:

The IR Emitter Diode
           The IR Emitter Diode is actually no different than any other LED you've ever seen, except for the fact that instead of outputing a color we can see, it outputs IR. This means that our eyes cannot see it. If take any standard video camera and point it at an IR LED that is turned on you can, however, see the color output.

The IR Detector - Phototransistor
           The photo-transistor is a normal transistor with the unique part being that the base input depends on the intensity of the IR light coming into it. So if a clean IR signal is coming into the base it's switch on, but if a noisey IR signal is coming in, it isn't all the way on. This simple idea will let us be able to distinguish inbetween black and white colors on our encoder strip.

           The above circuit illustrates basically the same idea as what we'll be using. The IR emitter/detector pair can be found at any electronics store, even radio shack!