PDA

View Full Version : IR Sensor with Phidget 8/8/8



lunarnexus
03-10-2008, 10:46 AM
I got a Phidget 8/8/8 and the IR sensor board hooked up to an IR Sensor. (Actually I got the 4 sensor 8"-60" IR sensor kit from Trossen) and the first thing I did was hook it up. I plugged everything in and fired up InterfaceKit-All.exe (or something like that) in the C:\Program Files\Phidgets\ directory, which is what gets installed from Phidgets.com.

A nice GUI comes up with a sweet readout of all the digital-in and digital-out, and values are displayed for the analog inputs.

My issue:
As I bring my hand closer to my IR sensor, the analog value raises until it reaches 500 or so, then goes back down to 300 or so when I'm too close to the sensor (less than 8"). My question is, how am I supposed to know (or the robot), when an object is getting closer to the robot, or when the sensor is just out of range? For instance, if something comes close to the robot (8" or so), how am I supposed to know if it's getting farther away or closer when the analog value goes back down?

I had though about getting a 4"-30" sensor and using a combination of the 2 ranges, but I'd like to keep costs down.

Thanks,
James

Alex
03-10-2008, 12:51 PM
edit: Sorry, I was totally off with my original post. let me try again

What we did was recess the sensor on our robot the distance of the error. Another solution would be to put bumpers on your robot as deep as the error.

Since your sensor is a longer range though, that means that 8" is the error margin. Sensors need to be matched to a robot and I think that this sensor is just a little much for your bot.

Matt
03-10-2008, 01:54 PM
To Echo Alex's reply, yes, unfortunately this is one of the down sides of the IR sensors from Sharp. There is no way to fix it in code since there is no way to really know which side of the 8" threshold you are on.

There are two usual fixes for this. One is that you never let you bot get closer than X inches to anything and keep out of the trouble range. You simply program it to stop or turn before that. The other is to recess the sensors far enough to cancel out the trouble area. Using this method means that you have to match the range of the sensor to the size of your bot in order to be able to have the room to recess them. If you are building a normal sized bot then you may have gotten sensors with a bit too high of a range. If the sensors are still in new condition we would be happy to swap them out for you, just contact Jennie and tell her I said it was okay.

These are good sensors to use since most bots have 4 inches of room to recess:
http://www.trossenrobotics.com/store/p/5429-GP2D12-4-30-inches-.aspx


cheers :)

JonHylands
03-10-2008, 02:43 PM
Another technique is to use a digital short-range IR sensor, like a ProxDot, to indicate that the obstacle is within the specified range (4"), and translate the Sharp readings based on that.

- Jon

lunarnexus
03-11-2008, 03:07 PM
Since there's not really a programmatic way to fix this one, I may have to try a combination of sensors. Since my sensor assembly will be on a pan/tilt I can probably have three 8"-60" sensors work omnidirectionally and one 1.5"-11.5" pointing straight forward. When something comes close to the 8" threshold, the robot will have to simply look in it's direction.

Option 2 could include using the 8"-60" I already have. This robot will have a "tail" of sorts, which will sit back a little less than 8". I can put the 4th sensor on the tail using Alex's recess idea.

I might recommend to Trossen, a combination pack of sensors that has various ranges for instances like this one.

Thanks for all the help guys!