Robot line sensor question

Status
Not open for further replies.

richardv2

New Member
I want to signal condition a phototransistor line sensor output to a digital input.

Although I am using the PIC16F8680 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.

00011000
00001000
00001100
00000100
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???
 
I must have missed the rule on cross-posting. I thought if it applied in more than one area, it was OK.

The link you gave me. I see nothing there that has anything to do with my question. (signal conditioning sensor inputs for PIC18F8680 microcontroller). Was there a specific place on this link I was supposed to look??
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…