McGourty Associates
    —
Our Company
    —
Our Products
MechaBlox for Quick Concept Design
    —
Services
Design Services we offer
    —
Customer Support
    —
Mechatronics Designer
Latest issue
    —
Design Files
Application Information
    —
Fundamentally So...
Engineering Fundamentals Review
    —
Designer's Bookshelf
Books for Mechatronics Designers
    —
Resources
Engineering Links
FAQs
The Forum
    —
Contact Us
    —

Photointerrupter Switches.

Design File DF02, November, 2005


Photointerrupter switches are a good choice for digital sensing and switching applications where electrical isolation and reliable operation of the switch are requirements. Because physical make-break contact is not present during the switching operation, they are inherently "contact bounce" free. However, they can exhibit "linear mode characteristics" during transition states and their use for digital applications must be careful considered.


Notes:

The Photointerrupter

A photointerrupter switch is usually implemented as a photodiode - phototransistor pair with a mechanical light beam interrupter or reflector. The photodiode is biased forward with an appropriate bias resistor to emit light. The light emitted by the photodiode is either directly transmitted to the phototransistor (direct type), or indirectly transmitted to the phototransistor by a reflective material or surface (reflective type). For higher switching current capability, a photodarlington transistor output is also available.

When the transmitted light is received by the phototransistor, the phototransistor is switched "on". When the light is blocked or reflected away from the phototransistor, the phototransistor is in the "off" state. Usually the phototransistor has uncommitted collector and emitter junctions which are connected in various configurations depending upon the switching application. For saturated switching applications, the base junction is not normally made available.

When a direct type photointerrupter is used in a switching application, a mechanical "interrupter" is used to break the light beam transmission causing an "on" to "off" state change in the phototransistor. In the case of a reflective type photointerrupter, the light beam is directed away from the phototransistor either by a shift in or a removal of the reflective material, causing a state change from "on" to "off."

There are no make-break contact events, so the signal is usually spike free, and the switching, to the extent of the motion of the mechanical interface is usually bounce free as well.

Photointerrupters are robust devices. Unless accidentally reverse biased, it is very rare for a properly biased photointerrupter to fail electrically. Only the mechanical interrupter if used, is subject to wear.

Biasing the photointerrupter photodiode.

When selecting a suitable bias circuit for the photointerrupter, two considerations need to be determined, the illumination intensity of the photodiode and the current switching requirements of the phototransistor.

In the case of a direct transmission type photointerrupter such as the Honeywell HOA1870, biasing of the photodiode is not too critical. Usually all that is required to bias the photodiode is to connect a resistor from the power source to the anode of the photodiode, and connect the photodiode directly to ground (figure 1) Data sheets usually do not give to much biasing detail other than maximum current and power dissipation (which you should never exceed). For operation, all that is required is sufficient current to illuminate the phototransistor and switch it on to the saturated state. Since transmission distance is very small, only a couple of mm, using the smallest bias current for minimal system power draw is usually the optimal solution.

Typical photodiode bias resistor values for a 5volt system, are in the 200 to 400 ohm range (10-20ma). In our own designs, we have found that 330Ohms works quite well with virtually all the device we have tested. One note of caution, in the case of low voltage systems especially, remember to take into account the forward voltage drop of the photodiode when calculating the bias current.

In the case of an implementation where the transmission distance between the photodiode and the phototransistor is long, the output of the photodiode must be increased substantially since light power diminishes as the square of distance. In order to not exceed the power dissipation of the photodiode, the power to photodiode will probably need to be pulsed.

Biasing the photodiode for reflective types photointerrupters, such as as the HOA1404 is a bit more involved because the properties of the light reflective surface determine how much light is returned. If the application is just to detect a shiny surface and switch upon detection, the biasing value is not too critical. All that is needed is enough light to switch the phototransistor on. Anything extra doesn't help, but doesn't hurt other than consuming extra power.

In the case of scanning something like a barcode pattern, an optimal solution is a bit more difficult to determine. In this example, there must be enough light to illuminate the target barcode and reflect back when the reflective part of the pattern is present, but not so much light that it washes out the non-reflective part when it is present. An optimal solution is usually best determined by experimentation.

Biasing the photointerrupter phototransistor.

Biasing the phototransistor can be a bit more challenging depending upon the detection circuitry the phototransistor is driving. The phototransistor is virtually always an NPN type. The optimal method of use is in open collector configuration with the signal detection circuit connected to the collector, and the emitter connected to ground (Fig 1.). In this configuration, the phototransistor acts as an electrical switch which shunts the signal to ground - sinking but not sourcing current. Unassisted, only a "low" signal level can be reliably switched by the phototransistor itself . At a minimum, a pull-up resistor is required to establish a "high" signal level when the phototransistor is "off"

For mechanical applications where the switching time is usually low (under 50kps), the bias value of the pull-up resistor is usually not too critical, but keep in mind that due to transistor junction capacitances, the higher the value the load resistor, the slower the switching time.

It might appear at first that the smaller the load resistor value, the better. Unfortunately, that is not the case because the higher the load current, the higher the Vce voltage of the phototransistor. In fact, if the load is too high, the transistor will not saturate properly and possibly bias somewhere in the linear region - which is never good for digital signals. Ideally, when the phototransistor is in its full illumination state, you want it to be fully saturated at its lowest switching value, typically 0.4 to 1.0 volts.

Reliable switching during signal transition.

