PIR Motion Sensor Alarm System
The PIR (Passive Infrared) Motion Sensor Alarm System is an Arduino-based project designed for detecting motion and triggering an alarm.
PIR sensors are employed to detect changes in infrared radiation, commonly emitted by moving objects. When motion is detected, an alarm is activated, providing a practical solution for security or surveillance applications.
Component List:
Name | Quantity | Component |
---|---|---|
U1 | 1 | Arduino Uno R3 |
PIR1 | 1 | -3.598290659201581 , -294.6670795675154 , -194.67798997574994 , -203.49447658018323 PIR Sensor |
PIEZO1 | 1 | Piezo |
D1 | 1 | Red LED |
R1 | 1 | 220 Ω Resistor |
Rpot1 | 1 | 10 kΩ Potentiometer |
R2 | 1 | 330 Ω Resistor |
The circuit involves an Arduino board connected to a PIR motion sensor. Additionally, an alarm system, such as a buzzer or LED, is integrated to provide a visible or audible alert upon motion detection.
Power is supplied to the components, creating a system ready to detect and respond to any motion within its range.
Arduino Code:
int sensorState = 0;
int buzz = 12;
int led = 11;
void setup() {
pinMode(2, INPUT);
pinMode(buzz, OUTPUT);
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop() {
sensorState = digitalRead(2);
if (sensorState == HIGH) {
digitalWrite(led, HIGH);
// Whoop up for (int hz = 440; hz < 1000; hz += 25) { tone(buzz, hz, 50); delay(5); } // Whoop down for (int hz = 1000; hz > 440; hz -= 25) { tone(buzz, hz, 50); delay(5); } Serial.println("Sensor activated!");
} else {
digitalWrite(led, LOW);
noTone(buzz);
}
delay(10);
}
This project serves as an efficient and cost-effective way to implement a motion detection system. Whether used for home security or interactive installations, the PIR Motion Sensor Alarm System showcases the versatility of Arduino in creating responsive and practical solutions.
The simplicity of the circuit makes it accessible for hobbyists and DIY enthusiasts, offering a foundation that can be expanded or modified for more advanced applications.