colored led recognition with photoresistor or -diode - Page 1
Forum section: electronics / beginners

author: Chris_D
author_rank: Regular Contributor
timestamp: November 26, 2021, 12:06:21 pm
content: Hallo,I have this project in mind: I want to create an array of leds, with different colours, wich should be recognized - so to speak - by photoresistors or -diodes(or better: the resistor should react on the color of the led).Is there someone who already tried to do this? I mean: one photoresistor should recognize a red led for instance, and the other a green led, and they shouldn't be able to react on the color of the other.

author: BeBuLamar
author_rank: Super Contributor
timestamp: November 26, 2021, 03:18:11 pm
content: You would need 3 photoresistors (or some integrated device with 3 sensors) and the R,G,B filters.

author: Chris_D
author_rank: Regular Contributor
timestamp: November 26, 2021, 07:48:43 pm
content: Quote from: BeBuLamar on November 26, 2021, 03:18:11 pmDo you mean creating RGB filters or do they exist? Because I want to create a really huge array of leds.And I want to do it as cheap as possible.

author: Benta
author_rank: Super Contributor
timestamp: November 26, 2021, 08:53:53 pm
content: It's called a Bayer filter. Do a search.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 26, 2021, 08:58:21 pm
content: There are ready made light sensors with integrated filters, a bit like a 1 pixel camera.For a large array I would consider a camera.

author: TimFox
author_rank: Super Contributor
timestamp: November 26, 2021, 09:02:22 pm
content: If you want to assemble your own color filters with non-microscopic sizes, the traditional Kodak (now made by someone else) Wratten filters come in 75 mm and 100 mm square sizes, and are easily cut to size with a normal scissors.seehttps://www.kodak.com/en/motion/page/wratten-2-filtersThat webpage includes download links for the transmission curves on each filter type.The discussion from the CRC Handbook can be found athttp://www.astrosurf.com/luxorion/Documents/transmission-wratten-filters.pdf

author: Benta
author_rank: Super Contributor
timestamp: November 26, 2021, 09:16:31 pm
content: Quote from: TimFox on November 26, 2021, 09:02:22 pmYeah, snippets of those could be placed in front of each photodetector. Also a nice idea.A simpler idea might be using colour sensors:https://www.vishay.com/optical-sensors/digital-output-color-sensor/

author: Zero999
author_rank: Super Contributor
timestamp: November 26, 2021, 09:40:49 pm
content: Quote from: Chris_D on November 26, 2021, 12:06:21 pmWhat's the application? If it's just to identify the colour of an object illuminated by the LEDs, then only use one photodetector and only one LED is illuminate at a time.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: November 27, 2021, 01:25:52 am
content: Why try to recognize the color?You could for example PWM your LED's or have them emit data just as with IR remote controls.If you have a matrix of LED's you could use separate data for rows and columns.For better advice then tell us more about your application.

author: Rich S
author_rank: Newbie
timestamp: November 27, 2021, 01:41:45 am
content: or in other words, a "webcam"already integrated with analog front end, A/D converter and USB interfaceI hear they're plug-and-play with the popular OS's too!

author: Chris_D
author_rank: Regular Contributor
timestamp: November 27, 2021, 06:10:27 am
content: Quote from: Zero999 on November 26, 2021, 09:40:49 pmNo they are next to each other. In rows. With very little space.

author: Chris_D
author_rank: Regular Contributor
timestamp: November 27, 2021, 06:13:20 am
content: Quote from: Doctorandus_P on November 27, 2021, 01:25:52 amThat is a good idea. the leds are in rows, next to each other. The purpose is that the resistors/diodes recognize them, and act as a trigger (for sounds by the way).How do I do this? Are there any schematics online? And how to 'de-modulate', because there has to be a 'receiver' of some sort?

