Difference between revisions of "Optointerrupter"

From Mech
Jump to navigationJump to search
Line 7: Line 7:
==Connecting to the PC/104 Stack==
==Connecting to the PC/104 Stack==
===Circuitry===
===Circuitry===
An example circuit (that should work with the PC104 stack's digital input) for the QVB 11134 slotted optical switch is shown below. When nothing obstructs the infrared beam, the phototransistor conducts and holds the voltage low. When the beam is broken, the phototransistor no longer conducts, and the voltage goes high. Because the phototransistor still has significant impedance when it is conducting, we use a large resistor (R2) to limit the current so the voltage will be close to zero when the beam is unbroken. We also use an [[Operational_Amplifiers_%28Op-Amps%29#Voltage_Follower|opamp voltage follower]] as a buffer. Remember to add a resistor (R1) to protect the IR LED in the switch.
An example circuit (that should work with the PC104 stack's digital input) for the QVB 11134 slotted optical switch is shown below. When nothing obstructs the infrared beam, the phototransistor conducts and holds the voltage low. When the beam is broken, the phototransistor no longer conducts, and the voltage goes high. Because the phototransistor still has significant impedance when it is conducting, we use a large resistor (R2) to limit the current so the voltage will be close to zero when the beam is unbroken. We use a Schmitt trigger to buffer our signal. Remember to add a resistor (R1) to protect the IR LED in the switch.


[[image:optointerrupter_ex_schematic.png]]
[[image:optointerrupter_ex_schematic.png]]

Revision as of 19:48, 28 July 2006

Overview

An infrared slotted optical switch is a device similar to the photo-reflector except that the emitter is pointed directly into the phototransistor. The slotted optical switch can be used to build shaft encoders. Shaft encoders can give the robot feedback on how far its wheels have turned or on synchronizing two wheels' velocity. A shaft encoder usually consists of a slotted optical switch and a striped wheel with a palette of radically alternating holes or slots on it. The palette of stripes will alternately reflect or not reflect light to the phototransistor, yielding a pulse-train output. The robot can then tell how far its wheels have rotated by counting the pulses.

Optointerrupter.png

Connecting to the PC/104 Stack

Circuitry

An example circuit (that should work with the PC104 stack's digital input) for the QVB 11134 slotted optical switch is shown below. When nothing obstructs the infrared beam, the phototransistor conducts and holds the voltage low. When the beam is broken, the phototransistor no longer conducts, and the voltage goes high. Because the phototransistor still has significant impedance when it is conducting, we use a large resistor (R2) to limit the current so the voltage will be close to zero when the beam is unbroken. We use a Schmitt trigger to buffer our signal. Remember to add a resistor (R1) to protect the IR LED in the switch.

Optointerrupter ex schematic.png

Optointerrupter ex photo1.jpg

Optointerrupter ex photo2.jpg

Optointerrupter ex photo3.jpg

(Note: the mounting tabs on the QVB 11134 optical switch have been snipped off for clarity.)

Program

The files below contain an example XPC Target program that will count the number of times the IR beam has been broken, and display them on the Seetron BPI-216 LCD display (on the COM1 serial port). Connect the output of the circuit above to channel 2 of the PC104 stack's digital input port. Depressing the Bit1 button (which sets channel 1 high) on the stack's break-out board will reset the counter to 0. Of course, you can edit the Simulink model to tweak the settings or route the data elsewhere.

Media:optointerrupter_XPC_program.zip

Unzip both files into your work directory, and open the .mdl file.

Optointerrupter XPC.png