0% found this document useful (0 votes)
11 views20 pages

Building An Efficient To-Do List Using Data Structure in C: Sethu Institute of Technology

The document outlines a mini project report for a Simple Alarm System using Arduino, designed by students from Sethu Institute of Technology. It details the project's objectives, hardware and software requirements, coding, circuit design, and implementation steps. The system aims to enhance security by detecting motion with a PIR sensor and triggering an alarm, serving as an introductory project for those learning about Arduino and embedded systems.

Uploaded by

Turgid gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views20 pages

Building An Efficient To-Do List Using Data Structure in C: Sethu Institute of Technology

The document outlines a mini project report for a Simple Alarm System using Arduino, designed by students from Sethu Institute of Technology. It details the project's objectives, hardware and software requirements, coding, circuit design, and implementation steps. The system aims to enhance security by detecting motion with a PIR sensor and triggering an alarm, serving as an introductory project for those learning about Arduino and embedded systems.

Uploaded by

Turgid gaming
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

BUILDING AN EFFICIENT TO-DO LIST

USING DATA STRUCTURE IN C

SETHU INSTITUTE OF TECHNOLOGY


(An Autonomous Institution | Accredited with „A++‟ Grade

by NAAC) PULLOOR, KARIAPATTI-626115

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

B.E COMPUTER SCIENCE & ENGINEERING

R21UEC425– MICROPROCESSORS AND


MICROCONTROLLERS

MINI PROJECT done by

MANOJ M 921723102080
JOTHI RAJ R 921723102063
JASPER DANIEL C 921723102061
R
LOKESH KUMAR A 921723102076

1
SETHU INSTITUTE OF TECHNOLOGY
(An Autonomous Institution | Accredited with „A‟
Grade by N PULLOOR, KARIAPATTI-626
115.
ANNA UNIVERSITY: CHENNAI 600 025.

BONAFIDE CERTIFICATE

Certified that this Mini project report entitled “SIMPLE


ALARM SYSTEM WITH ARDUINO UNO” is the bonafide
work of “JOTHI RAJ R, JASPER DANIEL C R, MANOJ M,
LOKESH KUMAR A” who carried out
the Mini project work under my supervision.

SIGNATURE SIGNATURE

Dr. M. PARVATHY M. MOHAMED ABUBAKKAR SIDDIQUE

HEAD OF THE ASSISTANT PROFESSOR/CSE


DEPARTMENT/CSE

2
 To promote excellence in technical education
Institute and scientific research for the benefit of the
Vision society

 To provide quality technical education to


Institute fulfill the aspiration of the student and to
Mission meet the needs of the Industry
 To provide holistic learning ambience
 To impart skills leading to employability
and entrepreneurship
 To establish effective linkage with industries
 To promote Research and
Development activities
 To offer services for the development of
society through education and
technology
Core Values
 Quality
 Commitment
 Innovation
 Team work
 Courtesy

B.E. COMPUTER
PROGRAMME
SCIENCE AND
ENGINEERING

To achieve excellence in technical education


Departme and scientific research in the field of computer
nt Vision science and engineering to contribute to the
society.
(CSE)
Transforming students into technocrats in
Departme computer technology confirming the industry
nt Mission expectation.
(CSE) Imparting holistic learner centric environment.

Cultivating comprehensive

personality
development of students leading to
3
innovators, leaders and entrepreneurs
Establishing collaboration with the industries
for mutual benefits
Promoting Research activities among the
students and the faculty to solve problems
related to industry and society.
Offering computer applications life skill to
society for better living.

PROGRAMME EDUCATIONAL OBJECTIVES

Graduates will Practice as Competent Computer Engineers by


PEO – I exhibiting the state of the art technical skills to cater to the
needs
of the industries.
Graduates will lead the team and function in a team of multi-
cultural professionals with effective interpersonal skills.
PEO – II

PEO – III Graduates will hone their professional expertise by engaged


in research and sustained learning activities.

PROGRAMME SPECIFIC OUTCOMES

Engineering graduates will demonstrate individual expertise in


PSO – I various programming languages to develop applications for
static,
internet, and mobile domains.
Engineering graduates will demonstrate the knowledge of
analyzing, planning, and constructing databases, ability to
PSO – II extract information using queries, and skills to develop
programming
interfaces to synthesis databases.

PROGRAMME OUTCOMES
Apply the knowledge of mathematics, science, engineering
4
PO 1 fundamentals, and an engineering specialization to the solution of
complex engineering
problems. (Engineering knowledge)

PO 2 Identify, formulate, review research literature, and analyze complex


engineering problems reaching substantiated conclusions using first
principles of mathematics, natural sciences, and engineering
sciences.
(Problem Analysis)
PO 3 Design solutions for complex engineering problems and design system
components or processes that meet the specified needs with
appropriate consideration for the public health and safety, and the
cultural, societal, and environmental considerations. (Design and
Development of Solutions)

PO 4 Use research-based knowledge and research methods including design


of experiments, analysis and interpretation of data, and synthesis of
the information to provide valid conclusions. (Investigation of
Complex Problems)

PO 5 Create, select, and apply appropriate techniques, resources, and


modern engineering and IT tools including prediction and modeling to
complex engineering activities with an understanding of the
limitations. (Modern Engineering Tools)

PO 6 Apply reasoning informed by the contextual knowledge to assess


societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professional engineering
practice.
(Engineer and Society)
PO 7 Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge
of, and need for sustainable development. (Environment and
Sustainability)

PO 8 Apply ethical principles and commit to professional ethics


and responsibilities and norms of the engineering practice.
(Ethics)
PO 9 Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings. (Individual and
Team Work)

PO 10 Communicate effectively on complex engineering activities with the


engineering community and with society at large, such as, being able
to comprehend and write effective reports and design documentation,
make effective presentations, and give and receive clear
instructions.
(Communication)

5
PO 11 Demonstrate knowledge and understanding of the engineering and
management principles and apply these to one’s own work, as a
member and leader in a team, to manage projects and in
multidisciplinary environments. (Project Management and
Finance)
PO 12 Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning in
the broadest context of
technological change. (Life-long learning)

6
Table of Contents
S.No: Contents Page No.
1. Abstract 6
2. Requirements 7
3. Design and Implementation 7
a) Data Structure Choice
b) Function Definitions
c) Program Flow
4. Code Explanation 8
5. Testing 10
6. Output 10
7. Conclusion 11
8. Future Enhancements 11
9. References 11

7
1. Abstract:
In today's world, security is a primary concern since the crime rate in
all the cities is increasing day by day, and simple yet effective alarm
systems play an important role in safeguarding homes and
businesses.

In 2024, India's crime rate stood at 445.9 per 100,000 people,


marking a decline from 487.8 in 2020, this is only thanks to the
growing technology that helps keep us safe from the unexpected
things that might happen to us in this world

We can know when a cyclone is about to strike or when a hurricane


is about to strike, this is all due to the technology that we hold,
which can warn us about any upcoming disasters and harm. The
same can be said when protecting our home, we can use Arduino to
make a simple alarm system that can detect and warn the residents
if someone breaks into the house

This Simple Alarm System project uses an Arduino


microcontroller, an infrared (IR) motion sensor (PIR sensor),
and a buzzer to detect motion in a given area and trigger an alarm.
This system is designed for simplicity, low cost, and ease of
implementation, providing an entry- level project for those new to
Arduino and embedded systems. The project aims to demonstrate
the use of sensors with Arduino, and how to create a basic alarm
system.

This system is ideal for monitoring rooms, corridors, or doors and


can be used in applications like home security, automatic lights, or
to track unauthorized access.

8
2. Requirements:
Hardware Requirements:
1. Arduino Uno (or any Arduino board compatible with the IDE)
o The central processing unit to control all components.
2. PIR Motion Sensor (HC-SR501 or similar)
o Detects movement in its vicinity and sends a signal to the
Arduino.
3. Buzzer (Active or Passive)
o Emits a sound when the motion is detected.
4. LED (for visual indication)
o Provides feedback to indicate the system’s status (whether
motion is detected or not).
5. Resistors:
o 220 ohms resistor for the LED.
o 10k ohms resistor for the PIR sensor, if needed, to
stabilize
the sensor's signal.
6. Breadboard and Jumper Wires
o Used to build the circuit without soldering.
7. Power Supply:
o Either a 9V battery or USB power from a
computer or external adapter to power the
Arduino.
Software Requirements:
1. Arduino IDE:
o A free software to write, compile, and upload the code to the
Arduino board.
2. Arduino Board:
o Select your board from the IDE’s “Tools” menu (Arduino Uno
or compatible).
3. Serial Monitor:
o For debugging and observing outputs like “No Motion” or
“Motion Detected”.

9
3. Coding:
Below is the code that controls the system. The primary logic checks
the state of the PIR sensor and triggers the buzzer if motion is
detected.

int pirPin = 2;
int buzzerPin = 3;
int ledPin = 13;

int pirState = LOW;


int val = 0;

