Labs / Electronic modules

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

Author: Li Zisheng · Source: FreakStudio open documentation, v1.4 · License: CC BY 4.0 · Driver code (sensors/pir_driver): MIT License

Contents
GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)
GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

I. Module Introduction

The infrared pyroelectric human proximity sensor module based on L916 is an L916 -based infrared pyroelectric human proximity sensor module. With the L916 pyroelectric probe as the core, it integrates a 5V to 3.3V power supply circuit, a power indicator, filter capacitors and wiring terminals, and outputs human proximity detection signals via the DIN interface. It can accurately detect the presence of the human body and is suitable for scenarios such as smart sensing devices and security systems.

II. Introduction to Main Chips

2.1 Chip Overview

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)
GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

2.2 Pin Definition

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

2.3 Functional Block Diagram

The following functional block diagram illustrates the internal signal processing flow of the L916-based infrared pyroelectric sensor:

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

The functions of each module are as follows:

2.4 Performance Parameters

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)
GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)
GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)
GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

This graph shows the transmittance curve of a typical 5.5μm infrared filter, with the horizontal axis representing wavelength (nm) and the vertical axis representing transmittance (T %). As the curve demonstrates, this filter in the wavelength range from 5000nm (5μm) to 13000nm (13μm) features a high infrared transmittance, which can effectively screen out the infrared radiation of the human body (with a peak at approximately 10μm). It provides optical support for the accurate detection of the human body by infrared pyroelectric sensors, ensuring that only infrared signals in the target wavelength band can pass through, thus improving the accuracy of human proximity detection.

2.5 Reference Circuit

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

This typical application circuit is a human body detection system based on XYC-PIR223D infrared pyroelectric sensor, which integrates power conversion (HI7133 converts 12V to 3.3V to power the sensor), signal filtering and protection (diode rectifier bridge, voltage regulator tube, RC filtering), human body detection (XYC-PIR223D module) and control output (triode, relay drive) and other links, realizing the complete functions from power supply, signal conditioning to human induction trigger execution, which is suitable for intelligent control scenarios of infrared human body induction (such as automatic lighting, security trigger, etc.).

2.6 Chip Configuration

None.

None.

2.8 PCB Routing Precautions

None.

III. Instructions for Circuit Engineering and Module Usage

3.1 Circuit Source Engineering

To obtain the source code of the circuit, please follow the official account [Freak Embedded]

3.2 Module Usage Instructions

The schematic diagram of this module is shown below:

SCH_L916-Based Infrared Pyroelectric Human Proximity Sensor Module_v1.0_2025-10-23.pdf 2.3 MB

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

This module provides a signal output interface DIN: this interface is used to output the digital signal of human proximity detection.

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)
GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

Its working principle is as follows: the infrared thermal radiation of the human body is focused by the Fresnel lens and then received by the L916 pyroelectric probe and converted into an electrical signal; internally, the analog signal is first digitized by the ADC, and then the characteristic frequency signal of human movement is filtered out by a band-pass filter (BPF), and the judgment is made in combination with the comparator and the alarm event logic. When the detection signal exceeds the set threshold, if two counting pulses are generated within 4 seconds, or a single pulse exceeds 5 times the threshold, the DIN interface will output a high level;This signal accurately reflects the movement trigger state of a human body within the detection area, provides external devices (such as a microcontroller) with digital feedback on human proximity, and realizes the complete human body induction logic covering infrared signal acquisition, internal processing and signal output.

3.3 Application Experiment

Here, we use the GraftPort-RP2040 development board for testing, and connect the L916-based pyroelectric infrared human proximity sensor module to communicate with the main controller via the DIO interface.

Here, we first use the HY2.0-4P cable to connect the module to the GraftPort-RP2040 development board's DIO0 interface:

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

The module connections are shown in the following table:

Development Board Pins

Module Pins

Description

Pin 6

DIN

Signal input pins of the modules on the MCU

Pin 7

NC

-

Here, we need to search for relevant driver packages on uPyPI: https://upypi.net/zh/

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

Enter pir_driver to search, and the following will be displayed:

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

Click to copy the local installation command:

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

Here, we can use the mip tool to import module driver library code. Below are the usage commands for the mpremote tool:

mpremote mip install github:FreakStudioCN/GraftSense-Drivers-MicroPython/sensors/pir_driver

Import the PIR Motion Sensor - MicroPython Driver Code, then copy the following main.py code into our project:

# Python env   : MicroPython v1.23.0
# -*- coding: utf-8 -*-
# @Time    : 2025/8/29 6:47 PM
# @Author  : 缪贵成
# @File    : main1.py
# @Description : Test file for the infrared human pyroelectric sensor driver

# ======================================== Import related modules =========================================\

from pir_sensor import PIRSensor
import time

# ======================================== Global Variables ============================================

# ======================================== Functions ============================================

def motion_callback():
    """
    Callback function

    ==========================================

    callback function
    """
    print("Motion detected!")

# ======================================== Custom Classes ============================================

# ======================================== Initialization configuration ===========================================

# Power-on delay of 3 s
time.sleep(3)
print("FreakStudio : Infrared human body pyro-release sensor test")

# Create the infrared human pyroelectric sensor object
pir = PIRSensor(pin=6, callback=motion_callback)

# ========================================  Main Program  ============================================

# Prompt the user to come closer
print("Waiting for motion...")
# Block and wait, no timeout
detected = pir.wait_for_motion(timeout=20)

if detected:
    # Block and wait for motion to be detected
    print("Motion detected via blocking wait!")
else:
    print("Timeout, no motion detected.")

To flash the code, open a terminal and use the mpremote tool to connect to the main controller; the output is as follows:

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)

It can be seen that when a human body is detected, the sensor outputs a corresponding level signal, which triggers the interrupt callback function. Meanwhile, the trigger indicator status light on the module LED2 lights up:

IV. Drivers

pir_driver.zip 9 KB

None.

VI. Revision History

Document Version

Date of Revision

Modifier

Revised Content

v1.0

2025-8-31

Hou Junhan

Zero Kōkō

Initialize the document

v1.1

2025-10-23

Li Zisheng

Added PCB layout precautions for Version 2.8

Revised Section 3, Instructions for Circuit Source Project and Module Usage, and added a secondary heading:

3.1 Circuit Source Engineering, 3.2 Module Usage Instructions, 3.3 Application Experiments

The BOM sheet has not been finally checked, the driver has not been re-verified, and the 3.3 application experiment

Not yet specified.

v1.2

2025-12-29

Li Zisheng

Added application experiments and production files

v1.3

2025-12-31

Xin Ruili

Create an open-version document based on the internal document version v1.2.

v1.4

2026-03-29

Xin Ruili

Modified the application experiment section

VII. Relevant Materials

7.1 Chip Datasheet

C2887901_Human Body Sensor_PIR223D-S0_Datasheet_WJ236843.PDF 910 KB

7.2 Unique Icons for PCB Silk Screen

GraftSense - L916-based Infrared Pyroelectric Human Proximity Sensor Module (Open Version)