The Roomba uses optical IR interrupts on a physical bumper (the bumper moves a slot that blocks/allows IR light to reach a detector -- this obviates the need for a mechanical switch which would be much more prone to physical breakage). Is that what you want to do? Or do you want multiple detectors in a "fan" or "array" facing different points on your 'bot?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ When the going gets weird, the weird turn pro. -- HST
to Zoot
right i need multiple detectors on my bot to detect object at 90 degree the same time.
how can i use 5 or 7 ir led to make light reflect back to 1 Ir detector, i not sure could it wok?
You probably need multiple IR detectors, essentially one for each IR emitter, a pair for each direction. You are also going to want some kind of IR opaque tube to narrow the beam from the IR emitters and to reduce the "view" of the IR detectors. You'll still have some problem with reflections, but the tubes should help. You will probably need to use one IR emitter / detector at a time, but you can time sequence them very rapidly since the IR detector will respond in less than 1ms to a modulated IR beam.
If you want to save I/O pins, you can use a 3 to 8 decoder (74HC138) and an 8 input selector (74HC151) to choose from among 8 emitters and detectors with only 5 I/O pins needed for everything.
I've always wanted to mount a PING on a servo and have it spin around like a radar dish [noparse]:D[/noparse] Maybe you could do the same with an IR sensor, the stamp would know what direction the obstacle was based on the servo's direction at the time of signal reciept.
If you want to save I/O pins, you can use a 3 to 8 decoder (74HC138) and an 8 input selector (74HC151) to choose from among 8 emitters and detectors with only 5 I/O pins needed for everything.
Now that you mention it, I am satisfactorily using a 151 for the detectors. My idea was to also use a 138 for the emitters but if you read a datasheet you will realise that the outputs are all of them inverted. Since the BS2 can't function properly with opposit current (I mean, sending a 0 to a IR LED with the other IR LED pin conected do Vdd is not posible, it must be send a 1 to a IR LED with the other·pin conected to Vss), I think the only way to solve it is to use a hex inverter in all of the outputs of the 138, which is just to messy to put in a robot due to all the wires...
You can use the LEDs with a 74HC138.· Since these outputs go low when selected, just connect the cathode of the LED to the output and the anode of the LED to Vdd (+5V) through the current limiting resistor.· Use the normal (E) enable input to connect to the Stamp I/O pin·and connect the other enable and not-enable pins with pullups and pulldowns so they're "on".· The result should work just fine with existing routines for the selected LED/detector pair.
Thanks Guys
One more question , could i do some like this , i want to make the docking station charger with 2 IR led , and the BoeBot with 3 Ir detector to make boebot forward the dock, so 3 Ir detector see the Ir led at docking station ,if IR detect left detect the IR Led the Boebot turn right 30 degree and if ir right detect then turn left turn 30 degree and if the center detect boebot go forward, i want to make BS2 at the docking station to communicate with boebot ,but i dont know how to write code to let 2 stamp communicate with eachother
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
right i need multiple detectors on my bot to detect object at 90 degree the same time.
how can i use 5 or 7 ir led to make light reflect back to 1 Ir detector, i not sure could it wok?
If you want to save I/O pins, you can use a 3 to 8 decoder (74HC138) and an 8 input selector (74HC151) to choose from among 8 emitters and detectors with only 5 I/O pins needed for everything.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
(5v) BS2 -> current -> LED (0v)
But if I understand, you say that this will also work (the current is going IN the BS2):
(0v) BS2 <- current <- LED (5v)
One more question , could i do some like this , i want to make the docking station charger with 2 IR led , and the BoeBot with 3 Ir detector to make boebot forward the dock, so 3 Ir detector see the Ir led at docking station ,if IR detect left detect the IR Led the Boebot turn right 30 degree and if ir right detect then turn left turn 30 degree and if the center detect boebot go forward, i want to make BS2 at the docking station to communicate with boebot ,but i dont know how to write code to let 2 stamp communicate with eachother