IR Emitter/Detector Pairs and Op-Amps

Objectives

Infrared (IR) emitters and detectors come as a pair of devices; one is a light source, and the other is a light sensor. They are tuned to emit and detect the same wavelength of light. They can be useful for sending light-based digital messages, detecting objects, or measuring distances. Because they are in the infrared portion of the light spectrum, they are invisible and less likely to be corrupted by visible light sources. See Scherz & Monk Section 5.7.1 for a complete explanation of how phototransistors work.

Operational amplifiers (Op-Amps), on the other hand, are an important part of analog signal processing. They are a fundamental component of many circuits, and knowing how to work with them will make it possible to work with and condition a wide array of non-ideal sensor signals

The goal for this lab is to get to know the basics of op-amps and how to use them in order to properly condition and amplify small signals from sensors such as IR emitter-detector pairs. This will be important as you learn about the often non-ideal behavior of simple passive and active sensors.

At the end of this tutorial you will be able to demonstrate knowledge of:

  1. The basic rules governing ideal op-amps.

  2. What happens when op-amps are connected with negative feedback in a non-inverting configuration.

  3. How to drive infrared (IR) emitters and read IR detectors.

Resources

You will need the following equipment and major components:

Item Quantity / Value
Benchtop Oscilloscope 1
Benchtop Power Supply (3.3V and 5V)
MCP6002-I/P Op Amp (datasheet) (digikey) 1
Pushbutton Switch 1
Capacitor Various
Emitter/Detector Pair (Amazon link) 1
Potentiometer 10 kΩ, 100 kΩ
  1. First, read the textbook sections and watch the videos indicated in the Resources section above. This step is critical for understanding the circuitry you will be designing below.

Figure 1: A trans-resistive circuit
Figure 1: A trans-resistive circuit

  1. Create the infrared emitter/detector circuit shown above, using one of the two op-amps in the MCP6002.

Tips and Tricks

  • Make sure to point the emitter (clear) and detector (dark) towards each other in order to transmit more infrared light from the LED to the IR phototransistor.
  • The V+ and V- pins (4 & 8, on the left of Figure 1) are the power pins for the MCP6002. For this symbol they are drawn and included separately on this schematic. Other symbols may handle common pins differently.
  • You can use a potentiometer as a variable resistor by connecting to the middle wiper pin and either of the other two pins (not both).
  • You can use a potentiometer as a voltage divider by connecting one of the outer pins to ground and the other outer pin to power. The middle wiper pin is then an adjustable, variable voltage that you can adjust from ground to power.
  • Try both a 10k and 100kOhm potentiometer at R2 to identify a good gain, or use a simulation in PSPICE to model this circuit.
  1. Attach an oscilloscope probe to the Vout1 pin (the output of the op-amp). Ensure that the ground clip is firmly attached to your breadboard’s ground using a wire.

  2. In the gap between the emitter and detector, slide something opaque (like a piece of cardboard) between them. How does the voltage at the op-amp’s output change?

  3. Using the oscilloscope, identify the minimum and maximum voltage of your signal when the card is inserted and removed. What gain would be required to boost that voltage range to 0-3.3V? What is the minimum voltage you ever see on Vout1? Why does the circuit never go below this minimum value?\

    (Hint: Look at Vref)

Figure 2: A separate “special” amplification stage added after the first stage.
Figure 2: A separate “special” amplification stage added after the first stage.

  1. Remove the emitter and solder two 1-meter (~3ft) wires to the emitter’s leads.

  2. Construct the above circuit. This adds a second stage to the original circuit, with a “special” function

Note: The function of this circuit is discussed in Section 8.4 (Figure 8.14) of Scherz & Monk. Why was this type of amplifier selected?

  1. Extend the emitter to its full length and shine it towards and away from the IR detector. Now what is the voltage swing? Reduce the value of R2 to achieve a 0V to 3.3V swing (without overly saturating the sensor).

  2. Once selected, measure the output of the constructed circuit with your oscilloscope. How does the signal change as you obstruct the signal and shine the IR beam directly on the detector?

  3. Then, using your breadboard, wire Vout2 (the output of the second op-amp) to the microcontroller’s analog input pin, disconnecting the wire from the potentiometer formerly used in HW2. Connect to the microcontroller over USB with Putty and read the changing analog values in decimal format as you shine your IR emitter at the IR detector.