Shop OBEX P1 Docs P2 Docs Learn Events
Ir beacon — Parallax Forums

Ir beacon

Special_KSpecial_K Posts: 162
edited 2006-09-13 05:50 in BASIC Stamp
IR BEACON
I am working on a project that has a boe bot reading a beacon from another stationary BOE with an IR LED. Basically I have broken up the diagram on page 243 of Robotics with the BOE-BOT so that there is only one transmitting IR LED and it is attached to another BOE (the detection part still stays the same). Is there any way to extend the range of the beacons transmission or the detectors ability to get an accurate reading over distance.

Also the BOE-BOT seems to home in on my laptop and my plasma TV more often then the beacon. Is thee a way to stop the errors. I thought of putting a bit of data in the beacons IR but would that still allow for homing to a beacon?

beacon code

ir CON 1
red CON 0

'red_led VAR BYTE
'ir_led VAR BYTE

DO
FREQOUT IR, 1050, 38500 'ir beacon on
FREQOUT red, 100, 38500 'red LED for the humans

LOOP


homing code is fast ir roaming. reversed.

irDetectLeft VAR BIT ' Variable Declarations
irDetectRight VAR BIT
pulseLeft VAR WORD
pulseRight VAR WORD

FREQOUT 2, 20, 3000 ' Signal program start/reset.

DO ' Main Routine

' Check IR Detectors
irDetectLeft = IN1
irDetectRight = IN0
' Decide how to navigate.
IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
FREQOUT 2, 200, 500 ' Signal program start/reset.
pulseLeft = 650
pulseRight = 850
HIGH 3
HIGH 4
FREQOUT 2, 200, 5500
ELSEIF (irDetectRight = 0) THEN
pulseLeft = 850
pulseRight = 850
FREQOUT 2, 200, 200
HIGH 4
ELSEIF (irDetectLeft = 0) THEN
pulseLeft = 650
pulseRight = 650
FREQOUT 2, 200, 300
HIGH 3
ELSE
ENDIF

PULSOUT 15,pulseLeft ' Apply the pulse.
PULSOUT 14,pulseRight
LOW 3
LOW 4
LOOP ' Repeat main routine

