In this tutorial / blog post, we will see how to make simple infrared sensor module for detecting reflecting surface. This sensor can be used to detect reflecting silver/white strip, obstacle detection, flame detection, etc. These sensors are primary requirement of any simple line follower robot car.
If you are looking for ready-made infrared sensors, check here.
IR LED emits infrared radiation. This radiation illuminates the surface in front of LED. Surface reflects the infrared light. Depending on reflectivity of the surface, amount of light reflected varies. This reflected light is made incident on reverse biased IR sensor. When photons are incident on reverse biased junction of this diode, electron-hole pairs are generated, which results in reverse leakage current. Amount of electron-hole pairs generated depends on intensity of incident IR radiation. More intense radiation results in more reverse leakage current. This current can be passed through a resistor so as to get proportional voltage. Thus as intensity of incident rays varies, voltage across resistor will vary accordingly.
This voltage can then be given to OPAMP based comparator.Output of the comparator can be read by uC. Alternatively, you can use on-chip ADC in AVR microcontroller to measure this voltage and perform comparison in software.
IR LED and IR sensor :
IR LED is used as a source of infrared rays. It comes in two packages 3mm or 5mm. 3mm is better as it is requires less space. IR sensor is nothing but a diode, which is sensitive for infrared radiation.
This infrared transmitter and receiver is called as IR TX-RX pair. It can be obtained from any decent electronics component shop and costs less than 10Rs. Following snap shows 3mm and 5mm IR pairs.
Colour of IR transmitter and receiver is different. However you may come across pairs which appear exactly same or even has opposite colours than shown in above pic and it is not possible to distinguish between TX and RX visually. In case you will have to take help of multimeter to distinguish between them.
Here is how you can distinguish between IR TX-RX using DMM :
Connect cathode of one LED to +ve terminal of DMM
Connect anode of the same LED to common terminal of DMM
(means connect LED such that It gets reverse biased by DMM )
Set DMM to measure resistance upto 2M Ohm.
Check the reading.
Repeat above procedure with second LED.
In above process, when you get the reading of the few hundred Kilo Ohms on DMM, then it indicated that LED that you are testing is IR sensor. In case of IR transmitter DMM will not show any reading.
Following snap shows typical DMM reading obtained when IR receiver is connected to it as mentioned above. Second snap shows how sensor’s resistance increases when it is covered by a finger. Note that, these are just illustrative figures and they will depend upon sensor as well as DMM that you are using.
While buying an IR sensor, make sure that its reverse resistance in ambient light is below 1000K. If it is more than this value, then it will not be able to generate sufficient voltage across external resistor and hence will be less sensitive to small variation in incident light.
The circuit diagram :
Circuit diagram for IR sensor module is very simple and straight forward.
Circuit is divided into two sections. IR TX and IR RX are to be soldered on small general purpose Grid PCB. From this module, take out 3 wires of sufficiently long length (say 1 ft). Then, as shown above, connect them to VCC, preset and to ground on main board. By adjusting preset, you can adjust sensitivity of the sensor. VCC should be connected to 5V supply.
Making the sensor module :
You can follow these steps to make a sensor module ….
Testing sensor module :
If you have a breadboard(BB) you can quickly test this module and see how it works.
-First, connect Module on BB and connect 50K preset between vOut and GND.
-Connect DMM to movable terminal of preset.
-Rotate preset knob fully so that, resistance between variable terminal and ground is maximum.
-Give 5V supply to sensor module.
|Test setup :|
Here are some test results of my module :
Here are some of the snaps of my sensor modules :
|Four IR transmitters are used to flood the surface. Sensor diode is at the centre. I had made this when I had to detect black wall. Even black colour reflects detectable IR, if irradiated sufficiently.|
|Sensor module covered with black tape to lessen effect of ambient IR radiation. Also metal strip is glued for easier mounting on robot-car’s chassis.|
|This is how I use sensor module with my mega16 development board. Blue preset is connected to sensor in exactly same way as shown in circuit diagram. vOut is connected to ADC input of AVR.|
vOut is the output from sensor module. You can connect this to ADC input of AVR microcontroller. Now using ADC, you can read the voltage developed across the movable tap and grounded pin of preset. Alternatively you can also use OPAMP based comparator.
…. And finally, if you found this tutorial helpful or have any suggestions … do leave a comment.
Ready made modules:
Making things by our own hands is fun!! However, if you are in a hurry, here are some readily available infrared sensor Modules:
Low cost infrared sensors(from Amazon):
Low cost infrared sensors(from DX):
(Approx cost ~ $4 to $10 / INR 300 to 600, free world wide shipping)