TOP Contributors

  1. MIKROE (2665 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 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 (137160 times)
  2. FAT32 Library (70288 times)
  3. Network Ethernet Library (56159 times)
  4. USB Device Library (46482 times)
  5. Network WiFi Library (42150 times)
  6. FT800 Library (41450 times)
  7. GSM click (29146 times)
  8. mikroSDK (26595 times)
  9. PID Library (26519 times)
  10. microSD click (25529 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

Proximity 16 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.10

mikroSDK Library: 2.0.0.0

Category: Proximity

Downloaded: 84 times

Not followed.

License: MIT license  

Proximity 16 Click is a compact add-on board that contains a close-range proximity sensing solution. This board features the VL53L5CX, a Time-of-Flight (ToF) multizone ranging sensor from STMicroelectronics. The VL53L5CX integrates a SPAD array, physical infrared filters, and diffractive optical elements (DOE) to achieve the best-ranging performance in various ambient lighting conditions with different cover glass materials. It allows absolute distance measurement, whatever the target color and reflectance, provides accurate ranging up to 400cm, and can work at fast speeds (60Hz). Also, multizone distance measurements are possible with either 4x4 or 8x8 separate zones with broad 63° diagonal software-configurable Field-of-View (FoV).

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Proximity 16 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Proximity 16 click" changes.

Do you want to report abuse regarding "Proximity 16 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Proximity 16 click

Proximity 16 Click is a compact add-on board that contains a close-range proximity sensing solution. This board features the VL53L5CX, a Time-of-Flight (ToF) multizone ranging sensor from STMicroelectronics. The VL53L5CX integrates a SPAD array, physical infrared filters, and diffractive optical elements (DOE) to achieve the best-ranging performance in various ambient lighting conditions with different cover glass materials. It allows absolute distance measurement, whatever the target color and reflectance, provides accurate ranging up to 400cm, and can work at fast speeds (60Hz). Also, multizone distance measurements are possible with either 4x4 or 8x8 separate zones with broad 63° diagonal software-configurable Field-of-View (FoV).

proximity16_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Jul 2022.
  • Type : I2C type

Software Support

We provide a library for the Proximity 16 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for Proximity 16 Click driver.

Standard key functions :

  • proximity16_cfg_setup Config Object Initialization function.

    void proximity16_cfg_setup ( proximity16_cfg_t *cfg );
  • proximity16_init Initialization function.

    err_t proximity16_init ( proximity16_t *ctx, proximity16_cfg_t *cfg );
  • proximity16_default_cfg Click Default Configuration function.

    err_t proximity16_default_cfg ( proximity16_t *ctx );

Example key functions :

  • proximity16_get_int_pin This function returns the INT pin logic state.

    uint8_t proximity16_get_int_pin ( proximity16_t *ctx );
  • proximity16_get_resolution This function gets the current resolution (4x4 or 8x8).

    err_t proximity16_get_resolution ( proximity16_t *ctx, uint8_t *resolution );
  • proximity16_get_ranging_data This function gets the ranging data, using the selected output and the resolution.

    err_t proximity16_get_ranging_data ( proximity16_t *ctx, proximity16_results_data_t *results );

Example Description

This example demonstrates the use of Proximity 16 click board by reading and displaying 8x8 zones measurements on the USB UART.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the click default configuration.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    proximity16_cfg_t proximity16_cfg;  /**< Click config object. */

    /** 
     * 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.
    proximity16_cfg_setup( &proximity16_cfg );
    PROXIMITY16_MAP_MIKROBUS( proximity16_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == proximity16_init( &proximity16, &proximity16_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( PROXIMITY16_ERROR == proximity16_default_cfg ( &proximity16 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Reads all zone measurements approximately every 500ms and logs them to the USB UART as an 8x8 map. The silicon temperature measurement in degrees Celsius is also displayed.

void application_task ( void )
{
    if ( !proximity16_get_int_pin ( &proximity16 ) )
    {
        proximity16_results_data_t results;
        uint8_t resolution, map_side;
        err_t error_flag = proximity16_get_resolution ( &proximity16, &resolution );
        error_flag |= proximity16_get_ranging_data ( &proximity16, &results );
        if ( PROXIMITY16_OK == error_flag )
        {
            map_side = ( PROXIMITY16_RESOLUTION_4X4 == resolution ) ? 4 : 8;
            log_printf ( &logger, "\r\n %ux%u MAP (mm):\r\n", ( uint16_t ) map_side, ( uint16_t ) map_side );
            for ( uint16_t cnt = 1; cnt <= resolution; cnt++ )
            {
                log_printf ( &logger, " %u\t", results.distance_mm[ cnt - 1 ] );
                if ( 0 == ( cnt % map_side ) )
                {
                    log_printf ( &logger, "\r\n" );
                }
            }
            log_printf ( &logger, " Silicon temperature : %d degC\r\n", ( int16_t ) results.silicon_temp_degc );
        }
    }
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Proximity16

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


ALSO FROM THIS AUTHOR

EnOcean 3 click

5

EnOcean 3 Click carries a ultra-low power TCM515 transceiver gateway module which operates at 868MHz radio band, perfectly suited for the realization of transceiver gateways, actuators and controllers for systems communicating based on the EnOcean radio standard.

[Learn More]

Hydrogen click

0

Hydrogen click carries an MQ-8 sensor for hydrogen (H2). The gas sensing layer on the sensor unit is made of tin dioxide (SnO2), which has lower conductivity in clean air.

[Learn More]

Charger 18 click

0

Charger 18 Click is a compact add-on board representing a single-cell battery charger. This board features the LTC3553, a micropower, highly integrated power management, and battery charger for single-cell Li-Ion/Polymer battery applications from Analog Devices. Designed specifically for USB applications, it also includes a PowerPath manager with automatic load prioritization and input current limit, a battery charger, and numerous internal protection features. It also indicates a battery charge state, and it comes with a synchronous 200mA buck regulator and a 150mA low dropout linear regulator (LDO).

[Learn More]