How to sort colors without an Arduino or a microcontroller?

Thread Starter

m3tobom

Joined Nov 15, 2019
3
Hello. I know we can sort colors by coding an Arduino or a microcontroller. I wonder how can we design a circuit for sorting colors as we want to without coding? For example:
If sensor senses black do stuff and if sensor senses white do stuff.
 

SamR

Joined Mar 19, 2019
5,031
Not sure what you mean by "sorting colors" but simple light detection to enable/disable LEDs of course. PWM to a RGB... Always did that with Arduino. I can envision doing it with logic chips but cost-wise and simplicity tells me to use uP. It would be like rubbing sticks together to start a fire when you have a lighter in your pocket.
 

dl324

Joined Mar 30, 2015
16,839
Welcome to AAC!

Look for a sensor that converts light intensity to voltage. For example, you could shine a red light on your white and black objects and measure the intensity of the reflected light.

1573854305047.png
 

dendad

Joined Feb 20, 2016
4,451
You really need to use a micro I think, like an Arduino. It just makes it so much easier to alter settings for instance.
Have you looked at these?
https://www.adafruit.com/product/1334
But I suppose you could use 3 x photo detectors of some sort, and colour filters then run the outputs into comparators to generate signals to do the sorting.
An Arduino will be much better!
 

djsfantasi

Joined Apr 11, 2010
9,156
Use a set of four light sensors, three have glass filters over them: a red, blue and green filter. Using comparators, compare the bare sensor with each of the filtered sensors. The outputs can be sent to a summing amplifier to code the three colors into a single level.

No, I don’t have a schematic. I’ve done the first part, comparing a bare sensor to one with a color filter.

So the latter part was just made up as an example.
 

Thread Starter

m3tobom

Joined Nov 15, 2019
3
You really need to use a micro I think, like an Arduino. It just makes it so much easier to alter settings for instance.
Have you looked at these?
https://www.adafruit.com/product/1334
But I suppose you could use 3 x photo detectors of some sort, and colour filters then run the outputs into comparators to generate signals to do the sorting.
An Arduino will be much better!
I am trying to satisfy my curiosity but thanks anyways.
 

John P

Joined Oct 14, 2008
2,025
I agree with everyone who's said that a processor is the way to do this. But rather than using a white light and filters, you could reverse the process and use a single broad-band light intensity sensor and illuminate the target with alternating red, green and blue LEDs, then compare the perceived intensity of reflected light. Colored LEDs are probably easier to obtain and operate than filters!

Actually white versus black targets aren't the easiest to work with, unless you can control the presentation well. A "white" object that's far away might not reflect much, so would it seem "black"? Whereas if you use colored lights (or filters) then the ratio of red-green-blue reflectance is what identifies the object, and that should be independent of distance or surface angle.
 

Mark Hughes

Joined Jun 14, 2016
409
Welcome to AAC!

Look for a sensor that converts light intensity to voltage. For example, you could shine a red light on your white and black objects and measure the intensity of the reflected light.
TAOS (now owned by AMS) has a line of color sensors as well. https://ams.com/color-sensors You could do a light-color to frequency converter -- and then go gonzo from there.

But the bigger question is -- why are these restrictions placed on the project?
 

dl324

Joined Mar 30, 2015
16,839
But the bigger question is -- why are these restrictions placed on the project?
OP knew it could be done with microcontrollers, presumably using light-to-frequency or I2C converters, but wanted to know if it could be done without coding.
I know we can sort colors by coding an Arduino or a microcontroller. I wonder how can we design a circuit for sorting colors as we want to without coding? For example:
If sensor senses black do stuff and if sensor senses white do stuff.
 

Analog Ground

Joined Apr 24, 2019
460
An alternative to a microcontroller is to build a "state machine" to perform the logical steps or sequencing. A state machine can be built up with logic gate and flip-flops ICs or done inside an FPGA device. Also, a Programmable Logic Controller or PLC can be used. These are very common in industrial applications for doing things like sorting. A PLC requires programming but is different than a microcontroller. There are definitely alternatives to a microcontroller. Finally, there is always the option of using a human being.
 

Reloadron

Joined Jan 15, 2015
7,501
Back around '62 I did a science fair project I named SOC (Sound Of Color). I just used a Cadmium-Sulfide Photocell as part of a simple transistor audio frequency oscillator circuit. I mounted a plain flashlight incandescent lamp beside it and angled it to reflect off a surface. I had pieces of construction paper mounted to a large wheel. The idea was a color like White would reflect the most light back to my sensor and a color like Black would absorb most of the light. Different colors in turn changed the oscillator frequency. A few transistors, a small speaker and a 9 Volt battery made the thing work.
If sensor senses black do stuff and if sensor senses white do stuff.
I guess if you set things up right you could set things up where different frequencies would give different outputs like a DTMF Decoder. There is likely a dozen other ways to go about it using common discreet components.

Ron
 

atferrari

Joined Jan 6, 2004
4,764
There was a project IIRC in Radioelectronics with three LEDs (blue red yellow IIRC again) shining their light in quick sequence over a sample of paper of unknown colour.

For each one the reflected light was measured via an ADC and recorded. The resulting three values conformed the colour profile of that sample.

Authors were from a University in USA IIRC.
I suspect that just one of the LEDs slightly off the range would not help to repeatability.

My first reaction was thinking that a micro could be used there.
 
Top