|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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. Thanks, Team 1241 |
|
#2
|
||||
|
||||
|
Re: Optical Sensors
|
|
#3
|
|||||
|
|||||
|
Re: Optical Sensors
Quote:
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., Code:
if (rc_dig_in01) //The Banner detects an obstruction – e.g., detour else //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., Code:
/* 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)
{
wheelCounter++;
bannerFlag = FALSE ;
}
else if (!bannerFlag)
{
wheelCounter++;
bannerFlag = TRUE ;
}
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. Last edited by Mark McLeod : 02-12-2004 at 07:34. Reason: Added fast polling note |
|
#4
|
||||
|
||||
|
Re: Optical Sensors
Also:
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. Sparks |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Optical Sensors Used as Encoders? | uvabrad825 | Technical Discussion | 22 | 03-05-2004 13:22 |
| Q&A Discuss: Optical sensors with EduBot | CD47-Bot | Extra Discussion | 2 | 01-03-2003 18:37 |
| Q&A Discuss: optical sensors | CD47-Bot | Extra Discussion | 0 | 15-02-2003 22:58 |
| optical sensors acting strangely | rosebud | Electrical | 10 | 03-02-2003 00:29 |
| optical sensors | majormusic2005 | General Forum | 1 | 28-01-2003 20:37 |