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

Arduino UNO Motion Detection System with IR Sensor, LCD Display, and Servo Control

View and Edit Project In Cirkit DesignerImage of Arduino UNO Motion Detection System with IR Sensor, LCD Display, and Servo Control

Circuit Documentation

Summary

This circuit is designed to interface with an IR sensor, a buzzer, a 16x2 I2C LCD, and a servo motor using an Arduino UNO. The IR sensor detects motion, and if motion is detected, the buzzer is deactivated. The LCD displays the status of the system, and the servo motor can be controlled based on additional logic. The Arduino UNO serves as the central microcontroller, coordinating the actions of all connected components.

Component List

  1. IR Sensor

    • Description: Detects infrared light, typically used for motion detection.
    • Pins: out, gnd, vcc
  2. 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
  3. 16x2 I2C LCD

    • Description: A 16x2 character LCD display with I2C interface.
    • Pins: GND, VCC, SDA, SCL
  4. MG90S Servo Motor

    • Description: A small servo motor used for precise control of angular position.
    • Pins: SIG, VCC, GND
  5. Buzzer

    • Description: An audio signaling device.
    • Pins: PIN, GND

Wiring Details

IR Sensor

Arduino UNO

16x2 I2C LCD

MG90S Servo Motor

Buzzer

Code Documentation

/*
 * This Arduino Sketch is designed to interface with an IR sensor, a buzzer, 
 * a 16x2 I2C LCD, and a servo motor. The IR sensor detects motion, and if 
 * motion is detected, the buzzer is deactivated. The LCD displays the status 
 * of the system, and the servo motor can be controlled based on additional 
 * logic (e.g., RFID card detection).
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>

// I2C LCD setup
LiquidCrystal_I2C lcd(0x27, 16, 2);

// Servo setup
Servo myServo;

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  
  // Initialize LCD
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("System Ready");
  
  // Initialize Servo
  myServo.attach(6);
  myServo.write(0); // Set to default position
  
  // Setup pins
  pinMode(8, INPUT);  // IR Sensor
  pinMode(7, OUTPUT); // Buzzer
}

void loop() {
  // IR Sensor
  if (digitalRead(8) == HIGH) {
    digitalWrite(7, HIGH); // Buzzer OFF
    lcd.setCursor(0, 1);
    lcd.print("Motion Detected");
  } else {
    digitalWrite(7, LOW);  // Buzzer ON
    lcd.setCursor(0, 1);
    lcd.print("No Motion     ");
  }
  delay(100);
}

This code initializes the LCD, servo motor, and sets up the pins for the IR sensor and buzzer. In the main loop, it reads the state of the IR sensor and updates the buzzer and LCD display accordingly.