Phone

    00852-6915 1330
  • Contents

Catalog

 

Introduction

Components

Arduino Code

 

Introduction

 

The idea of this project is to create an Arduino based home security alarm system that can be used to monitor and control the various appliances in the house. The main purpose of the system is to detect any unusual activity and notify the user about it in an efficient manner. The system will also use a web server to push notifications to mobile devices such as smartphones and tablets.

 

The project consists of an Arduino Uno board connected to a Debounce shield which contains a piezo buzzer, LED, power supply and other components necessary for interfacing with Arduino Uno board. A passive infrared sensor, or PIR, is a Pyroelectric device that senses motion. For this reason, it is sometimes referred to as a motion detecting sensor. It may be able to detect motion by detecting variations in the infrared levels emitted by nearby objects.

 

This gadget is a basic motion-activated alarm. Its brain is an Arduino microcontroller. It is connected to a PIR motion sensor, a buzzer, a resistor, and two external connectors. The system is very portable because it is entirely battery-powered. As soon as you get the code, you may link all of the external components. This is the easiest thing to do with a breadboard. To check everything out, you can create bogus connections.

 

Circuit for Arduino Based Home Security Alarm System

 

The whole system Is powered by 12V DC power supply which powers all other components except Arduino Uno board itself. The MCU receives digital commands from Arduino Uno through SCI interface and sends appropriate analog or digital signals on its pin according to the command received by it.

 

This project has been inspired by many previous projects that use Arduino boards for controlling various electronic devices such as lamps, lights etc., but this project focuses more on controlling various appliances.

 

The Arduino Uno Is based on the ATmega328 chip, which has built-in USB support for serial communications. It also has a built-in 5V power regulator that allows it to be powered directly from the USB connection or from a battery.

 

Components

 

1

Arduino

2

Motion Sensor

3

LED’s

4

Buzzer

5

LCD Module

 

Arduino Code

#include  <LiquidCrystal.h>   

int ledPin = 13;                

int inputPin = 7;               

int pirState = LOW;             

int val = 0;                    

int pinSpeaker = 10;          

 

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);                          

 

void setup() {  pinMode(ledPin, OUTPUT);

  pinMode(pinSpeaker, OUTPUT);

  Serial.begin(9600);

  lcd.begin(16, 2);

  lcd.setCursor(2, 0);                                            

  lcd.print("P.I.R Motion");                                      

  lcd.setCursor(5, 1);                                           

  lcd.print("Sensor");                                            

  delay(4000);

  lcd.clear();

  lcd.setCursor(2, 0);                                            

  lcd.print("Displaying");                                     

  lcd.setCursor(2, 1);                                            

  lcd.print("A");                                         

delay(5000);                                                      

lcd.clear();                                                    

lcd.setCursor(0, 0);

      lcd.print("Processing Data.");

      delay(3000);

      lcd.clear();

      lcd.setCursor(3, 0);

      lcd.print("Waiting For");

      lcd.setCursor(3, 1);

      lcd.print("Motion....");     

}

void loop(){

  val = digitalRead(inputPin);

  if (val == HIGH) {            

    digitalWrite(ledPin, HIGH);  

    playTone(300, 300);

    delay(150);

 

   

    if (pirState == LOW) {

      Serial.println("Motion detected!");

      lcd.clear() ;

      lcd.setCursor(0, 0);                                           

      lcd.print("Motion Detected!");  

     

      pirState = HIGH;

    }

  } else {

      digitalWrite(ledPin, LOW);

      playTone(0, 0);

      delay(300);   

      if (pirState == HIGH){

      

      Serial.println("Motion ended!");

      lcd.clear() ;

      lcd.setCursor(3, 0);

      lcd.print("Waiting For");

      lcd.setCursor(3, 1);

      lcd.print("Motion....");      

      pirState = LOW;

    }

  }

}

// duration in mSecs, frequency in hertz

void playTone(long duration, int freq) {

    duration *= 1000;

    int period = (1.0 / freq) * 100000;

    long elapsed_time = 0;

    while (elapsed_time < duration) {

        digitalWrite(pinSpeaker,HIGH);

        delayMicroseconds(period / 2);

        digitalWrite(pinSpeaker, LOW);

        delayMicroseconds(period / 2);

        elapsed_time += (period);

    }

}

 

Kynix

Kynix was founded in 2008, specializing in the electronic components distribution business. We adhere to honesty and ethics as our business philosophy and have gradually established an excellent reputation and credibility in our international business. With the accurate quotation, excellent credit, reasonable price, reliable quality, fast delivery, and authentic service, we have won the praise of the majority of customers.

Join our mailing list!

Be the first to know about new products, special offers, and more.

Leave a Reply

We'd love to hear from you! Feel free to share your thoughts and comments below. Rest assured, your email address will remain private.

Name *
Email *
Captcha *
Rating:

Kynix

  • How to purchase

  • Order
  • Search & Inquiry
  • Shipping & Tracking
  • Payment Methods
  • Contact Us

  • Tel: 00852-6915 1330
  • Email: info@kynix.com
  • Follow Us

authentication

Kynix

© 2008-2026 kynix.com all rights reserved.