Shop OBEX P1 Docs P2 Docs Learn Events
Radioshack IR emitter / detector pair — Parallax Forums

Radioshack IR emitter / detector pair

jzbrunojzbruno Posts: 2
edited 2007-11-06 18:07 in BASIC Stamp
Hello I have been working through the BASIC Stamp manual and am having fun. I am trying to make a photogate system and am stuck on getting the ir emitter / detector to work.

I know the emitter works by using a digital camera to see the ir light.

I found this forum post http://forums.parallax.com/showthread.php?p=596666 that says they used the circuit on the bottom right of page 2 of this pdf www.parallax.com/dl/docs/prod/robo/QTILineFollow.pdf With no luck.

I think the problem is in getting the detector to work. How do I wire the detector to the vdd / vss and p3? I have a program written to detect a 1 or 0 in p3 (IN3).

I prefer to stick to the ir emitter / detector alone as those are what I have. Any advice is appreciated.

JB

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-05 20:53
    The RadioShack detector is simply a phototransistor, not the same kind of IR detector discussed in a lot of Parallax documentation.
    Pretty much all transistors are sensitive to light including IR light, but they're normally packaged in an opaque package. Phototransistors are simply transistors packaged in transparent packages. Sometimes one is packaged in a housing opaque to visible light, but transparent to IR light.

    The particular phototransistor that RadioShack sells has its emitter and collector leads brought out to pins. The base lead is not connected since light serves as the input. Basically, connect the emitter to ground (Vss). Connect a resistor to +5V (Vdd). Any value from 1K to 10K will work fine. The other end of the resistor is connected to both the phototransistor's collector and a Stamp I/O pin. What you will find is that the I/O pin is normally HIGH (1). When the light level gets high enough, the I/O pin will become LOW (0). That's it!

    What you will also find is that the phototransistor is also very sensitive to ambient light which will make it pretty useless unless you keep the IR emitter very close or restrict ambient light with some kind of barrier (like a narrow tube restricting the field of view).

    In room light or daylight, you really have to use a pulsed light beam and a photodetector with an electronic filter that only responds to light pulsing at a particular frequency. That's what most IR remote controls use and the IR detectors that Parallax (and others) sell. Read the tutorial "IR Remote for the BOEBOT" which you can download from Parallax (under the Stamps in Class Downloads menu). It goes into more detail on this subject.
  • jzbrunojzbruno Posts: 2
    edited 2007-11-05 21:50
    Thank you for your quick and detailed response. I think I have it working now. I am using a cut up pen case to align the emitter / detector for testing and I can see what you mean by the ambient light interfering significantly. If I want to take this further I will have to look into IR Remote for the BOEBOT. Thanks for the help. I am sure I will be back with more questions.

    JB
  • D FaustD Faust Posts: 608
    edited 2007-11-06 13:31
    What is the difference (in implication circuitry) between an photoresistor and phototransistor. It seems like they could be used interchangably. (the parts, not terms for them). I don't mean to hijack this thread, I would just like quick answer thanks.

    PS I now understand the internal difference.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --DFaust
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-06 14:48
    Phototransistors are more sensitive to light and respond much faster to changes in light level than photoresistors.
    On the other hand, photoresistors respond to a much wider range of light levels.
  • D FaustD Faust Posts: 608
    edited 2007-11-06 18:07
    Perfect! Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --DFaust
Sign In or Register to comment.