ISL 29125-RGB color Light Sensor with Arduino

Last Updated on March 16, 2024

rgb-light-sensor-arduino

 

Is your Project design needs color light sensing? Here is the simple and robust sensor to satisfy your requirements. The ISL29125 RGB color light sensor with IR blocking filter helps to detect light spectrum color with high precision output, and it is suitable for any microcontroller or Embedded system hardware which has I2C communication line.




This sensor comes with (ODFN) Optical Dual Flat package No lead, need magnifier to handle hence better to try in breakout board.

How RGB light Color Sensor Work?

how-color-sensors-work

Working principle of Color and RGB light sensor is just simple to understand, the color light have different wavelengths those are detected and converted into current levels by the photo detectors and then  signal is processed. Finally current level signal is converted into digital values by the ADC (analog to digital converter). Output data can be handled by the Processor or Micro-controller to meet our applications.

ISL 29125-Color sensing sensor

Block diagram-ISL29125

isl29125-rgb-light-sensor-blockdiagramThe ISL29125 is a low power, high sensitivity, RED, GREEN and BLUE color light sensor (RGB) with an I2C (SMBus compatible) interface. Its state-of-the-art photodiode array provides an accurate RGB spectral response and excellent light source to light source variation (LS2LS). The ISL29125 is designed to reject IR in light sources allowing the device to operate in environments from sunlight to dark rooms. The integrating ADC rejects 50Hz and 60Hz flicker caused by artificial light sources. A selectable range allows the user to optimize sensitivity suitable for the specific application. In normal operation mode the device consumes 56μA, which reduces to 0.5μA in power-down mode. The ISL29125 supports hardware and software user programmable interrupt thresholds. The Interrupt persistency feature reduces false trigger notification. The device operates on supplies (VDD) from 2.25V to 3.63V, I2C supply from 1.7V to 3.63V, and operating temperature across the -40°C to +85°C range.

source: http://www.intersil.com/en/products/optoelectronics/ambient-light-sensors/light-to-digital-sensors/ISL29125.html)

Interfacing

isl29125-rgb-light-sensor-typical-application

The sensor gives simple way to communicate with external world that is I2C communication pins, By using SDA (data line) and SCL (clock line) digital sensed data can be transferred to the micro-controllers with high baud rate. There is interrupt option also available to take control over the color sensing. If you are using 5 volt controller, you need to provide TTL logic converter 5V to 3.3V because the sensor operates with 3.3V. If bias increases than 3.3V it may hurt the sensor.

RGB light sensor ISL29125 Breakout board

12829-02

ISL29125 sensor breakout board from Sparkfun, It contains few pins for biasing and communication. It is most suited for Arduino open source development boards. Otherwise you can interface with any controllers having I2C lines.

ISL29125-Arduino Hookup

rgb-light-sensor-arduino-code

As stated it is very simple to connect RGB light sensor breakout board and Arduino, connect the bias pins GND,3.3 V on Arduino GND & 3.3 V pins. The well known Arduino uno has I2C communication lines SDA (in A4) and SCL (in A5) so connect sensors I2C lines as illustrated. The wiring between Arduino and sensor board is over before jump into the code first install Arduino Library for ISL29125 sensor from github.

ISL 29125 Arduino Code

Here is simple code is provided to detect color light and it appears on serial port as hex values. (use 115200 as baud rate for serial port terminal).

 


#include <Wire.h>
#include "SparkFunISL29125.h"

// Declare sensor object
SFE_ISL29125 RGB_sensor;

void setup()
{
  // Initialize serial communication
  Serial.begin(115200);

  // Initialize the ISL29125 with simple configuration so it starts sampling
  if (RGB_sensor.init())
  {
    Serial.println("Sensor Initialization Successful\n\r");
  }
}

// Read sensor values for each color and print them to serial monitor
void loop()
{
  // Read sensor values (16 bit integers)
  unsigned int red = RGB_sensor.readRed();
  unsigned int green = RGB_sensor.readGreen();
  unsigned int blue = RGB_sensor.readBlue();
  
  // Print out readings, change HEX to DEC if you prefer decimal output
  Serial.print("Red: "); Serial.println(red,HEX);
  Serial.print("Green: "); Serial.println(green,HEX);
  Serial.print("Blue: "); Serial.println(blue,HEX);
  Serial.println();
  delay(2000);
}

Datasheet

pdf-icon isl29125

 



Leave a Reply

Your email address will not be published. Required fields are marked *