tamer1221
Newbie level 5
IR interfacing
I want to signal condition a photodiode line sensor output to a digital input.
Although I am using the PIC16F877a chip,
I have designed, built and tested a bank of 8 IR Transmitter/ Photodiodes pairs.
They all return 1.2 to 4.2 volts 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 want to signal condition a photodiode line sensor output to a digital input.
Although I am using the PIC16F877a chip,
I have designed, built and tested a bank of 8 IR Transmitter/ Photodiodes pairs.
They all return 1.2 to 4.2 volts 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???