The datasheet gives you nothing. Here is practical, better code for both Arduino and ESP32 (with deep sleep for battery life).
If you are looking for a PIR sensor "better" than the standard bulky blue boards (like the HC-SR501), here is a review of what you are likely looking at. hw416b pir sensor datasheet better
The HW-416B excels at sensing human body heat movement through its , providing a digital signal to a microcontroller or relay. Specification Operating Voltage 4.5V to 20V DC Output Signal High (3.3V) / Low (0V) Sensing Range Up to 7 meters (Adjustable) Detection Angle < 120° cone Quiescent Current < 65uA (Low power consumption) Delay Time 0.3s to 300s (Adjustable via Potentiometer) 🔧 On-Board Controls & Customization The datasheet gives you nothing