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 / 2540
2539  |  2541
Subject: 
Re: IR Port as Proximity detector.
Newsgroups: 
lugnet.robotics
Date: 
Fri, 8 Jan 1999 08:05:59 GMT
Original-From: 
Nick Taylor <ntaylor@iname.com>
Viewed: 
1522 times
  
David .....
Thanks for sharing ... it's a great idea!!!
- - - Nick - - -

David Chen wrote:

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
--
Did you check the web site first?: http://www.crynwr.com/lego-robotics

--
Did you check the web site first?: http://www.crynwr.com/lego-robotics



Message has 1 Reply:
  Re: IR Port as Proximity detector.
 
Oops, noticed a coding error, the line that says: level = Input(1); Should read: level = IN_2; For better readability. The original version works b/c IN_2 is #defined already as Input(1); but the latter is more readable. I have used this (...) (26 years ago, 8-Jan-99, to lugnet.robotics)

Message is in Reply To:
  IR Port as Proximity detector.
 
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 (...) (26 years ago, 8-Jan-99, to lugnet.robotics)

13 Messages in This Thread:







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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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