Go Down

Topic: TCS3200 with Arduino Uno (Read 2938 times) previous topic - next topic

marco_c

Karma points always welcome :)

Quote
Do I need to connect the outer inputs to the digital pins instead of connecting to 5V?

I don't know what this means. What are the 'outer inputs'?

Quote
Do you think I will be able to have the exact color temperature of a light?

No idea on this one. My use of the sensor is for detecting color, not color temperature. The sensors work by reading the level of reflected light rather than a light source directly. This may not be compatible with reading a color emitted from a colored source. However, assuming that you can read such a source, then there should be formulas that allow you to convert from one to the other. Color space and its attributes is an interesting topic but I am not at all an expert.
Arduino libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

carolx

#16
Jul 27, 2014, 03:57 am Last Edit: Jul 27, 2014, 07:03 am by carolx Reason: 1
Hello,

I am a web programmer trying to learn a bit of Arduino.

I installed marco_c 's library (thank you!) to use with a TCS230 sensor. The vendor said it's TCS3200, but it looks like this, so I'm guessing it's the TCS230.
I used the Calibration example and it worked, but rgb values on serial monitor translate to colors much darker than the objects sensed. I tried different libraries with the same problem, colors are too dark. For example, a green color that should be something around R=172 G=204 B=60  is being recognized as R=160 G=154 B=63.
My ultimate goal is to detect skin color, so some level of accuracy would be important.


Could this be caused by some problem with my settings or could it be sensor malfunction?

I changed pin definitions in the Calibration example to these:
Code: [Select]
#define  S0 13
#define  S1  12
#define  S2  11
#define  S3  10


And I'm calling the class like this:
Code: [Select]
MD_TCS230 CS(S2, S3, S0, S1);

OUT is set to D5
OE is set to GND

Can anyone help me?
I have little to no knowledge on hardware/electronics, but I may try to check the sensor if you have some tips.

Thank you in advance!

marco_c

When you are using the sensor, are you shielding it from externally reflected light? If you are using the sensor as-is in the picture you linked to, you will get different results depending on the light level and other objects in the room.

If you see in my documentation, I built a black cardboard shielding around the LEDs and the sensor. Then when I want to sense, I lock out all the external light from the sensor by putting the shroud in contact with the material to be identified. this stops the external light from influencing the reading and I get the same every time.

I would also say that the colours on the screen will look different from colours in real life because they are produced differently.
Arduino libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

carolx

Hi, thank you for such a quick response.

Well, I improvised a shield using thin cardboard, but it is not black and it still lets some external light pass through. For some colors the results are a lot different... A pale skin is read as dark brown.

I'll try to make a better shielding and post the results.

carolx

#19
Jul 27, 2014, 06:59 am Last Edit: Jul 27, 2014, 07:05 am by carolx Reason: 1
Well, I've built a pretty decent shield around the sensor in black cardboard, and the results changed minimally. On human skin, results are the worst, I guess skin has bad reflectance (I found some studies on the subject, like this one).

I put the colors generated from the rgb values on an image to illustrate what's happening (image attached)

jazzlee37

Dear marco_c sir, I'm also trying the TCS3200 color sensor to recognize the color of paper which was printed by ink printer. I used your library to calibrate and test it. I also made a quick shield to prevent the external light by your recommandation. I tried two kind paper. One is normal paper for copy machine, the other is for photo printing. Below is my color sample which I assigned the specific windows RGB number to each color. But the result is a little bit far from windows RGB number. My question is if the material of paper couldn't be changed. how should I change the setting to let the result from sensor to match the color sample I printed?
-------------------------------------------------
Arduino UNO + Tcs3200 color sensor

marco_c

I notice that your sensor shroud is made from the same white plastic material as the rest of the sensor holder. Have you tried to make the sensor shroud black. The surrounding ambient will influence what the sensor reads so if you have a color (ie, anything with RGB values greater than 0) you will find that the shroud will contribute to the color reading from the sensor. Black is RGB (0,0,0), so the contribution will be minimal.
Arduino libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

jazzlee37

Thanks for your information. I will try and revert back the result to you soon.

Go Up