Shop OBEX P1 Docs P2 Docs Learn Events
IR Reciver worrking in revers — Parallax Forums

IR Reciver worrking in revers

edited 2012-12-13 19:17 in BASIC Stamp
[FONT=&quot]Could you please give me some insight what I’m doing wrong??With the program loaded and[/FONT]
[FONT=&quot] wiring correct I believe when I put a block in front of the ir receiver I get just the oppisset results. [/FONT]

[FONT=&quot]I get a (0) instead of a (1) im lost in what to try next please take a look and advise me were to go or[/FONT]
[FONT=&quot] what to do thank in advance [/FONT]
[FONT=&quot]How many lumps 3 or 4[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]I under stand this is what to happen[/FONT]
[FONT=&quot]The IR receiver sends a low signal while it detects 38.5 kHz IR [/FONT][FONT=&quot]eflected off an object, which causes[/FONT][FONT=&quot] [/FONT][FONT=&quot]IN9[/FONT][FONT=&quot] [/FONT][FONT=&quot]to store 0. When the BASIC Stamp finishes t[/FONT][FONT=&quot]ransmitting its[/FONT][FONT=&quot] [/FONT][FONT=&quot]FREQOUT[/FONT][FONT=&quot]\
[/FONT][FONT=&quot]signal and moves on to the next command, it stops sending that [/FONT][FONT=&quot]38.5 kHz signal. So the program has to use[/FONT][FONT=&quot] [/FONT][FONT=&quot]irDetectLeft = IN9[/FONT][FONT=&quot] [/FONT][FONT=&quot]to catch that zero [/FONT][FONT=&quot]value before the IR receiver realizes
the 38.5 kHz signal stopped. It only takes a fraction of a millisecond for the IR receiver to realize the signal stopped, and after that, its output[/FONT]

[FONT=&quot] [/FONT][FONT=&quot]rebounds[/FONT][FONT=&quot] [/FONT][FONT=&quot]to[/FONT][FONT=&quot] [/FONT][FONT=&quot]high, and IN9 stores 1 again[/FONT]

[FONT=&quot]'[/FONT] [FONT=&quot]Test[/FONT] [FONT=&quot]IR[/FONT] [FONT=&quot]object[/FONT] [FONT=&quot]detection[/FONT] [FONT=&quot]circuits,[/FONT] [FONT=&quot]IR[/FONT] [FONT=&quot]LED[/FONT] [FONT=&quot]to[/FONT] [FONT=&quot]P8[/FONT] [FONT=&quot]and[/FONT] [FONT=&quot]detector[/FONT] [FONT=&quot]to[/FONT] [FONT=&quot]P9.[/FONT]
[FONT=&quot]'[/FONT] [FONT=&quot]{$STAMP[/FONT] [FONT=&quot]BS2}[/FONT]
[FONT=&quot]'[/FONT] [FONT=&quot]{$PBASIC[/FONT] [FONT=&quot]2.5}[/FONT]
[FONT=&quot]irDetectLeft[/FONT] [FONT=&quot]VAR[/FONT] [FONT=&quot]Bit[/FONT]
[FONT=&quot]DO[/FONT]
[FONT=&quot]FREQOUT[/FONT] [FONT=&quot]8,[/FONT] [FONT=&quot]1,[/FONT] [FONT=&quot]38500[/FONT]
[FONT=&quot]irDetectLeft[/FONT] [FONT=&quot]=[/FONT] [FONT=&quot]IN9[/FONT]
[FONT=&quot]DEBUG[/FONT] [FONT=&quot]HOME,[/FONT] [FONT=&quot]"irDetectLeft[/FONT] [FONT=&quot]=[/FONT] [FONT=&quot]",[/FONT] [FONT=&quot]BIN1[/FONT] [FONT=&quot]irDetectLeft[/FONT]
[FONT=&quot]PAUSE[/FONT] [FONT=&quot]100[/FONT]
[FONT=&quot]LOOP[/FONT]
[FONT=&quot][/FONT]

