Direction detector doubles as decoder

Texas Instruments CD4093B

Fig 1’s circuit, which was developed to monitor the traffic of bumblebees into and out of the hive, differentiates “a-to-b” motion from “b-to-a” motion. When used with an optical decoder, the circuit distinguishes clockwise from counterclockwise rotation and provides a resolution of one output pulse per quadrature cycle. The circuit is simple and inexpensive.

Each output pulse from this circuit represents the direction of an object's movement past the two phototransistors, Q1 and Q2.
Figure 1. Each output pulse from this circuit represents the direction of an object’s movement past the two phototransistors,
Q1 and Q2.

Q1 and Q2 are mounted so that a moving object first blocks one phototransistor, then both, then the other. Depending on the direction in which the object is moving, either IC1B or IC1D emits a negative pulse when the moving object blocks the second sensor. An object can get as far as condition 3 (see Table 1) and retreat without producing an output pulse; that is, the circuit ignores any probing or jittery motion. (If an object gets as far as condition 4, however, a retreat will produce an opposite-direction pulse.) The time constants R3C1 and R4C2 set the output-pulse width. A 100-kΩ/100-pF combination, for example, produces 10-μsec pulses. You select a value for pullup resistors R1 and R2 from the, 10- to 100-kΩ range, according to the sensitivity your application requires.

Table 1. Logic states for a-to-b motion (interchange a and b
for b-to-a motion)
Condition Inputs Intermediate
variables
Outputs
a1 b1 a2 b2 a3 b3 a4 b4
1) No passage 0 0 1 1 0 0 1 1
2) Object blocks a 1 0 0 1 0 0 1 1
3) Object blocks a and b 1 1 0 1 0 0 1 1
4) Object blocks b 0 1 1 0 0 1
5) No passage 0 0 1 1 0 1 1

Materials on the topic

  1. Datasheet Texas Instruments CD4093B