Comments

  • willthiswork89willthiswork89 Posts: 359
    edited 2006-09-01 00:47
    The only possible way to make the distance greater is exactly like they say for a normal LED, the more voltage the brighter the LED, same goes for infrared, Is it getting a constant signal from the tv? or a constant signal from the Laptop? if not you could make it check with a counter

    do
    if(FoundBeacon = True) then
    BeaconCount = BeaconCount +1
    endif
    if(FoundBeacon = False AND BeconCount <> 0) THEN
    BeaconCount = 0
    goto Roam
    endif
    loop until(BeaconCount = 200)



    it homes in and makes sure that the signal its receiving is constant, if not then it starts roaming again until next time

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Learn somthing about everything, and Everthing about somthing-
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-09-01 01:09
    I believe you can 'pulse' the IR-LED at like 100 mA (use a smaller current limiting resistor) since you're using the 38 Khz signal.· That's how real IR-Remote do it.· Make VERY sure the 'idle' voltage is the one that DOESN'T light up the LED, or you'll burn it out.· Test with a Visible LED first, they tend to be cheaper.· Another approach is to use 2 IR-LED's.

    And yes, a pattern of:
    FOR I = 1 to 10
    FREQOUT IRPin, 1, 38500
    PAUSE 1
    NEXT

    should be read by the BOE-BOT as a bunch of 1 mSec pulses -- very different from the TV remote or laptop signal.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-09-01 06:03
    Gents -

    Allan is of course correct. Is it CURRENT with an LED which will give you greater output, not VOLTAGE. The voltage for an LED is realtively fixed.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • ZootZoot Posts: 2,227
    edited 2006-09-01 07:57
    I've been working on something very similar. You might want to check out this link for ideas: http://www.pololu.com/products/pololu/0001/

    I looked at some setups like this and a lot of them use a much higher frequency LED frequency and detector frequency (56khz vs 38.5) which puts it in a higher range than regular remotes which may help interference. I would also think the detection range is greater, but I don't know enough about the opto-physics of IR -- others may know more. I saw a beacon like the one above in use on two robots and they homed in on each other from across a fluoroescently-lit room.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • Special_KSpecial_K Posts: 162
    edited 2006-09-01 14:10
    I looked at the IR Beacon from Pololu but it is out of production.
    I think I could get the parts but would not have an idea of how to program the PIC
    Also came across this. www.robotmaker.co.uk/IRCF/IRCF_benefits_Features.htm

    it looks like more of an IR navagation device then beacon reader (but the text says it can read a beacon).


    can you send a FREQOUT of 56khz on a BS2. I will have to try that when I get hoome tonight.

    Post Edited (Special_K) : 9/1/2006 7:11:04 PM GMT
  • Special_KSpecial_K Posts: 162
    edited 2006-09-01 21:54
    Just talked to a slaes person at Pololu, she said that they should have another version of the IR Becon out soon.
  • ZootZoot Posts: 2,227
    edited 2006-09-04 19:45
    You don't need the PIC on the beacon. I just sent that because it was a clever idea. I would guess their chip is there to generate the Freq. so you don't have to generate it "by hand" off a pin, and to read the status of the detectors and deliver to their own pinouts. I don't believe you can FreqOut at 56khz BS2??? But the bigger issue is you need a detector that DETECTS modulated IR at 56khz.

    You can also make your own freq. generator for IR and the like with a 555 (single) or 556 (double) timer IC -- which are like 50 cents.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • steve_bsteve_b Posts: 1,563
    edited 2006-09-05 14:19
    Is it a stationary beacon? or a scanning one (like a lighthouse or radar?)?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Special_KSpecial_K Posts: 162
    edited 2006-09-05 15:39
    Is it a stationary beacon.
    To mark something like a home base, or a recharge station, or a goal.
    if i could get a data bit encoded in the beacon it could serve to distinguish different docks.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-09-05 15:51
    Umh, why not use several LEDs. I suppose that if you could drive 5 or 10, you would get more output.
    Of course there would have to be something like a MOSfet between the Stamp and all those LEDs. I imagine you could have 20 or 50 if you wanted to.

    You coulds·easily use a 555 to generate a pulse and tune it to the right frequency. That would be a lot cheaper than a Stamp if this beacon in merely a drone.·

    You could also get away from the 38500KHZ as the band is crowded with remove controls and IrDA.· I believe that an IR photodiode and having the BS Pulse in tuned to something different and not harmonic would clear up a rather messy situation.· If you want high stability use a TTL oscillator [noparse][[/noparse]like 4 Mhz] and divide the pulse down with an IC to something usefull.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 9/5/2006 4:03:01 PM GMT
  • Special_KSpecial_K Posts: 162
    edited 2006-09-05 16:46
    does anyone have a link on how to make the beacon from a 555 chip. And I guess the P basic code to initialize it to pulse the LEDS at 38K. this will free up one stamp but still leaves long range detection issues.
    also I swapped out the resistor from a 220, to a 100, then to a 10 I think it will not hurt anything am I right??

    I did some tests with Paper an visible LEDs and the LED with the 10 resistor shows through 2 more sheets of standard 20 LBS press 92 brightness paper. I think this will translate into a few more feet.

    also if I do the same to the IR detectors (go from a 220 to a 10) will that increase their range also????

    Post Edited (Special_K) : 9/5/2006 5:00:46 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-09-05 17:00
    Let's see -- 5 volts, - 1.4 volts for the lit LED == 3.6 volts. V = I*R, so 3.6 / 10 ohms == 360 mA. Wow, that's a lot of current. If you weren't 'pulsing' the current, you'd burn out the LED in a few 10's of milliseconds. Since you ARE 'pulsing' the current, apparently you're OK.

    And it's the number of sheets that's important. For instance, you say it shown through two more -- what is the TOTAL number of sheets it showed through? Three? 12?

    And NO!· You cannot increase the "sensitivity" of a detector by lowering the value of the protection resistor.· You're increasing the intensity of the LIGHT output by the LED by increasing the current through it.· There IS NO equivalent way to increase the sensitivity of the detector -- it is what it is.

    Post Edited (allanlane5) : 9/5/2006 5:04:05 PM GMT
  • Special_KSpecial_K Posts: 162
    edited 2006-09-05 19:01
    I just put in this code

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    ir1 CON 0
    ir2 CON 1
    red CON 2
    
    'red_led VAR BYTE
    'ir_led  VAR BYTE
    I VAR BYTE
    DO
    FREQOUT IR1, 10, 56500
    PAUSE 20
    FREQOUT IR2, 10, 56500
    PAUSE 20
    FREQOUT red, 10, 37500
    PAUSE 20
    LOOP
    


    .

    the detector sees the IR LEDS.. is it really working are the leds pulsing at 56500 or have I pushed the freqout past 37500 and it is still only pulsing at 37500.

    problem is it looks like it is only getting half the number of hits at 56500.

    Post Edited (Special_K) : 9/5/2006 7:10:39 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-09-05 19:12
    Special_K -

    Actually the maximum value for the frequency parameter is 32767. There is something unexpected (but useful) that happens after that point, and it was described in a thread about 30-60 days ago. Unfortunately that's all I remember about it - sorry.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • NewzedNewzed Posts: 2,503
    edited 2006-09-05 19:45
    Kwaku, don't write:

    ir1 con 0
    ir2 con 1
    red·con 2

    Write instead:

    ir1 PIN 1
    ir2 PIN 2
    red PIN 3

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-09-05 20:59
    See the link below for generating frequencies higher than 32767Hz from the BS2

    Freakout (freqout) trick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-09-05 21:39
    Summary -- no, when you say "50000" in the frequency spec, you don't get 50,000. And because of the way the FREQOUT generates its frequencies, there's still a component in the 38 Khz range that the detector will respond to. But as you sweep the frequency setting, the amount of that component varies, which can give you a variable reflection detection range.

    Which is probably NOT what you want for a beacon. Just set it to 38,000 (or whatever they recommend) for the best detectability.
  • Special_KSpecial_K Posts: 162
    edited 2006-09-06 20:37
    Allanlane5,
    If I remember (since I did not write anything down) the light from a standard LED with 220 resistor can get through 4- 5 sheet depending on the weight. The LED with a 100 resistor can get through 9 and the LED with the 10 ohm resistor 11 sheets.
    I did this just to check the apparent brightness since after looking at one bright led the next LEDs brightness was indistinguishable to my eye.
    Test done in a room with standard florescent lighting and daylight.

    SID, thanks for the pin suggestion.

    So it looks like I have maxed out my LEDs with 10 ohm resistor and a freqout of 37500. This gives me some good distance

    Post Edited (Special_K) : 9/7/2006 2:55:56 AM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-09-06 20:49
    Brilliant! (no pun intended). Well done.
Sign In or Register to comment.