Even when the photointerrupter is properly biased for optimal signal performance when fully illuminated and completely not illuminated, there may be transitions times when the light signal is partially blocked as it changes. Momentary, as these transitions occur and the base of the phototransistor is only partially illuminated, the phototransistor may be biased into the linear region and output indeterminate signal state levels. Because of this, for digital switching applications the photointerrupter switch is almost always used in combination with a Schmitt trigger to condition the phototransistor output signal into a reliable and unambiguous digital signal. Some photointerrupters are available with integrated Schmitt Triggers, but usually not the ones you want, and they are always a lot more expensive

The Non-inverting Schmitt Trigger.

Last article on mechanical switches, we alluded to the Regenerative Comparator, or Schmitt trigger. Now is good time take a look at this useful circuit.

Figure 2 show a single-ended non-inverting Schmitt trigger circuit. A Schmitt trigger is a binary trigger circuit made up of a comparator with hysteresis. What that means, it is a comparator, with part of the output signal is feed back to the input create two distinct switching levels, a higher level to switch the circuit during low-to-high transitions and a lower level to switch the circuit during high-to-low transitions. The difference between the two switching levels is call hysteresis. The switching levels are determined by the values of R1 and R2.

Let's assume that the input voltage to the comparator (op-amp) is Vcc, and that Vref is half that value or Vcc/2- which is typically the chosen value for a single-ended configuration as shown.

Assume that the current value of the input signal Vs = 0v. Since Vs is less than Vref, the output of the comparator Vo = 0v.

Now we ramp up the Vs voltage. As Vs increases in value, the value applied to the comparator + input pin is:

V+ = Vs * (R2)/(R1 + R2)

Nothing happens to Vo until Vs is increased to a value of Vsh = Vref. The output of the comparator Vo then switches to Vo = Vcc. At the switch point

V+ = Vref = Vsh * (R2)/(R1+R2)

Or the low to high level transition occurs at

Vsh = Vref * (R1+R2)/(R2)

Since the Ratio of (R1+R2)/R1 is necessarily a value greater than 1, the Low to High switching point occurs at a Vsh value something greater than Vref.

If Vs is further increased, the output Vo remains the same at Vcc.

Now suppose the current value of Vs = Vcc. The signal applied to Vs has now ramped down, and:

V+ = Vs + (Vcc - Vs )*(R1)/(R1+R2)

Nothing happens to Vo until Vs is decreased to Vsl = Vref. At the switching point,

V+ = Vref = Vsl + (Vcc-Vsl)*(R1)/(R1+R2)

Vref = Vsl + (2*Vref - Vsl)*(R1)/(R1+R2)

Vref(R1+R2) = Vsl*(R1+R2) + 2*Vref*R1 - Vsl*R1

= Vsl*R2 + 2*Vref*R1

Finally,

Vsl = Vref*(R2-R1)/R2.

Since the ration of (R2-R1)/R2 is necessarily a value less than 1, the High to Low switching point must occur at a value less than Vref. It also follows that since Vsl cannot assume a negative value in a single-ended application, R2 must be larger than or equal to R1

The difference between (Vsh - Vsl) is called the hysteresis Vh

Vh = (Vsh - Vsl)

= Vref * (R1+R2)/(R2) - Vref*(R2-R1)/R2.

= Vref*(2*R1/R2) = 2*Vref*(R1/R2)

= Vcc*(R1/R2)

The extreme case is when R1 = R2, giving a hysteresis of VCC, that is a High to Low switching point at 0volts, and a Low to High switching point at VCC ! The other extreme is when R1 is much smaller than R2, essentially eliminating feedback, and the switching point is is at Vref as it would be in a normal comparator circuit

The inverting Schmitt Trigger.

The inverting Schmitt trigger is shown in figure 3. Operation of this circuit is similar to above, except that the output level is inverted relative to the input signal, and Vref is not connected directly, but connected to the comparator + input via the feedback network R1 and R2.

Again assume that Vref = Vcc/2

Assume that the current value of the input signal Vs = 0, and the output of the comparator Vo = Vcc. As we ramp up Vsh, the Low to High level switching point occurs when Vs = V+

Vsh = V+ = (Vcc- Vref)*(R1)/(R1+R2)

Since Vref = Vcc/2. the Low to High trigger point is some value greater than Vref.

At this point, the comparator output goes to 0V, and

Vsl = V+ = Vref*(R2)/(R1 + R2)

The High to Low transition trigger value for Vs has now switched to some value less than Vref.

Solving for Vh of this circuit,

Vh = (Vsh - Vsl) = (Vcc-Vref)*R1/(R1+R2) - Vref(R2)/(R1+R2)

= (2*Vref*R1-Vref*R1) - Vref*R2)/(R1+R2)

= Vref*(R1-R2)/(R1+R2)

At the boundary conditions, if R2 >> R1, essentially eliminating feedback, the switching point is is at Vref as it would be in a normal comparator circuit.

In the case where R1 = R2, unlike the example of the non-inverting comparator,

Vh = 0v when R1 = R2

Again, the Schmitt Trigger acts as simple comparator, but substituting
R1 = R2 in the above equations, we see that the trigger point is now at Vref/2

The choice of which type of Schmitt trigger to use is up to the designer. For example, if the normal state of the photointerruptor is "on" giving a low signal, and the design requires a low signal when the light beam is broken, use the inverting circuit.

It should be noted however that the non-inverting Schnitt Trigger does have a wider Vh range. Depending upon the design, this may be a consideration

Conclusion

Photointerrupter switches are a good choice for digital sensing and switching applications where electrical isolation and reliable operation of the switch are a requirement. They are simple to use and inherently stable. However, for reliable digital operation, they should be used in combination with a Schmitt Trigger circuit