Modulating an IR LED and detection using a phototransistor!

Thread Starter

PranavS

Joined Apr 5, 2015
6
Hi guys.

1 component of my design project needs a people counter. The device will count people walking in and out of the door. I need to use 2 parallel IR beams(IR LED and phototransistor). The led and transistor will be 0.8 m away. How do I modulate the LED with a 555 and setup the phototransistor to pick up the led at this distance?
I need either a high or a low when the beam is broken.
NB: I cant use micro controllers. I have a 5V ,1A power supply

Thanks
 

jpanhalt

Joined Jan 18, 2008
11,087
Can't use a microcontroller...

Sounds like homework. Have you searched on IRED oscillators? There are many examples of 555-based circuits for what you need. The most straight forward way is to use two 555's. One is set at 38 KHz or whatever your detector needs. The other turns that oscillator on and off to meet the modulation requirement.

John
 

MikeML

Joined Oct 2, 2009
5,444
The goal is to modulate the emitter (typically at about 38kHz), and then AC-couple the signal out of the photo-detector to make it more immune to ambient light level changes, which cause a DC shift in the output of the detector. Fancy systems use a bandpass filter centered on the carrier frequency, followed by gain, followed by a detector.

I have used the TSSOP type of TV IR Remote chips to make a beam-break detector.
 

jpanhalt

Joined Jan 18, 2008
11,087
@P
Yes. With a properly modulated system. Will it be indoors or outside? If indoors, no problem. If outside, I don't think there will be a problem, but I have only worked at about 1/3 m.

Sorry to post so late. I wrote this earlier and simply forgot to hit the post reply button. Talk about getting forgetful.

John
 

cmartinez

Joined Jan 17, 2007
8,212
The goal is to modulate the emitter (typically at about 38kHz), and then AC-couple the signal out of the photo-detector to make it more immune to ambient light level changes, which cause a DC shift in the output of the detector. Fancy systems use a bandpass filter centered on the carrier frequency, followed by gain, followed by a detector.

I have used the TSSOP type of TV IR Remote chips to make a beam-break detector.
I have no problem understanding the noise filtering issue, but I had no idea that an IR diode needed to be modulated. Why is that?
I would've thought that it was enough just to place a resistor in series to limit current, or if you wanted to get fancy, a constant current driver could be used.
 

MikeML

Joined Oct 2, 2009
5,444
I have no problem understanding the noise filtering issue, but I had no idea that an IR diode needed to be modulated. Why is that?
I would've thought that it was enough just to place a resistor in series to limit current, or if you wanted to get fancy, a constant current driver could be used.
You can get a 10:1 signal level change as ambient light changes. The ambient level change can be threeX to fiveX bigger than the IR signal attributable to the broken beam. In other words, the SNR can be awful. AC coupling, and bandpass filtering of the carrier frequency suppresses most of the ambient light level change. The bandpass filtering makes it immune to 60Hz and 120Hz buzz attributable to lighting, too.
 

cmartinez

Joined Jan 17, 2007
8,212
You can get a 10:1 signal level change as ambient light changes. The ambient level change can be threeX to fiveX bigger than the IR signal attributable to the broken beam. In other words, the SNR can be awful. AC coupling, and bandpass filtering of the carrier frequency suppresses most of the ambient light level change. The bandpass filtering makes it immune to 60Hz and 120Hz buzz attributable to lighting, too.
I understand that, but aren't those things normally placed at the sensor side of the system? Why would I want to modulate the emitter? It's obviously clear that I probably don't know much about this subject, but that's why I'm asking.
 

MikeML

Joined Oct 2, 2009
5,444
By modulating the emitter with a known frequency, the receiver knows that anything coming from the emitter has 38kHz on it; anything coming from ambient light or lighting artifacts doesn't.

Read this data sheet.
 
Last edited:

jpanhalt

