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.
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.