INTRUDER ALERT SYSTEM USING WOKWI SIMULATION
EMBEDDED SYSTEMS AND IOT
MINI-PROJECT
Submitted by
LOKESH P 513122104708
In partial fulfilment for the award of the degree
of
BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE AND ENGINEERING
THANTHAI PERIYAR GOVERNMENT INSTITUTE OF
TECHNOLOGY
VELLORE - 632 002
ANNA UNIVERSITY: CHENNAI-600 025
APR / MAY 2025
ABSTRACT
This Intruder Alarm System project uses an Arduino Uno, HC-SR04
ultrasonic sensor, LEDs, buzzer, and a 16×2 LCD to detect nearby movement
within a specified range (20 cm) and alert users. On sensing an intruder within the
threshold, the system lights a red LED, sounds a buzzer alarm, and displays a
warning message with the measured distance on the LCD. Under normal
conditions, a green LED remains lit and the LCD indicates "No one is there." This
simulation and real-world setup demonstrate basic principles of ultrasonic distance
measurement and embedded alert mechanisms
TABLE OF CONTENTS
S. NO TITLE PAGE NO.
1. ABSTRACT 2
2. PROJECT OBEJECTIVE 4
3. INTRODUCTION 5
4. PROJECT DESIGN AND IMPLEMENTATION 6
5. TECHNOLOGY USED 7
6. IMPLEMENTATION DETAILS 10
7. INSTRUCTION TO USE THE WEBSITE 11
8. SYSTEM SPECIFICATION 12
9. BLOCK DIAGRAM/ARCHITECTURE 13
10. LITERATURE SURVEY 14
11. CODING 15
12. OUTPUT 16
13. CONCLUSION 17
14. REFERENCES 1
PROJECT OBJECTIVE:
The objective of this project is to design and simulate a Intruder Alert
System using the Wokwi Arduino simulator that:
1. Implement an ultrasonic sensing module to measure distance between sensor
and object.
2. Configure visual (LED) and auditory (buzzer) alerts for intrusion events.
3. Display real-time distance readings and status messages on a 16×2 LCD.
4. Integrate all components via Arduino programming to build a functional
security prototype.
INTRODUCTION:
Security systems are essential in homes, offices, and sensitive facilities.
Ultrasonic sensors provide an economical solution for detecting movement without
physical contact. This project aims to develop an approachable, low-cost intrusion
detection system that visually and audibly alerts users when an object comes within a
critical range. The Arduino Uno microcontroller processes distance data, controls
output devices, and provides user feedback via an LCD display.
PROJECT DESIGN AND IMPLEMENTATION:
The intruder alarm project consists of three main components:
1. Sensor Input Module – Uses an HC-SR04 ultrasonic sensor connected to the
Arduino board to continuously monitor the environment for any object within
the set threshold distance. It measures distance based on the time taken by
ultrasonic waves to reflect back from an object.
2. Alert System Module – Includes a 16x2 LCD to display system status and a
buzzer to produce an alarm when an intruder is detected. When an object is
detected within the threshold range, the LCD shows "Intruder Alert!" and the
buzzer sounds; otherwise, it remains in "No one is There!" mode.
3. Simulation Environment – The entire circuit, including the Arduino Uno, HC-
SR04 sensor, LCD, and buzzer, can be built and tested using the Wokwi online
simulator. This allows real-time observation of distance readings and output
responses without physical components.
TECHNOLOGIES USED:
1. Arduino Uno (Microcontroller): Arduino Uno acts as the central controller of
the project, responsible for reading sensor input and controlling the output
devices like the buzzer and LCD.
Application in Project:
• Used to receive digital input from the HC-SR04 ultrasonic sensor to detect
object presence.
• Controlled the LCD display to show real-time system status ("No one is There!"
or "Intruder Alert!").
2. HC-SR04 Ultrasonic Sensor: The HC-SR04 sensor detects objects by emitting
and receiving ultrasonic waves to calculate distance.
Application in Project:
• Continuously monitors the environment for nearby objects.
• Sends sensor readings to the Arduino to be compared with a threshold value.
• Plays a critical role in intrusion detection accuracy and system responsiveness.
3. 16x2 LCD Display (Liquid Crystal): The LCD module is used to display the
real-time status of the system based on sensor input.
Application in Project:
• Displays "No one is There!" when no object is detected within the threshold.
• Displays "Intruder Alert!" message along with measured distance when an
object is detected.
• Helps users understand the system's current state instantly.
4. Piezo Buzzer: A buzzer is used to provide an audible alert when an intruder is
detected by the system.
Application in Project:
• Produces a warning sound when triggered by the Arduino.
• Controlled using the tone() and noTone() functions in the Arduino code.
• Acts as a critical alert mechanism in real-world security systems.
5. Wokwi Simulator (Online Simulation Tool): Wokwi is a web-based Arduino
simulator that allows for easy testing and visualization of Arduino circuits
without the need for physical hardware.
Application in Project:
• Simulated the complete intrusion detection system including the Arduino, HC-
SR04 sensor, LCD, and buzzer.
• Enabled testing and debugging of the code and circuit design in real-time.
IMPLEMENTATION DETAILS:
- The intruder alarm system was implemented on the Wokwi simulator using the
following components:
- The HC-SR04 ultrasonic sensor was connected to the Arduino board's digital pins
9 (TRIG) and 10 (ECHO).
- The LCD was connected to digital pins 12, 11, 5, 4, 3, and 2 using a standard 4-bit
data mode.
- The buzzer was connected to digital pin 8.
- The red LED was connected to digital pin 7 and the green LED to pin 6 with
appropriate resistors.
- The sensor readings (distance) were compared against a threshold value (20 cm in
the code) to determine the presence of an intruder.
- If an object was detected within the threshold distance, the LCD displayed
"Intruder Alert!" and the buzzer was activated.
- If no object was detected, the system displayed "No one is There!" and kept the
buzzer off.
INSTRUCTIONS TO USE THE WEBSITE:
1. Visit the Wokwi simulation platform ([Link]
2. Create a new project and choose "Arduino Uno" as the board.
3. Add the following components:
- HC-SR04 Ultrasonic Sensor
- 16x2 LCD
- Buzzer
- Red LED and Green LED
4. Wire the components as per the connections mentioned in the code.
5. Copy and paste the Arduino code into the code editor.
6. Start the simulation and observe the outputs based on object proximity.
SYSTEM SPECIFICATION:
Hardware Requirements:
1. Processor: Intel Core i3 or higher – suitable for running simulations
and code compilation.
2. RAM: Minimum 4 GB – to support Arduino IDE and Wokwi
smoothly.
3. Storage: 2 GB free space – for IDE, libraries, and simulation
files.
4. Display: Standard resolution (1366x768) – for clear viewing of
code and simulation.
Software Requirements:
1. Operating System: Windows 10/11, macOS, or Linux.
2. Programming Language: C/C++ (Arduino language).
3. Libraries:
• LiquidCrystal.h – for LCD display functions.
4. Tools Used:
Arduino IDE – for writing and compiling code.
Wokwi Simulator – for online testing and simulation
CIRCUIT DIAGRAM/ARCHITECTURE:
LITERATURE SURVEY:
1. "Design and Implementation of an Intruder Detection System Using
Arduino" (2022):
o This study used Arduino with ultrasonic sensors to detect object
proximity. It emphasized cost-effectiveness and real-time alert
mechanisms using buzzers and GSM modules.
2. "IoT-Based Intruder Alarm and Monitoring System" (2023):
o Focused on integrating IoT with intrusion detection systems. The system
sent live data to cloud platforms and mobile alerts through Wi-Fi modules
like ESP8266.
3. "Simulation of Intruder Detection System Using Wokwi Platform" (2023):
o Demonstrated how Wokwi simulator helps visualize sensor readings and
test detection logic without real hardware. It proved useful for educational
and prototyping purposes.
CODING:
#include <LiquidCrystal.h>
const int trigPin = 9;
const int echoPin = 10;
const int redLedPin = 7;
const int greenLedPin = 6;
const int buzzerPin = 8;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int intrusionThreshold = 20;
void setup() {
[Link](9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(redLedPin, OUTPUT);
pinMode(greenLedPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
[Link](16, 2);
[Link]("Intruder Alarm System");
[Link](0, 1);
[Link]("System is Ready to Use");
delay(2000);
[Link]();
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
long duration = pulseIn(echoPin, HIGH);
int distance = duration * 0.034 / 2;
[Link]("Distance: ");
[Link](distance);
[Link](" cm");
if (distance < intrusionThreshold) {
digitalWrite(redLedPin, HIGH);
digitalWrite(greenLedPin, LOW);
tone(buzzerPin, 1000);
[Link]();
[Link]("Intruder Alert!");
[Link](0, 1);
[Link]("Distance: ");
[Link](distance);
[Link](" cm");
} else {
digitalWrite(redLedPin, LOW);
digitalWrite(greenLedPin, HIGH);
noTone(buzzerPin);
[Link]();
[Link]("No one is There!");
}
delay(3000);
}
OUTPUT:
The output of the simulation includes:
[Link] INTRUDER DETECTED :
CONCLUSION:
The Intruder Alarm System effectively demonstrates ultrasonic sensing
for proximity detection and integrates visual and auditory alerts. The modular Arduino
platform simplifies programming and hardware integration, providing a scalable
prototype for home or office security solutions. Furthermore, the flexibility of the
Arduino ecosystem allows for easy upgrades, such as integrating GSM modules for
mobile alerts or Wi-Fi modules for IoT-based monitoring. The system can be
expanded to include multiple sensors to cover larger areas or different types of sensors
for enhanced accuracy, thus making it a versatile foundation for more advanced
security solutions.
REFERENCES :
1. Wokwi Arduino Simulator - [Link]
2. Arduino Official Documentation -
[Link]
3. IR Flame Sensor Datasheet
4. LCD 16x2 Pin Configuration and Tutorial
5. TutorialsPoint - Arduino Programming Basics