Arduino Uno-Based Smart Alarm System


Introduction

This project involves creating a smart alarm system using the Arduino Uno. The system will detect motion using a motion sensor and sound an alarm when motion is detected. This project provides an introduction to motion sensing and alarm systems using Arduino.

Building a smart alarm system is an excellent way to learn about sensors and alarms. Arduino Uno’s simplicity and versatility make it an ideal choice for this project. We will use a motion sensor to detect movement and a buzzer to sound the alarm. Let’s go through the materials and instructions to build your smart alarm system.

Materials






Arduino Uno Arduino Uno Buy at Amazon
PIR Sensor PIR Sensor Buy at Amazon
Buzzer Buzzer Buy at Amazon
Breadboard Breadboard Buy at Amazon
Jumper Wires Jumper Wires Buy at Amazon

Instructions

  1. Connect the PIR motion sensor to the Arduino:
    • VCC of sensor to 5V on Arduino
    • GND of sensor to GND on Arduino
    • OUT pin of sensor to digital pin 2 on Arduino
  2. Connect the buzzer to the Arduino:
    • Long leg (anode) of buzzer to digital pin 8, and short leg (cathode) to GND
  3. Open the Arduino IDE on your computer.
  4. Write the following code in the Arduino IDE and upload it to your Arduino board.

const int motionSensorPin = 2;
const int buzzerPin = 8;
void setup() {
pinMode(motionSensorPin, INPUT);
pinMode(buzzerPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int motionState = digitalRead(motionSensorPin);
if (motionState == HIGH) {
digitalWrite(buzzerPin, HIGH);
Serial.println(“Motion detected! Alarm ON.”);
} else {
digitalWrite(buzzerPin, LOW);
}
delay(100);
}

Explanation

The code for this smart alarm system reads the state of the PIR motion sensor and activates the buzzer when motion is detected. If motion is detected (HIGH), the buzzer sounds an alarm and a message is printed to the Serial Monitor. If no motion is detected (LOW), the buzzer is turned off.

This project provides an introduction to using motion sensors with Arduino and building simple alarm systems. It’s a practical application that can be used for security or alert systems in various settings.

Conclusion

Building a smart alarm system with Arduino Uno is a great way to learn about motion detection and alarm functionality. This project demonstrates how to use sensors and actuators with Arduino to create a functional security system.

Feel free to expand this project by adding more sensors, integrating it with other systems, or enhancing the alarm functionality. Arduino provides a versatile platform for creating custom solutions for various applications.

Thank you for following this tutorial. We hope you enjoyed building your smart alarm system and found it useful. Stay tuned for more Arduino projects and security solutions!

Leave a Comment