|
Re: A quick IR sensor question
a naked IR sensor has an input angle close to 180° on both axis - so its impossible to 'point' it at anything
you need to enclose the sensor in something light tight, and only allow light in from one direction
I used the same code we have in our FRC in the EDU RC and a spare sensor in a plastic hobbie box from radioshack - somewhat like a pinhole camera - to scan the field at the buckeye regional - I didnt get any reflections - the code only registered when the sensor was pointed directly at a beacon
BTW we had one match were I though the beacon had reflected off a ref standing at the edge of the field. We had a team member filming all our matches from up in the stands, and reviewing the tape I could see that is NOT what happened - the bearings in one of our triwheel assembles had bound up and the bot veried to the left
I cant recommend using a camcorder on your bot - zoomed in close - enough.
the tapes were extreemly useful after the matches , esp for debugging auton mode.
but there is one thing we learned about the IR sensors - if you simply put a scope or an LED on the output, so it blinks when the sensor triggers, the sensors DO trigger ocassional when there is NO IR present - a short burst about 100uS long (the normal beacon pulse is 1 or 2mS long) so if you are only looking for the output pin to go low, and you dont measure the pulse width, you will get false indications when no IR light is present.
in our code we look for the sensor to be active during 3 consecutive SW loops, then we take it as valid. This works perfectly - the chances of the sensor glitching out a 100uS pulse every 26mS is practically zero - Ive played around with the sensors on my scope, the glitches happen maybe once every 5 ot 10 seconds- it might be something to do with the automatic gain control built into the device.
Last edited by KenWittlief : 28-03-2004 at 21:09.
|