arduino+Reflective Color Sensor Assembly OPB780Z

Hi All, I recently bought a Reflective Color Sensor Assembly OPB780Z www.optekinc.com/datasheets/OPB780.PDF and I have arduino mega board which I want to integrate with the board. The problem is I don't understand how to integrate since am a beginner. :-? Any one to help me in which side of the arduino board (analog or digital or sda?) to connect the output frequency pin. Again how are the Photodiode type selection input pin used? Anyone with any help will really help me out.

Thanks for your time.

Regards, Mturuchiu.

The output of this sensor should go to a digital input. Then you measure the frequency of the output with a pulse In function. S2 and S3 control what colour is being sensed, connect these to arduino digital output pins. See page 4 of the data sheet for examples of all the colours but to select the red sensors put both to low.

EDIT Make sure you have at least 80R in series with the LED input.

Hi Grumpy_Mike, Thanx for the help. What I don't understand is what do you mean by

Then you measure the frequency of the output with a pulse In function.

What is the pulse In function? :-? please get me informed and I will really appreciate, since am not able to capture the frequency of different colors. Thanxs for your time.

Regards, Mturuchiu.

http://www.arduino.cc/en/Reference/PulseIn