PnP IR Optical Sensor
alessendrocrow
Posts: 6
I'm doing a walking robot with turn right or left when an object is detected, i'm using Basic Stamp 2 as software. Can any one give an idea or concept that how i'm gonna to program the sensor part.....
Comments
The BoeBot text shows pretty clearly how to make a more reliable object detector using an IR LED and a 38 kHz IR rcvr module. Scribbler gets left & right detection using one center mounted detector and 2 LEDs, one left one right.
-Phil
Seriously, thanks for your input. I have seen a few Fairchild metal-can phototransistors that do have an unused base lead. It's just there for moral support!
You're right: there are some with base connections. Frankly, I'm not sure what they're for, though. Biasing, perhaps?
-Phil
http://cgi.ebay.com.my/PnP-Opto-IR-Sensor-Basic-Stamp-PIC-AVR-MCU-Robot-/350233715179?pt=LH_DefaultDomain_0&hash=item518b8e61eb
it only consists of 1 output, the boe-bot sensor is similar to this sensor, but, i just dint work it out, can some one teach me ?
main:
FREQOUT 4, 1, 38500
Left_sensor = IN4
IF (Left_sensor = 0) THEN
GOSUB turn
ELSE
GOSUB forward
ENDIF
GOTO main
i wonder my robot dint get into ' turn ' command, and the sensor red LED just keep blinking when ther's an object in front of my robot, the LED should be a permanent light up when ther's an object, is'nt it ?
1) it generates the IR frequency by itself (don't freak out: you don't need the FREQOUT) and
2) this module is active HIGH where BoeBot's sensor is active low
So your code should look more like:
Left_sensor = IN4
main: IF (Left_sensor = 1) THEN GOSUB turn ' was 0
ELSE
GOSUB forward
ENDIF
GOTO main