TOP Contributors

  1. MIKROE (2730 codes)
  2. Alcides Ramos (369 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (116 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 (138642 times)
  2. FAT32 Library (71283 times)
  3. Network Ethernet Library (56793 times)
  4. USB Device Library (47127 times)
  5. Network WiFi Library (42856 times)
  6. FT800 Library (42100 times)
  7. GSM click (29663 times)
  8. mikroSDK (27527 times)
  9. PID Library (26788 times)
  10. microSD click (26020 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-08-13

Package Version: 2.1.0.1

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 16 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

Pressure 20 click

0

Pressure 20 Click is a compact add-on board that contains a board-mount pressure sensor. This board features the ICP-20100, a high-accuracy digital barometric pressure and temperature sensor from TDK InvenSense. The ICP-20100 is based on MEMS capacitive technology with ultra-low noise, low power consumption, and temperature stability alongside programmable output: all-pressure, all-temperature, or pressure and temperature output. It converts output data into a 20-bit digital value and sends the information via a configurable host interface that supports SPI and I2C serial communications. It measures pressure from 30kPa up to 110kPa with an accuracy of ±20Pa over a wide operating temperature range.

[Learn More]

3G Sara click

6

3G SARA click is a mikroBUS add-on board with the smallest UMTS/HSPA cellular modem available today. Click board carries SARA-U201 3G module accessible through UART interface capable to transmit/receive data, SMS and calls.

[Learn More]

Balancer 2 click

5

Balancer 2 Click is an overvoltage protection device for a 2-series cell lithium-ion battery. Click contains two separate overvoltage battery detection circuits and automatic cell imbalance correction.

[Learn More]