Professional Documents
Culture Documents
15,000 rpm or much more. However this design is more power consuming and is not optimized for high ranges. in
this design, range can be from 1 to 10 cm, depending on the ambient light conditions.
As you can see the schematic is divided
into 2 parts the sender and the receiver.
The sender is composed of an IR LED
(D2) in series with a 470 Ohm resistor,
yielding a forward current of 7.5 mA.
The receiver part is more complicated,
the 2 resistors R5 and R6 form a voltage
divider which provides 2.5V at the anode
of the IR LED (here, this led will be used
as a sensor). When IR light falls on the
LED (D1), the voltage drop increases, the
cathode's voltage of D1 may go as low as
1.4V or more, depending on the light
intensity. This voltage drop can be
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.
Some applications of the 'low range Always ON' Design:
Notice how in both devices, the IR leds are encapsulated to protect them from ambient light. this kind of
encapsulation was totally sufficient to overcome all noise due to ambient light for indoor applications.
Wheel Encoder
This is a simple wheel encoder based on the idea that
white stripes will reflect IR light, while black ones will
absorb it. this will result in a series of electrical pulses
as the wheel is rotating, providing the microcontroller
with precious information that can be used to calculate
displacement, velocity or even acceleration. It is now
clear that this kind of sensor has to be Always ON, to
detect every single white stripe passing in front of it, to
achieve accurate results.
Contact-Less tachometer
This is a tachometer, that counts the revolutions per
minute of a rotating object, given that the object has a
reflective stripe glued on it, that will pass in front of
the IR sensor for each and every revolution, giving a
pulse per revolution. Again a microcontroller will have
to be used to 'understand' the data provided by the
sensor and display it. Many commercial contact-less
tachometers, that are sold for more than $200 rely on
this simple idea!
[Build your own one for less than $20 in this article...]
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
delay(y){
unsigned int i;
for(i=0;i<y;i++){;}
}
void main(){
//P2.0 IR control pin going to the sensor
//P2.1 IR output pin coming from the sensor
while(1){
P2_0 = 1;
delay(20);
ir1 = P2_1;
P2_0 = 0;
delay(98);
ir2 = P2_1;
}
}
//send IR
//stop IR
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.
This 3D model shows the position of the LEDs. The
green plate is the PCB holding the electronic components
of the sensor. you can notice that the receiver LED is
positioned under the PCB, this way, there wont be ambient
light falling directly on it, as ambient light usually comes
from the top.
It is also clear that this way of positioning the LEDs
prevent the emitted IR light to be detected before hitting an
eventual obstacle.
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 OpAmp 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.
In the example C code above, the final output of the sensor appears on the pin P2_3 of the microcontroller