0% found this document useful (0 votes)
87 views9 pages

Arduino-Based Intruder Detection System

This project was developed for the course Embedded Systems Lab of Southeast University. This system detects unwanted objects by rotating a sonar sensor, it can work on any weather situation, when it detects an intrusion it kicks off a buzzer alarm and red warning light. Project planned and developed by Saleh Ibne Omar and logistics support provided by other group members.

Uploaded by

Saleh Ibne Omar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
87 views9 pages

Arduino-Based Intruder Detection System

This project was developed for the course Embedded Systems Lab of Southeast University. This system detects unwanted objects by rotating a sonar sensor, it can work on any weather situation, when it detects an intrusion it kicks off a buzzer alarm and red warning light. Project planned and developed by Saleh Ibne Omar and logistics support provided by other group members.

Uploaded by

Saleh Ibne Omar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.

Southeast University

Department of CSE
Lab Project Report

Title: Intruder Detection System Using Arduino Uno R3.


Course: Introduction to Embedded Systems Lab
Course Code: CSE3028.2
Section: 02

Submitted To:
Mr. Ovishake Sen
Lecturer, Department of CSE
Southeast University

Submitted By:
Name: Saleh Ibne Omar
ID: 2017000000040
Name: MD Jabir Hussain Shuvo
ID: 2018000000129
Name: Morjina Akter
ID: 2018000000102

Date of Submission:
12 October 2022

1
Title:

Intruder Detection System Using Arduino Uno R3.

Theory:

An intruder detection system is an embedded system that detects intruders at a given


distance, the system we’ve developed can detect objects from 30cm which can
easily be changed to the desired level, after detecting an object/intruder the system
turns on an alert to let the users know about the occurrence, this embedded system
utilizes a distance measurement sensor which can rotate to a certain angle and gets
the distance of the objects near it. The system is useful for protecting important and
expensive items from potential thieves, the system can also be used as a surveillance
or radar system if desired.

Apparatus:

Hardware: Arduino Uno R3, Ultrasonic sonar sensor HC-SR04, Servo motor SG90,
Temperature and humidity sensor DHT11, Active buzzer speaker, Red LED, 1/4w
resistor, Breadboard, Jumper wires.

Software: Arduino IDE, DHT library, Servo library.

Implementation:

The system uses Arduino Uno R3 as the mainboard, the servo motor used here acts
as the actuator of the sonar sensor which has been mounted on top of the servo
motor, whenever the servo rotates to a certain degree the sonar sensor also rotates,
and the DHT11 sensor acts as the dynamic temperature detection for the sonar
system to work properly in any weather conditions, it is well known that sonar
system emits ultrasonic waves continuously and the speed of the wave depends on
the temperature of the surrounding environment. The active buzzer and the LED is
there just for alerting mechanism, all the sensors and output devices get power

2
equally from the breadboard where a positive and negative column is directly
connected to the Arduino’s VCC and GND port respectively.

Circuit Diagram:

Details of the Circuit Diagram:

Ultrasonic sonar sensor: The VCC and GND pin of the sensor is connected to the
positive and negative column of the breadboard respectively, the trig pin is
connected to the 8th digital port and the echo pin is connected to the 9th port of the
Arduino.

Servo motor: The VCC and GND wire of the motor is connected to the positive and
negative column of the breadboard respectively, and the Pulse wire is connected to
the 5th digital PWM port of the Arduino.

Temperature and Humidity sensor: The VCC and GND pin of this sensor is
connected to the breadboard similarly to the sonar sensor and servo motor, and the
Data pin is connected to the 3rd digital pin of the Arduino.

Active buzzer: The positive pin of the buzzer is connected to the 11th digital port of
the Arduino Uno and the negative pin is connected to the negative column of the
breadboard.
3
Red LED: The positive pin of the LED is connected to the 13th digital pin of the
Arduino through a ¼ w ohm resistor and the negative pin is connected to the
negative column of the breadboard.

Applications:

 Intruder detection
 Radar system
 Security system to protect expensive items

Source Code:

#include <dht.h>

#include <Servo.h>

dht DHT;

Servo servo;

int tempSensorPin = 3;

int servoPin = 5;

int servoDelay = 12;

int servoDeg = 50;

int trigPin = 8;

int echoPin = 9;

int ledPin = 13;

int buzzerPin = 11;

bool servoIncr = true;

float velocity, distance, duration;

