# How to test IR sensor module?

I am a beginner and trying to make an IR sensor module for my project. I have implemented the following circuit diagram on my breadboard.

The problem is that even if I don't introduce an obstacle in between the sensors , the LED at the output is still glowing. Where is the error? How do I know that the sensor is still working? Please Help! Thank you!

[ NOTE: I am using 330ohm resistor instead of 150 ohm mentioned in the diagram ]

• What happens when you move the wiper on the pot - is there a point when the LED changes from on to off? Commented Nov 23, 2015 at 21:32
• Try changing the Potentiometer value and test the circuit again. Commented Nov 23, 2015 at 21:33
• Such a sensor is very suseptive to ambient (IR) light. A far superior sensor can be made from a canned IR receiver and a suitably modulated IR LED signal. If you are using a microcontroller this approach would be a much better solution. Commented Nov 23, 2015 at 21:38
• @Andyaka I did change the value almost 15% but there was no change. I have checked my breadboard connections too. But the error is that when we introduce an obstacle between the sensor the LED should turn on then, but it is on the moment i give voltage to the circuit. It should rather be off at first. Commented Nov 23, 2015 at 21:39
• The way I read this circuit is that when there is no blockage between IRLED and PD, the LED SHOULD be on. Try altering the pot end to end and see if there is a point where the LED changes brightness. Then, either side of that settting check what happens when you block the IR to the PD. Commented Nov 23, 2015 at 22:24

To figure out what is going on you are just going to have to break down and measure the signals at the + and - input of the comparator to see what is happening there in terms of voltages. Only then can you deduce what is wrong. Make sure to use a volt meter that has a high input impedance and not some cleap 20K ohms input impedance meter.

Some things that can be learned by that are:

1. What voltage does the pot present to the - input of the comparator?
2. Can you verify that the pot adjustment allows setting the - input anywhere from 0 to 5 volts?
3. What voltage is presented to the + input from the photo diode node?
4. Can you see changes in the voltage at the + input of the comparator as you block and unblock the photo diode?
5. What are the voltage levels at the + input when the photo diode is blocked and unblocked?
6. Can you adjust the pot so that the voltage at the - input is exactly half way in between the blocked and unblocked voltages on the + input?
7. If you can achieve a YES to #6 then does the comparator output change state now between the blocked and unblock states of the photo diode.

If you can get through all of these steps and understand how the circuit performs you should be able to achieve success or conclude that some component is bad.

• Hey thanks for the help! I did follow these steps, the problem was that the resistance that pot was giving to the circuit. Now its working fine! Commented Nov 24, 2015 at 15:16

To contribute, as opposed to duplicating the good answer above, look at your problem with a different approach. What are possible issues causing the problem? and what is the best way to isolate the problem? I'll start with the most obvious /probable:

1. Pot is incorrectly set / adjusted.
2. Wiring mistake. It's a simple enough circuit to buzz out the connections.
3. Comparator chip is bad. Do you have a spare you can quickly drop in?
4. Sensor is bad. (#4 above) It's possible your sensor is detecting IR from a different source.
5. Because the led is on, your power supply is probably ok, but check the +5v to be sure.