Modulating an IR LED and detection using a phototransistor!

Discussion in 'The Projects Forum' started by PranavS, Apr 5, 2015.

  1. PranavS

    Thread Starter New Member

    Apr 5, 2015
    6
    1
    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
     
  2. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,694
    904
    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
     
  3. PranavS

    Thread Starter New Member

    Apr 5, 2015
    6
    1
    Thanks will read up on that.
    Will i be able to get 0.8m from 1 led?
     
  4. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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.
     
  5. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,694
    904
    @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
     
  6. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,573
    2,540
    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.
     
  7. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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.
     
  8. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,573
    2,540
    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.
     
  9. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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: Apr 5, 2015
    cmartinez likes this.
  10. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,573
    2,540
    I think I might be beginning to understand the issue now, thanks... I'll probably come back with a couple more questions later... if you don't mind... thanks again!
     
  11. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,694
    904
    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
     
    cmartinez likes this.
  12. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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: Apr 5, 2015
    cmartinez likes this.
  13. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,058
    3,819
    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.
     
    jpanhalt likes this.
  14. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,573
    2,540
    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.
     
  15. PranavS

    Thread Starter New Member

    Apr 5, 2015
    6
    1
    Okay I have to circuits the circuit for a beam and filter will this work?
    Thanks. Filter.jpg IRLED.jpg Filter.jpg IRLED.jpg Filter.jpg IRLED.jpg Filter.jpg IRLED.jpg
     
  16. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    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
     
  17. PranavS

    Thread Starter New Member

    Apr 5, 2015
    6
    1
    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
     
  18. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    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
     
  19. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    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.
     
Loading...