An IR proximity sensor is a device which detects the presence of an object or a human when it is within a predetermined range from the sensor, through reflected infrared beams.
Three useful proximity sensor concepts are explained here, the first concept is based on an ordinary opamp LM358, the second one using IC LM567 which functions with a phase locked loop principle ensuring very accurate response for the detection. The third circuit works using the ubiquitous IC 555. Let's learn each one with a step by step explanation.
There is a long list of sensors that are available in market today.
One such sensor is proximity sensor.
In this post , we are about to unravel how a proximity sensor works and what provide the necessary knowledge to make this project at home. As the name suggests, the unit detects whether an object is near or far from it. They can be designed in different ways.
But, the most common method is the one based on INFRARED rays and OPAMP. Some common uses of this device can be seen in cell phones, automatic flush systems , automatic taps, hand dryers and never-falling robots.
1. IR led: Every led emits some form of electromagnetic radiation when powered up. From our household experience, we have known leds that emit visible light.
But, there are also some special leds that emit infra red rays. Just as there can be visible led of different colours , IR led also emit rays of different wavelengths. Infra Red rays can be of varying wavelengths and can take up any value belonging to their waveband.
So , it is very important that the IR photodiode used must be able to detect the particular wavelength of INFRA RED given out by the IR led.
2. IR PHOTODIODE: It is a special type of diode which is connected in reverse bias for IR rays detection. In the absence of IR radiation , it has a very high resistance and practically zero current passes through it.
But when the IR rays fall on to it ,its resistance decreases and a current proportional to the intensity of the radiation is allowed to pass through it.
This property of photodiode is used to generate an electric signal in proximity sensor on incidence of IR rays.
3. Op-amp (IC LM358): Op-amp or operational amplifier is a multi-purpose ic and is highly revered in the electronics world.
In this project op-amp is used as a comparator. LM358 IC has two op-amps which means we can make two proximity detectors using just one IC. The reason to use op-amp in the circuit is to convert analog signal into digital signal.
4. Preset: Preset is basically a resistor having three terminals.
The function of a preset is to divide the total voltage available in a way that the user can access a fraction of it. We just have to set the middle terminal to an appropriate position.
The preset sets the threshold voltage above which the output voltage should be generated. It can be manually set to resistance of any value by rotating its head using a suitable screwdriver.
5. Red led : I have used a red led for my project but in general led of any colour can be used. It acts as a visual signal to show that the obstacle has come close enough.
6. Resistors: Two 220 ohms and one 10k ohm.
7. Power supply: 5 v to 6v.
How it work
The principle lying behind the working of a proximity sensor is fairly simple. A typical concept has two leds parallel to each other – IR emitting led and a photodiode.
They act as a transmitter-receiver pair. When an obstacle comes in front of emitter rays, they are reflected back and intercepted by the receiver.
As per the properties of the photodiode ,the intercepted IR rays decrease the resistance of the photodiode and the resultant electric signal is generated. This signal in practice is the voltage across the 10k resistor which is directly fed to non-inverting end of op-amp.
The function of the op-amp is to compare the two inputs given to it.
The signal from the photodiode is given to the non-inverting pin (pin 3) and the threshold voltage from potentiometer is given to the inverting pin (pin 2).If the voltage at the non-inverting pin is greater than the voltage at the inverting pin the op-amp output is high otherwise the output is low.
All in all, op-amp converts analog signal into digital signal in this circuit.
The sensor output can be used in two forms: ANALOG and DIGITAL.
Digital output is in the form of either high or low. Digital output signal of a proximity sensor can be used to stop the motion of an obstacle-avoiding robot. As soon as, the obstacle comes close enough, signal can be directly fed to the input pins of motor driver to stop the motors.
Analog output is a continuous range of values from zero to some finite value. Such signal cannot be directly given to motor drivers and other switching devices. First they need to be processed by the microcontrollers and converted into digital form through ADC and some coding. This output form requires an additional microcontroller but eliminates the use of op-amp.
Full Circuit Digaram
UPDATE from Admin
The above circuit design could be also built using an ordinary single opamp IC 741, as shown below:
Proximity Sensor with a Relay and IC LM358
The above explained proximity sensors can be also used with a 12V supply and a 12V relay, as shown in the following figure. The op amp used is from the IC LM358.
Using a Relay and IC 741
The transmitter and the receiver IR LEDs can be also configured with the IC 741 for making a simple proximity sensor circuit. The entire diagram is given in the following figure:
2) Accurate Proximity Detector Circuit (Immune to Sunlight)
The following post explains an accurate infrared (IR) based proximity detector circuit which incorporates the IC LM567 for ensuring reliable, and foolproof operations. This circuit is immune to sunlight or any other ambient light, and will not get affected, until the tuned reflected signals is received by the sensor. The design also works as an obstacle detector.
The Circuit Concept
I found this design on the net while searching for an accurate and reliable yet cheap proximity sensor circuit.
The circuit may be understood with the help of the following description:
Referring to the below shown infrared (IR) motion detector circuit, we see the design consisting of two main stages, one involving the IC LM567 while the other with the IC555.
Basically the IC LM567 becomes the heart of the circuit which solely performs the functions of the generating/transmitting the IR frequency and also detecting the same.
Moreover the IC has an internal phase locked loop circuitry which makes it highly reliable with frequency detecting circuit applications.
It means once it reads and latches to a given frequency, its detection feature gets locked to that frequency and therefore any other stray disturbance no matter how strong it may be doesn't influence or rattle its functioning.
An internal oscillator frequency determined by R3, C2 feeds the IR diode D274 via a current controlled stage consisting T1, R2. This frequency decides the center frequency of the chip.
With the above conditions the IC gets set and centered at the above frequency generating a constant high at its output pin#8.
Input pin#3 of the IC waits to receive a frequency which may be exactly equal to the above "centered" frequency of the IC.
The IR receiver or the sensor connected across pin#3 of the IC is positioned exactly for this purpose.
As soon the IR beam from the LD274 finds an obstacle, its beam gets reflected and falls on the appropriately positioned detector diode BP104.
The IR frequency from the LD274 now passes to the input pin#3 of the IC, since this frequency will be exactly same to the set center frequency of the IC, the IC recognizes this and instantly switches its output from high to LOW.
The above low trigger at pin#2 of the IC 555 which is configured as a monostable in turn switches its output high, causing the connected alarm to blow.
The above condition persists for so long as the interruption from of the IR sensor/ detector stays and allows the beams to get reflected. With the inclusion of R9 and C5, the output of IC555 exhibits a certain delay off condition for the connected buzzer even after the motion or the obstacle moves away.
For adjusting the delay-off effect, R9 and C5 may be tweaked as per preference.
The above explained circuit may also be used as a proximity detector circuit and obstacle detector circuit.
The following test circuit shows how to verify the results from a basic LM567 IR based design. The schematic can be seen below:
As you can see, only the LM567 stage is incorporated in the design while the IC 555 stage has been eliminated in order to keep the fundamental testing procedures simpler.
Here the red LED at pin#8 of the IC lights up and remains illuminated as long as the IR LEDs are held parallel to each other within a distance of 1 foot.
If you try replacing the Tx infrared red transmitter LED with some other external source having a different frequency, the LM567 is stop detecting the signals and the red LED will stop glowing.
The photo diodes are not crucial, you can use any similar or standard photo diodes for the transmitter and receiver LEDs.
Video clip for the above test set up:
3) Another IC 567 based Proximity Sensor Design
Just as above, the exceptional feature regarding this circuit is that it cannot be activated or rattled by direct IR radiation, rather only reflected IR radiation hitting the detector will trigger the circuit.
In the centre of the circuit is a solitary 567 tone decoder IC (U1) that executes a twin functionality: it runs both as a basic IR-transmitter driver and as a receiver. Capacitor C1 and resistor R2 are employed to fix U1's internal oscillator frequency to around 1 kHz.
The square-wave output from U1 at pin 5 is applied on the Q1 base. Transistor Q1 is set up as an emitter-follower amplifier, which connects a 20-mA pulse on the LED2 anode.
Transistor Q3 picks up the IR output from LED2 and directs the transmission on to Q2 for more amplification. Following amplification by Q2, the signal is applied back to the input of U1 at pin 3, triggering pin 8 to become low, switching ON LED1.
When required, LED1 could be substituted with an optocoupler to toggle virtually any AC-operated load. Because the circuit is very straightforward, almost any design plan will work.
The IR emitter (LED1) and the phototransistor (03) must be installed approximately inch separated within a side-by-side placement and focused in the exact same track.
It may be required to test out the spacing and installation viewpoint of the a pair of IR devices to figure out the perfect position for any assigned range between the detector and the emitter.
As a rule of thumb, an inch gap between the IR-emitter/detector pair makes it possible for the proximity circuit to discover a target approximately half to 1-inch apart. Lighter shaded targets reflect much better and can perform at increased distances than those created from deeper elements. So long as the proximity sensor picks up the tuned IR signals, the controlled circuit continues to be turned on, and as soon as the signal vanishes the output turns off.
Proximity Detector using LM567 and OPB711 optocoupler
The electronic diagram of this important part is shown in the figure below. The use of a small opto-reflective sensor will allow us to utilize infrared radiation emitted by the IC2 circuit's emitting diode (pins A and K).
Unlike traditional integrated or forked opto-couplers, the IR beam from the emitter is directed outward from the package at an angle of a few degrees.
The receiving phototransistor is also oriented at the same angle in order to achieve a convergence point a few centimeters away from the sensitive surface.
If no obstacle "reflects" the emitted beam, the sensor will remain inactive. An object, or even just a hand, is sufficient to validate the signal and enable its further processing.
To ensure perfectly reliable operation even in bright light conditions, we will control the emitting LED with a periodic signal of a precise and relatively high frequency. To achieve this, let's examine the IC1 circuit labeled NE567N.
This circuit is commonly used as an ultra-selective frequency decoder. It has its own internal time base, which can be supplemented externally by resistor R5 and capacitor C2. The central frequency of our sample is simply calculated using the following relationship:
f = 1/R5 * C2 = 1/0.012 * 0.033 = approximately 2.5 kHz.
This rectangular signal is available at pin 5 of the IC1 circuit. By injecting a signal of the same frequency at pin 3 of the decoder, the internal PLL would perform the comparison, and in case of a match, the circuit's output at pin 8 would be set to a low level.
Using the PNP transistor T1, which is driven on its base through resistor R3 by the same signal, we supply power to the emitting LED of the IC2 sensor.
When there is reflection, the phototransistor collects a signal with reduced amplitude (adjusted by adjustable P1) but with the same frequency.
If the sensitivity is sufficient, the IC1 circuit validates, through R9, the T2 transistor responsible for driving a small relay at the output. One of the relay's contacts is also used to illuminate the indicator LED L1 through limiting resistor R10.
Capacitors C3 and C4 provide filtering to improve the operation of the entire system, which should be powered by a voltage close to 5V.
In fact, to best suit our relay, the power supply voltage is set at approximately 6V without damaging the IC1 circuit.
It should be noted that the control signal can range from 0.01 Hz to 500 kHz, and the open-collector output at pin 8 is capable of supplying 100 mA to ground.
4) Proximity Detector Using IC 555 Circuit
In this third design we discus a simple IC 555 based proximity detector circuit which can be used for detecting human trespassing from a distance.
An infrared proximity detector can be considered as one of the most valuable and widely used circuits in electronic automation application range.
We can typically see it being used in automatic water dispensers, automatic hand dryer units and some specific variants may be witnessed in the automatic doors of department stores.
Working principle of the proposed proximity detector circuit using IC 555
In the design a generation of rapid bursts of peak voltage pulses from the IC LM555 is implemented at a relatively lower frequency rate, which is transmitted via the infrared LED as jets of IR beams.
These transmitted pulses are focused toward the area which is required to be monitored, and is reflected back when a subject or intruder is detected over a phototransistor diode positioned strategically for receiving these reflected signals..
Once this happens the received signals go through processing in order to enable an attached relay mechanism and subsequently an alarm device to get activated.
To test the above implementation an object may be introduced across the zone of the IR beams and the response may be checked by monitoring the relay operation, such as by moving hand in the focused area, within a distance of about 1 meter.
When the reflected signals hit the phototransistor, it develops a potential difference across the 1M pot (adjustable) and triggers the associated Darlington stage, which in turn activate the right hand side 555 stage configured as a monostable circuit.
The relay gets activated in response to this and stays ON depending on the monostable predetermined time delay set by the 1M and the 10uF capacitor.
Parts List fro the proposed IC 555 based IR proximity detector circuit.
2-- IC LM 555
2-- IC sockets 8 pin
1-- relay 12 V 5 pin
1-- Infrared Phototransistor General Purpose
1-- Infrared Diode General Purpose
2-- capacitors. 10 uF / 50 V
1-- 1N4148 diode
1-- red led 5mm
1-- 68 H
1-- 470 R H All 1/2 W
1-- 10k 1/4 w resistor to be connected in between 1M preset center lead and the BC547 pair
IC 555 Pinouts