0% found this document useful (0 votes)
3 views2 pages

Arduino Intruder Alert System Code

The document contains an Arduino code snippet that sets up a motion detection system using a PIR sensor, an LED, and a buzzer. When motion is detected, the LED and buzzer are activated, and a message indicating 'Intruders!' is printed to the serial monitor. If no motion is detected, the system enters 'Vigilante Mode' with the LED and buzzer turned off.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Arduino Intruder Alert System Code

The document contains an Arduino code snippet that sets up a motion detection system using a PIR sensor, an LED, and a buzzer. When motion is detected, the LED and buzzer are activated, and a message indicating 'Intruders!' is printed to the serial monitor. If no motion is detected, the system enters 'Vigilante Mode' with the LED and buzzer turned off.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

int pir_pin = 2;

int led_pin = 3;

int buzzer_pin = 4;

void setup()

pinMode(pir_pin, INPUT);

pinMode(led_pin, OUTPUT);

pinMode(buzzer_pin, OUTPUT);

[Link](9600);

void loop()

if (digitalRead(pir_pin) == HIGH)

digitalWrite(led_pin, HIGH);

digitalWrite(buzzer_pin, HIGH);

[Link]("Intruders!");

else

Generated with [Link]


digitalWrite(led_pin, LOW);

digitalWrite(buzzer_pin, LOW);

[Link]("Vigilante Mode");

Generated with [Link]

You might also like