Spectrometer 2 Click Board
Spectrometer 2 Click Board
The Spectrometer 2 Click Board™ is a compact add-on board that collects light waves. This board features the VD6283TX, a colour sensor with advanced light flicker extraction from STMicroelectronics. The VD6283TX performs fast and accurate light measurements thanks to an individual ADC and a readout for each colour channel - red, green, blue, IR, clear, and visible. It uses hybrid colour filters with precise responses allowing accurate computation of the correlated colour temperature (CCT) and Lux information. Its patented architecture and a high-performance photodiode design can also extract light-flickering frequencies to avoid “banding effects” or check that they are safe for the human eye. This Click board™ is suitable for screen brightness adjustment and white balance colour assistance, lux and CCT measurement, or light frequency extraction for flicker correction assistance.
The Spectrometer 2 Click Board™ is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
How Does The Spectrometer 2 Click Board™ Work?
The Spectrometer 2 Click Board™ is based on the VD6283TX, a color sensor with advanced light flicker extraction from STMicroelectronics. It performs fast and accurate light measurements thanks to an individual ADC with a resolution of 24 bits (16 bit + 8 bit for high accuracy under low light) and a readout for six color channels: red, green, blue, IR, clear, and visible. The color channels can be individually enabled to optimize power consumption, alongside 15 programmable gains for a high-dynamic range, through a serial interface. Six channels can operate with independent, parallel reading for ALS or flicker operations, one represents a dedicated fast channel for light flicker measurement, and one stands for an internal dark channel.
The VD6283TX uses hybrid color filters with precise responses allowing accurate computation of the correlated color temperature (CCT) and Lux information. Its patented architecture and a high-performance photodiode design can also extract light-flickering frequencies from a minimum of 100Hz and a maximum frequency of 2kHz, including LED square signals, to avoid "banding effects" or check that they are safe for the human eye.
The Spectrometer 2 Click Board™ communicates with MCU using the standard I2C 2-Wire interface with a maximum clock frequency of 1MHz, fully adjustable through software registers. The VD6283TX 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 is used, the ADP151, providing a 1.8V out of 3.3V mikroBUS™ power rail. Since the sensor for operation requires a power supply of 1.8V, this Click board™ also features the PCA9306 voltage-level translator allowing the VD6283TX to work with 3.3V MCU properly.
The VD6283TX can stream the following data continuously: ALS color data over the I2C interface and raw flicker data over the AN pin of the mikroBUS™ socket. It also possesses an additional interrupt signal, routed on the INT pin of the mikroBUS™ socket labelled as INT, indicating when a specific interrupt event occurs.
The Spectrometer 2 Click Board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used, as a reference, for further development.
SPECIFICATIONS
Type | Optical |
Applications | Can be used for screen brightness adjustment and white balance color assistance, lux and CCT measurement, or light frequency extraction for flicker correction assistance |
On-board modules | VD6283TX - hybrid filter multispectral sensor with light flicker engine from STMicroelectronics |
Key Features | Advanced hybrid filters with high photocount response, parallel sensing of all six channels, innovative readout architecture to extract AC light flicker signal, from 100Hz to 2kHz frequency detection - sine or square wave, low power consumption, and more |
Interface | Analog,I2C |
Compatibility | mikroBUS |
Click board size | S (28.6 x 25.4 mm) |
Input Voltage | 3.3V |
PINOUT DIAGRAM
This table shows how the pinout of the Spectrometer 2 Click Board™ corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
Raw Flicker Data | AN | 1 | AN | PWM | 16 | NC | |
NC | 2 | RST | INT | 15 | INT | Interrupt | |
NC | 3 | CS | RX | 14 | NC | ||
NC | 4 | SCK | TX | 13 | NC | ||
NC | 5 | MISO | SCL | 12 | SCL | I2C Clock | |
NC | 6 | MOSI | SDA | 11 | SDA | I2C Data | |
Power Supply | 3.3V | 7 | 3.3V | 5V | 10 | NC | |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED Indicator |
SPECTROMETER 2 CLICK ELECTRICAL SPECIFICATIONS
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | - | 3.3 | - | V |
Peak Wavelength (R/G/B/VIS/IR/C) | 610/550/470/560/820/680 | nm | ||
AC Flicker Frequency Detection Range | 100 | - | 2000 | Hz |
Resolution | 16 | - | 24 | bit |
Operating Temperature Range | -30 | +25 | +85 | °C |
Software Support
We provide a library for the Spectrometer 2 Click Board™ as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
The package can be downloaded/installed directly from NECTO Studio The package Manager (recommended), downloaded from our LibStock™ or found on MikroE Github account.
Library Description
This library contains API for the Spectrometer 2 Click Board™ driver.
Key functions
-
spectrometer2_get_data
This function reads data from 6 ALS channels (Red, Visible, Blue, Green, IR, Clear). -
spectrometer2_rgbc_to_hsl
This function converts RGBC (red, green, blue, clear) to HSL (hue, saturation, lightness) color value. -
spectrometer2_get_color
This function returns the color name flag from the input HSL color.
Example Description
This example demonstrates the use of Sthe Spectrometer 2 Click Board™ by reading data from 6 ALS channels and converting them to HSL color and displaying those data as well as the detected color name on the USB UART.
void application_task ( void )
{
// Wait for the data ready interrupt indication
while ( !spectrometer2_get_int_pin ( &spectrometer2 ) );
spectrometer2_als_channels_t als_channels;
if ( ( SPECTROMETER2_OK == spectrometer2_clear_interrupt ( &spectrometer2 ) ) &&
( SPECTROMETER2_OK == spectrometer2_get_data ( &spectrometer2, &als_channels ) ) )
{
spectrometer2_hsl_t hsl;
spectrometer2_rgbc_to_hsl( &als_channels, &hsl );
log_printf ( &logger, "rn Hue: %.1f degrn", hsl.hue );
log_printf ( &logger, " Saturation: %.1f %%rn", hsl.saturation );
log_printf ( &logger, " Lightness: %.1f %%rn", hsl.lightness );
switch ( spectrometer2_get_color ( &hsl ) )
{
case SPECTROMETER2_RED_COLOR:
{
log_printf( &logger, " Color: REDrn" );
break;
}
case SPECTROMETER2_YELLOW_COLOR:
{
log_printf( &logger, " Color: YELLOWrn" );
break;
}
case SPECTROMETER2_GREEN_COLOR:
{
log_printf( &logger, " Color: GREENrn" );
break;
}
case SPECTROMETER2_CYAN_COLOR:
{
log_printf( &logger, " Color: CYANrn" );
break;
}
case SPECTROMETER2_BLUE_COLOR:
{
log_printf( &logger, " Color: BLUErn" );
break;
}
case SPECTROMETER2_MAGENTA_COLOR:
{
log_printf( &logger, " Color: MAGENTArn" );
break;
}
case SPECTROMETER2_WHITE_COLOR:
{
log_printf( &logger, " Color: WHITErn" );
break;
}
case SPECTROMETER2_BLACK_COLOR:
{
log_printf( &logger, " Color: BLACKrn" );
break;
}
default:
{
log_printf( &logger, " Color: UNKNOWNrn" );
break;
}
}
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio The 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.Spectrometer2
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART Click Board™, 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 MikroElektronika compilers.
MIKROSDK
The Spectrometer 2 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.
Software Support
We provide a library for the Spectrometer 2 Click Board™ as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
The package can be downloaded/installed directly from NECTO Studio The package Manager (recommended), downloaded from our LibStock™ or found on MikroE Github account.
Library Description
This library contains API for the Spectrometer 2 Click Board™ driver.
Key functions
-
spectrometer2_get_data
This function reads data from 6 ALS channels (Red, Visible, Blue, Green, IR, Clear). -
spectrometer2_rgbc_to_hsl
This function converts RGBC (red, green, blue, clear) to HSL (hue, saturation, lightness) color value. -
spectrometer2_get_color
This function returns the color name flag from the input HSL color.
Example Description
This example demonstrates the use of Sthe Spectrometer 2 Click Board™ by reading data from 6 ALS channels and converting them to HSL color and displaying those data as well as the detected color name on the USB UART.
void application_task ( void )
{
// Wait for the data ready interrupt indication
while ( !spectrometer2_get_int_pin ( &spectrometer2 ) );
spectrometer2_als_channels_t als_channels;
if ( ( SPECTROMETER2_OK == spectrometer2_clear_interrupt ( &spectrometer2 ) ) &&
( SPECTROMETER2_OK == spectrometer2_get_data ( &spectrometer2, &als_channels ) ) )
{
spectrometer2_hsl_t hsl;
spectrometer2_rgbc_to_hsl( &als_channels, &hsl );
log_printf ( &logger, "rn Hue: %.1f degrn", hsl.hue );
log_printf ( &logger, " Saturation: %.1f %%rn", hsl.saturation );
log_printf ( &logger, " Lightness: %.1f %%rn", hsl.lightness );
switch ( spectrometer2_get_color ( &hsl ) )
{
case SPECTROMETER2_RED_COLOR:
{
log_printf( &logger, " Color: REDrn" );
break;
}
case SPECTROMETER2_YELLOW_COLOR:
{
log_printf( &logger, " Color: YELLOWrn" );
break;
}
case SPECTROMETER2_GREEN_COLOR:
{
log_printf( &logger, " Color: GREENrn" );
break;
}
case SPECTROMETER2_CYAN_COLOR:
{
log_printf( &logger, " Color: CYANrn" );
break;
}
case SPECTROMETER2_BLUE_COLOR:
{
log_printf( &logger, " Color: BLUErn" );
break;
}
case SPECTROMETER2_MAGENTA_COLOR:
{
log_printf( &logger, " Color: MAGENTArn" );
break;
}
case SPECTROMETER2_WHITE_COLOR:
{
log_printf( &logger, " Color: WHITErn" );
break;
}
case SPECTROMETER2_BLACK_COLOR:
{
log_printf( &logger, " Color: BLACKrn" );
break;
}
default:
{
log_printf( &logger, " Color: UNKNOWNrn" );
break;
}
}
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio The 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.Spectrometer2
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART Click Board™, 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 MikroElektronika compilers.
MIKROSDK
The Spectrometer 2 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.
Spectrometer 2 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.