| 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:
03 Sep 2008 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
I agree with that it is very interesting to be able to detect such long ranges.
Since you are registered to the forum, you will know soon enough by mail when such a project is done and published on the site.
I do have the lazer pointer, but nothing else.. i can't promess when such a project will be ready.
|
|
|
|
Posted
by:
s_hatalageri
on:
03 Sep 2008 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
thanks for the reply....
it would be very helpful if u could do a similar uv or laser proximity sensors and make that as one of the projects on your sites.
it would be really useful as 25 to 30 meters ranges are employed in various application as you know..
looking forward for a positive reply..
thank you
|
|
|
|
 |
Posted
by:
ikalogic
on:
03 Sep 2008 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
Quoting s_hatalageri: i need a clarification ..
Is it possible to increase the proximity sensor of the above type with detecting ranges upto
30 meters?
if yes ....can u plz show the circuit diagram with the modifications required
and also ..is it possible to make a led glow once the object is detected at ranges in between 25-30 m? |
No, i really doubt 30 meters would be doable, at least now that i know of.. i am sorry.
I think you best bet for such ranges is ultra sound.
There may be also some LAZER based range finders that combine lazer, a camera and complex DSP to claculate the distance based on the diameter of the lazer SPOT on a surface...
|
|
|
|
 |
Posted
by:
s_hatalageri
on:
03 Sep 2008 |
Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
i need a clarification ..
Is it possible to increase the proximity sensor of the above type with detecting ranges upto
30 meters?
if yes ....can u plz show the circuit diagram with the modifications required
and also ..is it possible to make a led glow once the object is detected at ranges in between 25-30 m?
|
|
|
|
 |
 |
Posted
by:
ikalogic
on:
24 Jul 2008 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
Quoting girishbe04: Hi
Is there a possibility to measure the speed of a small object (50mmx100mm size), which is just passing in front of the sensor (where the speed could be at around 200 to 500m/sec) using this method? The distance between the sensor and an object is 2m to 3 meter.
If so, anything should I modify from schematic diagram Please suggest |
Such a small object is not detectable from 2 or 3 meters, it has to be a few centimeter away from the sensor..
So, Yes, this could be done, without modifications as far as i can imagine.. but as i said, you have to bring the object to zone that is "detectable"...
|
|
|
|
 |
Posted
by:
girishbe04
on:
24 Jul 2008 |
Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
Hi
Is there a possibility to measure the speed of a small object (50mmx100mm size), which is just passing in front of the sensor (where the speed could be at around 200 to 500m/sec) using this method? The distance between the sensor and an object is 2m to 3 meter.
If so, anything should I modify from schematic diagram Please suggest
|
|
|
|
Posted
by:
kenji83
on:
02 Jul 2008 |
Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
Hi "saif" , i think you should do some circuit analysing. The 1st 2 NAND gate are becomes a oscillator which generate a pulse signal (40kHz). The function of NAND gate L+L=H,L+H=H,H+L=H,H+H=L. Please keep in mind, the CTRL ,pin2 should always connected to +5V because the signals from pin 8 in pulse form. L+(pin2)=H , H+(pin2)=L
Hope my elpaination would help you ^^
|
|
|
|
Posted
by:
ikalogic
on:
13 Jun 2008 |
Re: Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
Good work aroud!
About the CTRL pin, well, there is no certain frequency for that pin, it is optional anyway, it just allows you to turn on or off the whole sensor. (sometimes, when you have 5 or 6 of those "power consuming" sensors, it interesting to turn on only the onw you're actually reading)
|
|
|
|
Posted
by:
one
on:
12 Jun 2008 |
Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
ok,i've found out wat's the reason dat my IRLEDs r not emitting, just try to reverse bias both D1 and D3, and the whole circuit works fine! So the output for now is,when there's an obstacle existing, my LED at the Rx side will glow. As for the CTRL at pin#2 of 74HC00, may i noe izit required me to connect it to a micro controller and provide some pulses to it?if yes...may i noe wat frequency do i have to apply?
|
|
|
|
Posted
by:
one
on:
12 Jun 2008 |
Infra-Red proximity sensors PART 2 (40 Khz Mudulated) |
|
 |
ok, i will try to send u a screen shot of the circuit i built to ur email, i am following exactly the same circuit design dat u posted it on infrared proximity sensor part2. However, i guess my Tx part is not working properly, there is a voltage across to both IR LEDs, but it doesnt seems to be emitting, cuz my TSOP couldnt detect anything from it.
|
|
|
|
You have
to be a member to post replies. |
|
|
|