Author Topic: Using LEDs as photodiodes, for LED 7-segment display auto dimming  (Read 1263 times)

0 Members and 1 Guest are viewing this topic.

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4298
  • Country: gb
  • Doing electronics since the 1960s...
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.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 15045
  • Country: de
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #1 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.
 

Offline Andree Henkel

  • Regular Contributor
  • *
  • Posts: 112
  • Country: de
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #2 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
 

Offline eutectique

  • Frequent Contributor
  • **
  • Posts: 455
  • Country: be
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #3 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
 
The following users thanked this post: tooki, ftg

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14102
  • Country: gb
    • Mike's Electric Stuff
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #4 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.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4298
  • Country: gb
  • Doing electronics since the 1960s...
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #5 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.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7629
  • Country: ca
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #6 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.
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4298
  • Country: gb
  • Doing electronics since the 1960s...
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #7 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.
« Last Edit: December 06, 2024, 11:05:50 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7629
  • Country: ca
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #8 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 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.
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4298
  • Country: gb
  • Doing electronics since the 1960s...
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #9 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.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Mahagam

  • Regular Contributor
  • *
  • Posts: 59
  • Country: pl
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #10 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.
 
The following users thanked this post: peter-h, spostma

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4298
  • Country: gb
  • Doing electronics since the 1960s...
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #11 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.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17369
  • Country: us
  • DavidH
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #12 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.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2567
  • Country: gb
  • Recovering Electrical Engineer
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #13 on: December 16, 2024, 05:28:24 pm »
Yeah.
The driver leakage current will swamp the photo currents.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #14 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.
 
The following users thanked this post: Someone, peter-h

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 8177
  • Country: nl
  • Current job: ATEX product design
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #15 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.
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4298
  • Country: gb
  • Doing electronics since the 1960s...
Re: Using LEDs as photodiodes, for LED 7-segment display auto dimming
« Reply #16 on: December 18, 2024, 07:41:17 am »
Indeed, use a decimal point, for example.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf