Using a LED as a photodiode

Hello fellow Arduino-lovers, I wanted to do some light measurements and as I had no photodiodes lying around (except some old CNY-70s) I decided to use a LED, (which should be possible in general, right?) when something weird happened.

The results on my Arduino Mega 2560 look like this:

|500x338

I connected the LED like this:

|368x500

With the cathode to GND, just as it should be. And a 82k current limiting resistor, which might be little to high, but that is another problem. If I turn the LED by 180° (cathode to 5V) it looks just the same, but with higher peaks.

If somebody can tell me why:

  1. I can't read out proper values of the 'photodiode'

or even more important:

  1. Why it makes these interesting curves

that'd be great.

It looks somewhat like charging and decharging a capcaitor to me.

Greetings and thanks in Advance :)

Your resistor is not wired like a current limit resistor, it goes from A0 to Gnd, so its more like a pulldown resistor on A0 to dissipate any current the LED creates.

CrossRoads: Your resistor is not wired like a current limit resistor, it goes from A0 to Gnd, so its more like a pulldown resistor on A0 to dissipate any current the LED creates.

Well, but this is just a matter of terminology, right?

In this specific case, I suppose so, since you have 5V to LED to resistor to Gnd, and you are looking at changes in voltage at the LED-resistor junction.

What is the light source illuminating the LED? Is it possible you're seeing AC flicker or an aliased version of the same?

MrMark: What is the light source illuminating the LED? Is it possible you're seeing AC flicker or an aliased version of the same?

Due to the Planck-Einstein relation I thought it would be useful to use the exact same LED as light source. But even if I try using a flashlight the result stays the same.

Read Mikes discussion:
http://www.thebox.myzen.co.uk/Workshop/LED_Sensing.html

Can you tell the frequency of the "oscillation"? Maybe it is interference of some sort being picked up in the wiring: line frequency, a switching power supply, or some such. Does the signal change significantly if you block light from your receiving LED?

I'm pretty sure that there is mains fluorescent lighting causing those peaks.

The 82k resistor is shorting out the photocurrent - use a higher value and you may get slightly higher peaks.

But if you want better detection method use the LED reverse biased (82k between anode and ground, cathode to 5V, analog pin to the anode).

Agree with interference.

That seems to be every 8 to 10ms, which fits with 60 or 50Hz.

Arduinojoey: Well, but this is just a matter of terminology, right?

Perhaps, but it would be called a load resistor in conventional terminology. It's not there to limit current. It's there to convert a current to a voltage.

Arduinojoey: Due to the Planck-Einstein relation I thought it would be useful to use the exact same LED as light source.

Alas it doesn't quite work like that - efficient LEDs are heterojunction devices these days, so the emission is all concetrated in the intrinsic layer, but absorption can happen in other layers where the bandgap is greater - I suspect the emission and absorption spectra are fairly complex as a result.

Photons absorbed in the intrinsic layer produce carriers that likely remain trapped in that layer until a photon is re-emitted. The whole point of the device is to dump carriers into this layer where they are confined until they recombine and emit.

Try using sunlight (or anything at the blue end of the spectrum) which is likely to be absorbed in every layer.

Okay, so with no artificial light the measurements look like this:

|500x339

So you are picking up electrical noise, hum from the powerlines surrounding you. Check grounds, wires should be short, maybe need to shield things.

What is that scale?