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

Arduino UNO Motion-Activated Alarm with LED Indicator and Buzzer

View and Edit Project In Cirkit DesignerImage of Arduino UNO Motion-Activated Alarm with LED Indicator and Buzzer

Circuit Documentation

Summary

This circuit is designed to detect motion using a PIR sensor and respond by blinking an LED and sounding a buzzer. The circuit is controlled by an Arduino UNO microcontroller.

Component List

  1. Arduino UNO

    • Description: A 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

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

    • Description: A simple buzzer.
    • Pins: PIN, GND
  5. PIR Sensor

    • Description: A Passive Infrared (PIR) sensor for motion detection.
    • Pins: VDD, SIG, GND

Wiring Details

Arduino UNO

LED: Two Pin (red)

Resistor

Buzzer

PIR Sensor

Code Documentation

Code Overview

The code initializes the pins for the LED, buzzer, and PIR sensor. When motion is detected by the PIR sensor, the LED blinks 20 times, and the buzzer sounds for 3 seconds.

Code

int led = 6;
int buz = 5;
int sig = 9;

void setup() {
  pinMode(led, OUTPUT);
  pinMode(buz, OUTPUT);
  pinMode(sig, INPUT);
}

void loop() {
  int motion = digitalRead(sig); 
  if (motion == HIGH) { 
    for (int i = 0; i < 20; i++) { 
      digitalWrite(led, HIGH);
      delay(250);
      digitalWrite(led, LOW);
      delay(250);
    }
    digitalWrite(buz, HIGH);
    delay(3000);
    digitalWrite(buz, LOW);
  }
}

Code Explanation

This documentation provides a comprehensive overview of the circuit, including the components used, their wiring, and the code that controls the circuit.