Skip to main content

Grove-Color Sensor V3.0 - I2C interface

Description

It is a sensor to measure the color chromaticity of ambient light or the color of objects. With the synchronization input pin, an external pulsed light source can provide precise synchronous conversion control.

Features

  • Color Detection: Measures red, green, blue, and white light components.
  • I2C Interface: Easy integration with microcontrollers via I2C for data access.
  • Supply Voltage: Operates at 3.3V or 5V.
  • Synchronization: Can work with an external pulsed light source for accurate readings.
  • Compact Design: Small form factor for easy integration into various projects.
  • Low Power Consumption: Ideal for battery-operated devices.

Specification

ParameterValue/Range
Color ChannelsRed, green, blue, and clear (white)
Supply Voltag3.3V to 5V
InterfaceI2C
Resolution16-bit color data output
Operating Temperature Range-40°C to +85°C
Current Consumption200μA
Selectable maximum detection range515.4, 1031, 2062, 4124, 8248, or 16 496 lux with highest sensitivity 0.007865 lux/step

Getting Started

indication diagram

Hardware

Step 1. Prepare the below stuffs:

  • Play with Arduino
Seeeduino V4.2Base ShieldGrove - Color Sensor V3.0
Get One NowGet One NowGet One Now
  • Connect Grove with Arduino
  • Play with XIAO ESP32 Series
Seeed Studio Grove Base for XIAOXIAO ESP32-S3Grove - Color Sensor V3.0
Get One NowGet One NowGet One Now
  • Connect Grove with XIAO ESP32S3

Two different combinations, but using the same code.

Software

  • Step 1. DownLoad Library

Install the VEML6040 library.

  • Step 2. Copy the code into Arduino IDE and upload.
#include "Wire.h"
#include "veml6040.h"

VEML6040 RGBWSensor;

void setup() {
Serial.begin(9600);
Wire.begin();
if(!RGBWSensor.begin()) {
Serial.println("ERROR: couldn't detect the sensor");
while(1){}
}

RGBWSensor.setConfiguration(VEML6040_IT_320MS + VEML6040_AF_AUTO + VEML6040_SD_ENABLE);

delay(1500);
Serial.println("Vishay VEML6040 RGBW color sensor auto mode example");
Serial.println("CCT: Correlated color temperature in \260K");
Serial.println("AL: Ambient light in lux");
delay(1500);
}

void loop() {
Serial.print("RED: ");
Serial.print(RGBWSensor.getRed());
Serial.print(" GREEN: ");
Serial.print(RGBWSensor.getGreen());
Serial.print(" BLUE: ");
Serial.print(RGBWSensor.getBlue());
Serial.print(" WHITE: ");
Serial.print(RGBWSensor.getWhite());
Serial.print(" CCT: ");
Serial.print(RGBWSensor.getCCT());
Serial.print(" AL: ");
Serial.println(RGBWSensor.getAmbientLight());
delay(400);
}
  • Step 3. Open the serial port to view the printed content.

When I placed the color sensor on the white area of our viewer, we opened the serial port and found that the value of WHITE was the highest

Resources

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...