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:
You will need the following equipment and major components:
Item | Details |
---|---|
Benchtop Oscilloscope | |
Benchtop Power Supply or Voltage Regulator Circuit from Lab 1 |
|
MCP6004-I/P Op Amp (datasheet) (digikey) | |
OPB732 IR Emitter/Detector Distance Sensor | Datasheet | Digikey |
Potentiometer(s) | 1-2 10k Potentiometers |
Question | Importance | Resource |
---|---|---|
What is the maximum current of the IR LED? | Sending through too much current can damage the LED | OPB732 Datasheet |
What is forward voltage of the the IR LED? | This value is required for calculating the current through the LED | OPB732 Datasheet |
What is the working distance of the distance sensor? | Outside of the working range, the sensor’s output may give unexpected results | OPB732 Datasheet Distance vs. Normalized $I_c$ |
What is the peak wavelength of the OPB732? | Its peak wavelength is one parameter that will tell you what other lights might impact its sensor readings, and whether it will be visible or not | OPB732 Datasheet |
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-impedance circuit |
Create the infrared emitter/detector circuit shown above, using the MCP6004.
Tips and Tricks
- U1A and U1B, along with the V+ and V- pins corresponding to U1E in the schematic are all different submodules of the same physical MCP6004 compopnent. 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 usually check to see if an infrared-range LED is on with your phone. (See below)
testing an IR LED with your camera |
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.
Move a white piece of paper (or something else light-colored and non-reflecting) up and down over the sensor. How does the voltage at the op-amp’s output change?
Hint: Even though the detector’s peak detection spectrum is in the infrared range, ambient indoor light and especially sunlight can impact its reading. Shield the sensor from direct light with your hand to get a good reading.
Using the oscilloscope, identify the minimum and maximum voltage of your signal. What gain would be required to boost that voltage range to 0-5V? What is the minimum voltage you ever see on Vout1? Why does the circuit never go below this minimum value?
Hint: What is the value you calculate for $V_{ref}$?
Now take a look at the second stage of this amplifier. Why was this type of amplifier selected?
Note: The function of this circuit is discussed in Section 8.4 (Figure 8.14) of Scherz & Monk.
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? How is this different from $V_{out1}$?
Note: For better performance, you can replace $V_{ref2}$ with a potentiometer for fine-tuned adjustment.
Then, using your breadboard, wire $V_{out2}$ (the output of the second op-amp) to a pin that can be used by the ADC of the microcontroller. Create a new project in MPLabX, and set it up with ADC and UART to read the value of $V_{out2}$.
Program your microcontroller and connect to it over USB and read the changing analog values with Putty in decimal format as you move the paper closer and further away from the OPB732.