Robot Line Sensor Question

Discussion in 'Embedded Systems and Microcontrollers' started by richardv2, May 13, 2008.

  1. richardv2

    Thread Starter New Member

    Jan 24, 2008
    I want to signal condition a phototransistor line sensor output to a digital input.

    Although I am using the PIC18F8680 chip, the answer should be valid for most PIC chips. If not, please let me know.

    I have designed, built and tested a bank of 8 IR Transmitter/ Phototransistor pairs.
    They all return 1.2 to 4.2 volts at 3/8ths inch depending on a light or dark surface below the sensors.

    I ultimately want an 8-bit digital pattern where the sensors might react like this when travelling over a black line.

    meaning the robot is drifting off center.

    Seems like I have several options:
    Lets say I use Port B as an input port.

    1. If I just run the sensor inputs to the port, it would seem that I would get what I want; zeros or ones.

    2. Could I send the 1.2-4.2 volt signal through some kind of chip like an inverter to "clean up" the signal and only produce 0 or 1? I know an opamp could do this, but that seems like overkill.

    3. How about an LED/resistor voltage divider to drop the 1.2 down to 0.7 to make sure I get a zero into the chip at low voltage??

    4. I could use ADC, but it seems inefficient to convert the voltage into an 8 bit number just to turn it back into a one or zero.

    So what would you do???
    Last edited: May 16, 2008
  2. hgmjr

    Retired Moderator

    Jan 28, 2005
    Can you provide a schematic of one of your photo-sensor circuits (emitter and detector) so that we can determine if there is any room for improvement? Part numbers of the photo-detector and the emitter will allow us to access the datasheets for them. It may be possible to enhance your sensor circuit and avoid the need for further signal conditioning.

  3. Søren

    Senior Member

    Sep 2, 2006
    A 40106 (Hex inverters w. Schmitt trigger inputs) might be just what you want.