How does it work?
The Color 10 Click is based on VEML3328, a RGB and IR light sensor from Vishay. This sensor is a 16-bit, low power, high sensitivity CMOS color sensor and signal conditioning IC, that can be operated via a simple I2C commands. This sensor has many features that make it a perfect solution for small designs such as the Color 10 Click board™. One of these features is certainly its high level of integration that allows a minimal number of external components.
VEML3328 provides excellent temperature compensation capability for keeping the output stable under changing temperature. The sensor’s functions are easily operated via the simple command format of I2C (SMBus compatible) interface protocol. VEML3328 has a low operating voltage range of 2.6V to 3.6V, integrated modules, color sensor and signal conditioning IC, supports low transmittance (dark) lens design and provides 16-bit resolution for each channel (R, G, B, C, and IR).
The WS2812 on Color 10 Click board™ can be used for testing purposes as well as the light source for object color detector, since VEML3328 can detect the color which WS2812 emits in R, G, B range. For clear and IR light, appropriate photodiodes should be used.
The WS2812 can be controlled by data protocol on DI and DO pins, data transfer protocol use single NZR communication mode. After the pixel power-on reset, the DI port receive data from microcontroller, the first pixel collect initial 24bit data then sent to the internal data latch, the other data which reshaping by the internal signal reshaping amplification circuit sent to the next cascade pixel through the DO port. After transmission for each pixel, the signal to reduce 24bit pixel adopt auto reshaping transmit technology, making the pixel cascade number is not limited the signal transmission, only depend on the speed of signal transmission.
Specifications
Type
Color Sensing,Optical
Applications
Can be used for adjusting brightness and color temperature of a display backlight based on the ambient light source, and it can differentiate indoor from outdoor lighting environment, and many other applications
On-board modules
VEML3328, color sensor and signal conditioning IC
Key Features
16-bit resolution for each channel (R, G, B, C, and IR), low power consumption I 2 C (SMBus compatible) interface on board RGB light source for calibration and object color sensing.
Interface
GPIO,I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V,5V
Pinout diagram
This table shows how the pinout on Color 10 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
LD2 | WS2812 | – | Controllable RGB light power source |
Software Support
We provide a library for the Color 10 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library provides functions for reading color registers from device. Converting data to HSL color data, and automaticly reading predefined colors;
Key functions:
uint16_t color10_generic_read ( uint8_t cmd_addr );
– Generic read function from devicefloat color10_get_color_value ( void );
– Functions for read HSL color valueuint8_t color10_get_color ( float color_value );
– Functions for detecting colors from HSL value
Examples description
The application is composed of three sections :
- System Initialization – Inicializes I2C module
- Application Initialization – Initialization driver init, checks device ID and sets default configuration
- Application Task – Reads color IR ADC value and then checks for predefined colors with write_color funcion
void application_task ( ) { uint16_t read_data; float color_data; read_data = color10_generic_read( COLOR10_CMD_REG_IR ); WordToStr( read_data, demo_txt ); mikrobus_logWrite( " - IR value: ", _LOG_TEXT ); mikrobus_logWrite( demo_txt, _LOG_LINE ); mikrobus_logWrite( " - Color: ", _LOG_TEXT ); write_color( ); mikrobus_logWrite( " *************** ", _LOG_LINE ); Delay_ms( 1000 ); }
Additional Functions :
- void write_color ( float color_val ) – Reads and gets color HSL value and then checks for the color and logs a few predefined colors
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- UART
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.