Optical Sensors

Can we please have some information about Optical Sensors, because our team has just decided to use them. We need to know how to use them, how to program them, etc.

Any ideas will be greatly appreciated.


Team 1241


Look this over and then post with any additional questions: Banner Sensors

Banner sensors can be used for lot of purposes: line tracking, measuring distance traveled, locating obstructions or those bins from 2003.

See the Banner spec sheet Mike identified for detailed information.

Hookup to Controller
v Power and ground attach to 12v breaker panel 20a fuse
o brown wire - +12V
o blue wire - ground
v Signal attach to a digital input (only need to pick one)
o black wire – Open by default signal
o white wire – Closed by default signal
v The detection range of the Banner is adjusted by a small black pot on the back.

The code is simply a check on the digital input the Banner signal wire is connected to. The Banner is either on or off, e.g.,

if (rc_dig_in01)
	//The Banner detects an obstruction – e.g., detour
	//The banner doesn’t “see” anything – e.g., keep going

For example, if you are using it to measure distance by watching alternating light/dark spots on your wheels or drive shafts, then each on/off cycle will equal a certain number of inches traveled. Your code will just keep count whenever the banner changes from on to off and vice versa, e.g.,

/* The following polling of the Banner sensors should be performed in the fast loop */
#define TRUE 1
#define FALSE 0
/* Note: Banner TRUE or FALSE will differ based on which of the two possible 
* signal wires you choose to use
static char bannerFlag = FALSE ; // Default to FALSE
static int wheelCounter=0;
// Count when the Banner changes from on to off (& vice versa)
if (rc_dig_in01 & bannerFlag) 
	bannerFlag = FALSE ; 
else if (!bannerFlag)
	bannerFlag = TRUE ; 

[edit] A side note:
[font=Verdana]The sensors will take a few seconds on 12v power start-up, before the readings are dependable, and be careful with the 7.2v RC backup battery. If the RC stays on while the 12v power is cycled you will get several bogus on/off readings from the banners while they are powering up.[/font]

They are digital. That really didn’t make much sense to me, but they are. Hook them into digital i/o on the robot controller, and don’t worry about more than 5v going to sig. The digital i/o looks for either a pos voltage or gnd, with no real specification on the pos voltage.