Skip to content
Wish Lists Cart
0 items

News

YS312 Thermal Detection Infrared Sensor of Shenzhen Donglin High-tech Co., Ltd.

17 May 2025
YS312 Thermal Detection Infrared Sensor of Shenzhen Donglin High-tech Co., Ltd.

YS312 Pyroelectric Infrared Sensor

The YS312 is a sensor developed by the Senba brand. Below is an introduction covering its product overview, features, applications, performance parameters, and code snippet.


I. Product Overview

The YS312 is a pyroelectric infrared sensor that integrates an AD chip and a human body detection sensing element within an electromagnetic shielding case. The sensing element detects human movement signals and transmits them to the AD chip, which then performs signal acquisition and filtering to output a 16-bit digital signal. These signals are processed by a microcontroller via peripheral circuits to enable various functions.


II. Features

  • 16-bit digital signal output

  • Single-wire serial data communication

  • Low power consumption


III. Applications

  1. Consumer Electronics: Toys, digital photo frames, doorbells, TVs, refrigerators, air conditioners, etc.

  2. Smart Home & Security: Network cameras, personal alarms, car anti-theft systems, etc.

  3. Lighting Systems: Automatic on/off functionality for indoor, garden, corridor, and stairway lighting.


IV. Performance Parameters

1. Internal block diagram (not included in this text)

2. Working conditions
Power supply voltage: 2.2--5.5V
Working current: 5--20uA
ADC resolution: 16 bits
Detection wavelength: 14um
Low-pass filter cutoff frequency: 7Hz
High-pass filter cutoff frequency: 0.44Hz

#error Delete this line after defining the PIR pin function
#define PIR_PIN          // Definition of PIR pin
#define PIR_PIN_OUT      // Definition of PIR pin output mode
#define PIR_PIN_IN       // Definition of PIR pin input mode

#error Delete this line after defining MCU's enable/disable global interrupt functions
#define ENINT()          // Define to enable global interrupt
#define DISINT()         // Define to disable global interrupt

typedef unsigned char   u8;
typedef unsigned int    u16;  
typedef unsigned long   u32; 

u16 pirDataLast;  // Previous PIR data
u16 difference;   // Difference value

typedef struct
{
    u8 Timer1ms_F : 1;
}_Flag;

_Flag Flag;

void DelayUs(u8 nus)             
{
    #error Delete this line after implementing microsecond-level delay
}

/************************************************
*    @Function Name     : PIR_Read
*    @Description       : PIR data reading

1. PIR generates an interrupt signal approximately every 16ms (pulls the output pin high).
2. After detecting a PIR interrupt signal, it must stay high for at least 100μs before being forcibly pulled low.
3. The MCU's IO pin outputs low level for 4–8μs, then high level for 4–8μs,
   then switches to input mode to read 1 bit of data (high bits are read first).
   The total time of pulling low + high + reading 1 bit should not exceed 31.25μs (recommended not to exceed 25μs).
4. Repeat step 3 until all 19 bits of data are read.
5. After reading all the data, the MCU IO outputs a low level and then switches to input mode.

*    @IN_Parameter      :   None
*    @Return parameter  :   Detection status  1: Detected  0: Not detected    
***********************************************/


 

Prev Post
Next Post

Thanks for subscribing!

This email has been registered!

Shop the look

Hot Sale

USB Rechargeable LED motion Sensor Light 3 Pack White Closet Motion Sensor Lights
Shop Now
Wireless Under Cabinet Lights with Motion Sensor - Bright LED Design 8 inch
Find what you need in a flash thanks to the convenience of hands-free lighting. If rummaging through dark closets and cabinets has you frustrated, this 3 pack of self-activating under-cabinet lights is the solution. Just stick them inside and enjoy automatic illumination whenever you...
$38.99
$59.99
$38.99
closet lighting Vanity Make Up Light 64 LED
Shop Now
Lepotec 64 LED Under Cabinet Lighting 3 Color Plug in Lights
Elevate your lighting experience with the 3 Color Plug-In Lights, perfect for vanity setups and various spaces in your home. This versatile and user-friendly light offers a range of brightness levels and color temperatures to suit your needs. Here's why it's an essential addition...
From $23.93
$57.99
From $23.93
54 led motion sensor lighting under cabinet wireless lighting
Shop Now
Lepotec 54 Wireless Under Cabinet Lighting with Motion Sensor
Our LED lights will enhance the ambience of any room, kitchen or closet. These LED under cabinet lighting are stylish and functional. These LED lights feature 54 high-quality lamp bead and an elegant aluminum alloy design. They provide a soft, bright glow for any...
From $29.63
From $29.63
motion sensor under cabinet light 10 LED Wireless Rechargeable Motion Sensor Cabinet Lights
Shop Now
Lepotec 10 LED Under Cabinet Lights With Motion Sensor
This rechargeable LED light is versatile and offers bright illumination with automatic motion detection without batteries. It is perfect for cabinet under lighting or cabinet under lighting. Ideal for cabinetry with under-lighting, as well as closets, pantries and workspaces.  Features and Key Features:  ...
From $24.76
From $24.76

Shop Now

Recently Viewed

Edit Option
Back In Stock Notification
Compare ()
Compare
Product SKU Description Collection Availability Product Type Other Details
this is just a warning
Login
Shopping Cart
0 items

Before you leave...

Take 20% off your first order

20% off

Enter the code below at checkout to get 20% off your first order

CODESALE20

Continue Shopping