Electrical – Using a LED like a photodiode to measure light


I was experimenting the other day trying to find some way to get cheap light sensors and read somewhere that LEDs can be driven backwards and let through current backwards more the larger amount of light shining on the LED. Then my solution involved setting pin to high ( 5V ) and switching to input and measuring time (clock cycles) required to leak down to a false state ( close to 0V ).


simulate this circuit – Schematic created using CircuitLab

Any idea how I can modify my circuit to get a faster more predictable maximum time for the time counter for my controller?

Best Answer

You can use an LED as a photodiode. They are not the same however, a photodiode produces a leakage current in the opposite direction from LED's. One problem is the currents are also small (as with photodiodes in the mA to uA range).

To gain the current a transimpedance amplifier is necessary and change it to a voltage that can be read by your micro controller