author: Chris_D
author_rank: Regular Contributor
timestamp: November 27, 2021, 06:14:46 am
content: Quote from: Benta on November 26, 2021, 08:53:53 pmYes, I see, but that is not what I'm looking for.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 27, 2021, 08:57:14 am
content: As Zero999 said.LEDs can turn on/off in just tens of nanoseconds!Photodiodes can react in tens of nanoseconds! Phototransistors are slower, but likely fast enough.Fast enough for what?For implementing this pseudocode:1) turn on red LED2) R = Sample intensity value3) Turn off red LED, turn on green LED4) G = Sample intensity value5) Turn off green LED, turn on blue LED6) B = Sample intensity valueSee? You need just one RGB LED, and one normal single-color photodiode (or phototransistor, if you are fine with poor characteristic curve, including large temperature variation).If the light source for detectionhasto be external (for example, whatever ambient light is available, and you can't shield it), then this won't work, of course.

author: Chris_D
author_rank: Regular Contributor
timestamp: November 27, 2021, 09:22:15 am
content: Quote from: Siwastaja on November 27, 2021, 08:57:14 amI understand what you are saying, but if I have obtained the right sample value, I suppose in amp, then how do I proceed?The purpose it that my receiving resistor/diode should work as a trigger/switch for a signal. Do I need resistors, transistors,...?

author: Siwastaja
author_rank: Super Contributor
timestamp: November 27, 2021, 12:51:43 pm
content: I don't know, because I didn't quite understand from the opening post what you are actually doing. Maybe elaborate a bit, not on what you think you need as a solution, but what's the original project?

author: Chris_D
author_rank: Regular Contributor
timestamp: November 27, 2021, 01:26:15 pm
content: Quote from: Siwastaja on November 27, 2021, 12:51:43 pmI just want to make a little circuit (for the moment) where 3 photoresistors/diodes react to a different color of light.And if they do, another light starts to burn.I thought this was going to be rather simple.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 27, 2021, 01:37:23 pm
content: It's not about it being simple or not simple, it's about us understanding what you actually want, so we can make good suggestions, i.e., see what is the simplest way to achieve your goal, whatever it is.For example, it was a bit unclear if the device needs to detectcolor of external objects, orcolor of external light. The former is easy to do using the method described by Zero999 and myself. If it's about the latter, then you need a sensor with color filters. Look at the parametric search of your favorite distributor; I haven't used color sensors myself lately but I'm sure you'll find some nice tiny integrated chip with color filters and R,G,B light sensors and their signal conditioning all nicely integrated.What do you mean by "trigger"? You mean, like "red color detected" -> "play a certain sound"? This is all doable using analog electronics, but likely much easier to achieve with a microcontroller, so you can empirically adjust detection algorithms and thresholds. For example, certain "red" color might look quite red to your eye, but still cause a significant signal level on the green channel.Finally, knowing your actual goal could help us give completely different suggestions. For example, if you aresorting LEDswith the contraption, then just measuring Vf at certain constant current (like 10mA) could prove easiest.

author: Chris_D
author_rank: Regular Contributor
timestamp: November 27, 2021, 03:07:41 pm
content: Quote from: Siwastaja on November 27, 2021, 01:37:23 pmNo, it is color of external light.And I don't want to use microcontrollers.And I have a motto I've borrowed from Goethe, who contributed heavy to color theory: 'In der beschränkung zeigt sich erst der Meister'.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 27, 2021, 04:45:28 pm
content: OK, we are getting your requirements bit by bit!Not "wanting" to use a microcontroller is a strange one but yeah, if you want to do that, this may (or may not) increase the difficulty significantly. Analog electronics is simple when... simple, but get pretty complex and hard to design really fast, as you have to sacrifice flexibility. To me, restraining from use of certain tools for no technical reason is not a simplification, but a complication.As an engineer, I can't help you when for you this isn't an engineering project, but an art project including a social game element.But as you clearly know what you are doing, while I don't have a clue, I wish you best of luck.

author: Terry Bites
author_rank: Super Contributor
timestamp: November 27, 2021, 05:19:09 pm
content: Heres a dirty secret: Coloured leds can be used as wavelength specific photodiodes- just use them to control single transistor current sources.https://www.analog.com/en/analog-dialogue/raqs/raq-issue-108.htmlSomething as simple as this:https://wiki.analog.com/university/courses/electronics/electronics-lab-led-sensor

author: Chris_D
author_rank: Regular Contributor
timestamp: November 27, 2021, 06:40:35 pm
content: Quote from: Terry Bites on November 27, 2021, 05:19:09 pmHello Terry, indeed, very interesting.Actually I was basically just thinking about the 'simple' (although I'm not going to use that word anymore) light detector circuit with a photoresistor,like so:https://circuits-diy.com/light-activated-led-using-photoresistor-ldr/but working the other way round (switch goes on when there is light detected instead of darkness), with the photoresistor reacting to light of a certain kind of color, red or green for instance.

author: Chris_D
author_rank: Regular Contributor
timestamp: November 27, 2021, 06:50:16 pm
content: Quote from: Terry Bites on November 27, 2021, 05:19:09 pm...but intriguing idea nevertheless.

author: Terry Bites
author_rank: Super Contributor
timestamp: November 27, 2021, 09:41:12 pm
content: wrong diagram sorry seehttps://wiki.analog.com/university/courses/electronics/electronics-lab-led-sensor

author: Zero999
author_rank: Super Contributor
timestamp: November 27, 2021, 10:25:12 pm
content: Quote from: Chris_D on November 27, 2021, 06:50:16 pmIt works, but note that an LED will respond to a shorter wavelength, than what it emits, so a red LED, will respond to orange, yellow, green light and a blue LED will respond to blue and violet. If you choose red and green LEDs, with coloured epoxy, it should minimise the response to other wavelengths.

author: Chris_D
author_rank: Regular Contributor
timestamp: November 28, 2021, 05:21:56 am
content: Thanks for the diagram, I will look into it.

author: Chris_D
author_rank: Regular Contributor
timestamp: November 28, 2021, 05:22:42 am
content: Quote from: Terry Bites on November 27, 2021, 09:41:12 pmThanks for the information I will look into it.