I am trying to detect the size of different bottles on a conveyor belt and for that I thought of using IR transmitter and receiver but I am not getting desired output. I want the output of IR receiver to be constant '1' or '0' but instead I am getting a pulsating output. Since I am not good at designing electronics circuits, therefore, I downloaded a circuit from internet and implemented it. Now, please help me troubleshoot the problem in the following circuit:
-
2Show us an oscilloscope screenshot – Nov 04 '16 at 08:28
-
I don't have an oscilloscope, neither can I find a simulator which has TSOP1738 component. I can just tell you that the output LED just keeps blinking instead of constantly on. – user2969603 Nov 04 '16 at 08:31
3 Answers
If the LED blinks on and off when the bottles interrupt the IR beam, then that means that there are spaces between the bottles on the belt and although your circuit may seem to be working, the circuit is bogus and should look like the circuit shown below.
Also, the LED will turn OFF when the bottles break the beam.
If by "size" you mean the diameter of the bottles, in order to determine that you'll need to know the speed of the belt and the length of time the LED stays OFF as each bottle passes by.

- 17,377
- 2
- 19
- 23
-
By "size" I meant "capacity". I have to determine whether a bottle is 250 ml, 500 ml or 1000 ml. For that, I have implemented three of these pairs to be placed at three different levels , i.e. 250 ml, 500 ml and 750 ml. When the lowest beam is disturbed, it is 250 ml and so on. – user2969603 Nov 04 '16 at 11:44
There are several problem here.
These TSOP receivers and similar ones from other companies, are not intended to detect a steady carrier. They are highly tuned to a specific carrier frequency, and then expect that carrier to be toggled on and off frequently. Part of the reason for this is that the strength of the signal can vary over a wide range, a few orders of magnitude at the receiver. As a result, there is no pre-set level for carrier on and off. These are determined on the fly from recent history. If the carrier didn't toggle recently, then the receiver gets confused about what is carrier on and carrier off. "Recently" is usually a few milliseconds, certainly way less than the time for another bottle to pass on a conveyor belt.
One possibility is to pulse the carrier on/off frequently. These TSOPs reliably react to 10 carrier cycles if I remember right. Assuming that's correct, pulse the carrier on for 10 cycles, off for 10 cycles, etc. That results in a square wave out of the TSOP. You then detect the presence of this square wave instead of a steady signal.
Let's say you use 40 kHz carrier frequency. Each cycle is 25 µs long, so 10 cycles is 250 µs, and a complete carrier on/off cycle is 500 µs, which means 2 kHz frequency. As long as the time for a bottle to pass, and the time between bottles is at least a few modulation cycles, this will work. I'd say you want at least four modulation cycles per bottle and gap. That means a total minimum period of 4 ms, or 250 bottles/second. If your conveyor rate is higher than that, you need a different approach.
Another problem is that the receiver circuit has Q1 flipped collector to emitter. It looks like it is supposed to be a PNP, which gets turned on when the output of the TSOP goes low. It would all make sense if E and C were flipped.
C1 on the output is suspicious too. I haven't looked at the TSOP datasheet, but 1 µF seems like a lot to hang on the output. I'm guessing that's another screwup in the schematic, and that C1 was really meant to be between 5 V and ground close to the TSOP. 1 µF ceramic as a decoupling cap across the power close to the device makes sense.
All in all, don't just build something you dredged up from the internet, particularly in a real world production environment. There is no substitute for understanding what is going on. You said yourself that you're "not so good at electronic circuits". That's fine, as long as you don't then pretend to be a electrical engineer, particularly in a production environment. Tell your boss that this is outside your expertise, and to get someone for that job to work with you that can cover the EE part. There are many EE consultants out there. This should be a small and cheap job.
Remember, good engineering is expensive, but bad engineering much more so.

- 310,974
- 36
- 428
- 915
The TSOP1738 is designed to receive an IR signal with a particular modulation format (designed for television remote controls). DC or quasi-DC signals won't be received correctly. This is a necessary result of the processing to combat interference from changing ambient lighting conditions.
You could look at some emitter-sensor combinations such as the Panasonic EX-23 which have some intelligence in the emitter and receiver so that even though you give the emitter a DC input, it transmits a modulated IR signal, and likewise the receiver demodulates it and gives you a simple quasi-DC output indicating presence or absence of the beam. I've had good results using those to detect when a helicopter rotor blade passes the fuselage.

- 6,164
- 20
- 34
-
1Note that the OP is using a 555 astable to generate the transmit carrier. – EM Fields Nov 04 '16 at 09:44