There are several issues involved. To ignore extraneous light, use a detector that has an IR filter. To enhance detection, send out a series of low duty cycle IR pulses. These should have a fixed frequency. Have the receiver shielded, especially from the transmitter, so that ONLY reflected light is detected. If you want to detect objects at a specific distance (say 12"), then mount the IR source and detector at some distance apart from each other, and tilted so that the detector "sees" the transmitter signal only when it is bounced off of an object 12" away. OBJECT /\ / \ / \ / \ / \ * O Where [*] is the IR LED, and [O] is the IR detector. **************** There are several things you can do to enhance signal detection. Include an LC tuned circuit in the receiver. This helps the system pull the signal out of all the background noise. Use synchronous detection. This is quite simple. You turn on the IR source, wait a ms, and then determine if you can "see" it with the detector. If you can, then you turn off the IR source, wait a ms, and see if the signal is now gone. Now this is particularly sensitive if you are measuring signal levels, for all you need to have is a small SYNCHRONOUS change to know for sure that you have a reflection. This method tolerates a lot of extraneous light. A/D detection is particularly useful here. EXCLUDE as much as possible all other light sources. You can do this by placing the detector at the bottom of a "sighting tube". It is sort of like being able to see the stars during the day if you are looking up from the bottom of a well. If using a sighting tube, do not make it too narrow or it will be difficult to get it aimed properly. If using the angular approach diagrammed above, the angles become quite critical with sighting tubes, but a properly adjusted set of tubes can give you excellent fixed distance information. For other application a "barrel and sight" approach similar to a gun barrel and a gunsight (parallel approach) works well for telling whether an obstacle is up ahead. It does NOT give distance information. By the way, a single IR source can be used with SEVERAL detectors to give a sort of "step" distance information as shown below: B /\ / \ A \ / \ \ / \ \ * X Y Where [*] is the IR LED, [A] and [B] two object distances, and [X] and [Y] two detectors. As the robot approaches an object such as a wall, at distance B detector Y would detect it, and at distance A, detector X would detect it. I once built a "distance" detector that used a laser beam and a linear charge coupled device originally designed for a fax machine. The laser beam was swept across a small angle using a mirror, and a lens gathered the reflected light and focused it on the linear sensor. The beam would be modulated from scan to scan, and then when the data was marched out of the device and placed in external RAM, it could be compared pixel by pixel and based on the modulation you could determine how far away an object or set of objects were from the sensor array. I know that some of these techniques are over-kill for most projects, but still, it is always good to be aware of many different techniques. You never know when one of them will come in handy. Fr. Tom McGahee ----- Original Message ----- From: Micro Eng To: Sent: Friday, August 24, 2001 12:06 PM Subject: [PIC]:Using IR....determing position? > I am trying to decide if I can use an IR setup to determine if something is > in range. I could use ultrasonic, but I wondered if IR might be easier. > All I want is PIC watching the inputs and if the box is moved within a > certain range (12"-16") turn on an LED. Simple in concept.... > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads