Note
Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
Why Join?
Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
Learn & Share: Exchange tips and tutorials to enhance your skills.
Exclusive Previews: Get early access to new product announcements and sneak peeks.
Special Discounts: Enjoy exclusive discounts on our newest products.
Festive Promotions and Giveaways: Take part in giveaways and holiday promotions.
👉 Ready to explore and create with us? Click [here] and join today!
PIR Motion Sensor Module
Overview
In this lesson, you will learn about PIR motion sensor module. The Passive Infrared(PIR) Motion Sensor is a sensor that detects motion. It is commonly used in security systems and automatic lighting systems. The sensor has two slots that detect infrared radiation. When an object, such as a person, passes in front of the sensor, it detects a change in the amount of infrared radiation and triggers an output signal.
Required Components
In this project, we need the following components.
It’s definitely convenient to buy a whole kit, here’s the link:
Name |
ITEMS IN THIS KIT |
LINK |
---|---|---|
Elite Explorer Kit |
300+ |
You can also buy them separately from the links below.
COMPONENT INTRODUCTION |
PURCHASE LINK |
---|---|
- |
|
Wiring

Schematic Diagram

Code
Note
You can open the file
05-pir_motion_sensor.ino
under the path ofelite-explorer-kit-main\basic_project\05-pir_motion_sensor
directly.Or copy this code into Arduino IDE.
After uploading the code to the Arduino Uno board, you can open the serial monitor to observe the sensor’s output. When the PIR (passive infrared) motion sensor detects movement, the serial monitor will display the message “Somebody here!” to indicate that motion has been detected. If no motion is detected, the message “Monitoring…” will be shown instead.
The PIR sensor outputs a digital HIGH or LOW signal, corresponding to detected or undetected motion, respectively. Unlike an analog sensor that provides a range of values, the digital output from this PIR sensor will either be HIGH (typically represented as ‘1’) or LOW (typically represented as ‘0’).
Note that the actual sensitivity and range of detection can vary based on the PIR sensor’s characteristics and the environmental conditions. Therefore, it is advisable to calibrate the sensor according to your specific needs.