Licht Mix-Sens Click-Platine
Licht Mix-Sens Click-Platine
Das Light Mix-Sens Click Board ™ basiert auf dem TMD37253, einem fortschrittlichen Gerät zur Näherungsmessung, Farberkennung (RGBC+IR) und digitalen Umgebungslichterkennung (ALS). Das schlanke Modulpaket TMD37253 wurde für eine „Einzelloch“-Blendenkonstruktion mit einer IR-LED und einem werkseitig kalibrierten LED-Treiber entwickelt.
Die Annäherungserkennungsfunktion ermöglicht die Objekterkennung (z. B. Bildschirm eines Mobilgeräts am Ohr des Benutzers) durch Photodiodenerkennung der reflektierten IR-Energie (von der integrierten LED erzeugt). Die ALS-Erkennungsfunktion liefert Daten zur photopischen Lichtintensität. Die Farbphotodioden verfügen über UV- und IR-Sperrfilter und dedizierte Datenkonverter, die 16-Bit-Daten erzeugen. Diese Architektur ermöglicht Anwendungen die genaue Messung des Umgebungslichts, sodass Geräte Beleuchtungsstärke und Farbtemperatur berechnen können, um die Hintergrundbeleuchtung und Farbart des Displays zu steuern.
Der Light Mix-Sens Click Board™ wird von einer mikroSDK-kompatiblen Bibliothek unterstützt, die Funktionen enthält, die die Softwareentwicklung vereinfachen. Dieses Click Board™ ist ein gründlich getestetes Produkt und kann auf einem System verwendet werden, das mit der mikroBUS™-Buchse ausgestattet ist.
How Does The Light Mix-Sens Click Board™ Work?
The Light Mix-Sens Click Board™ features advanced proximity measurement, colour sense (RGBC+IR), and digital ambient light sensing (ALS). The TMD37253 slim module, from AMS, incorporates an IR LED and factory calibrated LED driver. The proximity detection feature provides object detection (e.g. mobile device screen to the user's ear) by photo-diode detection of reflected IR energy (sourced by the integrated LED). Detect/release events are interrupt-driven, and occur when proximity result crosses upper and/or lower threshold settings. The proximity engine features offset adjustment registers to compensate for unwanted IR energy reflection at the sensor. Proximity results are further improved by automatic ambient light subtraction. The ALS detection feature provides photopic light intensity data. The colour photodiodes have UV and IR blocking filters and a dedicated data converters producing 16-bit data. This architecture allows applications to accurately measure ambient light which enables devices to calculate illuminance and colour temperature to control display backlight and chromaticity.
Proximity results are affected by three fundamental factors: the integrated IR LED emission, IR reception, and environmental factors, including target distance and surface reflectivity. The IR reception signal path begins with IR detection from a photodiode and ends with the 8-bit proximity result in the PDATA register. A signal from the photodiode is amplified, and offset adjusted to optimize performance. Offset correction or cross-talk compensation is accomplished by adjustment to the POFFSET register. The analog circuitry of the device applies the offset value as a subtraction to the signal accumulation; therefore a positive offset value has the effect of decreasing the results.
The colour and ALS reception signal path begins as photodiodes receive filtered light and ends with 16-bit results. The IR photodiode primarily used for proximity sensing is multiplexed with the green channel's ADC to measure the IR content of ambient light. The colour photodiodes are filtered with UV and IR filters. The IR photodiode is filtered to receive only IR. A signal from the RGBC photodiodes simultaneously accumulate for a period of time set by the value in ATIME before the results are available. Measurement of IR must be done in a separate integration because it shares the ADC with the green photodiode. Gain is adjustable from 1x to 128 x to facilitate the operation over a wide range of lighting conditions. Custom LUX equations are used to calculate the amount of ambient light, color temperature, as well as, determine the light type (e.g. LED, fluorescent, incandescent, etc.) using the ALS results.
The TMD37253 module operates at 1.8V power supply with 1.8V I2C bus for reduced power consumption. For integration on mikroBUS, complete voltage regulation and logic level translation has been implemented. Therefore, the Light Mix-Sens Click Board™ is designed to be operated only with a 3.3V logic level. A proper logic voltage level conversion should be performed before the Click Board™ is used with MCUs with logic levels of 5V.
SPECIFICATIONS
Type | Optical |
Applications | The Light Mix-Sens Click Board™ can be used for ambient light sensing, single hole proximity sensing, mobile phone touch screen disable, colour temperature sensing to assist backlight, camera, and flash control. |
On-board modules | The Light Mix-Sens Click Board™ uses the TMD37253 IC, an advanced proximity measurement, color sense (RGBC+IR), and digital ambient light sensing (ALS) device, from AMS. |
Key Features | Accurate colour temperature and ambient light sensing, UV / IR blocking filters, 46° Average FOV, Photopic ambient light sensing (ALS), Programmable gain and integration time, Reduced power consumption. |
Interface | 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 on the Light Mix-Sens Click Board™ corresponds to the pinout on the mikroBUS socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 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 |
Software Support
We provide a library for the Light Mix-Sens Click Board™ 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
This library allows user to perform a communication with the Light Mix-Sens Click Board™. The user can measure the full spectral of light together with proximity measurement. By switching an IR diode, one of two possible IR measurements can be executed, the level of IR light can be measured, or the proximity, together with the all other channels. For more details, please, check the full documentation.
Key Functions
lightmixsens_err_t lightmixsens_write_byte( uint8_t reg_addr, uint8_t data_in );
- This function writes data byte to the selected register.lightmixsens_err_t lightmixsens_read_byte( uint8_t reg_addr, uint8_t *data_out );
- This function reads data byte from the selected register.void lightmixsens_switch_ir_to_green( void );
- This function switches the IR light to be measured in the Green channel (GDATA) register.
Example Description
The application is composed of three sections :
- System Initialization - Initializes all necessary peripherals and pins.
- Application Initialization - Initializes I2C driver and performs the Click Board™ default configuration to allow ALS/Color and Proximity measurements.
- Application Task - (code snippet) - Waits until ALS/Color integration cycle was done and then reads the entire measurement. The all results will be sent to the selected UART terminal.
void application_task( ) { lightmixsens_wait_atime( ); lightmixsens_read_word( LIGHTMIXSENS_REG_CDATA, &lightmixsens_cdata ); lightmixsens_read_word( LIGHTMIXSENS_REG_RDATA, &lightmixsens_rdata ); lightmixsens_read_word( LIGHTMIXSENS_REG_GDATA_IRDATA, &lightmixsens_gdata ); lightmixsens_read_word( LIGHTMIXSENS_REG_BDATA, &lightmixsens_bdata ); lightmixsens_read_byte( LIGHTMIXSENS_REG_PDATA, &lightmixsens_pdata ); WordToStr( lightmixsens_cdata, log_txt ); Ltrim( log_txt ); mikroBUS_logWrite( "- Clear light: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); WordToStr( lightmixsens_rdata, log_txt ); Ltrim( log_txt ); mikroBUS_logWrite( "- Red light: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); WordToStr( lightmixsens_gdata, log_txt ); Ltrim( log_txt ); mikroBUS_logWrite( "- Green light: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); WordToStr( lightmixsens_bdata, log_txt ); Ltrim( log_txt ); mikroBUS_logWrite( "- Blue light: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); prox_app( ); mikroBUS_logWrite( "** Proximity: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_LINE ); mikroBUS_logWrite( "", _LOG_LINE ); }
Additional Functions :
- prox_app - This is application function which determines the proximity results.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- Conversions
- C_String
- I2C
- UART
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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
The Light Mix-Sens 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 Light Mix-Sens Click Board™ 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
This library allows user to perform a communication with the Light Mix-Sens Click Board™. The user can measure the full spectral of light together with proximity measurement. By switching an IR diode, one of two possible IR measurements can be executed, the level of IR light can be measured, or the proximity, together with the all other channels. For more details, please, check the full documentation.
Key Functions
lightmixsens_err_t lightmixsens_write_byte( uint8_t reg_addr, uint8_t data_in );
- This function writes data byte to the selected register.lightmixsens_err_t lightmixsens_read_byte( uint8_t reg_addr, uint8_t *data_out );
- This function reads data byte from the selected register.void lightmixsens_switch_ir_to_green( void );
- This function switches the IR light to be measured in the Green channel (GDATA) register.
Example Description
The application is composed of three sections :
- System Initialization - Initializes all necessary peripherals and pins.
- Application Initialization - Initializes I2C driver and performs the Click Board™ default configuration to allow ALS/Color and Proximity measurements.
- Application Task - (code snippet) - Waits until ALS/Color integration cycle was done and then reads the entire measurement. The all results will be sent to the selected UART terminal.
void application_task( ) { lightmixsens_wait_atime( ); lightmixsens_read_word( LIGHTMIXSENS_REG_CDATA, &lightmixsens_cdata ); lightmixsens_read_word( LIGHTMIXSENS_REG_RDATA, &lightmixsens_rdata ); lightmixsens_read_word( LIGHTMIXSENS_REG_GDATA_IRDATA, &lightmixsens_gdata ); lightmixsens_read_word( LIGHTMIXSENS_REG_BDATA, &lightmixsens_bdata ); lightmixsens_read_byte( LIGHTMIXSENS_REG_PDATA, &lightmixsens_pdata ); WordToStr( lightmixsens_cdata, log_txt ); Ltrim( log_txt ); mikroBUS_logWrite( "- Clear light: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); WordToStr( lightmixsens_rdata, log_txt ); Ltrim( log_txt ); mikroBUS_logWrite( "- Red light: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); WordToStr( lightmixsens_gdata, log_txt ); Ltrim( log_txt ); mikroBUS_logWrite( "- Green light: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); WordToStr( lightmixsens_bdata, log_txt ); Ltrim( log_txt ); mikroBUS_logWrite( "- Blue light: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_TEXT ); mikroBUS_logWrite( " lx", _LOG_LINE ); prox_app( ); mikroBUS_logWrite( "** Proximity: ", _LOG_TEXT ); mikroBUS_logWrite( log_txt, _LOG_LINE ); mikroBUS_logWrite( "", _LOG_LINE ); }
Additional Functions :
- prox_app - This is application function which determines the proximity results.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- Conversions
- C_String
- I2C
- UART
Additional Notes and Information
Depending on the development board you are using, you may need a USB UART Click Board™, USB UART 2 Click Board™ or RS232 Click Board™ 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
The Light Mix-Sens 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.
Licht Mix-Sens Click-Platine
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.