Compatible with Arduino? Colour Light Sensor Avago

I'm after an easy to program color light sensor, came across this on, is it compatible with the arduino?

Colour Light Sensor Avago ADJDS371-Q999

or should i go for the evaluation model? The ADJD-S371

The q999 seems easier to hook up, as it does all the processing for you, but i cant find any example codes for it, anyone successfully hooked one up? Or know of any links


but i cant find any example codes for it,

Well do a google search there are a few examples of this in the forum.

I am in the process of using this:-

/* Colour Pegs - Mike Cook August 2009
 based on:-
 // Avago ADJD-S311-CR999 Color Sensor demo
// by Musashinodenpa (

// Modified version of the Wire libary that does not enable the internal pull up resistors
// To allow a 5V processor to talk to the 3V3 sensor, external pull ups are required
#include <WireOC.h>

// Define Constants 
#define chSel0 6    // channel select 0 pin
#define chSel1 7    // channel select 1 pin
#define COLOUR_SENSOR_ADDRESS 0x74       // 7bit

// CAP - controlls the number of capacitors on the input of the A/D
// in effect a gain setting for each sensor
// the bigger the number the more it takes to charge up the capacitors and the less sensitave it will be
// but the lower the noise
#define REG_CAP_RED       0x06
#define REG_CAP_GREEN     0x07
#define REG_CAP_BLUE      0x08
#define REG_CAP_CLEAR     0x09

// INT controlls the intergration time for each sensor 
// this is the time to gather light before making a measurement
// the longer it is the more sensitave but also the more prone to noise
#define REG_INT_RED_LO    0x0A
#define REG_INT_RED_HI    0x0B
#define REG_INT_GREEN_LO  0x0C
#define REG_INT_GREEN_HI  0x0D
#define REG_INT_BLUE_LO   0x0E
#define REG_INT_BLUE_HI   0x0F
#define REG_INT_CLEAR_LO  0x10
#define REG_INT_CLEAR_HI  0x11

// DATA - the registers containing the 8 bit readings from each sensor
#define REG_DATA_RED_LO   0x40
#define REG_DATA_RED_HI   0x41
#define REG_DATA_GREEN_LO 0x42
#define REG_DATA_GREEN_HI 0x43
#define REG_DATA_BLUE_LO  0x44
#define REG_DATA_BLUE_HI  0x45
#define REG_DATA_CLEAR_LO 0x46
#define REG_DATA_CLEAR_HI 0x47

byte Sensor_LED_Pin[] = { 2,3,4,5}; // pins controlling sensor LEDs
int r[4], g[4], b[4], c[4];   // Global arrays containing colours
boolean debug = true;         // change for debug printout

void set_register(unsigned char r, unsigned char v)

unsigned char read_register(unsigned char r)
  unsigned char v;
  Wire.send(r);  // register to read
  Wire.requestFrom(COLOUR_SENSOR_ADDRESS, 1); // read a byte
  while(!Wire.available()) {
    // waiting
  v = Wire.receive();
  return v;

void setup(void)
  // initilise illuminating LEDs
  for(int i = 0; i>0; i++){
  // I2C channel select multiplexers
  // sensor gain setting (Avago app note 5330)
  // CAPs are 4bit (higher value will result in lower output)
  set_register(REG_CAP_RED, 0x03);
  set_register(REG_CAP_GREEN, 0x03);
  set_register(REG_CAP_BLUE, 0x03);
  set_register(REG_CAP_CLEAR, 0x08);
  // INTs are 12bit (higher value will result in higher sensor value)
  set_register(REG_INT_RED_LO, 0xC4);
  set_register(REG_INT_RED_HI, 0x09);
  set_register(REG_INT_GREEN_LO, 0xC4);
  set_register(REG_INT_GREEN_HI, 0x09);
  set_register(REG_INT_BLUE_LO, 0xC4);
  set_register(REG_INT_BLUE_HI, 0x09);
  set_register(REG_INT_CLEAR_LO, 0xC4);
  set_register(REG_INT_CLEAR_HI, 0x09);

void loop()
  for(int ch = 0 ; ch<4; ch++){
  Read_Colour(ch); // read colour

void Read_Colour(int ch)
  // select the channel
  ch = ch & 0x03;  // keep channel select to 2 bits only
  digitalWrite(chSel0,ch & 1);
  digitalWrite(chSel0,ch >> 1);
  digitalWrite(Sensor_LED_Pin[ch],HIGH);   // turn on illuminating LED
  set_register(0x00,0x01);                 // start sensing
  while(read_register(0x00) != 0) {
    // waiting for a result

  // 10bit results
  c[ch] = read_register(REG_DATA_CLEAR_LO) | (read_register(REG_DATA_CLEAR_HI)<<8);
  r[ch] = read_register(REG_DATA_RED_LO) | (read_register(REG_DATA_RED_HI)<<8);
  g[ch] = read_register(REG_DATA_GREEN_LO) | (read_register(REG_DATA_GREEN_HI)<<8);
  b[ch] = read_register(REG_DATA_BLUE_LO) | (read_register(REG_DATA_BLUE_HI)<<8);
 if(debug) {
  Serial.print("channel ");
  Serial.print(ch, DEC);
  Serial.print(" crgb=");
  Serial.print(c[ch] ,DEC);
  Serial.print(r[ch] ,DEC);
  Serial.print(g[ch] ,DEC);
  Serial.println(b[ch] ,DEC);
 digitalWrite(Sensor_LED_Pin[ch],LOW); // turn off illuminating LED

I’ve seen code for the evaluation version of the board on this forum, but i havent seen any code for the q999 version of it, which i link to in my op.

Thats my question basically will code working on the evaluation version, work on the none evaluation version, q999?


I am not sure what difference you think there is but an ADJDS371-Q999 is an ADJDS371-Q999 irrespective of if it is on an evaluation board or not. The 999 part is just the back end of the part number.

will code working on the evaluation version, work on the none evaluation version,

there is no difference between the two so yes it would work.