Here is the circuit diagram for a quadrature encoder I made using two phototransistors. I’m using this for the Cylinder Balancing Robot Project.
Schmitt triggers filter the output and adjustments can be made with the three potentiometers–one for adjusting the LED current and one for adjusting the output for each phototransistor. Here is the finished board.
I notches out of an index card because it ended up working better than a black and white pattern on the card. Here is a diagram I made planning the circuit board.
How it Works
See my previous article, Photointerruptor Test Circuit, to see how the circuitry works.
A quadrature encoder works by measuring two square wave signals which are ninety degrees out of phase and advance as the wheel turns. These two signals are generated by the two photointerruptors
It is called a quadrature encoder because the two signals are always in one of four states.
By detecting the transitions between states, we can detect clockwise and counterclockwise steps.




