Shop OBEX P1 Docs P2 Docs Learn Events
Circuit that uses only one pin to drive the IR LED and then to also read the IR — Parallax Forums

Circuit that uses only one pin to drive the IR LED and then to also read the IR

Russ FergusonRuss Ferguson Posts: 206
edited 2005-07-23 15:31 in Robotics
I recently ran across the attached·circuit. It appears to use just one pin to drive the IR LED and then also sense the IR signal on the detector.

Has anyone used this type circuit? Any comments on how well it works?

Comments

  • edited 2005-04-01 05:22
    Russ,

    I haven't used that same circuit, but it is very similar to the Parallax SSIR detector. Something like this should work on it:

    FREQOUT 9, 1, 38500
    INPUT 9
    detect = IN9

    Andy
  • JonbJonb Posts: 146
    edited 2005-04-01 05:47
    Although this circuit has an apparent advantage, there are more components involved and I believe it may be less efficient in terms of power consumption. Decisions, decisions...
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-01 15:47
    The PNA4602 is an IR-Detector IC at 38 Khz. As such, its output signal is normally high, and goes low only when the sensor 'sees' an IR signal modulated a 38 Khz -- like with a FREQOUT 9, 1, 38500 command.

    It 'holds' the signal low for a little time after the IR signal goes away. A very clever BS2 user realized this a few years ago, and thus the 'IR-Whisker' was born -- your circuit is a single pin version.

    The 10K resistor insures the Detector side 'floats' high. I don't know what the effect is on the biasing of the transistor at that time -- I assume the resistor values are selected to keep it off at that time.

    The idea is to allow the BS2 to drive the pin as an output and turn on and off the IR-LED. Then it's supposed to read the same pin as an input -- allowing the IR-Detector to drive the pin low if it sees a reflected light from the IR-LED. It looks to me like there are some bias issues on the transistor -- can an PNP transistor with zero volts on its emitter and zero volts on its base turn on? With 5 volts on its base, isn't it reverse-biased and off?

    Oh, it's been too long since I studied Transistors...

    P.S. if you used an NPN transistor, and turned the IR-LED around, that may fix the bias issues on the circuit...

    Post Edited (allanlane5) : 4/1/2005 3:52:24 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2005-04-01 16:24
    Is it my imagination or is the IR led reverse biased? Shouldn't the Anode and Cathode be reversed?
    ...and if a PNP transistor is meant to be used here, shouldn't the C-E be reversed also? Assuming that
    the IR LED and the C-E junction was reversed, this condition might cause the circuit to latch if the PNA4602
    receives a signal from the IR LED. Otherwise, I don't see the IR LED turning on at all with the current configuration.

    I believe that a NPN is meant to be in place of the PNP, and that the Anode/Cathode of the IR LED should be reversed.
    ...also, the IR LED and 330 Ohm current limiting resistor should be on the Collector side of the transistor while the
    Emitter should go directly to GRD.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    Latest Company News
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • Russ FergusonRuss Ferguson Posts: 206
    edited 2005-04-01 19:31
    I posted the copy of the drawing without carefully examining it. I have not built the circuit yet, but plan to this weekend.

    All the comments about the wrong transistor and polarity on the parts makes me extremely curious about trying to get it to work.

    Maybe I can find the circuit for the Parallax SSIR detector mentioned by Andy, and use that instead.

    You guys are the best...
  • Steve JoblinSteve Joblin Posts: 784
    edited 2005-04-01 21:32
    I never really appreciated the Swanson Sensor until just now.· I had thought that it was just an IR LED and Receiver mounted on a board (the same as what is the the Stamps-In-Class Robots! curriculum).· Only now, thanks to this thread, do I realize how I can save many of my I/O pins using the SSIR!· Exactly how does it work?· It looks like only 4 components.· I know what the IR LED does, the IR Receiver does, the resistor I assume is for the LED, but what is the other component?· Is there a schematic for it?· Thanks for this post... it will save me a bunch of trouble for my next robot!
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2005-04-02 06:35
    Ok so this has been bothering me....

    I re-examined the original circuit and made a few changes that I think should
    allow it to function properly. Someone feel free to test this on a SSB.

    Basically I added a diode and a resistor, and tweaked some of the resistor
    values.

    Operation:
    If the I/O pin is in Input mode, then a LOW signal at pin3 of the PNA4602
    produces about 767mV on the I/O pin. If a HIGH signal is at pin3 of the
    PNA4602, then the I/O pin "sees" 5V. In either case the IRLED remains off.

    If the I/O pin is in Output mode, then a LOW signal on the I/O pin will cause the
    IRLED to come on. (current draw on the I/O pin is about 5mA). If the I/O pin
    is HIGH, then the IRLED is off. (current draw on I/O pin is 0uA)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    Latest Company News
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071

    Post Edited (Beau Schwabe) : 4/2/2005 6:52:31 AM GMT
    909 x 599 - 13K
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-02 13:01
    Instead of the 2N3906 PNP transistor, if you used a 2N3904 NPN transistor, and turned the IR-LED around, I would think this could work.
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2005-04-02 14:53
    What happens if you substitute an NPN for the original schematic and turn the IR-LED around, there is a B-C loop between
    the 330 1K and 10K resistors that are enough to turn the transistor ON. In addition, the IRLED can be influenced by the state
    of the PNA4602, which I don't think is the intent of the circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    Latest Company News
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • Russ FergusonRuss Ferguson Posts: 206
    edited 2005-04-02 14:54
    I am curious as to why a low from the PNA4602 wouldn't cause the transistor to also switch on.

    It seams that the freqout signal on the transistor would be lost when the 4602 saw the IR light. The 4602 would not have the 38kHz on it so the IR LED would simply be on and cause the 4602 to stop seeing the light. Why wouldn't the circuit be effected by this type of feedback?

    (I am refering to Beau's circuit with the PNP.)

    Post Edited (Russ) : 4/2/2005 2:58:30 PM GMT
  • Russ FergusonRuss Ferguson Posts: 206
    edited 2005-04-02 15:22
    The schematic that I have repeats the IR circuit multiple times. After comparing the part of the circuit which I posted, with other places where the curcuit is duplicated it has become appearant that author was not consistent. The circuit is on a printed piece of paper which I scanned in, so I do not have a web page for everyone to refer to.

    I have redrawn the circuit to contain what I believe were the author's original intention. It is very similar to the one Beau posted. It does not have the voltage divider on the base of the transistor.
    651 x 471 - 39K
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-02 15:48
    Looks like a winner. You may have swapped the 330 ohm and 1K ohm resistors, though -- I think the higher resistor should be on the output of the IR-Decoder. Just a thought.
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2005-04-02 21:06
    It's funny how things work out... I think the only difference is that I have a 220 Ohm resistor
    where the other version had a 330 Ohm and the voltage divider or shunt across the B-E,


    Russ,
    Russ said...

    I am curious as to why a low from the PNA4602 wouldn't cause the transistor to also switch on.

    The 68 Ohm resistor and Diode form a shunt across the B-E junction where the LOW from the
    PNA4602 can't bring the voltage to a level great enough through the 220 Ohm and 1K resistor
    to turn the transistor on, however if the I/O pin is driven LOW, there is enough through just
    the 1K resistor that the transistor does turn on.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    Latest Company News
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071

    Post Edited (Beau Schwabe) : 4/2/2005 9:12:22 PM GMT
  • Russ FergusonRuss Ferguson Posts: 206
    edited 2005-04-06 05:14
    Here are the results of bread-boarding the three circuits:

    1. SSIR draws - 2.7ma (My 4602 draws 2.5ma all by itself.)
    2. Transistor circuit without the 68 ohm and diode - 4.2ma
    3. Transistor circuit with the 68 ohm and diode - 11.6ma

    All circuits work great.
    The transistor circuit without the 68 ohm resistor and diode had the best range using the Frequency Sweep program.

    Russ
  • very old gearvery old gear Posts: 2
    edited 2005-07-23 13:13
    May I have the SSIR schematics to compare designs.
    TIA
  • Steve JoblinSteve Joblin Posts: 784
    edited 2005-07-23 15:31
    Here is the SSIR Schematic that I got from Steve Swanson, inventor of the SSIR
    960 x 720 - 19K
Sign In or Register to comment.