Optically detecting no-colour led  - Page 1
Forum section: electronics / projects

author: MadScientist
author_rank: Frequent Contributor
timestamp: November 12, 2022, 08:58:38 am
content: I need a mechanism to detect red green bi colour leds optically so as to relay the colour status remotelyOk trying to avoid optical filters etc.Are there any optical style detectors that can be tuned to wavelength etc. ?

author: oliv3r
author_rank: Frequent Contributor
timestamp: November 12, 2022, 09:59:19 am
content: Does it have to be cheap? There's color sensors etc. In school, some 20 years ago, we did a 'marble color detection system'. How it worked, was a (color?) sensor and 4 colored leds. You'd turn on the leds 1 by 1 and checked the reflection. The highest reflection based on the color that was on, must have been the color. In a nutshell. So stuff like this certainly should exist. Maybe the color sensor was just a regular LDR (the marble did go into a 'dark room') ... so maybe LDR's are differently affected by wavelength? Doesn't sound to far fetched. Have you done any experimentation?

author: tantradnya
author_rank: Newbie
timestamp: November 12, 2022, 10:18:39 am
content: Well, you could try to measure reflected light from the LED on a green or red paper. If it is lit green then will reflect more from red paper and vice versa. Perhaps a cheap photodiode or LDR with followed by a comparator. This would need lot of testing and tuning.But a colour sensor would be easiest to start as suggested by @oliv3r.https://uk.farnell.com/vishay/veml6040a3og/colour-sensor-3-6v-16bit-digital/dp/2504135Just need to make sure the ambient light is not directly reaching the sensor.

author: Gyro
author_rank: Super Contributor
timestamp: November 12, 2022, 10:21:03 am
content: You might want to experiment with Red and Green LEDs as optical sensors, they will potentially be more sensitive at their own wavelength. Output level will be small though.P.S. I don't know the actual setup, presumable an LED on some front panel - obviously any ambient light will be a problem.

author: Hawaka
author_rank: Regular Contributor
timestamp: November 12, 2022, 10:44:02 am
content: It might be overkill, but a super cheap camera sensor and some software it should be quite easy I think.

author: robzy
author_rank: Regular Contributor
timestamp: November 12, 2022, 11:08:02 am
content: Do you mean that you're trying to avoidadditionaloptical filters?In that case considerhttps://www.sparkfun.com/products/12829It's basically a single pixel camera sensor. A single camera pixel has 3 sensors with a different optical filter infront of them.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 12, 2022, 12:42:00 pm
content: The ready made RGB sensors are likely the easiest way.There is a chance that one could use a set of LED as photo diodes. As a photodiode a LED should only react to the light it can emit or more energetic (more to the blue side of the visible spectrum) light.So a yellow or orange LED should react to green light, but not to red light.How good a LED works as a sensor can vary quite a bit by type. The current is expected to be quite small and would need sensitive amplifiaction.

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 13, 2022, 05:04:39 am
content: I'm just a know-nothing hobbyist, but I would try an ambient color sensor likeams OSRAM TCS3601, with TCS37013M available at Mouser for about a dollar/euro apiece in singles. It runs off 1.8V, and communicates using I²C, so you might wish to use a suitable level shifter, say TCA9416D; and unless you already have a microcontroller, one with a suitable interface (and I²C) to your computer or whatever you use that needs to know the color. I'm sure even an ATtiny202 would suffice for this, as the detection is just comparing the four or five intensity components.Note that even if you wish to set the detection thresholds at run time, the microcontroller can still be useful, as it can poll the sensor at relatively high frequency, and only report changes upstream.

author: inse
author_rank: Super Contributor
timestamp: November 13, 2022, 09:35:24 am
content: Do you have to distinguish between red and green or would red/not red or green/not green be sufficient?In this case any optical sensor and a piece of red or green acrylic would do the job.Or is this considered as optical filter, and why is it to be avoided?

author: mariush
author_rank: Super Contributor
timestamp: November 13, 2022, 09:48:39 am
content: I was thinking if it would be possible to use two different solar cells, one that's more sensitive to the red led and one more sensitive to the green ... measure both voltages and figure out the color based on the differences in the voltage of the cells.If you can't get close to the led then I can only think of a camera sensors or maybe infrared detectors (like the ones used in scroll wheel of mice

author: tooki
author_rank: Super Contributor
timestamp: November 13, 2022, 04:22:06 pm
content: Quote from: mariush on November 13, 2022, 09:48:39 amHow would you do that without using optical filters, which OP doesn’t want? Solar cells are sensitive to a wide range of wavelengths, I doubt you could ever use them for color detection.

author: DavidAlfa
author_rank: Super Contributor
timestamp: November 13, 2022, 04:26:26 pm
content: I wonder what spectrum a conventional LED would be sensible to.You could also test if a normal photodiode generates different current depending on the wavelength, in that case you could simply read the voltage drop on the load, ex. 1.5V=red, 1.25V=green.

author: 741
author_rank: Frequent Contributor
timestamp: November 13, 2022, 09:02:09 pm
content: As a minor extension to Gyro's suggestion, maybe the detector is a dual Red/Green LED.As a very vague, and incomplete thought - can anything useful be done with colour-mixing? For example if by default a blue light falls on the same place that the red or green fall...

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 14, 2022, 04:32:31 am
content: RGB sensors are relatively cheap and the easiest path as others have said... as long as you have a microcontroller available. All the ones I have seen are I2C, so if you're expecting some kind of direct logic to control something, you'll be out of luck with those. Now an RGB sensor + a cheap MCU would be all you'd need.You didn't mention what the distance between LED and sensor would be though (unless I missed it), nor the environment? Obviously if the sensor can't be placed close enough to the LEDs and/or there is external light around them, that may not work at all.

author: richard.cs
author_rank: Super Contributor
timestamp: November 14, 2022, 01:50:29 pm
content: LEDsdowork as photodiodes, sensitive to their own wavelength and shorter, so can be used here, I have used it a few times at work. Oddly they don't seem to be sensitive tothatmuch shorter than their own wavelength but I don't know what the mechanism for that is. I found a red LED was pretty sensitive to red/orange/yellow, but for unknown reasons poorly sensitive to blue or UV. A green LED was sensitive to green/blue/near-UV. This is all LEDs in clear packages.

author: inse
author_rank: Super Contributor
timestamp: November 14, 2022, 02:22:56 pm
content: I wonder whether the mad scientist is going to return to his posting, while a dozen suggestions have been made.

author: Terry Bites
author_rank: Super Contributor
timestamp: November 14, 2022, 04:02:47 pm
content: LEDs work in reverse- an 560nm peak led will act as a 560nm centre tuned photodiode and so on. Glass clear types are not ideal, use the coloured diffuser ones.Add a small signal darlington and you're away! A dual opamp set up as a pair o trancondctance amps will do it, just let the photocurrent drive it to the rail!

author: MikeK
author_rank: Super Contributor
timestamp: November 14, 2022, 04:08:51 pm
content: Quote from: Gyro on November 12, 2022, 10:21:03 amThat does work. And I think Forrest Mims was the first one to do it.