Using LEDs as photodiodes, for LED 7-segment display auto dimming - Page 1
Forum section: electronics / projects

author: peter-h
author_rank: Super Contributor
timestamp: December 05, 2024, 07:26:54 am
content: 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.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 05, 2024, 10:49:54 am
content: 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.

author: Andree Henkel
author_rank: Regular Contributor
timestamp: December 05, 2024, 11:16:57 am
content: 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-55https://de.scribd.com/document/47030066/klugesandhacks6c

author: eutectique
author_rank: Frequent Contributor
timestamp: December 05, 2024, 11:35:32 am
content: Quote from: Andree Henkel on December 05, 2024, 11:16:57 amOr get a pdf here:https://electrooptical.net/static/oldsite/www/canceller/klugesandhacks6c.pdf

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: December 05, 2024, 11:48:22 am
content: Quote from: Kleinstein on December 05, 2024, 10:49:54 amDoing 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.

author: peter-h
author_rank: Super Contributor
timestamp: December 05, 2024, 05:37:16 pm
content: QuoteIndeed 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.QuoteYes; exactly. You need a bigger aperture (a hole in the front panel) for the light sensor.

author: floobydust
author_rank: Super Contributor
timestamp: December 05, 2024, 05:52:15 pm
content: 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.

author: peter-h
author_rank: Super Contributor
timestamp: December 05, 2024, 10:59:47 pm
content: 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.

author: floobydust
author_rank: Super Contributor
timestamp: December 06, 2024, 07:34:05 pm
content: 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 likeAMS302spectral 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.

author: peter-h
author_rank: Super Contributor
timestamp: December 08, 2024, 08:33:38 am
content: I experimented with a photodiode and it worked but in the end I ended up using an LDR (CdS sensor) NSL-19M51.

author: Mahagam
author_rank: Regular Contributor
timestamp: December 08, 2024, 12:03:31 pm
content: 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.

author: peter-h
author_rank: Super Contributor
timestamp: December 09, 2024, 07:55:17 am
content: 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.

author: David Hess
author_rank: Super Contributor
timestamp: December 09, 2024, 09:49:30 am
content: 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.

author: Terry Bites
author_rank: Super Contributor
timestamp: December 16, 2024, 05:28:24 pm
content: Yeah.The driver leakage current will swamp the photo currents.

author: Peabody
author_rank: Super Contributor
timestamp: December 16, 2024, 06:44:57 pm
content: 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.

author: tszaboo
author_rank: Super Contributor
timestamp: December 16, 2024, 10:44:46 pm
content: 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.

author: peter-h
author_rank: Super Contributor
timestamp: December 18, 2024, 07:41:17 am
content: Indeed, use a decimal point, for example.