EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: peter-h on December 05, 2024, 07:26:54 am

Title: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: peter-h on December 05, 2024, 07:26:54 am
Is anyone doing this?

I've never tried it but it should be possible, and would avoid a separate light sensor.

One hassle is having to switch one of the segments into a reverse voltage mode. Most 7-segment displays are common cathode or common anode. The latter is less common because very few driver chips support common anode (I use the STLED316). So you would disconnect one segment from the driver circuit and reverse-bias it.

Photodiode mode is very fast so you need to do it for just microseconds.

It is also an obvious patenting candidate.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: Kleinstein on December 05, 2024, 10:49:54 am
One does not really need a reverse voltage. If one does not need very high speed one can also use a photodiode / LED with essentially zero forward voltage. The longer part of the response time would be from the amplifer to recover anyway.

A small photodiode / phototransistor is not expensive - it really is the question what is cheaper: the extra sensor or the extra circuit to isolate the sensor from the drive part. The current to look at is likely in the nA range and one would need a resonable low leakage driver. The normal drivers may work, but usually not guaranteed. The main advantage of using a LED is not needing extra front panel space, not the part saved.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: Andree Henkel on December 05, 2024, 11:16:57 am
P. C. D. Hobbs, author of "Building electro-optical sysstems, making it all work" has done it to get a large and cheap array of photodetectors.
see link, slides 53-55
https://de.scribd.com/document/47030066/klugesandhacks6c
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: eutectique on December 05, 2024, 11:35:32 am
P. C. D. Hobbs, author of "Building electro-optical sysstems, making it all work" has done it to get a large and cheap array of photodetectors.
see link, slides 53-55

Or get a pdf here: https://electrooptical.net/static/oldsite/www/canceller/klugesandhacks6c.pdf
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: mikeselectricstuff on December 05, 2024, 11:48:22 am
One does not really need a reverse voltage. If one does not need very high speed one can also use a photodiode / LED with essentially zero forward voltage. The longer part of the response time would be from the amplifer to recover anyway.

A small photodiode / phototransistor is not expensive - it really is the question what is cheaper: the extra sensor or the extra circuit to isolate the sensor from the drive part. The current to look at is likely in the nA range and one would need a resonable low leakage driver. The normal drivers may work, but usually not guaranteed. The main advantage of using a LED is not needing extra front panel space, not the part saved.
Doing anything in the nA DC range consistently enough to not need expensive analogue parts and /or  per-device calibration is going to be tricky, unlikely to be worth the trouble. Maybe if all you care about is indoor vs. outdoor it might be doable  but there's probably a reason this isn't commonly done.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: peter-h on December 05, 2024, 05:37:16 pm
Quote
One does not really need a reverse voltage

Indeed that is very true; a photodiode can work in a virtual earth. I used to make RS232/4XX modems over multimode fibre which did that.

Quote
The main advantage of using a LED is not needing extra front panel space, not the part saved.

Yes; exactly. You need a bigger aperture (a hole in the front panel) for the light sensor.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: floobydust on December 05, 2024, 05:52:15 pm
Try the LED's in a photo-voltaic mode, I have some that generate 1.5V in bright light. But watch the viewing angle.

I found phototransistors T-1 (3mm) did not work well for ambient light sensing. It's a pretty narrow angle looking straight out at only the surface it sees.
Room light was not seen, unless I held something reflective up. My next attempt is a diffuser lens and aiming up at a white ceiling.

Another sensorless trick is to just dim based on real time, say 10pm-6am dim it.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: peter-h on December 05, 2024, 10:59:47 pm
The other thing to deal with is that typically the LED array is driven from an LED driver chip (and you just upload ASCII data to it, via e.g. SPI) and you have to sample the lines to see when it is scanning the display. And is is probably scanning nonstop, so there is no obvious point for you to jump in and use an LED segment to measure the ambient light. One might have to blank the display (usually there is an explicit function, as well as a brightness control one) for a brief time. However if you disconnect the one segment, the other scanning won't matter...

A PIN diode does produce little current from ambient light, but I've done it. Historically people used LDRs which give you tons of "output", as well as having a very slow response which can be handy.

But another consideration is that the light sensor will be picking up some of the display light, so you want to read the sensor only during display blanking. That is why I used a PIN diode; it's very fast.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: floobydust on December 06, 2024, 07:34:05 pm
What part number for the photodiode you like?
TBH the only thing that works great (sensing ambient light) for me is CdS photocells - they have a very wide viewing angle and spectral response is broad, close to the human eye's, they are too slow to worry about flicker from LED/fluorescent light bulbs.

Obsolete Panasonic NaPiCa sensors like AMS302 (https://api.pim.na.industrial.panasonic.com/file_stream/main/fileversion/1927) spectral matches the human eye but with unknown angle.
Compared to the spike at near IR that photodiodes have. Why not use a phototransistor, much less hassle no preamp needed.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: peter-h on December 08, 2024, 08:33:38 am
I experimented with a photodiode and it worked but in the end I ended up using an LDR (CdS sensor) NSL-19M51.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: Mahagam on December 08, 2024, 12:03:31 pm
I did several tests with LED and FPGA. If you switch output pin to z-state, instead of zero, LED voltage will drop smoothly, and time of the falling edge will depend on ambient lightness.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: peter-h on December 09, 2024, 07:55:17 am
There must be something else involved there.

The LED will have a capacitance, and the LED will be generating a current from the photons arriving at it. You must have a pulldown resistor somewhere, otherwise the whole thing will be poorly defined.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: David Hess on December 09, 2024, 09:49:30 am
Optical leakage between the segments will require the entire display to be blanked during the measurement.

I my experience LEDs do not make very good photodiodes, so the measurement current will be small requiring the leakage from the driver to be isolated, which is just as well because the capacitance also needs to be isolated for a fast measurement time at such low currents.

A separate photodiode or other sensor would be a lot simpler.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: Terry Bites on December 16, 2024, 05:28:24 pm
Yeah.
The driver leakage current will swamp the photo currents.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: Peabody on December 16, 2024, 06:44:57 pm
For what it's worth, I dug out a Kingbright CC56-21SRWA, which is a 4-digit common cathode display, and connected my scope across pins 11 and 12 with a 1K resistor in series.  It produces a noisy zero volts in room light, but about 150mV across the resistor in bright light.  That's with nothing else connected to the display.  It seems a processor's ADC should be able to pick that up.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: tszaboo on December 16, 2024, 10:44:46 pm
You can use LEDs in reverse as simple photo sensitive resistors. Just take a segment you would't use. Measure it with a multimeter in resistance mode. The ones I used were super sensitive, hundred kohm to megaohms region.
Title: Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
Post by: peter-h on December 18, 2024, 07:41:17 am
Indeed, use a decimal point, for example.