Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Smart Security System with PIR Sensor and LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Smart Security System with PIR Sensor and LCD Display

Circuit Documentation

Summary

This circuit is designed to detect motion using a PIR sensor and display the system status on a 16x2 I2C LCD. It also includes a pushbutton to toggle the system state, an LED to indicate motion detection, and a piezo buzzer to sound an alarm when motion is detected. The circuit is controlled by an Arduino UNO microcontroller.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. LED: Two Pin (red)

    • Description: A red LED with two pins.
    • Pins: cathode, anode
  3. Resistor (1k Ohms)

    • Description: A resistor with a resistance of 1000 Ohms.
    • Pins: pin1, pin2
  4. Piezo Buzzer

    • Description: A piezoelectric buzzer.
    • Pins: pin 1, pin 2
  5. Pushbutton

    • Description: A pushbutton switch.
    • Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
  6. PIR sensor

    • Description: A passive infrared sensor for motion detection.
    • Pins: VDD, SIG, GND
  7. 16x2 I2C LCD

    • Description: A 16x2 character LCD with I2C interface.
    • Pins: GND, VCC, SDA, SCL

Wiring Details

Arduino UNO

LED: Two Pin (red)

Resistor (1k Ohms)

Piezo Buzzer

Pushbutton

PIR sensor

16x2 I2C LCD

Documented Code

#include <Adafruit_LiquidCrystal.h>

Adafruit_LiquidCrystal lcd(0);
int led = 13;
int buzzer = 12;
int button = 11;
int holder = 0;
int pir = 10;
int pirholder = 0;

void setup() {
  // put your setup code here, to run once:
  pinMode(led, OUTPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(pir, INPUT);
  pinMode(button, INPUT);
  lcd.begin(16, 2);
  lcd.print("is system on");
}

void loop() {
  // put your main code here, to run repeatedly:
  holder = digitalRead(button);
  pirholder = digitalRead(pir);
  lcd.clear();
  lcd.setCursor(0, 0);

  if (holder == 1) {
    if (pirholder == 1) {
      digitalWrite(led, HIGH);
      delay(200);
      digitalWrite(buzzer, HIGH);
      delay(10000);
      digitalWrite(led, LOW);
      digitalWrite(buzzer, LOW);
    } else {
      lcd.clear();
      lcd.print("NO one inside the building");
    }
  } else {
    lcd.clear();
    lcd.print("System is off");
  }
}

This code initializes the components and continuously checks the state of the pushbutton and PIR sensor. If the button is pressed and motion is detected, the LED and buzzer are activated. The LCD displays the system status accordingly.