Pages: [1] 2 3   Go Down
Author Topic: Color Sensor TCS230  (Read 10817 times)
0 Members and 1 Guest are viewing this topic.
Kent, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Nice, France
Offline Offline
Full Member
***
Karma: 11
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: October 23, 2012, 07:31:33 pm by Fatoni » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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? smiley-sad
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3080
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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".
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1287
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: December 13, 2013, 04:30:06 am by yildiz90 » Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1287
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: December 13, 2013, 05:35:33 am by yildiz90 » Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1287
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Pages: [1] 2 3   Go Up
Jump to: