Shop OBEX P1 Docs P2 Docs Learn Events
IR Detection of moving objects, BS2 — Parallax Forums

IR Detection of moving objects, BS2

mlkakdsnldsnvmlkakdsnldsnv Posts: 5
edited 2006-05-03 20:53 in Robotics
I am working with some infrared LEDs and I couldn't figure out how to make a code for IR detection of only moving objects that cross the range of the LED instead of everything it picks up. Anyone know how to program a code for something like this?

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-03 20:52
    It turns out that detecting a stationary object in time to not bump into it can be difficult. If you want to detect MOVING objects, you'll need multiple sensors with limited spread, or really sophisticated sensors that detect the doppler shift in the returned signal. The multiple sensor approach can work more cheaply.

    And even in the multiple sensor approach, that would work by something being in the Zone 1 detector, then the Zone 2 detector, then the Zone 3 detector -- and your code concluding that it's moving.
  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-05-03 20:53
    Maybe you should put up the regular FastIroaming BOE schematic. Then, use the logic:
    For an object to move in front of the Boe-Bot, it must cross first the left, and then right IR.(or vice versa)
    Try this:
    ' {$STAMP BS2}  '(can't test this so I don't no if it will work)
    ' {$PBASIC 2.5}
    counter VAR Word
    do
    IF (IN0 = 0) THEN
    GOSUB sub
    endif
    sub:
    PAUSE 2
    IF (IN9 = 0) then
    FOR counter = 1 TO 30
    PULSOUT 12, 650
    PULSOUT 13, 850
    next
    endif
    loop
    

    But I think you should get a PIR sensor, just for 8$, here:
    http://www.parallax.com/detail.asp?product_id=555-28027
    -AC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Somebody said...
    -Never Underestimate the power of human stupidity.
    ·
Sign In or Register to comment.