| Infra-Red
Proximity Sensor
(II)
Using
40Khz IR receiver IC
By
Ibrahim Kamal
Last update:
4/4/08
Overview
 |
This
article deals with a more advanced IR proximity sensing
scheme, as compared to the one proposed in the previous
article. It is also more expensive but provides more
accurate results even in sunny outdoor environment.
This sensor is practically not affected by
ambient light, and it can provide detections ranges that
exceed 1 meter. However, The main idea remains the same
where Infra-Red light is emitted on an object, which reflects
the light back, then the reflected Infra-Red light is sensed
with a special IR sensor. The whole difference is in the
way IR is sent and received. |
|
1.
The Principle of operation
 |
As I said, the main idea behind
obstacle detection using IR is to send Infra-Red (IR) light in
a
certain
direction, and if an object is present no too far from the
sensor, IR will be reflected back and detected by the sensor.
But as you may already know, one of the biggest problems
that can cause the malfunctioning of an IR proximity sensor,
is the ambient light and surrounding sources of IR like
the sun and halogen lamps that can cause false triggering
of the sensor.
The ingenious solution that was developed to avoid this
problem, is to send pulses of IR light at a certain frequency
instead of a constant beam, and build a receiver that would
only detect IR pulses of the same exact frequency, cutting
of all pulses of higher or lower frequency. The kind of
device capable of filtering signals this way is called a
bandpass filter. There are a lot of types of bandpass filters,
a whole branch of electricity is dedicated to this subject.
Instead of building a band pass filter, we used a very common
IR receiver Module as the one shown in figure 1.A, that
incorporates a receiver, an amplifier and a very reliable
filter that rejects all the signals that are a couple of
kilohertz far from the original central frequency, all in
one single integrated circuit, just as big as a 5V regulator.
The central frequency is fixed by the constructor usually
at 40 khz.
In order to achieve the best possible results, it's important
to understand how this IR receiver detect the 40 Khz IR
pulses among all other sources of light. This will help
you to take some important factors in consideration |

Figure 1.A
|
while designing similar sensors using the same IR
receiver.
Figure 1.B shows in simplified way the
composition of the IR receiver and the way it filters
all the source of light except the the 40Khz IR signal.
It all starts by generating the 40 Khz pulses of electricity
that are fed to an IR LED, emitting 40Khz pulses of Infra
Red light. A weaker signal but with the same frequency
is reflected from an eventual obstacle to the IR receiver,
it passes through the IR-PASS filter, which will eliminate
other sources of light which are not IR (visible light).
At this point the photo diode hiding behind
|

Figure 1.B |
the IR-PASS filter still detects
a lot of noise due to other sources of IR light like the sun for
example, so the signals received by the diode are fed to another
stage composed of an active filter to select the 40Khz IR signals
among all others, amplify it and demodulate it, providing a clean
logic output (5 or 0 volts).
2.
The electronic Circuit
 |
The electronic circuit for this proximity sensor
is shown in figure 2.A, as you can see it is composed of two main
parts, the sender and the receiver. The sender part is composed
of the four NAND gates, the 2N2222A transistor and the IR LEDs.
The first two gates are a NAND gates oscillator, they
generate the 40 Khz square wave required to send valid signals
that are compatible with the receiver IC. The second two gates
are configured as one single AND gate, used to enable or disable
the sender part. The potentiometer R1 adjust the current injected
into the LED thus it controls the strength of the emitted IR beam
and thus it controls the range of the proximity sensor. The potentiometer
R2 is used to precisely adjust the frequency of the signal that
drives the IR LED.
The Receiver is pretty simple, because is basically relies on
the U2 the IR receiver is discussed above. The low pass RC filter
composed of R6 and C2 is very important to eliminate the noise
especially that the emitter and the receiver share the same power
supply. Noting that the output of U2 (the IR receiver) is active
low, it is clear that the LED D2 will glow when an object is detected
by the sensor.

figure 2.A |
3.
Components
positioning
 |
Like in most home made proximity sensors, the sender
LEDs and the receiver are placed on different sides of the PCB
in such a way that the PCB optically isolates the receiver from
the
direct
IR emissions of the LEDs. Note that if the IR receiver
detect the IR light of the LED directly; before it hits
an objects that reflects it back, the whole process of
object detection wont work. Figure 3.A shows the path
of the beams from the IR LED to the object and finally
to the IR receiver.
You can also notice that the PCB is inclined at 35°.
Actually the PCB was designed to be mounted this way on
a robot or for other application to totally protect the
sensor from ambient light. This way, even the sun light
with all its infrared radiations don't perturb the operation
of the sensor. This is due to the fact that most - if
not all - of the strong ambient light sources come from
a relatively high position and thus, the light beams of
the such sources of light will hit the PCB instead of
the receiver. Only the vertical or almost vertical beams
will reach the receiver. It is clear that we may be losing
a part of the 40 KHz IR beams sent |

