TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139263 times)
  2. FAT32 Library (71752 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47431 times)
  5. Network WiFi Library (43092 times)
  6. FT800 Library (42407 times)
  7. GSM click (29835 times)
  8. mikroSDK (28080 times)
  9. PID Library (26886 times)
  10. microSD click (26198 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: 25 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

External Memory

22

Contains libraries for working with 24C02 EEPROM memory, low-voltage serial flash memory M25P80 and serial SRAM 23K640 device.

[Learn More]

TempHum 10 Click

0

Temp&Hum 10 Click is a smart temperature and humidity sensing Click board™, aimed towards IoT applications, due to its extremely small size and very low power consumption.

[Learn More]

WaterDetect click

10

Water Detect click is used for detecting water and other electroconductive liquids. All you need to do is splash or soak the upper part of the click board, and the output of Microchip's MCP606 compactor will go positive, signaling the presence of liquid.

[Learn More]