I have made my little bot do basic obstacle avoidance but want make it more precise. Right now it only turns left if the parallax ping sensor detects an object less than 6 inches in front of the bot. What I wnt to do is add a sensor tot eh left and right sides of the bot in the front to determine if the bot is closer to the obstacle on the left or right and turn in the opposite direction when detected. I have several Ping's laying around but they are really big on a little bot, so my idea was to use a couple sets of infrared emitter/receiver, mainly because I have them already. So I made a couple up and wired them in with a couple resistor just to check them out. but don't notice much voltage variance, except up very close. Has anyone else done this? and what kind of range were you getting if so. I read a few who were saying as little as 3cm, if so this will have to be abandoned and something else used.
Here is a pic and they will mount under the front corners of the bot chassis.
What is the max current for the IR LED? You may be able to increase range by driving the LED harder but with a pulse. Turn on the LED only when you want to read the photo transistor and for just long enough to get the reading (millisecond(s)).
it looks like 150mA on the current. will have to check what I can get out of it. So your saying more of a pulse type detection. short burst to isolate better?
Do you know of any sketch I might use as a reference to get started?
What I was suggesting was to only turn on the IR LED when you want to read the phototransistor and only for long enough to get a reading. A side benefit is that since you are turning it on for a very short period you can up the current and get more range. I haven't any idea what the max range may be but it is easily found experimentally. The data sheet should have the currents that are allowed versus pulse width or duty cycle.
Also you might have better range if you angle them together a bit /\ so the reflected light has a straighter shot at the detector. Most of the manufactured proximity sensors are made like that.