Saturday, July 17, 2010

Obstacle Sensor Circuit

Here I am explaining a circuit for obstacle sensing which I designed for my project work. This is based on IR led and photo transistor.

Working Of The Circuit
This circuit has symmetry about a line drawn through the center. Left side constitutes left sensor and right side constitutes right sensor. For the ease of explanation only one side alone is referred. Each sensor is composed of two IR led’s and one photo transistor. The resistor R1 limits the current through the IR led’s. IR led will send IR rays. If any obstacle is before it, the IR rays get reflected from it. These reflected rays will be sensed by the phototransistor. It is the base of the photo transistor which is the sensing part. The amount of light falling on base region constitutes the base drive. This will get amplified. In the circuit when there is no obstacle ,the photo transistor will not sense any light. Thus no base drive and the transistor is cut off. So no current flows through R2 and subsequently no voltage drop. Thus the transistor Q1 will not get the base drive so its output at the collector will be high. This output is sent to a comparator working in inverted mode. So the output of the comparator will be low. Thus if no obstacle is sensed at the left side then the output from the left side comparator will be low. Similar is the case for left side. If an obstacle is present, it will reflect the IR rays. It will be sensed by the photo transistor. This will create a base drive which turns ON the photo transistor. Thus current starts flowing through R2 and as a result a voltage is developed across it which gives Q1 a sufficient drive. This will lower the output at the collector. The output voltage will depend on the amount of the reflected rays. This analog nature is not suitable for the microcontroller. It is to convert this analog output to the digital form we use a comparator set at a specified threshold. LM324N quad comparator IC is used for this. Threshold is set by varying the pot. Thus if an obstacle is sensed at left side, P1.4 becomes high. If an obstacle was detected at the right side, P1.5 goes high. These two are the inputs to the micro controller, connected to the P1.4 and P1.5 respectively. Rest of the control is done by the microcontroller program.

Component Explanation
In this circuit IR LED’s together with phototransistors are used for sensing the obstacle. D1, D2, D3, D4 are IR LED’s and Q3 and Q4 are photo transistors. Resistors R1 and R8 are for current limiting. Transistors Q1 and Q2 are preamplifiers and R3, R4, R5, R6 are biasing resistors for Q1and Q2. P1, P2 are potentiometers foe setting the threshold of the comparator. LM324N is a quad Op amp IC. Pins 2, 3, 13, 14 are the inputs of the upper comparators. Pin 1&14 are the outputs of the upper comparators. These are given to the microcontroller inputs P1.4& P1.5.

For more details and troubleshooting contact me at


Clement Mwenda said...


like ur circuit,i have been busy to, with ir sensors for ma project obsticals robot,the problem is my sensor does not detect everything,example it dont detect black obstical ;
does urs detect everything?

Radha Manju said...

Thank you so much for all the wonderful explanation to make the circuit.

Load Cell Manufacturers in India | Load Cell Supplier in India

Jeba Sheela said...

This was a good suggestion that you put up here.hope that it benefits all the ones who land up here.

Compression Load Cell | Shear Beam Load Cell

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes