How does it work?
Color 18 Click is based on the TCS3530, a true color ambient light sensor from ams OSRAM. This sensor has advanced capabilities such as true color XYZ ambient light detection and selective flicker detection, supporting frequencies up to 7kHz. It is fully embedded, with an integrated aperture and diffuser, ensuring precise pre-calibration by maintaining accurate distances between the photodiodes and other optical elements. This sophisticated design allows the sensor to provide eight concurrent ambient light sensing channels, each with an independent gain configuration, which can be linked to any of the 27 photodiodes. Additionally, the built-in sequencer makes automated measurements, eliminating the need for re-programming after each cycle. The sensor’s UV/IR blocking filter enhances its ability to measure ambient light accurately and calculate key parameters such as illuminance, chromaticity, and correlated color temperature (CCT) for optimal display management.
Moreover, the TCS3530 on the Color 18 Click offers direct ambient light flicker detection, capable of handling both traditional 50Hz/60Hz AC light sources and modern LED lighting systems with PDM control. This flicker detection operates in tandem with ambient light sensing, with its gain settings managed independently, and allows for external flicker frequency calculations on a host MCU. Based on these features, this Click board™ makes an excellent choice for precise lighting management and display optimization like calculating CCT and chromaticity, supporting auto white balancing, identifying light types, and ensuring flicker-free camera operation.
This Click board™ is designed in a unique format supporting the newly introduced MIKROE feature called “Click Snap.” Unlike the standardized version of Click boards, this feature allows the main sensor area to become movable by breaking the PCB, opening up many new possibilities for implementation. Thanks to the Snap feature, the switches can operate autonomously by accessing their signals directly on the pins marked 1-8. Additionally, the Snap part includes a specified and fixed screw hole position, enabling users to secure the Snap board in their desired location.
This Click board™ uses a standard 2-wire I2C interface to communicate with the host MCU, supporting Standard mode with up to 400kHz of frequency clock. The I2C interface and registers allow for controlling various sensor functions, such as offset and measurement mode settings, interrupt system management for interrupt signals available on the INT pin, and adjusting offset and threshold values for color sensor data. This flexibility ensures precise and customizable operations tailored to specific application needs.
The SYC pin on the mikroBUS™ socket serves a dual-purpose function. It can be used as a synchronization input, allowing the sensor to align its measurements with external events or signals, ensuring accurate timing and coordination in applications that require precise synchronization. Alternatively, it can also function as a general-purpose open-drain input/output pin, providing additional flexibility for various control or signaling tasks, depending on the application’s specific requirements.
The TCS3530 does not require a specific Power-Up sequence but requires a voltage of 1.8V for its interface and logic part to work correctly. Therefore, a small regulating LDO, the AP2112, provides a 1.8V out of selected mikroBUS™ power rail. Since the sensor operates on 1.8V, this Click board™ also features the PCA9306 voltage-level translator, allowing the TCS3530 to work properly with 3.3V and 5V MCU.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Click Snap
Click Snap is an innovative feature of our standardized Click add-on boards, introducing a new level of flexibility and ease of use. This feature allows for easy detachment of the main sensor area by simply snapping the PCB along designated lines, enabling various implementation possibilities. For detailed information about Click Snap, please visit the official page dedicated to this feature.
Specifications
Type
Color Sensing,Optical
Applications
Ideal for calculating CCT and chromaticity, auto white balancing, light type identification, and ensuring flicker-free camera operation
On-board modules
TCS3530 – true color ambient light sensor from ams OSRAM
Key Features
True color XYZ ALS, selective flicker detection, eight concurrent ALS channels, integrated UV/IR blocking filter, Click Snap feature, synchronization and interrupt signals, I2C interface, and more
Interface
I2C
Feature
Click Snap,ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Color 18 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 |
JP1 | VCC SEL | Left | Power Voltage Level Selection 3V3/5V: Left position 3V3, Right position 5V |
Color 18 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Channel Center Wavelength (X1/X2/Y/Z/HgL/HgH) | 436/594/555/445/519/545 | nm | ||
ALS Gain | 0.5 | – | 4096 | – |
Software Support
We provide a library for the Color 18 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for Color 18 Click driver.
Key functions
-
color18_get_int_pin
This function returns the INT pin logic state. -
color18_read_data
This function checks if the color measurement data are ready for all channels and reads them. -
color18_clear_fifo
This function clears the FIFO buffers and interrupts.
Example Description
This example demonstrates the use of Color 18 click by reading and displaying the values from all 8 modulator channels.
void application_task ( void )
{
color18_data_t color_data;
// Wait for a data ready interrupt
while ( color18_get_int_pin ( &color18 ) );
if ( COLOR18_OK == color18_read_data ( &color18, &color_data ) )
{
log_printf ( &logger, "X: %urn", color_data.x );
log_printf ( &logger, "Y: %urn", color_data.y );
log_printf ( &logger, "Z: %urn", color_data.z );
log_printf ( &logger, "IR: %urn", color_data.ir );
log_printf ( &logger, "HgL: %urn", color_data.hgl );
log_printf ( &logger, "HgH: %urn", color_data.hgh );
log_printf ( &logger, "Clear: %urn", color_data.clear );
log_printf ( &logger, "Flicker: %urnn", color_data.flicker );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Other MIKROE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Color18
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. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE 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.