I'm trying to detect light using an led that's already attached to the circuit. I have a flashlight shining on the led.
Minimal sketch:
while( true )
{
int photoValue = 0;
analogReference(INTERNAL);
photoValue = analogRead(A5);
Serial.println(photoValue);
delay(300);
}
While I have my multimeter attached, it reads a pretty constant value around 5mV. The serial output however swings around, as seen in this sample output:
0
0
4
4
0
16
15
22
21
25
20
36
40
34
36
24
5
0
3
6
0
0
0
0
That would translate to values between 0 and 43mV.
When I disconnect the multimeter only get 1023
printed.
I don't get how the values from the ADC and the multimeter, totally don't match.