To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 2538
2537  |  2539
Subject: 
IR Port as Proximity detector.
Newsgroups: 
lugnet.robotics
Date: 
Fri, 8 Jan 1999 06:15:11 GMT
Reply-To: 
nospam-dcchen@pacbell.net-nospamSPAMLESS
Viewed: 
1482 times
  
Someone (Can't remember who, so unfortunately unable to give credit for
the idea appropriately) posted the fact that the IR port used as a
emitter coupled with the Light Sensor unit as the reciever can be used
as a IR proximity sensor.

Seemed like a good idea.  Had not heard of it done before on this news
group.  Thought I'd give it a try.

NQC code as follows for a test program called Ping.

/*
* Ping
* ===========
* Reads light level into level, transmitts it out via SendMessage.
*
* Mapping:
*   OUT_A: empty
*   OUT_B: empty
*   OUT_C: empty
*    IN_1: empty
*    IN_2: light sensor
*    IN_3: empty
*
*/

#define THRESHOLD 70

int level;

task Ping

{
  while(true)
  {
    level = Input(1);
    if(level > THRESHOLD)
      PlaySound(1);
    SendMessage(level);
  }
}

task main
{
  // Set up the sensors
  Sensor(IN_2,IN_CFG(STYPE_LIGHT, SMODE_PERCENT));

  // Start Tasks
  start Ping;
}

This has the RCX sending infrared pulses out constantly, if the
reflected pulse is > THRESHOLD (arbitrary values, see below), then it
beeps.

THRESHOLD values I have found to cause beeps when Light Sensor is within
the following distances to a wall painted white (flat wall indoor
paint).  Your milage may vary depending on ambient light.

Threshold: 75 70 60 55-

Range: 6" 4" 3" Triggers constantly at with the
ambient light.

Perhaps a routine to adjust for Threshold = average ambient level + 20
would work?

Whoever's idea this was, it was a brilliant one.  Now you have an IR
object detector/range detector to use along with your 2 touch sensors.
I can now use the touch sensors for side collision detection and IR
sensor for front.

Next, use a 3rd motor for side to side scanning of objects...

Dave Chen



Message has 4 Replies:
  Re: IR Port as Proximity detector.
 
David - - - Thanks for sharing .... it's a great idea! I wish more people would post their NQC code snippets. - - - Nick - - - (...) (25 years ago, 8-Jan-99, to lugnet.robotics)
  Re: IR Port as Proximity detector.
 
David ..... Thanks for sharing ... it's a great idea!!! - - - Nick - - - (...) (25 years ago, 8-Jan-99, to lugnet.robotics)
  IR Port as night/day detector (Was: Re: IR Port as Proximity detector.)
 
Pardon my newbieness. This is my first post here and I'm still saving up to buy a MindStorms set. I was wondering if the IR port on the RCX can be used to determine if it's night or day out without using the light sensor. Are IR readings of (...) (25 years ago, 14-Jan-99, to lugnet.robotics)
  Re: IR Port as night/day detector (Was: Re: IR Port as Proximity detector.)
 
(...) I though the RCX had a internal clock. I don't have a RCX so I can not tell. The CyberMaster doesn't. Laurentino Martins *<||:-) [mailto:lau@mail.telepac.pt] [(URL) you check the web site first?: (URL) (25 years ago, 14-Jan-99, to lugnet.robotics)

13 Messages in This Thread:







Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR