Go Down

Topic: Color Sensor TCS230 (Read 12608 times) previous topic - next topic

Has anyone ever got this working, I picked one up a few days ago, and used the example code from http://www.geeetech.com/wiki/index.php/Arduino_TCS230_Color_Recognition_Sensor_module

I tested the code but could not get it working correct, it would not see red at any point, and could not see the reading correct from the green and blue.
ALSO ... Some how, without changing a thing I killed my Duemilanove. It started to stop talking via USB/serial back to the PC then it would start again, and so on.
Then it just stopped and I can not get it to work at all now, I get a power light, but will not let me upload anything to it from the PC.
Lucky for me, I got another one, "but not to hand" but I do have a Mega to hand but do not want to take the chance of braking that too.

So any advice/help would be great on the sensor, I'll ask in the correct place about seeing if I can pull my Duemilanove back from the dead.

Thanks

Hello

I have written the driver for this device. Here on my github: https://github.com/dalmirdasilva/ArduinoColorRecognitionDriver

I'm still adjusting it, but you can clone the repository and test it. 

There is a example inside the library.

To install just type sudo make install (or copy into the correct "libraries" folder if you want).

To see the doc, type make doc. It uses doxygen to generate the documentation and will create a folder called "doc" inside the library.

Cheers!

Nantonos

This is the same sensor as used in the ColorHug, which is an open hardware colorimeter for PC screen calibration (see this interview where Richard mentions the chip used).

You should note that the sensor is very sensitive to infrared, so you may need a sharp IR cut filter if you want to measure visible light only.

Quote
You should note that the sensor is very sensitive to infrared, so you may need a sharp IR cut filter if you want to measure visible light only.


I are right.

My sensor is this one http://dx.com/p/tcs230-color-sensor-detector-module-for-arduino-148739?item=1; these 4 led on the top of the board cannot be turned off! It becomes hard to test it with black objects. I don't recommend this one. 

Fatoni

#4
Oct 24, 2012, 02:25 am Last Edit: Oct 24, 2012, 02:31 am by Fatoni Reason: 1
Using the same reference you're written, my TCS230 just print unknown character in port windows, and I try using another example code, posted in http://www.elecfreaks.com/wiki/index.php?title=Color_Sensor_Module, it work well.
Note: by using the example download from http://elecfreaks.com/store/download/datasheet/sensor/TCS230/TCS230.zip as mention in the text of the given link, the color sensor didn't work. So you better follow the code written in the text, it has a little different wiring configuration, but I think this is important, for the "out" pin of TCS230

yildiz90

hello,
I am so new at Arduino and I got one TCS230. exactly this one https://www.kartalotomasyon.com.tr/modules/catalog/products/pr_01_10006_max.jpg . I downloaded your library now trying to get some results but couldnt get anything on screen. Can you tell me the pic connections with arduino and TCS230 please? :(

You meant 'pin', right?

If yes:

Sensor -> Arduino UNO
==============
pin OUT -> pin 2
pin S2 -> pin 3
pin S3 -> pin 4

ColorRecognitionTCS230PI tcs230(2, 3, 4);


yildiz90

Thanks so much. it worked well now I got values for example:
Red: 255
Green:34
Blue:127

but when i put something totally red, it must be Red:255 Green:0 Blue:0 but it is not like this in results. what should i do for accurate results? Cover around the LEDs to protect them from outside light sources?

It is almost impossible to get values 100% accurate. But protecting the sensor from infrared light is one thing you can do to minimize  the problem. Also, when it is adjusting the white and the black frequencies, is difficult to point it to something really white or black. My experience: it will never be totally accurate!

michinyon

Quote
but when i put something totally red, it must be Red:255 Green:0 Blue:0 but it is not like this in results. what should i do for accurate results?


This belief is mistaken.   there is nothing you can put in front of it,  which is "totally red".

marco_c

The sensors need to be calibrated in your software. If you look at the pdf that comes with a library that I wrote for the sensor, you can see an explanation of how you can do that. The library is in my code repository (link below in the signature). Once calibrated they are pretty good at discriminating colors.
Arduino libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

yildiz90

#11
Dec 13, 2013, 10:06 am Last Edit: Dec 13, 2013, 10:30 am by yildiz90 Reason: 1
I already did it but couldnt get any  result.  when i start the  Calibrate_TCS230 example, I am getting this weird result ''eanIé?*?VEÎoB² ''...and result for ColorMatch_TCS230 example is ''ãBèôºáê±?)¿1Iÿ''...I have this one, https://www.kartalotomasyon.com.tr/modules/catalog/products/pr_01_10006_max.jpg
Mine seems a bit different from yours. Problem could be pin connections? how should i do the connections according to mine?

marco_c

If the result is what you see on the serial output then you need to make sure that the bit per second are the same as what the serial .begin is setting.
Arduino libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

yildiz90

#13
Dec 13, 2013, 11:12 am Last Edit: Dec 13, 2013, 11:35 am by yildiz90 Reason: 1
Oh yes! I set 57600 now and started to get results but I always read 0 for RED. I think there is a problem with connections.  How can i do the pin connections?

marco_c

Pin connections do not matter as long as they match what you tell the library when you start. The only pin that is important is the frequency pin, so make sure you are using the right pin as per the header file table.
Arduino libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

Go Up