How to interface a PIR (Passive Infrared) sensor with an Arduino:
- Amit Rana
- Sep 1, 2023
- 1 min read
Step 1: List of Components
You’ll need the following components:
● Arduino board (e.g. Arduino Uno) ● PIR sensor ● Jumper wires ● Breadboard (optional)


Step 3: Code
Open the Arduino IDE and create a new sketch. Paste the following code: This code will turn on an LED when motion is detected by the PIR sensor, and print a message to the Serial Monitor in the Arduino IDE. You can modify the code to do something else when motion is detected, like triggering an alarm or sending an alert.
Step 4: Upload and Test
Connect your Arduino board to your computer and upload the code. Open the Serial Monitor in the Arduino IDE to see the messages printed when motion is detected. Move around in front of the PIR sensor to test it out.
Comments