Photodiode Values

i have a Circuit and code for a photo-diode but i am not getting any Values from it , even if i Flip it around , i do not have any resistor value labeled as i have tried several Values with no luck, Strange thing is that if i disconnect A0 i get Values. any help would be appreciated

PhotoDiode

// Reading PhotoDiode 
int sensorPin = A0;
int sensorValue = 0;

void setup(void) {
   Serial.begin(9600);
   pinMode(sensorPin, INPUT); 
}
 
void loop(void) {
   sensorValue = analogRead(sensorPin);
   Serial.println(sensorValue);
}

Reverse the photodiode. Photocurrent flow is in the opposite direction of the diode arrow, and the analog input cannot read negative voltages.

What value of resistor?

Since you connected it to GND - you think the photodiode will generate current?

If a pin isn't connected to anything then it is floating and will pick up noise from the environment, which is what you are seeing.

1 Like

Scratched the old Circuit the New Circuit and it Works fine now .. :slight_smile:

The current from a photodiode is very small and you generally need a Transimpedance Amplifier.

A phototransistor would be easier to use.

Although, I MIGHT be wrong since the input impedance on the Arduino is very-high and you MIGHT get enough voltage to read/measure.

And of course it depends on if you are reading direct sunlight or the output from a little LED. :wink:

And I assume you know that's in an infrared photodiode.

1 Like

Great, but the schematic is drawn with the photodiode in the wrong orientation, and the resistor has no practical effect.

What are you going to use it for? If I want a rough indication of light level I use an LDR. I'm just curious about why you chose a photo diode and not a photo transistor or an LDR.

Dave , Gaps in labels is what we are using it for , have you off by chance know any good Slot readers for Labels. affordable wise

yes i know we are using a LED on the Other Side they are pointing towards each other

I don't know anything about them, sorry.

Use a phototransistor not a photodiode.
A phototransistor will give you a digital outout (ON/OFF) that you can connect to an Arduino digital pin.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.