Comments

  • ercoerco Posts: 20,257
    edited 2012-12-12 09:10
    Need clarification.

    You are getting opposite results, or inconsistent results? Are you interrupting the beam, or reflecting off an object?
    Your problem may be that 95% of IR receivers are not "continuous signal acceptable". They will only go low for a fraction of a second when a steady IR signal is received.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-12-12 09:46
    irDetectLeft gets set to the state (low or high) of input pin 9. This is connected (I assume) to the output of the IR detector. The IR detector's output pin is normally high (1) when there's no modulated IR (38.5KHz) being received and goes low (0) when modulated IR is received. There's some filtering internal to the detector and that introduces some time delays, so the output pin takes a millisecond or so to become low when IR is received and stays low a millisecond or so after the IR stops. The code you posted relies on this delay and checks for the state of the I/O pin (IN9) immediately after the Stamp stops sending IR (FREQOUT). erco's comment would apply if you used a long time period in the FREQOUT statement (like 1000 = 1 second).
  • edited 2012-12-12 13:20
    yes i get opposite results. not inconsistent ones. im in a room with no florescent light and far enough away that there should be no bouncing of sing back . Ive run the interference program with no results of interference or no detection. when i i use a Sony TV remote the receiver pick up the signal changing for o to1 as the pulse pass threw the 38.5k range. when i do have the IR LED transmitting a 38500 signal in order for the receiver to change for 0 to 1 i have to cover the entire surface with my thumb

    "Your problem may be that 95% of IR receivers are not "continuous signal acceptable". They will only go low for a fraction of a second when a steady IR signal is received" so i may have the wrong receiver or need more time delay?
  • edited 2012-12-12 13:24
    Oaky i will and some delay and see if that work ill let you know thanks [FREQOUT statement (like 1000 = 1 second]
  • Mike GreenMike Green Posts: 23,101
    edited 2012-12-12 15:23
    It's not clear from your description just what's happening.

    I'm not aware of any IR detectors that behave the way you've described. They all idle with their output pin at high and this goes low when modulated IR is received. Some IR detectors will stop "seeing" the IR after a short time ... they don't stay on as long as the IR is present. Their output pin goes low at first, then, after a short time, goes high again even if IR is present. They'll only respond with a new pulse after the IR has been off for a little while. None of that would explain what you're describing. Changing the FREQOUT won't affect any of that.
  • edited 2012-12-12 20:49
    [FONT=&quot]Sorry I have a hard time explaining myself. Ill try it again I applogize for the horrible gramer.[/FONT]
    [FONT=&quot] [/FONT]
    [FONT=&quot]Here we go me and a friend decided to build a couple boe bot to keep are minds fresh. Do we bought couple of Basic Stamps 2 Homework boards servos and all the hardware to build two [2] Boe Bots. We started to built one first following the parallax boe bot manual Robotics with the Boe-Bot Student Guide version 3.0 Everything went well no problem was having great time. So we decide I was time to build the second one to have a little computation in the maze. So we built the second one exactly like the first one and per the manual (so we think??). We were we ready to power up for the first time using fresh 9 vdc batter and 4 c size nickel metal hydride batteries for servo power. We did use a different laptop that we download 2.5.4 stamp editor. We Loaded the IR left test program first to test thing out . program was from the manual form the manual[/FONT]

    [FONT=&quot] [/FONT]
    [FONT=&quot]' Robotics with the Boe-Bot - TestLeftIr.bs2[/FONT]
    [FONT=&quot]' Test IR object detection circuits, IR LED to P8 and detector to P9.[/FONT]
    [FONT=&quot]' {$STAMP BS2}[/FONT]
    [FONT=&quot]' {$PBASIC 2.5}[/FONT]
    [FONT=&quot]irDetectLeft VAR Bit[/FONT]
    [FONT=&quot]DO[/FONT]
    [FONT=&quot]FREQOUT 8, 1, 38500[/FONT]
    [FONT=&quot]irDetectLeft = IN9[/FONT]
    [FONT=&quot]DEBUG HOME, "irDetectLeft = ", BIN1 irDetectLeft[/FONT]
    [FONT=&quot]PAUSE 100[/FONT]
    [FONT=&quot]LOOP[/FONT]
    [FONT=&quot] [/FONT]
    [FONT=&quot]So we ran the program and while testing the Left detector were we getting a different response.[/FONT]
    [FONT=&quot]First thing was no detections unless you covered the detector completely with your finger or piece of paper. You had to be very close about 3/16 of an inch away. The second problem was the high - low was backwards. With nothing in front of the detector or too close to any object we were get a low indication (0) cover the ir receiver or detector it would go high or show a (1). Think that we had interference we ran the sniffer program.[/FONT]

    [FONT=&quot] [/FONT]
    [FONT=&quot]' Robotics with the Boe-Bot – IrInterferenceSniffer.bs2[/FONT]
    [FONT=&quot]' Test fluorescent lights, infrared remotes, and other sources[/FONT]
    [FONT=&quot]' of 38.5 kHz IR interference.[/FONT]
    [FONT=&quot]' {$STAMP BS2} ' Stamp directive.[/FONT]
    [FONT=&quot]' {$PBASIC 2.5} ' PBASIC directive.[/FONT]
    [FONT=&quot]counter VAR Nib[/FONT]
    [FONT=&quot]DEBUG "IR interference not detected, yet...", CR[/FONT]
    [FONT=&quot]DO[/FONT]
    [FONT=&quot]IF (IN0 = 0) OR (IN9 = 0) THEN[/FONT]
    [FONT=&quot]DEBUG "IR Interference detected!!!", CR[/FONT]
    [FONT=&quot]FOR counter = 1 TO 5[/FONT]
    [FONT=&quot]HIGH 1[/FONT]
    [FONT=&quot]HIGH 10[/FONT]
    [FONT=&quot]FREQOUT 4, 50, 4000[/FONT]
    [FONT=&quot]LOW 1[/FONT]
    [FONT=&quot]LOW 10[/FONT]
    [FONT=&quot]PAUSE 20[/FONT]
    [FONT=&quot]NEXT[/FONT]
    [FONT=&quot]ENDIF[/FONT]
    [FONT=&quot]LOOP[/FONT]
    [FONT=&quot]No detection found[/FONT]
    [FONT=&quot] [/FONT]
    [FONT=&quot]So back to the basic we only connected the left IR system to rule out any other problems, but we got the same results.[/FONT]
    [FONT=&quot] [/FONT]
    [FONT=&quot]Now were thinking we got the program messed up and we decided to load the first boe bot with the same program and see what happen. Using the first built Boe Bot everything worked correctly high with no interference and low when object place in front of IR detector.[/FONT]
    [FONT=&quot] [/FONT]
    [FONT=&quot]So that’s my kinder garden version of what we did and with correct voltage on the 9 vdc and nothing but the left IR installed we still get low with no detection and high with detection. [/FONT]
    [FONT=&quot] [/FONT]
    [FONT=&quot]I hope this is a better explanation of what going on and hope u can help I enjoy the parallax system[/FONT]
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-12-12 21:46
    I would first suggest double checking ALL of your connections on bot 2 and verify there are no shorts and they are all connected exactly as they are on bot 1. If all is well, try using the IR receiver from bot 1 on bot 2 and see what happens. If it does the same thing, try brand new batteries. If it still does the same thing, swap out the rest of the hardware from bot 1 to bot 2. This is obviously not a software issue unless you are using seperate systems on each bot.

    Edit: After reading the rest of your last post I do not think it is software related.
  • edited 2012-12-12 22:29
    we did on boe bot 2 use a different laptop to program the stamp. you think that might be it i could try using the same laptop that we used on one to see if it works and that would ruel that out right
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-12-12 22:39
    i could try using the same laptop that we used on one to see if it works and that would ruel that out right

    Yes, it would.

    I do not think it would be the laptop. The more likely cause would be the program itself.
  • edited 2012-12-13 19:17
    Hey everyone thanks for the help we found the problem:smile: After starting form scratch basically tearing the board down to nothing we started at the beginning!! servos already installed wired per the manual no whisker, ir or anything to be sure that we were good here.So decided to run centering test and guess what we found a bad servo !! yes apparently the signal pot (centering pot ) must had shorted and voltage was being back feed to the homework board. After replacing the servo and successful in adjusting the servo we went straight ahead installing the ir system and every thing works great.

    I like to thank everyone for there help and bearing with the poor grammar thanks again

    Happy Holidays
Sign In or Register to comment.