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

Arduino UNO Based IR Sensor Alarm System

View and Edit Project In Cirkit DesignerImage of Arduino UNO Based IR Sensor Alarm System

Circuit Documentation

Summary of the Circuit

This circuit is designed to detect an event (such as the presence of an object) using an infrared (IR) sensor and provide an audible alert through a Piezo Buzzer. The Arduino UNO serves as the central processing unit, reading the output from the IR sensor and controlling the state of the Piezo Buzzer accordingly. When the IR sensor detects the specified event, the Arduino activates the buzzer.

Component List

Arduino UNO

IR Sensor

Piezo Buzzer

Wiring Details

Arduino UNO

IR Sensor

Piezo Buzzer

Documented Code

// Code for Arduino UNO
int sensorPin = 2; // IR sensor OUT pin connected to Digital Pin 2
int buzzerPin = 8; // Piezo Buzzer pin connected to Digital Pin 8
int sensorValue = 0; // Variable to store the sensor output

void setup() {
  pinMode(sensorPin, INPUT); // Set the sensor pin as input
  pinMode(buzzerPin, OUTPUT); // Set the buzzer pin as output
}

void loop() {
  sensorValue = digitalRead(sensorPin); // Read the sensor output
  if (sensorValue == HIGH) {
    // If the sensor detects the specified event (assuming HIGH means event detected)
    digitalWrite(buzzerPin, HIGH); // Turn on the buzzer
  } else {
    digitalWrite(buzzerPin, LOW); // Turn off the buzzer
  }
}

Filename: sketch.ino

This code is written for the Arduino UNO microcontroller. It initializes the sensor and buzzer pins, reads the sensor output in the main loop, and turns the buzzer on or off based on the sensor reading. The assumption here is that a HIGH signal from the IR sensor indicates the detection of the specified event.