Arduino color recognition
RGB color detector – Color Recognition Sensor – TCS230 TCS3200

Parts Required:
– TCS230 TCS3200 Color Recognition Sensor
– Breadboard
– Arduino NANO v3.0
– Wires to connect it all together

Wiring your Color Sensor

Wiring your Color Sensor

// Hisham Marzouk
// www.Officialhrm.com
int s0_pin =2;
int s1_pin =3;
int s2_pin =4;
int s3_pin =5;
int out_pin =6;
void setup() {
Serial.begin(9600);
pinMode(s0_pin, OUTPUT);
pinMode(s1_pin, OUTPUT);
pinMode(s2_pin, OUTPUT);
pinMode(s3_pin, OUTPUT);
pinMode(out_pin, INPUT);
digitalWrite(s0_pin,HIGH);
digitalWrite(s1_pin,LOW);
}
void loop() {
digitalWrite(s2_pin,LOW);
digitalWrite(s3_pin,LOW);
int red_color = pulseIn(out_pin, LOW);
red_color = map(red_color, 25,72,255,0);
digitalWrite(s2_pin,HIGH);
digitalWrite(s3_pin,HIGH);
int green_color = pulseIn(out_pin, LOW);
green_color = map(green_color, 30,90,255,0);
delay(5);
digitalWrite(s2_pin,LOW);
digitalWrite(s3_pin,HIGH);
int blue_color = pulseIn(out_pin, LOW);
blue_color = map(blue_color, 25,70,255,0);
delay(30);
if (red_color >=0){
Serial.print(red_color *2);
Serial.print(“,”);
}else{
Serial.print(0);
Serial.print(“,”);
}
if (green_color >=0){
Serial.print(green_color*10);
Serial.print(“,”);
}else{
Serial.print(0);
Serial.print(“,”);
}
if (blue_color >=0){
Serial.print(blue_color*10);
}else{
Serial.print(0);
}
Serial.print(“,”);
Serial.println(0);
}

I have fun with, result in I found just what I was having a look for. You have ended my 4 day long hunt! God Bless you man. Have a nice day. Bye
I believe this is one of the so much vital info for me. And i’m happy studying your article. However want to statement on some basic things, The web site taste is perfect, the articles is in reality excellent : D. Just right task, cheers|
Hi there would you mind letting me know which hosting company you’re working with? I’ve loaded your blog in 3 completely different internet browsers and I must say this blog loads a lot faster then most. Can you suggest a good hosting provider at a fair price? Thanks, I appreciate it!
Very good post keep it up like never before and keep it reals all the time
Very interesting and encouraging keep up the good work
Hello my loved one! I wish to say that this article is amazing, nice written and come with almost all significant infos. I’d like to see extra posts like this .
You are a very smart person!
This actually answered my problem, thank you!
bookmarked!!, I really like your site!
I don’t even know how I ended up here, but I thought this post was great. I do not know who you are but definitely you’re going to a famous blogger if you aren’t already 😉 Cheers!