Object detection by color

I just started planning a project including the arduino . I have experience in programming but never used an arduino before. In my project I want to do object detection by color. I need to classify the objects by theire different colors on multiple conveyor belts. On each belt only one object will pass because its only wide enough for one object.

My problem is that I dont know how to realize my project. Is one camera enough for lets say 2 belts or should I use one camera for each belt ? If yes can I even use two cameras at the same time on one arduino?
That are my first thoughts. Maybe you can help me deciding how to realize my project.

Camera?
Perhaps you mean Pixy?

All you need is 3 Foto Transistors/Foto LEDs.

And color filters. My Arduino starter set came with a red, blue and green foil.

And it does work.

For production you might look for a better solution.

Especially distance is impotant. For control via a larger distance than a fey centimeters you will need optic devices.

Thanks for your advice. I wount use sensors because maybe I also want to try it without color detection. So I must use a camera

See reply #1:
charmedlabs.com/default/pixy-cmucam5/

But it's indeed much easier (and cheaper) to use light sensors as arduinoaleman suggested. Since there will be passing only one object at a time, you can just use these to detect wheter there's an object or not, and detect the color as well. There are even complete sensor modules available that have an RGB LED and an RGB color sensor (i.e. RGB filters with a light sensor).

Pieter

Yeah I just done some research and cameras are a lot more complicated to use :frowning:
I'll try a RGB Sensor with and LED for the constant light. Thanks for the help.

I have done some work with the Adafruit TCS34725 Color Sensor . My problem is that its to slow. The sensor takes 4,8ms to take one measurement. I need a rgb sensor, which is all the time active and sends me an interrupt when the known color passes the sensor.

The distance between object and sensor are a few millimiter and the objects are 1 to 2 meter per second fast. For example I need to detect if the passing by object is green or red and count the ammount of green and red objects, which passed the sensor.

I found this sensor, but could no figure out, if its usable for my problem. TCS3200_Color_Sensor__SKU_SEN0101_-DFRobot

That is not really useful for what you want as it will not react fast enough and you are trying to measure three frequencies at the same time.

A camara is even less useful as you only get one frame every 20mS.

What are these objects? I think you should have mentioned them before. How long are they in the field of view of a sensor?

they are one centimeter big square shaped objects. For the field of view of the sensor, it would be ok if the sensor can only measure one pixel from the object, if that would lead to a faster response time.

As I understood, the sensor I mentioned above converts the light to frequency , in form of an integer value. Before that you need to set the measurement color with the status pins, like LOW LOW for red and so on for blue and green. What I thought was to use two sensor one on each color I want to measure.

converts the light to frequency , in form of an integer value.

No that makes no sense at all.

It outputs a frequency all the time, the dark frequency is 2 to 10 Hz for any LED. At 2m/s it would be in the field of view for only 5ms. The frequency output would be proportional to the intensity of the selected sensor. So you get a speed up in frequency as the object passes, that is going to be difficult to detect especially if you have two sensors.
I can't see that working.

What would you recommend ? Is there no other sensor , which could take fast enough measurements.