If the IR detector is actually detecting the IR that is good, if it's detecting when you're not using the remote control, obviously that is bad. If it's the former, I would suggest putting some black heatshrink around the IR LEDs to reduce the angle of the light beam. If it's the latter, and you don't need actual distance measuring, but just object detection, I would get a Panasonic 4602 or similar as a detector. They have filters on the lense thingy to reduce ambient light noise and then probably have all kinds of intergrated circuitry as well to give good clean ttl output. I'm no expert or anything, but I did mess around with doing object detection with the 4602 and it worked out fairly well. Good luck, peace MJ Brush ----- Original Message ----- From: "Lindy Mayfield" To: Sent: Thursday, May 27, 2004 6:55 PM Subject: [PIC:] Question about using IR Detector for measuring distance Would someone please help me a bit by steering me in the correct direction here? I've read everything I could find in books and on the net about this subject, but I'm still very stupid when it comes to the electronic bits. Please forgive my ignorance, but I'm really trying. I want to add distance measuring to my robot. I connected an IR detector (TSOP) to a breadboard and then connected it to a PIC chip on a development board. Using MPLAB and ICD2 and the development board, I wrote some code to detect when the IR detector detects something. I put the debugger into a loop to stop when the IR detector receives something and it worked great. So far so good, I thought. To test things, I used our TV remote control. Every time I pushed a button the debugger stopped at a break point. Perfect! Yes? No! No matter where I pointed the thing, the IR detector detected it. I even put aluminum foil around the IR detector, and still it wouldn't fail. It is just a Gr|ndig TV and remote. What am I doing or thinking wrong? I tried to move from IR to sonar, but I cannot understand how the electronic portion works for the receiver. (I've ordered "The art of..." and "Beboop.."; they are on their way.) Thanks very much to the people who take the time to help me. Cheers, Lindy --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.663 / Virus Database: 426 - Release Date: 4/20/2004 -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics