TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (392 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (123 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 (140531 times)
  2. FAT32 Library (73021 times)
  3. Network Ethernet Library (58016 times)
  4. USB Device Library (48211 times)
  5. Network WiFi Library (43821 times)
  6. FT800 Library (43292 times)
  7. GSM click (30343 times)
  8. mikroSDK (28983 times)
  9. PID Library (27106 times)
  10. microSD click (26703 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

PIR 3 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.2

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 38 times

Not followed.

License: MIT license  

PIR 3 Click is a compact add-on board designed for efficient and reliable motion detection in various applications. This board features the ZDP323B1 sensor from Zilog (Littelfuse), with high EMI immunity and precise motion detection capabilities. It includes a spectral filter window tuned to an 8-13um wavelength, dual sensing elements with a 0.6mm spacing, and a field of view of 148° on the X-axis and 136° on the Y-axis. The board also integrates the ZNCL10S PIR lens for maximum IR transmissivity and includes the Click Snap feature for flexible implementation.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "PIR 3 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "PIR 3 Click" changes.

Do you want to report abuse regarding "PIR 3 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


PIR 3 Click

PIR 3 Click is a compact add-on board designed for efficient and reliable motion detection in various applications. This board features the ZDP323B1 sensor from Zilog (Littelfuse), with high EMI immunity and precise motion detection capabilities. It includes a spectral filter window tuned to an 8-13um wavelength, dual sensing elements with a 0.6mm spacing, and a field of view of 148° on the X-axis and 136° on the Y-axis. The board also integrates the ZNCL10S PIR lens for maximum IR transmissivity and includes the Click Snap feature for flexible implementation.

pir3_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Jun 2024.
  • Type : I2C type

Software Support

We provide a library for the PIR 3 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 PIR 3 Click driver.

Standard key functions :

  • pir3_cfg_setup Config Object Initialization function.

    void pir3_cfg_setup ( pir3_cfg_t *cfg );
  • pir3_init Initialization function.

    err_t pir3_init ( pir3_t *ctx, pir3_cfg_t *cfg );
  • pir3_default_cfg Click Default Configuration function.

    err_t pir3_default_cfg ( pir3_t *ctx );

Example key functions :

  • pir3_set_detection_level This function sets the detection threshold level in the ctx->config structure.

    void pir3_set_detection_level ( pir3_t *ctx, uint8_t detlvl );
  • pir3_write_config This function writes a config structure to the sensor by using I2C serial interface.

    err_t pir3_write_config ( pir3_t *ctx );
  • pir3_read_peak_hold This function reads a 12-bit signed peak hold data by using I2C serial interface.

    err_t pir3_read_peak_hold ( pir3_t *ctx, int16_t *peak_hold );

Example Description

This example demonstrates the use of PIR 3 Click board by reading and displaying the peak hold tracking data.

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. */
    pir3_cfg_t pir3_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.
    pir3_cfg_setup( &pir3_cfg );
    PIR3_MAP_MIKROBUS( pir3_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == pir3_init( &pir3, &pir3_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( PIR3_ERROR == pir3_default_cfg ( &pir3 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

Reads the peak hold tracking data every 100ms and displays the results on the USB UART.

void application_task ( void )
{
    int16_t peak_hold = 0;
    if ( PIR3_OK == pir3_read_peak_hold ( &pir3, &peak_hold ) )
    {
        log_printf( &logger, " PEAK HOLD: %d\r\n\n", peak_hold );
        Delay_ms ( 100 );
    }
}

Note

In order to establish communication with the sensor, some of the supported MCUs may require the I2C lines to be pulled up additionally either with the external or internal weak pull-up resistor.

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

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

Single Wire CAN click

5

Single Wire CAN Click is a compact add-on board that contains an IC for a single wire data link capable of operating with various protocols such as the Controller Area Network (CAN).

[Learn More]

AD-SWIO 2 click

5

AD-SWIO 2 Click is a Click board equipped with the AD74413R, from Analog Devices. The AD74413R is a quad-channel software configurable input/output solution for building and process control applications. The device provides a fully integrated single chip solution for input and output operation.

[Learn More]

Multi Stepper TB67S269 Click

0

Multi Stepper Click is a compact add-on board that contains a bipolar stepper motor driver. This board features the TB67S269FTG, CLOCK-in controlled bipolar stepping motor driver from Toshiba Semiconductor. It supports a PWM constant-current control drive and allows from full-step up to 1/32 steps resolution for less motor noise and smoother control. It has a wide operating voltage range of 10V to 47V with an output current capacity of 1.4A in addition to several built-in error detection circuits.

[Learn More]