240-480 mV to 0-5V?

Hello everyone,
here I am again asking for help: I am trying to read the output of a photodiode (which is inside a laser led) and I am struggling to get the output right. This is the problem: in darkness the output from the photodiode is 240mV (as measured with my oscilloscope) and when i hit it with a laser beam (from an external source) it is 480 mV. I managed to wire up an op-amp (LM358P) and amplify the signal to 2.16 - 4.80V, but it would be useful to have the output range from 0 (or more close to 0 than 2.16V) to 5 V. Is there a way to "shift" the output? (I would not mind to have it from 0 to whatever, as I can always amplify this again to have 0-5)
Thank you in advance for any help you can offer, op amps I have available are tl082, lm358, ina126, but I would not mind to buy different components if needed, or even a ready made shield if that would do the trick

Regards

1/ How can a photodiode produce any voltage at all in darkness ? Could you publish a circuit?

2/ Are you tryng to control the laser power ? If so manufacturers publish recommended circuits. They depend on measuring the current produced by a photodiode.

Alan

To measure light intensity with a photodiode, you measure the photodiode current, not the voltage. The best way to do that is with a transimpedance (current to voltage) amplifier.

Here is a good introduction to photodiode amplifiers.

allanhurst:
1/ How can a photodiode produce any voltage at all in darkness ? Could you publish a circuit?

I do not know but that is what I measure

2/ Are you tryng to control the laser power ? If so manufacturers publish recommended circuits. They depend on measuring the current produced by a photodiode.

No, I do have a separate current limiter to power the laser (now not connected). I am interested in measuring the photodiode output when the laser is OFF

Alan

here is the schematic

jremington:
To measure light intensity with a photodiode, you measure the photodiode current, not the voltage. The best way to do that is with a transimpedance (current to voltage) amplifier.

Here is a good introduction to photodiode amplifiers.

Thank you

Maybe there is already an amplifier in the device. Perhaps that would explain the non-zero dark voltage?

Maybe you don't need the op-amp? Set the Arduino to its internal 1.1V reference voltage and you should get readings between around 250 and 500 from analogRead (). Would that give enough resolution for your project?

Thanks Paul,
I do not exclude that, but actually if I run the simulation of the circuit in Proteus I do measure the same voltage across the photodiode (see attached)
It would be really nice to have the full swing to 0 to 5V, I was thinking that maybe I can feed the output of this to a comparator, with the second input adjusted to the same 240mV, so to amplify just the difference between 240 and 480 mV, maybe this is the way to go

Not a comparator. That has a digital output. Just a second op-amp's "-" input (with unitary gain).

So, in Proteus, you can simulate light level falling on the photodiode? And in darkness it shows a non-zero reading?

In my personal opinion, the unusual response of the photodiode (voltage in darkness) is to be explained before going ahead.

Of course, there is the so-called "dark current" (https://aip.scitation.org/doi/abs/10.1063/1.4749259?journalCode=jap), but can we be sure the darkness voltage is caused by this?

Maybe replacing photo diode by a diode and measuring the voltage may offer more info. Remember reverse bias.

What photo diode do you use? There are photo diodes for different ranges of the wave-lengths.

Also check the wiring. I mean something like gently pulling the wires and a very close examination of the circuit.

My humble opinion: if not explained, check simple causes first. :-).

Cloxart - don't do it like that. The voltage of a photodiode doesn't give an accurate measurement of the light.

See page 9 of the NatSemi guide recommended by JRemington in post 2

Allan

Looking at that...

As far as I know, the photo-diode response in not linear (maybe photodiodes that have linear response do exist, but I am not aware about such components). So the calibration curve shall be set according to the particular diode characteristics. The monochrome nature of the laser beam helps.

What I would do is to calibrate readings by distance: measure amperage at 1m,1.5 m, 2m, 2.5 m, 3m (or alike). Then construct a formula to approximate the results.

As far as I know, the photo-diode response in not linear

If you measure the photodiode current as in the NatSemi recommended circuits linked above it's very linear over many decades.

Allan

I think what allanhurst is trying to say that the posted circuit is not a transimpedance amplifier.

The polarity of the diode must be reversed for that, so the diode generates a negative voltage (current) that the amplfier compensates with an equal and opposite positive current (zero volt across the diode).
What is measured is the opamp compensating.
See page 9 of the document jremington posted.
Leo..

Some highlights:

Liniarity depends on the brightness. In low brightness, the linearity is lower. Also, at high light intensity, once the saturation point is reached, the behavior becomes more and more non-linear.

There are also influences from temperature and wave length. If the laser beam hits the diode this offers a monochrome light. But there is a directional characteristic of a photo-diode, that means it counts from which angle the beam hits the detector (and also wide vs. narrow characteristics of a particular type of diode). The liniarity also deteriorates in case of laser beams as such.

Near-infrared radiation (800 nm to 1100 nm) where silicon detectors have their peak sensitivity is another point of concern. If the photodiode gets its IR filter (like in cameras) that influence is removed.

One in all, in my humble opinion, in practical terms it may be difficult to find a reliable formula to mirror all these factors. While to compute the curve based on theory and apply it to a certain type of diode is beyond my capacity and available time.

Therefore, if we are talking about some 250 points curve, and assuming liniarity in current terms will be more or less preserved within some 10 sub-domains, picking 25 points to calibrate might fit the purpose. To make sure one does not waste time in drawing lines, I think starting by some 5 points over the most expected brightness domain (indoor).

A very interesting (in my view) alternative is to use a LED in place of the photodiode.

falexandru:
Liniarity depends on the brightness. In low brightness, the linearity is lower. Also, at high light intensity, once the saturation point is reached, the behavior becomes more and more non-linear.

So we're talking voltage, or some photo conductive circuit,
not photodiode current (which is very linear over several decades).
Leo..

Liniarity depends on the brightness. In low brightness, the linearity is lower.

Why are you wasting everyone's time with such useless, misinformed comments?

There are quite a lot of info about different types of photo-diodes on the internet. And a lot of research on this topic.

If you think is not correct what I said, please quote the research paper and all the conditions that shall be met to obtain liniarity, explain. offer arguments, whatever. Or just say "according to my knowledge, this is not correct" - no problem. Imagine I got the info from somewhere. Wouldnt be better to just ask me why I said that? (maybe I am wrong, but yourself are you always right?)

I think everybody will gain from such a discussion and a lot more of course than from a comment in which you blame me.

You know, it is difficult to really help the others. In this particular case, there are a lot of unknown points and is not just "measuring light". Interesting topic.

So please stay on topic and refrain blaming the others. Be gentle - keep in mind that no matter how experienced you are or how much you read, there is always a chance to either misunderstand or just dont be right. You may understand that there could be info you are not aware as well. You may understand that practice is different from the textbooks.

Aggression leads nowhere. Please be respectful to your forum mates. Believe me, I can be agressive to you and you would not like it at all. But this forum is not a battle field - who is the smartest guy on Arduino :-).

Because I do not want to be part of a flame, I will no longer read or respond to this topic.