PWR to Leg 1 of photo-sensor
Leg 2 of Photo-sensor connect to a resitor that then goes to ground AND
Leg 2 of Photo-sensor connected to the analog pin (ie. A0)
Another schematick from another places shows it reversed
PWR to a resitor and then to Leg 1 of photo-sensor AND
Leg 1 of Photo-sensor connected to the analog pin (ie. A0)
Leg 2 of Photo-sensor connect to ground.
What I want to know is why this setup.
Why can't you just have pwr to leg 1 and leg2 to the input pin?
itisi:
Why can't you just have pwr to leg 1 and leg2 to the input pin?
Hi
There's a very detailed tutorial on these over at Adafruit (How to use photocells, LDRs, CdS cells, photoresistors!). Under the heading "Analog voltage reading method" it shows the schematic with the pulldown resistor, and why.