void rotateServo(){

if(servoIncr){

for(servoDeg; servoDeg<=130; servoDeg++){

[Link](servoDeg);

if(servoDeg%5==0){

4
calculateDistance();

alertOn();

delay(servoDelay);

else if(!servoIncr){

for(servoDeg; servoDeg>=50; servoDeg--){

[Link](servoDeg);

if(servoDeg%5==0){

calculateDistance();

alertOn();

delay(servoDelay);

servoIncr = servoDeg>=130 ? false : servoDeg<=50 ? true : servoIncr;

void calculateVelocity(int temp){

velocity = 332 + (0.6 * temp);

velocity = (velocity/1000000.00)*100;

void calculateDistance(){

digitalWrite(trigPin, LOW);

delayMicroseconds(5);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance = (velocity * duration)/2.00;

[Link]("Distance = ");

[Link](distance, 4);

5
void alertOn(){

if(distance<=30){

digitalWrite(ledPin, HIGH);

tone(buzzerPin, 500);

[Link]("Intruder Detected!");

void setup() {

[Link](9600);

[Link](servoPin);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

pinMode(ledPin, OUTPUT);

pinMode(buzzerPin, OUTPUT);

void loop(){

int var = DHT.read11(tempSensorPin);

delay(500);

digitalWrite(ledPin, LOW);

noTone(buzzerPin);

int currTemp = [Link];

[Link]("Current Temperature: ");

[Link](currTemp);

calculateVelocity(currTemp);

[Link]("Velocity = ");

[Link](velocity, 4);

rotateServo();

6
Serial Monitor Output:

The physical image of the Intruder detection system:

7
Discussion:

The servo motor of this embedded system can rotate from 50 degrees to 130 degrees
and vice versa, the ultrasonic sonar sensor is mounted on the top of the servo motor
so when the servo rotates the sonar rotates along with it, for every multiplier of 5
for a certain degree the sonar emits ultrasonic sound and then the distance is
calculated, from 50 to 130 and 130 to 50-degree rotation the sonar sensor calculates
distance 32 to 34 times and looks for an object within 30cm if an object is detected
within the range this system turns on the Buzzer and Red LED.

Limitations:

 The servo motor used in the system cannot rotate 360 degrees
 The system cannot detect objects which move at a high speed
 The range of the sonar sensor used for this system is only 2cm to 400cm
 If the system calculates distance for every degree change of the servo
motor’s actuator then the servo rotation becomes very slow
 To solve slow servo rotation the distance measurements were reduced, the
system only measures when the rotated degree is a multiplier of 5
 The system has a delay of 500ms for every repetition of the actual operation

Conclusion:

By doing this intruder detection system project we learned how embedded systems
works and how to develop one from scratch, we also learned how an intrusion
detection system works and how it can be used for different security purposes. The
various tools we used to develop this system gave us a thorough understanding of
their working mechanisms, uses, and limitations.

8
References:

 Source code:
[Link]
arduino/blob/main/[Link]

 Circuit Diagram:
[Link]
GkpMQ5E_MzUGqQr4rZQTOXKLQ

 Video:
[Link]

 Articles:
[Link]
[Link]

Common questions

Powered by AI

The hardware design impacts operational effectiveness in terms of detection range, speed, and accuracy. The inability of the servo motor to rotate 360 degrees limits detection coverage, while the sonar sensor's range constraints affect its adaptability to different environments. Improvements could include using a more capable servo for full rotation and integrating a more sensitive sonar sensor for a broader detection range, enhancing the system's overall efficacy .

The intruder detection system employs cost-effective components, such as the Arduino Uno R3, HC-SR04 sonar sensor, and SG90 servo motor, which are widely available and relatively inexpensive. This choice of components ensures the system is affordable while serving its intended purpose. Additionally, the use of a breadboard for connecting components simplifies assembly and reduces costs compared to custom printed circuit boards .

The alert mechanism of the intruder detection system consists of an active buzzer and a red LED. When the distance to an object is detected to be less than or equal to 30 cm, the system activates the buzzer and turns on the LED to alert users of an intruder. This condition is checked frequently as the sonar sensor scans in its specified degree range .

The intruder detection system can be applied in several areas: intruder detection for security, as a radar system, and for the protection of expensive items. Each application benefits from its ability to detect motion within a specific range using ultrasonic sensors, providing real-time alerts through sound and visual signals, which enhance security and can be used in surveillance .

The servo motor in the intruder detection system acts as an actuator for rotating the ultrasonic sonar sensor. It enables the sensor to sweep through angles from 50 to 130 degrees and back to its original position. During this rotation, the sensor calculates distance at the intervals of every 5 degrees, ensuring it detects objects in a broader sweep range .

The DHT library is essential for interfacing with the DHT11 temperature and humidity sensor, enabling the system to read current environmental conditions. The Servo library facilitates control over the SG90 servo motor, managing its rotation precisely to ensure the sonar sensor sweeps across the designated angular range for detecting intruders. These libraries abstract complex interfacing into simpler functions, aiding efficient system development .

The system cannot effectively detect fast-moving objects due to the relatively slow response time and the limited rotation range of the servo motor. Since continuous measurement for every degree would slow the servo, the system measures distance only at multiples of 5 degrees, from 50 to 130 degrees and vice versa, thereby facilitating quicker rotation while maintaining some level of accuracy. The limitation of the servo motor not rotating 360 degrees also affects full-range detection .

The system utilizes the DHT11 sensor to measure ambient temperature, which is used to calculate the velocity of ultrasonic waves, vital for accurately measuring distance. The formula used is velocity = 332 + (0.6 * temperature), adjusting the velocity of ultrasonic waves emitted by the sonar sensor according to the current temperature so that the distance measurements remain accurate irrespective of temperature fluctuations .

The components used in the intruder detection system include an Arduino Uno R3, an Ultrasonic sonar sensor HC-SR04, a Servo motor SG90, a Temperature and humidity sensor DHT11, an Active buzzer speaker, a Red LED, a 1/4w resistor, and a Breadboard with jumper wires. The Ultrasonic sonar sensor's VCC and GND pins connect to the breadboard's power rails, with the trig and echo pins connected to the 8th and 9th digital ports of the Arduino. The servo motor connects through its VCC, GND, and Pulse wires to the breadboard and the 5th digital PWM port of the Arduino. The DHT11 sensor interfaces with the 3rd digital pin of the Arduino. The active buzzer and LED connect through the 11th and 13th digital ports respectively, with the LED tied through a resistor .

Data processing begins with temperature readings from the DHT11 sensor, which adjust the ultrasonic wave velocity used by the sonar sensor to measure distances accurately. The sonar data is processed by measuring the time delay of ultrasonic waves to calculate distance. If an object is detected within 30 cm, the system triggers alerts via the buzzer and LED. This processing cycle repeats after every 500ms delay, allowing real-time operation while minimizing power consumption .

You might also like