void setup() {
pinMode(pirPin, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}

void loop() {
val = digitalRead(pirPin);

if (val == HIGH) {
digitalWrite(buzzerPin, HIGH);
digitalWrite(ledPin, HIGH);
Serial.println("Motion Detected! Alarm Activated!");
delay(1000);
} else {
digitalWrite(buzzerPin,
LOW); digitalWrite(ledPin,
LOW); Serial.println("No
Motion");
}
}
Explanation:

 Pin Setup:
o pirPin: The input pin that reads the motion from the PIR
sensor.

10
buzzerPin: The output pin that controls the buzzer.
o
o ledPin: The output pin to indicate the status visually.
 Main Logic:
o digitalRead(pirPin): Reads the motion detected by the
PIR sensor. If motion is detected (HIGH), it triggers the
buzzer
and LED.
o The serial monitor will also print "Motion Detected!"
to inform the user of the status.

4. Design and Implementation of the


Simple
Alarm System
The design of this project revolves around detecting motion using
the PIR sensor and triggering an alert (buzzer and LED) when
motion is detected. The Arduino Uno serves as the central
controller, processing input from the PIR sensor and controlling the
output devices (buzzer and LED).

1. Circuit Design:

In this section, we will explain how to connect the hardware


components and create the working circuit for the Simple
Alarm System.
Key Components:
 PIR Motion Sensor: Detects motion in the environment.
 Buzzer: Emits a sound when the alarm is triggered.
 LED: Provides visual feedback that motion has been detected.
 Arduino Uno: Processes the PIR sensor input and controls the
output devices.
Component Connections:
1. PIR Sensor Connections:
o VCC pin: Connect this to 5V on the Arduino board
(Arduino provides 5V to power the PIR
sensor).
o GND pin: Connect this to GND on the Arduino board.

11
o OUT pin: Connect this pin to digital pin 2 on the
Arduino. This pin will send a HIGH signal when motion is
detected and
LOW when no motion is detected.
2. Buzzer Connections:
o Positive (long leg) terminal of the buzzer: Connect this
to
digital pin 3 on the Arduino.
o Negative (short leg) terminal of the buzzer: Connect this
to
GND on the Arduino.
3. LED Connections (for visual feedback):
o Anode (long leg) of the LED: Connect this to digital pin
13
on the Arduino.
o Cathode (short leg) of the LED: Connect this to
GND
through a 220-ohm resistor. The resistor limits the
current flowing through the LED, preventing damage.
4. Powering the System:
o The Arduino can be powered either through a
USB connection from your computer or through a
9V battery (using a battery connector to the
Arduino's power jack).

Circuit Schematic Overview:


Here's a quick description of how the connections should look:
 PIR Sensor:
o VCC → 5V (Arduino)
o GND → GND (Arduino)
o OUT → Digital Pin 2 (Arduino)
 Buzze
r: o Positive terminal → Digital Pin 3 (Arduino)
o Negative terminal → GND (Arduino)

 LED: o Anode → Digital Pin 13 (Arduino)


o Cathode → GND (via 220-ohm resistor)
2. Step-by-Step Implementation:

In this section, we'll describe how to implement the system, from


12
connecting the hardware to writing the code and uploading it to
the Arduino board.

13
Step 1: Build the Circuit
 Place all components on the breadboard:
o Insert the PIR sensor, buzzer, and LED onto the breadboard.
Connect jumper wires between the Arduino board and the
breadboard according to the schematic above.
 Ensure correct connections:
o Double-check the connections for the PIR sensor (VCC, GND,
OUT), buzzer (positive to digital pin 3, negative to GND), and
the LED (anode to pin 13, cathode through the resistor to
GND).
 Power the Arduino:
o If you're using a USB connection, plug the Arduino into your
computer.
o If you're using a battery, connect the 9V battery to
the Arduino’s power input jack.
Step 2: Writing the Code
1. Initial Setup:
o Define the pins where the PIR sensor, buzzer, and LED
are
connected.
o Set the PIR sensor pin as an INPUT since we are reading
its
state.
o Set the buzzer and LED pins as OUTPUT since they will
emit signals based on motion detection.
2. Code Logic:
o In the loop() function, we continuously monitor the PIR
sensor for motion.
o If the PIR sensor detects motion (i.e., it sends a HIGH
signal), we activate both the buzzer and the LED. We
also print a message in the Serial Monitor indicating
motion detection.
o If no motion is detected (sensor outputs LOW), we turn
off both the buzzer and LED and print "No Motion" to the
serial
monitor.
3. Serial Monitor for Debugging:
o The Serial Monitor will provide real-time feedback.
This is useful for debugging and confirming the system's
behavior.
4. Upload the Code to Arduino:

14
o After writing the code, connect your Arduino to
your computer using a USB cable.
o Select the correct board type (Arduino Uno) and port
from
the Arduino IDE.
o Click the Upload button to transfer the code to the Arduino.
Step 3: Testing the System
 Test the motion detection:
o Once the code is uploaded, test the system by walking
in front of the PIR sensor. When motion is detected, the
buzzer
should sound and the LED should light up.
o Observe the Serial Monitor. It should display
"Motion Detected!" when motion is detected and "No
Motion" when
there’s no movement.
 Test the response time:
o The PIR sensor has a built-in delay before detecting
motion again. You can adjust the delay and sensitivity
using the
built-in potentiometer on the sensor (if needed).

3. Code Logic and Flow:

1. Pin Configuration:
int pirPin = 2;
int buzzerPin = 3; int
ledPin = 13;
Here, the pirPin is set to pin 2 (where the PIR sensor’s OUT
o
pin is connected).
o The buzzerPin is set to pin 3 (the output to the buzzer).
o The ledPin is set to pin 13 (the LED will light up when
motion
is detected).
2. Setup Function:
void setup() { pinMode(pirPin,
INPUT);
pinMode(buzzerPin, OUTPUT); pinMode(ledPin,
OUTPUT);

15
Serial.begin(9600);
}
o In the setup() function, we configure the pins:
 The pirPin is set to INPUT because we will read data
from the PIR sensor.
 The buzzerPin and ledPin are set to OUTPUT to
control
the buzzer and LED.
3. Loop Function:
void loop() {
val =
digitalRead(pirPin); if
(val == HIGH) {
digitalWrite(buzzerPin,
HIGH); digitalWrite(ledPin,
HIGH);
Serial.println("Motion Detected! Alarm Activated!");
delay(1000);
} else {
digitalWrite(buzzerPin,
LOW); digitalWrite(ledPin,
LOW); Serial.println("No
Motion");
}
}
o Reading the PIR sensor:
 The digitalRead(pirPin) function checks if the PIR
sensor has detected motion. If the sensor detects
motion, it
returns HIGH; otherwise, it returns LOW.
o Condition for motion detection:
 When motion is detected (val == HIGH), the buzzer
and
LED are activated using digitalWrite(). The Serial
Monitor prints "Motion Detected! Alarm Activated!",
and the buzzer will sound for 1 second (delay(1000)).
o When no motion is detected:
 If there is no motion (val == LOW), the buzzer and
LED
are turned off.

16
Conclusion of the Design and Implementation:

17
The design and implementation of the Simple Alarm System are
straightforward and simple to build. By connecting the PIR sensor,
buzzer, and LED to the Arduino, and writing a basic program, we
can create a motion-detecting alarm. This project serves as a
great introduction to working with sensors and controlling external
devices using Arduino.

5. Testing:
Initial Testing:

1. Power On the System:


o Power the Arduino either through USB or a 9V battery.
o Open the serial monitor from the Arduino IDE. It
should show "No Motion" at the beginning.
2. Triggering the Alarm:
o Walk in front of the PIR sensor.
o Once motion is detected, the serial monitor should
read "Motion Detected!" and the buzzer should
activate.
o The LED should turn on as well.

Additional Testing:

 Test the system by adjusting the sensor‟s sensitivity.


 Check the time for the system to detect motion and activate
the alarm.
 Delay Mechanism: Ensure that the alarm only stays active for
a
short period (e.g., 1 second), as set in the delay(1000); part of
the code.

6. Output:
Expected Output:
1. Serial Monitor:
o When no motion is detected, the serial monitor will print
"No Motion."
o When motion is detected, the serial monitor will print
"Motion Detected! Alarm Activated!"
2. Visual Output:

18
o The LED connected to pin 13 will light up when motion
is detected.
3. Auditory Output:
o The buzzer will emit a sound when motion is
detected, indicating an alert.

7. Conclusion:
This project demonstrates a simple yet effective alarm system
using Arduino. The system leverages the capabilities of the PIR
sensor to detect motion and trigger the buzzer, providing a
basic level of security and alertness.

The successful implementation of this project showcases the ease


of use and versatility of the Arduino platform, making it an ideal
choice for DIY enthusiasts, students, and professionals alike.

The alarm system can be further enhanced and customized to


suit specific needs and applications, such as:

- Integrating multiple sensors to detect different types of


intrusions
- Adding a notification system to alert authorities or owners
- Incorporating a timer or scheduling system to arm/disarm the
alarm
- Using a more advanced microcontroller or development board for
increased functionality

19
Overall, this project highlights the potential of Arduino-based
projects in creating innovative and practical solutions for real-
world problems, and serves as a stepping stone for more
complex and ambitious projects in the future.

8. Future Enhancements
1. Add a keypad or password system to arm/disarm the alarm.
2. Use a more advanced sensor, such as a camera or
microphone, to detect intruders.
3. Add a notification system, such as an SMS or email, to alert
the owner when the alarm is triggered.

9. References
- Arduino Official Website: https://www.arduino.cc/
- PIR Sensor Datasheet:
https://www.sparkfun.com/datasheets/Sensors/PIR/proximity.pdf

20

You might also like