TCS3200 with Arduino Uno

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

2014-11-28 12.08.54.jpg

2014-11-28 12.09.10.jpg

Color sample result-4x6.jpg

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.

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

is there any way to save the calibration so that it doesn't need to be done every time?

The sensor needs to be calibrated for the situation/environment in which you are using it. Once this is done, you can either build the calibration parameters into your code or save them to EEPROM (you need to write this code).

If you change the environment around the sensor (background, shroud, voltage, etc) then you should recalibrate.

Thanks!

Building the calibration parameters into the code seems like the best option for me.

How would I go about to retrieve them from the calibration example?

You can print them out using Serial.print

Also look at the colour recognition example as that one produces a header file to include with the code, printed to the serial monitor. That may be quicker for you.

That was really nice I will try it out! thank you!!