Shop OBEX P1 Docs P2 Docs Learn Events
Infrared receiver troubles - Page 2 — Parallax Forums

Infrared receiver troubles

2»

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-24 03:15
    Three legs = all the same is not a valid assumption (not where I'm sitting.)

    The datasheet you linked to showed an application circuit, anyway·-- with a pull-up resistor on the OUTPUT, along with·another resistor on the +V with a cap (looks like a low-pass filter, probably disregard that much for your purpose.)

    Try bennettdan's idea with a TV remote.· But, still, you really need the voltmeter.


    Post Edited (PJ Allen) : 6/24/2006 3:25:30 AM GMT
    628 x 516 - 28K
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-24 03:34
    im not sure what any of that stuff is you guys are talking about, i didnt think it was going to be difficult or anything lol,· the 555 timer? the only supplied i have are the things from the kit WAM and a mosfet. what do i need to buy to make this work?
  • SSteveSSteve Posts: 808
    edited 2006-06-24 03:34
    willthiswork89 said...
    P7~(red-red-brown-gold)->OUT
    VSS->GND
    VDD->VCC

    then i did

    P8~(Brown-Black-Red)->anode lead
    VSS-> Cathode Lead

    for the IR

    now after that i wrote code that folows

    irDetect VAR Bit
    DO
    FREQOUT 7,1,38000
    irDetect = IN6
    DEBUG HOME, "irDetect = ", BIN1 irDetect
    PAUSE 100
    LOOP
    You should post your current code. In this code, you are sending FREQOUT to pin 7 which is connected to the IR detector.

    I don't know about the Radio Shack IR detector, but the one that Parallax sells doesn't need any external components. It connects directly to Vss, Vdd, and the input pin. Take a look at chapter 20 in the StampWorks manual (downloadable from www.parallax.com/detail.asp?product_id=27220).

    I don't think a voltmeter is going to work for measuring the output of the IR detector, you probably need an oscilloscope.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-24 03:37
    well thats the thing.. im thinking it just does but im not sure about the resistors? i think it just goes vdd vss and the input pin... im ganna talk to the radioshack guys and see if theres anything else about it... but im guessing it shouldnt be rocket sceince for the damn thinfg
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-24 03:41
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    irDetect VAR Bit

    DO
    FREQOUT 14,1,38000
    irDetect = IN15

    DEBUG HOME, "irDetect = ", BIN1 irDetect
    PAUSE 100
    LOOP


    there is my code as of now, like i said the Infrared is working for sure because i connected a LED that i can see with my eyes and it flashes so its flashing...
  • bennettdanbennettdan Posts: 614
    edited 2006-06-24 05:27
    I think when PJ ALLEN is talking about using a meter he means find the two pins connected to the internal diode then you would know the pinout. A 555 timer can be found at most radioshacks also you can use a universal remote for a TV on most recievers. This 555 curcuit will give you about 38k to your IR led at about 50% duty.
    Also here is a good websight on 555 Timers
    http://home.cogeco.ca/~rpaisley4/LM555.html

    Post Edited (bennettdan) : 6/24/2006 6:08:38 AM GMT
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-24 11:07
    okay but what im getting at is what will this do for me... i know that my LED is flashing because i hooked a normal led to it and it flashed... so i know my led is flashing thats in question. the only thing is im hooking the reciever module up wrong, i know this because i used code from the parallax website. now it might not be right becasue im using the three pin receiver instead of the two but i dunno. ill talk to the radioshack guys and see if they know whats up with the IR Receiver.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-24 11:20
    bennetdan,

    is your LED/IRED backward in that drawing?

    w.t.w.,

    Given the unknown nature of this Detector and the invisible characteristic of Infra-red "light", the use of a voltmeter would be highly beneficial.· That's the only way that "we" are going to find out what the deal with it IS.· We would also be able to tell if the IR-LED is turning on or not (here, too, you can't tell by looking at it.)

    The radio-shack guys·are not (emphasis NOT)·going to pull your bacon out of the fire.

    [noparse][[/noparse]Side note -- if you have a webcam or a video-cam, they can often "see" I-R and it shows up on the monitor as like a white-blue light. ]
  • SSteveSSteve Posts: 808
    edited 2006-06-24 13:26
    PJ Allen said...
    [noparse][[/noparse]Side note -- if you have a webcam or a video-cam, they can often "see" I-R and it shows up on the monitor as like a white-blue light. ]
    I can also see the IR on my digital still camera.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-06-24 13:35
    Gents -

    Let's slow down for a second, and take a deep breath. One thing we don't have at present is a copy of the most recent test program. It has changed a number of times along the way since the beginning of this thread, so it might be wise to get two things:

    1. A copy of the test program as it's presently written.

    2. A simple SKETCH (rather than a verbalization) of what the circuitry looks like.

    Then we'll go on from there. Since we don't have datasheets (apparently) for the I/R transmitter and I/R receiver, we are hard pressed to say they are a MATCHED PAIR!

    Reagrds,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-06-24 14:26
    Gents -

    One other thing. According to previous messages (if I've read them correctly) the I/R transmitter presently has a 1K ("brown-black-red") resistor connected to it. Here are the specs from the Radio Shack web site for that I/R LED:

    Model 276-0143 - Voltage 1.2 VDC, Current 29 mA

    Presuming it's being fed by 5 VDC, shouldn't there be a 130 ohm resistor in series with it, not IK ohms? I'm just a software guy, so I don't know how that going to impact anything, and PLEASE check my figures!

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Mike GreenMike Green Posts: 23,101
    edited 2006-06-24 14:34
    The resistor is to limit the current through the LED. The Stamp pin, like most CMOS outputs, is designed to supply 10-20 ma max. and the resistor should limit the current to probably 20ma. 5V - 1.2V = 3.8V. Roughly, that gives a current of 3ma with a 1K resistor which is quite reasonable. I would probably use no smaller than a 220 ohm series resistor. Keep in mind that, if you're driving several LEDs or other "high" current devices, there's an upper limit on the total current output of the Stamp and on each set of output pins (0-7 and 8-15).
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-24 18:05
    · I have tested one of these radioshack ir modules (276-640) with a Vcr remote control.· It has a normally high output, with or without a pull-up.·
    · Looking at the output with an oscillscope I see low-going pulses with button pushes.· So, you need to be looking for zeros.·

    · The outputs have sharper corners with a 4.7K pull-up.

    · See attached drawing.
    272 x 322 - 8K
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-24 19:38
    okay so you bought one qand tested it your self... what type of resitor should i be using for the OUT? and how do you know what to tune the remote to? i have a UNIversal remote just dunno what i need to set it to.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-24 19:49
    · Tuning, what tuning?· No tuning, just doing.· What, you have a remote with a freq adjust?· Press the PLAY button or something, for crying out loud, whatever'll work.· [noparse][[/noparse]Don't make me come over there.]
    · I suppose that a 1K resistor between the output and the STAMP's input should suffice.· Don't use the FREQOUT part of the program if you're using the vcr remote.
    · Use P15.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    irDetect VAR Bit
    DO
    ·irDetect = IN15
    ·DEBUG HOME, "irDetect = ", BIN1 irDetect
    ·PAUSE·200
    LOOP

    In fact, here's a program that I like a whole lot better:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    irDetect VAR Bit
    INPUT 15
    Check:
     FREQOUT 14,1,38000
     irDetect = IN15
     DEBUG "No infra-red emission", BIN1 irDetect,CR
     PAUSE 50
     IF irDetect = 0 THEN GOTO IRdone
     GOTO Check
    IRdone:
     DEBUG "Infra-Red emission Detected"
    END
    


    
    

    Post Edited (PJ Allen) : 6/24/2006 8:07:10 PM GMT
  • bennettdanbennettdan Posts: 614
    edited 2006-06-24 20:44
    PJ ALLEN , the LED is in wrong my bad I will change it and upload it tonight I drew it late last night after work. Also did your IR from the shack care What code you had in the TV remote?

    Willthiswork89 I built a simular 555 curcuit to test IR projects, I just suggested you use and outside source of IR so you could focus on makeing just the reciever work and know the code is not a problem.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-24 20:54
    bennettdan,

    The radioshack IR receiver module "doesn't care" -- it's looking for 38-kHz center-frequency and results the data stream (intelligence) received from the remote.·

    If you want to use that first program, not my program, you need to change that PAUSE to a lot smaller number to increase the sample rate, or it'll seem to work intermittently (it's not, it doesn't go looking often/fast enough as it is.)

    I just made mine so that once it sees I-R, it cashes out.· Somebody could modify it to increment a counter.
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-24 21:42
    im just trying to get the led working, i used my digital camera and looked and the IR isnt flashing, so i got a AAA battery and put a resitor on the positive and connected it directly to the IR and it turned on... so i thought it was maybe the port damaged but i replaced the IR with a normal LED and it flashed on the same circuit. somthing isnt right?
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-25 02:11
    alright guys for the record i solved this puzzle, somthing was the matter with the LED flashing, come to find out the IN stays high until it detects the frequency then it turns low. heres the code im using... thanks for the help guys i owe you all...


    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    irDetect VAR Bit
    DO
    FREQOUT 15,1,38000
    irDetect = IN14
    IF irDetect = 0 THEN
    HIGH 13
    PAUSE 100
    ELSE
    LOW 13
    ENDIF
    LOOP


    again thank you guys your life savers...one question though... if im not mistaken it doesnt detect EVERYTHING because the frequency drops from the distance it needs to go...so since this IR detector only detects a frequency of 38k how can i make it detect things from a farther distance? thanks
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-25 03:40
    More distance with greater IRED current, possible use of lenses/optics.

    If you look at the program that I made you will see that I have irDetect=0, I also mentioned this fact in my write-up featuring the pin-out drawing of the I-R Module.· Cripes!
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-25 18:24
    {$STAMP BS2}
    ' {$PBASIC 2.5}
    freqSelect VAR Nib
    irFrequency VAR Word
    irDetect VAR Bit
    distance VAR Nib
    roll VAR Nib

    DO
    FOR roll = 0 TO 4
    LOW roll
    NEXT
    roll = 0
    distance = 0
    FOR freqSelect = 0 TO 4
    LOOKUP freqSelect, [noparse][[/noparse]37500, 38250, 39500, 40500, 41500] , irFrequency
    FREQOUT 15, 1, irFrequency
    irDetect = IN14

    distance = distance + irDetect



    DEBUG CRSRXY,4, (freqSelect + 3), DEC5 irFrequency
    DEBUG CRSRXY,11,freqSelect + 3
    IF (irDetect = 0) THEN DEBUG "Yes" ELSE DEBUG "NO "
    PAUSE 100
    NEXT
    DEBUG CR,
    "

    ", CR,
    "Zone ", DEC1 distance

    FOR roll = 0 TO 4
    IF(distance = 5) THEN
    distance = distance - 1
    ENDIF
    IF(roll = distance) THEN
    HIGH roll
    PAUSE 500
    ENDIF
    NEXT
    LOOP


    my new code it works amazing. i was proud of my self for this one...well the LEDS at least [noparse]:)[/noparse]

    haha yes it was i nthe wrong one i duno how i ended up doing that
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-06-27 20:52
    Cleaned it up a little:

    '{$STAMP BS2}
    '{$PBASIC 2.5}
    
    freqSelect  VAR   Nib
    irFrequency VAR   Word
    irDetect    VAR   Bit
    distance    VAR   Nib
    
    DO
      LOW OUTA
      distance = 0
    
      FOR freqSelect = 0 TO 4
        LOOKUP freqSelect, [noparse][[/noparse]37500, 38250, 39500, 40500, 41500] , irFrequency
        FREQOUT 15, 1, irFrequency
        irDetect = IN14
        distance = distance + irDetect
        DEBUG CRSRXY,4, (freqSelect + 3), DEC5 irFrequency
        DEBUG CRSRXY,11,freqSelect + 3
        IF (irDetect = 0) THEN DEBUG "Yes" ELSE DEBUG "NO "
        PAUSE 100
      NEXT
    
      DEBUG CR,
      "--------- --------", CR,
      "Zone ", DEC1 distance
    
      FOR freqSelect = 0 TO 4
        IF(distance = 5) THEN
          distance = distance - 1
        ENDIF
        IF(freqSelect = distance) THEN
          HIGH freqSelect
          PAUSE 500
        ENDIF
      NEXT
    
    LOOP
    
    



    Good job on getting it up and running.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
Sign In or Register to comment.