TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139560 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57254 times)
  4. USB Device Library (47609 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42551 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26930 times)
  10. microSD click (26309 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Light mix-sens Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.12

mikroSDK Library: 2.0.0.0

Category: Optical

Downloaded: 142 times

Not followed.

License: MIT license  

Light mix-sens Click is carrying TMD37253, an advanced proximity measurement, color sense (RGBC+IR), and digital ambient light sensing (ALS) device. The TMD37253 slim module package has been designed to accommodate a “single hole” aperture approach that 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 photodiode detection of reflected IR energy (sourced by the integrated LED). The ALS detection feature provides photopic light intensity data. The color photodiodes have UV and IR blocking filters and a dedicated data converters producing 16-bit data.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Light mix-sens Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Light mix-sens Click" changes.

Do you want to report abuse regarding "Light mix-sens Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


Light mix sens Click

Light mix-sens Click is carrying TMD37253, an advanced proximity measurement, color sense (RGBC+IR), and digital ambient light sensing (ALS) device. The TMD37253 slim module package has been designed to accommodate a “single hole” aperture approach that 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 photodiode detection of reflected IR energy (sourced by the integrated LED). The ALS detection feature provides photopic light intensity data. The color photodiodes have UV and IR blocking filters and a dedicated data converters producing 16-bit data.

lightmixsens_click.png

Click Product page


Click library

  • Author : MikroE Team
  • Date : jul 2020.
  • Type : I2C type

Software Support

We provide a library for the LightMixSens Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for LightMixSens Click driver.

Standard key functions :

  • lightmixsens_cfg_setup Config Object Initialization function.

    void lightmixsens_cfg_setup ( lightmixsens_cfg_t *cfg );
  • lightmixsens_init Initialization function.

    err_t lightmixsens_init ( lightmixsens_t *ctx, lightmixsens_cfg_t *cfg );
  • lightmixsens_default_cfg Light mix sens default configuration function.

    void lightmixsens_default_cfg ( lightmixsens_t *ctx );

Example key functions :

  • lightmixsens_write_byte Generic Write Byte function.

    err_t lightmixsens_write_byte ( lightmixsens_t *ctx, uint8_t reg_addr, uint8_t data_in );
  • lightmixsens_read_byte Generic Read Byte function.

    err_t lightmixsens_read_byte ( lightmixsens_t *ctx, uint8_t reg_addr, uint8_t *data_out );
  • lightmixsens_switch_ir_to_prox Switch IR To Proximity function.

    void lightmixsens_switch_ir_to_prox ( lightmixsens_t *ctx );

Examples Description

This example show usage of Light Mix Sens Click. It switches the IR light for separate and measure sectar of RGB lights. Click also measure proximity from the object using light source.

The demo application is composed of two sections :

Application Init

Initializes all necessary peripherals and pins, initializes I2C driver and performs the Click board default configuration to allow ALS/Color and Proximity measurements.


void application_init ( void )
{
    log_cfg_t log_cfg;
    lightmixsens_cfg_t cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    lightmixsens_cfg_setup( &cfg );
    LIGHTMIXSENS_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    lightmixsens_init( &lightmixsens, &cfg );

    lightmixsens_default_cfg( &lightmixsens );

    lightmixsens_cdata = LIGHTMIXSENS_DUMMY_DATA;
    lightmixsens_rdata = LIGHTMIXSENS_DUMMY_DATA;
    lightmixsens_gdata = LIGHTMIXSENS_DUMMY_DATA;
    lightmixsens_bdata = LIGHTMIXSENS_DUMMY_DATA;
    lightmixsens_pdata = LIGHTMIXSENS_DUMMY_DATA;

    log_printf( &logger, "*  Light mix-sens Click initialization done.  *\r\n" );
}

Application Task

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 ( void )
{
    lightmixsens_wait_atime( &lightmixsens );

    lightmixsens_read_word( &lightmixsens, LIGHTMIXSENS_REG_CDATA, &lightmixsens_cdata );
    lightmixsens_read_word( &lightmixsens, LIGHTMIXSENS_REG_RDATA, &lightmixsens_rdata );
    lightmixsens_read_word( &lightmixsens, LIGHTMIXSENS_REG_GDATA_IRDATA, &lightmixsens_gdata );
    lightmixsens_read_word( &lightmixsens, LIGHTMIXSENS_REG_BDATA, &lightmixsens_bdata );
    lightmixsens_read_byte( &lightmixsens, LIGHTMIXSENS_REG_PDATA, &lightmixsens_pdata );

    log_printf( &logger, "- Clear light:  %d lx\r\n", lightmixsens_cdata );
    log_printf( &logger, "- Red light:    %d lx\r\n", lightmixsens_rdata );
    log_printf( &logger, "- Green light:  %d lx\r\n", lightmixsens_gdata );
    log_printf( &logger, "- Blue light:   %d lx\r\n", lightmixsens_bdata );

    prox_app( );
    log_printf( &logger, "** Proximity:   %s\r\n", prox_str );

    log_printf( &logger, "\r\n" );
    Delay_ms ( 1000 );
} 

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.LightMixSens

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.


ALSO FROM THIS AUTHOR

Compass 8 Click

0

Compass 8 Click is a compact add-on board designed for precise compass applications. This board features the AK09919, a 3-axis electronic compass IC from AKM Semiconductor. The AK09919 is based on high-sensitivity Hall sensor technology for detecting terrestrial magnetism across the X, Y, and Z axes, has multiple operational modes, a built-in oscillator, and a Power On Reset circuit. It also includes a magnetic sensor overflow monitor and a 16-sample FIFO data buffer for efficient data handling.

[Learn More]

EERAM 5v click

5

Add memory to your project with EERAM 5V click. It carries the 47L16/47C16 I2C serial EERAM from Microchip. The click is designed to run on a 5V power supply. It communicates with the target microcontroller over I2C interface, with additional functionality provided by the INT pin on the mikroBUSâ„¢ line.

[Learn More]

Charger 17 Click

0

Charger 17 Click is a compact add-on board that provides a single-cell battery charging solution. This board features the RT9471, a 3A single-cell switching battery charger from Richtek. It is a highly-integrated battery charge and system power-path management device for single-cell Li-Ion and Li-Polymer batteries. The high-efficiency 1.5MHz synchronous switch-mode buck charger achieves up to 92% charge efficiency at 2A with 5V input and 3.8V battery.

[Learn More]