Figure 3.A |
from the IR LED, but we also also
eliminating all most probable sources of error. If you
want to be sure for 100 % that the reading of the sensor is not
affected by ambient lightning conditions, you can still use the
"software based
ambient light detection" technique explained in this
previous article.
A last note on component positioning
is the fact that we used two IR LEDs instead of one
in the previous sensors. The use of two leds increases
the angle of vision of the sensor, but do not increase
the range to am important extent. if you want to build
a sensor that concentrates on a smaller angle, you can
use a single IR LED.
Figure 3.B shows the two IR LEDs while they are being
carefully positioned by trial and error to achieve the
desired coverage area.
|

Figure 3.B |
4.
Conclusion
 |
The technique
proposed in this article is sophisticated and reliable
enough to be used in mobile robots for obstacle avoidance,
for automatic doors, for parking aid devices or for alarm
systems, however, the main weakness of IR remains the
same, which is the fact that the reflectivity of the IR
beams highly depend on the shape, size and color of the
object. In other words if you adjust your sensor for detecting
objects at a distance of 50 cm, important variation of
this distance can be observed between a big white wall
and a small black purse on the ground for example.
Techniques that are further more sophisticated have been
developed to overcome this point of weakness of IR proximity
sensors...
|
|
Some
picture of the IR proximity sensor.
|
|
Join the Mailing List |
| Let us get in
touch with you when we upload new interesting content.
|
Preview of the last 15
messages discussing this page. Messages are sorted from the newest to
the oldest. |
Posted
by:
ikalogic
on:
02 Mar 2010 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
Quoting huayuliang: fish and fishery
simple chinese |
Great! Now, as the french say "je me coucherais moins bête ce soir" meaning, when i go to sleep tonight i'll be less stupid than yesterday (meaning i learnt somthing new) !
Yes... french proverbs are always that ironic! lol
|
|
|
|
Posted
by:
ikalogic
on:
01 Mar 2010 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
Quoting huayuliang:
Quoting rami00972:
| Quoting islammath: where is pcb |
hay man you should learn how to make your own pcb Chinese saying :"Don't give me fish, teach me to fish" |
? and ?
although the difference between different languages, but the base is same... |
mhhh... any translation plz?
|
|
|
|
Posted
by:
yuvi
on:
29 Dec 2009 |
|
|
Posted
by:
johncoths
on:
29 Oct 2009 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
I am thinking of a best sensitivity of a Infra-Red proximity sensors? Just wanna know about the accurate sensitivity for several proximity? And about the an IR sensor module for some distance measurement of the order for a micro mouse.
_________________ [url=http://www.protectyourhome.com>Security Systems"> [link]
|
|
|
|
Posted
by:
ikalogic
on:
13 Aug 2009 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
| Quoting ryan_chandl: I have built a similar device but the receiver is too sensitive, it detected the ir beam even when i put the led in different direction. I think this is because the led doesn't focus the ir beam, any solution for this? |
Put the receiver leds behind the sender, and enclose the sender with thermotube or any other thing that prevent IR from going backward by reflection or any other means...
|
|
|
|
 |
Posted
by:
ikalogic
on:
01 Jul 2009 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
Quoting ivan123_ph: im doing a thesis on a security system that uses proximity sensors as a triggering device and plans to use IR proximity sensors. This site really helps alot in my study. What is the maximum range for this sensor because i wish for the sensor to detect or trigger the security system 1 meter or more away from the sensor. will i be able to use the sensor in this site? pls reply
Thank you |
for 1 meter indoor, yes.
If you want really big ditancces you can use the same sensor in an IR barrier configuration, where you can easily reach anything from 1m to 20m
|
|
|
|
 |
Posted
by:
ivan123_ph
on:
01 Jul 2009 |
Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
im doing a thesis on a security system that uses proximity sensors as a triggering device and plans to use IR proximity sensors. This site really helps alot in my study. What is the maximum range for this sensor because i wish for the sensor to detect or trigger the security system 1 meter or more away from the sensor. will i be able to use the sensor in this site? pls reply
Thank you
|
|
|
|
You have
to be a member to post replies. |
|
|
|