Skip to content

Opening book details…

About this document

PIR Sensor Relay Control Code by Osama Yaseen is a document available to read on EtoBox.

This code sets up an Arduino circuit to detect motion using a PIR sensor connected to pin 2. When motion is detected, it turns on a relay connected to pin 3 and prints "Motion detected!" to the serial monitor. When no motion is detected, it turns off the relay and prints "Motion ended!" to indicate the sensor is inactive again.

Author
Osama Yaseen
Language
EN