Return to: Projects page.
This proximity detector is an extension of IRPD circuits described by Dennis Clark (555 Based IR Proximity Detector and 12C508 IR Obstruction Detector), and by Dave Hylands. Similar devices that have been around for several years, such as Seattle Robotics, and can be traced back to at least the early 1990's in Circuit Cellar magazine.
Dennis's units count background pulses and decide if an object is present based upon a certain degree of increase of pulse activity above this background level. Dave's unit appears to signal an obstacle whenever the detector module output goes low. The present detector differs from the others in that it rejects background activity and noisy reflections by integrating the pulse output of the IR detector module to produce an analog signal, which can easily be converted and thresholded using an A/D converter on a microcontroller.
Circuit Operation. As shown in the diagram at the right, the basic circuit consists of an IR Led pulsed at a frequency near 38 khz, plus an IR detector module, eg Panasonic PNA4602M. The light from the Led bounces off a nearby object, and is picked up by the detector module. A baffle can be placed between the Led and detector module to prevent direct pickup of pulses, or the Led can be partially encased in black heat-shrink tubing to eliminate backwards and sideways radiation.
The PWM signal to the Led has approx 50% duty cycle, and comes from a microcontroller. The output of the PNA4602 module is normally high, but goes low and stays low, when it picks up a steady 38 khz infrared signal. However, the module output will pulse irregularly in the presence of intermittent IR input - such as a reflected signal. To deal with this, the detector signal is integrated using a low-pass filter in a manner similar to converting a regular PWM signal to a DC voltage. The PNA4602 has an output inverter stage with an internal pull-up resistor of about 20 Kohms. The circuit adds another external pull-up (R1), and also low-pass filter R2-C1. The time constant of the overall filter consisting of R1, R2, and C1 is about 2 msec. This filter rejects individual noise pulses, smoothes pulsetrains into a representative voltage, and allows threshold-setting for reliable operation.
Downside - note that the downside to this type of detector is that the PNA4602 module is very sensitive, and will respond to other IR sources modulated at close to 38 khz, such as a TV remote or other robots generating IR signals. In practice, it's preferable to start and stop the Led output, and scan for extraneous IR sources inbetween searching for local obstacles.
<| Circuit Values
The IR Leds used in the circuit were Fairchild QED234 T-1 3/4 devices, with 27 mw/sr output at 940 nm peak wavelength, and the detector module was a Panasonic PNA4602M, which is a 3-pin device slightly smaller than a TO-220 package.
Effective Range. The range of the detector can be controlled in two ways: (a) by using an Led pulse frequency which is off-center from the most sensitive pickup frequency for the detector module, and (b) by adjusting the power output of the Led by adjusting the current flowing through it.
After some experimentation, we ended up using a 34.8 Khz PWM signal, and as shown in the diagram at the right, at this frequency the sensitivity of the 38 khz PNA4602 module is down to about 25% of its peak value. In addition, POT1 was set to about 3.4 Kohms, which limits the current through the Led to about 1 mA. These values give an effective detection range of 4 - 6" for objects with high infrared reflectivity, such as white paper and objects with shiny surfaces - and as shown below, this also allows objects with less IR reflectivity to still be detected at smaller distances.
Variations. Clearly, the detection distance can be adjusted over a wide range of values, from just a couple of inches to well over the 6" set here. Using a PWM frequency closer to 38 Khz and/or more Led current will select a longer range - and vice versa. Also, we haven't specifically examined it, but suspect that setting a longer range [by using more Led power, etc] will also increase the number of noise pulses picked up by the detector due to spurious reflections. In general, this could be a problem with a simple 'yes-no' digital output, but the integrated-analog output used here should reduce the problem somewhat.
<| Signal Measurements
The PNA4602 module itself has an internal integrator, which turns a continuous 38 khz IR pulse input into a constant output = low, or '0'. Therefore, with a strong reflection, the detector module will output a continuous '0' level. However, for objects either far away or with weak reflection, the detector module will only receive a few reflected pulses, and its output will be a series of pulses of varying width and number, depending upon how strong the reflection is. This last situation is shown in the diagram below. Note that this display is a single long trace, which wraps around 8 times on the screen. In this case, the external integrator, consisting of R1-R2-C2, has been disconnected from the module.
Raw Detector Module Output. In the presence of no pickup, the PNA4602 module output is steady high = '1'. A highly-reflective object [ie, the experimenter's hand] is then brought in from far away. As the object comes closer [shown in epochs 0 - 3], pulses start occurring as the reflection gets stronger. The number, length, and shape [negative-going or positive-going] of pulses in the transition zone between steady '1' and steady '0' is roughly related to the distance of the object. When the object is very close, a steady '0' level is output. In epochs 5 - 7, the reverse situation takes place as the object moves away from the detector - steady '0' gives way to pulses, then to a steady '1'.
Maximum Usable Range and Reliable Operation. By adjusting the current to the IR Led, the range of the IRPD can be varied. Less Led current decreases the range, and more current increases it. We found that the circuit is usable out to about 12" or so - however, what happens with the larger Led currents [ie, power output] is that "noisy" background pickup increases dramatically, and this gets especially serious when attempting to adjust the range to more than 12" or so. When listening on the piezo, there is a continuous pulse chatter with larger Led current levels, and if current is increased too much, then background pickup turns on the IR detector module fully, even with no targets in the beam. In contrast, when the current is set so the effective range is 8" or less, there is very little background chatter.
For reliable operation, the system needs a good way to reject or compensate for background pickup at the range selected.
<| Analog Output
Integrator Output. The diagram below shows the detector module output integrated by external low-pass filter, R1-R2-C1, as the A/D converter sees it. Of note, individual noise pulses are eliminated, and a monotonic decrease in voltage is seen as the object moves in from afar. The transition zone corresponds to the situation above where the pulses occur. Once the object gets in close, the voltage stabilizes at a low level. The transition from low voltage back to high is the object moving away from the detector.
This voltage can be measured by the A/D converter, and a threshold value between max and min can be used as a stable measure of object detection. This helps to eliminate the problem seen in the previous diagram, where the microcontroller has to use software routines to reject noise and deal with transition-zone pulses, and decide when a hard response is present. In fact, the signal below is smooth enough, it would probably work just as well if sent into a digital input of a microcontroller instead of to an A/D converter channel.
<| Object Reflectance Characteristics
Note that the reflected signal from an object is dependent upon a number of factors, and this will affect the nature of the detector module output [eg, pulses in the transition region], and also the distance of reliable detection. Objects with different reflective properties were found to have different detection distances. Relevant factors include:
The table at right shows detection ranges for several common objects. Flat objects were oriented orthogonal to the detector beam. "Just-detect" refers to the distance at which the first few individual detector module output pulses were observed.
Oblique Objects. When flat objects are oriented at an angle to the detector beam, instead of oriented orthogonally, the responses are generally lower - and the objects must be located slightly closer for full-on detection. The table below shows responses for several of the same objects as before, but angled at 45 deg with respect to the detector beam.
Summary. Comparing the beamwidth and object reflectivity results indicates that: