Académique Documents
Professionnel Documents
Culture Documents
Top of Form
Bottom of Form
../ir_prox_sensor Login
Overview
This sensor can be used for most indoor applications where no important
ambient light is present. For simplicity, this sensor doesn't provide ambient
light immunity, but a more complicated, ambient light ignoring sensor
should be discussed in a coming article. However, this sensor can be used
to measure the speed of object moving at a very high speed, like in industry
or in tachometers. In such applications, ambient light ignoring sensor,
which rely on sending 40 Khz pulsed signals cannot be used because there
are time gaps between the pulses where the sensor is 'blind'...
The solution proposed doesn't contain any special components, like photo-diodes, photo-transistors, or IR receiver ICs,
only a couple if IR leds, an Op amp, a transistor and a couple of resistors. In need, as the title says, a standard IR led is
used for the purpose of detection. Due to that fact, the circuit is extremely simple, and any novice electronics hobbyist
can easily understand and build it.
schematic, we are going to use a Op-Amp (operational Amplifier) to accurately detect very small voltage changes.
detected using an Op-Amp (operational Amplifier LM358). You will have to adjust the variable resistor (POT.) R8 so
the the voltage at the positive input of the Op-Amp (pin No. 5) would be somewhere near 1.6 Volt. if you understand the
functioning of Op-Amps, you will notice that the output will go High when the volt at the cathode of D1 drops under
1.6. So the output will be High when IR light is detected, which is the purpose of the receiver.
In case you're not familiar with op-amps, here is shortly and in a very simplified manner, what you need to know to
understand how this sensor functions: The op-amp has 2 input, the +ve input, and the -ve input. If the +ve input's
voltage is higher than the -ve input's voltage, the output goes High (5v, given the supply voltage in the schematic),
otherwise, if the +ve input's voltage is lower than the -ve input's voltage, then the output of the Op-Amp goes to
Low (0V). It doesn't matter how big is the difference between the +ve and -ve inputs, even a 0.0001 volts difference will
be detected, and the the output will swing to 0v or 5v according to which input has a higher voltage.
Now, hands on the circuit that will put all this theory into practice. The CTRL input in the figure, stands for Control,
and this pin should be connected to the source of the low duty cycle pulses discussed above, whether it is a
microcontroller or an LM555 timer that generates the pulses.
The calculations yielded that a 10 ohm resistor is series with the LED D2, would cause a current of approximately 250
mA to flow through the LED. A current this high, would destroy the LED if applied for a long period of time (some
dozens of seconds), this is why we have to send low duty cycle pulses.
The first Op-amp will provide voltage buffer, to enable any kind of device to control the
sensor, also, it will provide the 30mA
base current required to drive the
base of the transistor. The calculation
of the the base resistor R3 depends
on the type of transistor you use, thus
on how much current you need on
the base to drive the required
collector current.
OFF. But study the second period of the graph, where the sensor is put in a high ambient light environment. As you can
see, the the microcontroller records "1" in both conditions (OFF or ON). This means that we can't be sure whether the
sensor reception was caused by an object that reflected the sent IR light, or it is simply receiving too much ambient light,
and is giving "1" whether there is an obstacle or not.
while(1){
P2_0 = 1; //send IR
delay(20);
ir1 = P2_1;
P2_0 = 0; //stop IR
delay(98);
ir2 = P2_1;
Components positioning:
The correct positioning of the sender LED, the receiver LED with regard to each other and to the Op-Amp can also
increase the performance of the sensor. First, we need to adjust the position of the sender LED with respect to the
receiver LED, in such a way they are as near as possible to each others , while preventing any IR light to be picked up
by the receiver LED before it hit and object and returns back. The easiest way to do that is to put the sender(s) LED(s)
from one side of the PCB, and the receiver LED from the other side, as shown in the 3D model below.
Another important issue about components positioning, is the distance between the receiver LED and the Op-Amp.
which should be as small as possible. Generally speaking, the length of wires or PCB tracks before an amplifier should
be reduced, otherwise, the amplifier will amplify - along with the original signal - a lot of noise picked up form the
electromagnetic waves traveling the surrounding.
Here is an example PCB where the distance between the LED and the Op-Amp is
shown. Sure this distance is not as critical as you may think, it can be up to 35mm
without causing serious problems, but trying to reduce this distance will Always give
you better results.
Actually, when I design the PCB, I start by placing the receiver LED and the Op-
Amp, as near to each others as possible, then continue the rest of the design.
Then, you can start testing the range of the sensor, and experiment it in different ambient light conditions, but the
potentiometer may have to be adjusted carefully, to cope with ambient light.
In the example C code above, the final output of the sensor appears on the pin P2_3 of the microcontroller, as explained
before.
Related Tutorials
Ambient light ignoring infra-Red proximity sensor, using 40Khz IR receiver IC
Proximity sensors at BEAM circuits,an overview about IR (InfraRed), Acoustic, Capacitive and Inductive procimity
sensors.
Name:
Email:
2181283854
Subscribe Unsubscribe
1 GO
Bottom of Form
Posted by:
kaviyar ['Quote ]
Infra-Red proximity sensors PART 1
asu
on: 04
Nov 2009 i want clear detail for this project pls send
Posted by:
pratik2 ['Quote ]
Infra-Red proximity sensors PART 1
0990
on: 19 Oct
2009 i have some doubts-
Posted by:
svignes ['Quote ]
Infra-Red proximity sensors PART 1
h90
on: 12 Oct
2009 Can I use this sensor for line-tracking? And is it possible to get these kind of sensors as 8-cell arrays (similar
to LED and LDRs) ?
http://www.pololu.com/catalog/product/1134
Posted by:
svignes ['Quote ]
Infra-Red proximity sensors PART 1
h90
on: 12 Oct
2009 Sir,
I'm building a robot now and I would like to use line-tracking sensor which can detect white reflective tape
on a black background. The distance from which it can sense the line needs to be approximately 3-5 cm
(height of chassis from the ground). Is it advisable to use IR proximity sensors for this?
I checked the line tracking sensors at http://www.ikalogic.com/tut_line_sens_algo.php. The speed at which
it detects is important and hence I think IR proximity sensor is better than LED and LDRs. Most of the Line
tracking sensors I found online have a very low sensing distance of 1-12 mm (like this one
http://www.trossenrobotics.com/p/I2C-Li ... ensor.aspx).
Can you please advice which one will be better for me to use? And is it possible to get a detailed description
of "IR proximity sensor used for line-tracking" as it's mentioned for LED and LDR sensor?
Thank you very much.
Posted by:
['Quote ]
Re: Infra-Red proximity sensors PART 1
Quoting jaydu1904: thank you Sir, bt if I use those blue/black IR LEDs that i am getting here, will the circuit work properly or not??
Also I have another doubt, if I want to use a photo detector diode in the Receiver part of the circuit(instead of IR LED), will there be
any changes in the circuit??(Because photo diode is connected in reverse bias)
thanks again...
ikalogic
on: 02 Oct
2009
I am not quite sure of the result, I know it will work, but how good? i dont know. You have to try
different configurations.
Posted by:
jaydu1 ['Quote ]
Re: Infra-Red proximity sensors PART 1
904
on: 02
Oct 2009 thank you Sir, bt if I use those blue/black IR LEDs that i am getting here, will the circuit work properly or
not?? Also I have another doubt, if I want to use a photo detector diode in the Receiver part of the
circuit(instead of IR LED), will there be any changes in the circuit??(Because photo diode is connected in
reverse bias)
thanks again...
Posted by:
['Quote ]
Re: Infra-Red proximity sensors PART 1
How an IR LED looks like??? Bcoz one that is shown in images here is transperant, whereas one i've got here is bluish black in colour.
Are the same or will it make some difference??
I know it sounds a fullish kind of quetion bt still please let me know...
ikalogic
on: 02 Oct thanking you...
2009
it is not a foolish question at all! on the contrary, when i was testing my IR sensors, i always got much
better results with transparent IR leds than with opaque ones. I am however unable to give you a certain
reason for that!
Posted by:
jaydu1 ['Quote ]
Infra-Red proximity sensors PART 1
904
on: 02
Oct 2009 hello Sir,
How an IR LED looks like??? Bcoz one that is shown in images here is transperant, whereas one i've got
here is bluish black in colour. Are the same or will it make some difference??
I know it sounds a fullish kind of quetion bt still please let me know...
thanking you...
Posted by:
['Quote ]
Re: Infra-Red proximity sensors PART 1
Quoting Rafrussel: hello..could some one help me: I need a circuit of a sensor and their components using PIC16f84...thankyou for
you time
ikalogic
on: 02 May
2009 That same circuit will work with any µC, including PIC.
http://www.ikalogic.com/ir_prox_sensors.php
http://www.ikalogic.com/ir_prox_sensors_40khz.php
Posted
by: ['Quote ]
Infra-Red proximity sensors PART 1
rafrus
sel
on: 02 hello..could some one help me: I need a circuit of a sensor and their components using PIC16f84...thankyou
May for you time
2009
Posted
by: ['Quote ]
Infra-Red proximity sensors PART 1
sukr
ut
on: 15 hello sir.
Apr i have finished making the ir sensor.
2009
so do u need to add program with ir sensor zip file to microcontroller.
as when u connect sensor the o/p isnt changing on display.?
reply immediately.
Posted
by: ['Quote ]
Infra-Red proximity sensors PART 1
sukr
ut
on: 12 hi,do we have to burn program given for ir sensor in microcontroller along with the code for the digital
Apr tachometer.
2009
Poste
d by: ['Quote ]
Infra-Red proximity sensors PART 1
the
jud
ge this is probably a noob question, but what's the amp rating for the different 5v inputs?
on: also, is the on/off "switch" between the output label and ground?
02
Apr
2009
Poste
d by: ['Quote ]
Re: Infra-Red proximity sensors PART 1
mak
sa
on: 02
Mar Quoting sumanfiem:
2009
Quoting sumanfiem: Sir,
I'm interested in having an IR Proximity detector circuit that gives an analog output and not digital...i.e, I want to know exactly how far is
the bot from an obstacle. What changes would you suggest in your above circuit that would make this possible?
Thank you
since op amp output will swing from 0 to 5v if it sense something, i think is hard to do but if u use ranger or
sonar sensor u could do that, because apparently i use those method for my sumo robot. so the ranger will send
signal and receive the signal back after that it will calculate it for u then i use adc to convert to digital as my
input function.
Posted by:
sumanf ['Quote ]
Re: Infra-Red proximity sensors PART 1
iem
on: 28 Feb
2009
Quoting sumanfiem: Sir,
I'm interested in having an IR Proximity detector circuit that gives an analog output and not digital...i.e, I want to know exactly how far is
the bot from an obstacle. What changes would you suggest in your above circuit that would make this possible?
Thank you
../ir_prox_sensor Login
All content on this site is provided as is and without any guarantee of any kind. We cannot be held responsible for any errors,
omissions, or damages arising out of use of information available on this web site.
IMPORTANT COPYRIGHT NOTE: Electronics and Robotics Articles by Ibrahim
KAMAL are licensed under a Creative Commons Attribution-Noncommercial-No
Derivative Works 3.0 United States License.