Joined Jan 18, 2008
11,087
If you look at the datasheet for any modern IR detector, you will see that the gain is turned way down for a steady IR signal. Even if you modulate the IR at 38 KHz,as is typical, you need to send packets of about 21 pulses (i.e., 600 us) to get best sensitivity. I have used that system in bright sunlight under many different cloud conditions to detect the movement of a 3/16" wire without fail for more then 10 years.

John
 

MikeML

Joined Oct 2, 2009
5,444
I have made a beam-break detector using a TSOPxxx that worked in bright sun over a distance of a couple of meters, where I transmit 38kHz continuously (no mark-space data modulation), and then just break the beam with a opaque object. Because the receiver is AC-coupled, initially breaking the beam causes a change-of-state of the logic output. As the detector capacitor discharges, the logic output goes back to the carrier-detect level even though the beam is still blocked. The beam must be unblocked for some time before it is ready to detect the next object.

I was able to use that as a "people" counter... I modulated the IR emitter LED at 38kHz using a 555.

Bunch of posts on this topic here
 
Last edited:

GopherT

Joined Nov 23, 2012
8,009
If you look at the datasheet for any modern IR detector, you will see that the gain is turned way down for a steady IR signal. Even if you modulate the IR at 38 KHz,as is typical, you need to send packets of about 21 pulses (i.e., 600 us) to get best sensitivity. I have used that system in bright sunlight under many different cloud conditions to detect the movement of a 3/16" wire without fail for more then 10 years.

John
Vishay (and probably others) makes continuous 38kHz sensors that can receive a continuous train of ir pulses (not limited to 21 pulses) - automatic gain control and sensitive in reflection mode to about 3 feet on a neutral gray. Great range 15 feet or more in direct mode using an ir emitter driven at 20 mA. More than 20 mA at close range (2 to 30 inches) swamps the agc.
 

cmartinez

Joined Jan 17, 2007
8,212
I have made a beam-break detector using a TSOPxxx that worked in bright sun over a distance of a couple of meters, where I transmit 38kHz continuously (no mark-space data modulation), and then just break the beam with a opaque object. Because the receiver is AC-coupled, initially breaking the beam causes a change-of-state of the logic output. As the detector capacitor discharges, the logic output goes back to the carrier-detect level even though the beam is still blocked. The beam must be unblocked for some time before it is ready to detect the next object.

I was able to use that as a "people" counter... I modulated the IR emitter LED at 38kHz using a 555.

Bunch of posts on this topic here
Thanks, Mike. I was about to open a new thread with several questions regarding this subject. But I've got enough reading material with what you've posted already.
 

bertus

Joined Apr 5, 2008
22,266
Hello,

The phototransistor will be burned, as you do not have a collector resistor between the "This goes to the filter" connection and +5 Volts.
Also the led will have problems. there is no current limiting resistor in series with it.

Both inputs of the LM358 are open.
How would you have them connected?

Bertus
 

Thread Starter

PranavS

Joined Apr 5, 2015
6
Sorry this was a makeshift circuit I will add resistors to get the max voltage for IR led.
For the LM358 the positive terminal will be grounded and the negative terminal will be connected to resistor R1.

Thanks
 

bertus

Joined Apr 5, 2008
22,266
Hello,

When the negative input of the opamp is grounded , it will not work correctly.
Put the negative input at about 1/2 Vcc, so about 2.5 Volts for 5 Volts supply.
Also use a decoupling capacitor from the negative input to ground.

Bertus
 

Søren

Joined Sep 2, 2006
472
Vishay (and probably others) makes continuous 38kHz sensors that can receive a continuous train of ir pulses (not limited to 21 pulses) - automatic gain control and sensitive in reflection mode to about 3 feet on a neutral gray. Great range 15 feet or more in direct mode using an ir emitter driven at 20 mA. More than 20 mA at close range (2 to 30 inches) swamps the agc.
Ward Cunningham didn't, so let me :)
The Vishay receivers (eg. TSSP4038) made for CW/light curtains etc. does not use an AGC (as that would just screw things up).
They operate with a fixed sensitivity, giving up to 2m (~6½ feet) of reflective range and 30m (~98 feet) of direct range.
 
Top