TCS3200 color sensor

Hello

I am trying to wire up the TCS3200 color sensor for arduino uno R3 and I am having issues. I have checked many documents on the web and they all have different ways of wiring. Some document set OE pin on TCS3200 to ground on the Arduino, and other don't use the OE pin. Some document set s0= Arduino pin 2, s1= Arduino pin 3, s2= Arduino pin 4, s3=Arduino pin 5, and out pin to Arduino pin 10. Other documents have a different pin wiring configurations. Hence i was wonder what is the correct way to wire TCS3200 color sensor to the Arduino?

Thanks

Use whatever pins you like, as long as those are the pins you use in the sketch. There's no "correct" way. I'dstart with the maker's sample here.

As to the OE pin, I see on dfr's site that seems to be optional, their sample code and diagram doesn't use it,and it's not immediately apparent to me what it's for. It' active low, so hooking it to ground enablesthat feature, whatever it is.

OE (Output Enable) is used to disconnects the sensor outputs (electrically) from the Arduino pins.
Used if e.g. you want more than one sensor on the same Arduino pins.
Breakout boards should already have a resistor mounted to keep that pin in the correct (enabled) logic state.
So you don't even have to connect it to a pin (or ground) if you are using just one sensor.
Leo..

Hello

Thanks for response. I have one more question. I tried the wire configurations on kenwood120s link but my sensor does not produce any light. Hence the reflected light can't be read.

I was wondering how would read the the reflected light? I am using pulsein to read the reflected light.
I was wondering if some one could explain output frequency scaling and the difference between power down, 2%, 20%, and 100%?

Here is my code:

void setup() {
pinMode(3, OUTPUT); //s0
pinMode(4, OUTPUT); //s1
pinMode(5, OUTPUT); //s2
pinMode(6, OUTPUT); //s3
pinMode(2, OUTPUT); //out
digitalWrite(3,LOW); // power down
digitalWrite(4,LOW); // power down

Serial.begin(9600);
}

void loop() {
digitalWrite(5,LOW);
digitalWrite(6,LOW);
Serial.println("red");
Serial.print(pulseIn(2, LOW));
Serial.println();
delay(100);

digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
Serial.println("green");
Serial.print(pulseIn(2, LOW));
Serial.println();
delay(100);

digitalWrite(5,LOW);
digitalWrite(6,HIGH);
Serial.println("blue");
Serial.print(pulseIn(2, LOW));
Serial.println();
delay(100);
}

Thanks