Light Sensor

Status
Not open for further replies.

ibwev

Member
I am attempting to connect a light sensor (GP2A200LCS0F) to PIC16F690. The pic will receive signal from the light sensor and count the number of interruptions. The maximum current output of the light sensor is 50 mA and the maximum output voltage is 30 V.

Since the maximum input clamp current of the pic is 20 mA and the maximum voltage on Vdd is 6.5 V (I assume all other input pin maximum voltages = Vdd), should Resistor A (see diagram) be:

R=V/I
=(Difference of Maximum Voltages)/(Maximum input clamp current)
=(30 - 6.5) / (0.020)
=1.18 kΩ

View attachment Light Sensor.sch

Light Sensor Datasheet
 

Attachments

  • Light Sensor.pdf
    153.8 KB · Views: 179
Last edited:
Cant read your .sch file. Next time post a graphics file, like a jpg or pdf.

Tie Pin 1 to PIC VCC (+5V).
Tie Pin 2 to PIC input port pin, connect a 10K resistor from PIC pin to +5V.
Tie Pin 3 to PIC VSS (Gnd).
 
The lower limit for the pull-up resistor is based on how much current the sensor will sink, which I think is ~30mA, so 5V/0.03 = 167Ω.

The upper limit is based on either the input current into the PIC port pin while HIGH plus the Off leakage back into the sensor output pin while HIGH, or how long it will take the pull-up to charge the capacitance of the wire and both pins when the sensor's output transistor turns off.

When the wire is at 4V (which is a clean HIGH, >Vih), there is 1V across my 10K pull-up, meaning it can supply (5-4)/10K = 100uA, which is well in excess of the leakages, which are likely ~1uA each.

A WAG at the capacitance on that wire node is 15p (pin) + 15pF(pin) + 30pF(wire) = 60pF. The time-constant when the pull-up is charging the node is 10e3*60e-12 = 600e-9 = 600ns. I dont think there will many pulses you will miss....

10K is a good compromise; does the job, doesn't produce much heat while the sensor output pin is low...
 
Wow!!! Thanks for the detailed explanation. That helps me better understand what is happening in the circuit.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…