You don't really need a comparator. Use 2 photodiodes placed as follows: +5 volts--100K resistor--anode/cathode--+--anode--cathode--ground. The input pin to your microprocessor goes to the spot marked +, ie between the 2 photodiodes. The input will be high if the upper diode gets more light, low if the lower one gets more. You can 'balance' it by adjusting the angles of the photodiodes. For better adjustment, put a pot between the photodiodes with the center going to the processor pin. Credit this configuration to BEAM robotics. Mark Lerman
<equant@azstarnet.com> wrote in message news:8eq9ae$3cl$1@nnrp1.deja.com... > Ok, I have an idea for a simple robot sensor (I'm sure it's been done > before) and I'd like a little guidance from you robot experts. > > Lets say I have a smallish mobile robot with differential stearing and > one I/O pin left. Now, say I put two phototrasistors on it; one on the > front-left corner and one on the front-right corner. OK, so is it > reasonable to expect good results if I use a comparator (LM339) to > compare the to phototransistors and bring the microcontroller line high > or low depending on which sensor is seeing more (or less) light? > > I'm thinking that if this works the way I think it should work, that it > wouldn't be used all the time. IE, not a light seeking robot all the > time. It seems to me if it was a light seeker, it would never go > straight (not a bad thing, but kind of funky). So I was thinking that > certain events could trigger behavior where the robot figures out which > detector is getting more light, and then turns that way either for a > small amount of time, and the goes forward, or turns untill it sees a > transition between the two sensors and then goes forwards (or whatever). > > Ok, any thoughts, experience, schematics would be appretiated. I'm not > a newbie, but pretty close :) > > Thanks, > Nathan Hendler > Tucson, AZ USA > > > Sent via Deja.com http://www.deja.com/ > Before you buy.
|