Microcontroller Report Final
Microcontroller Report Final
BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE & ENGINEERING
Submitted By:
D MANOHAR 1MJ23CS040
CHETHAN KUMAR B S 1MJ23CS036
CERTIFICATE
This is to certify that the mini- project work, entitled “SMART ENERGY SAVER IN
PUBLIC PLACES” is a Bonafide work carried out by CHETHAN KUMAR B S
(1MJ23CS036) & D MANOHAR (1MJ23CS040) in partial fulfillment for the award of
degree of Bachelor of Engineering in Computer Science & Engineering during the fourth
semester of the academic year 2024-25. The mini project report has been approved as it
satisfies the academic requirements.
DECLARATION
We, Chethan Kumar B S (1MJ23CS036) & D. Manohar (1MJ23CS040) hereby declare
that the project work entitled “SMART ENERGY SAVER IN PUBLIC PLACES”
embodied in this mini-project report has been carried out by us during the Fourth Semester
of the Bachelor of Engineering (B.E.) degree at MVJ College of Engineering (MVJCE),
Bangalore, under the esteemed guidance of Mrs. Nivedita Sahoo, Assistant Professor,
Department of Computer Science and Engineering, MVJCE.
Chethan
Kumar B S
1MJ23CS036
D. Manohar
1MJ23CS040
Place:
Date:
ABSTRACT
This project presents the design and implementation of a basic motion detection system using the Arduino
Uno and an HC-SR04 ultrasonic sensor. The primary objective is to detect the presence or movement of an
object within a defined range and respond by activating an LED indicator. The HC-SR04 sensor works on the
principle of ultrasonic sound wave reflection; it emits a high-frequency sound pulse and measures the time
taken for the echo to return after bouncing off a nearby object. This time delay is used to calculate the distance
between the sensor and the object using the formula:
Distance = (Speed of Sound × Time) / 2.
When the measured distance falls below a predefined threshold, the system recognizes this as motion and
triggers a connected LED via the Arduino Uno. A 220-ohm resistor is used to prevent excessive current from
damaging the LED. All components are connected using a breadboard and jumper wires, ensuring easy
assembly and modification.
This project is a practical demonstration of how basic electronic components can be used to build intelligent
systems that respond to environmental stimuli. The same concept can be scaled or enhanced for real-world
applications such as:
➢ Touchless systems such as doorbells, waste bins, and public access points.
➢ Smart energy-saving solutions that shut off appliances when no movement is detected.
The project promotes efficient energy usage, touch-free automation, and low-cost prototyping, making it ideal
for students and hobbyists exploring embedded systems, IoT, and smart technologies.
I
ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the successful completion of any task would be
incomplete without acknowledging the people who made it possible. Success is the epitome of hard
work and perseverance, but above all, it is guided by steadfast support and encouragement.
With deep gratitude, we acknowledge all those whose guidance and motivation served as a beacon
of light and crowned our efforts with success.
We extend our heartfelt thanks to Dr. AJAYAN KR, Principal of MVJCE, for his constant
encouragement and support throughout the course of our project.
We are grateful to Dr. HAMEEM SHRANAVAS, Dean, School of Computer Science, MVJCE,
for his valuable support and motivation during our project work.
We sincerely thank Mr. Kumar, Controller of Examinations, for his continued encouragement and
support.
We would like to express our gratitude to Dr. Kiran Babu T. S., Head of the CSE Department, for
his unwavering support and the assistance provided during the course of the project.
It is a privilege and an honor for us to express our sincere appreciation to our guide, Mrs. Nivedita
Sahoo, Assistant Professor, CSE Department, for her valuable guidance, timely feedback, and constant
encouragement throughout the tenure of this project.
We also extend our gratitude to all the faculty members of the CSE Department for their
cooperation, support, and constructive feedback that helped us immensely during this journey.
Finally, we would like to thank our families and friends for their continuous encouragement and
support, which played an invaluable role in the successful completion of this project.
This project is a collaborative effort by both members of our group, and each member has
contributed equally to its successful completion.
Thanking You
II
TABLE OF CONTENTS
Abstract ............................................................................................................................................................ i
Acknowledgement .......................................................................................................................................... ii
List of Figures................................................................................................................................................ iv
CONCLUSION ............................................................................................................................................ 19
REFERENCES ............................................................................................................................................. 22
III
MICROCONTROLLER
CHAPTER 1
INTRODUCTION
With the advancement of technology, the demand for automated systems that enhance security, energy
efficiency, and user convenience has significantly increased. Among these, motion detection systems have
become a core feature in various applications — from smart homes and offices to public spaces and
industrial environments. This project explores the implementation of a low-cost, Arduino-based
Ultrasonic Motion Detection System using readily available electronic components.
At the heart of this system is the Arduino Uno, a widely used open-source microcontroller board known
for its ease of use and flexibility. It interfaces with the HC-SR04 ultrasonic sensor, which functions by
emitting ultrasonic sound waves and measuring the time it takes for the echo to return after reflecting off
an object. This time is used to calculate the distance to the object using the formula:
When the calculated distance falls below a pre-defined threshold, it indicates that an object (or person) has
entered the detection zone. The system then activates a connected LED to visually signal the detection of
motion. A 220Ω resistor is used in series with the LED to ensure safe current levels, and jumper wires
along with a breadboard allow for a modular and solder-free setup.
This project serves as a hands-on introduction to sensor-based automation, showcasing how basic hardware
components and embedded programming can be combined to build real-time systems. It lays the
groundwork for more advanced applications, such as:
➢ Automatic lighting systems that save power by operating only when motion is detected.
➢ Intrusion detection alarms that improve home and facility security.
➢ Touchless controls in hygiene-sensitive areas like hospitals and restrooms.
➢ Smart resource management in classrooms, malls, or offices through occupancy detection.
By developing this project, students gain practical experience in interfacing sensors, working with
microcontrollers, and applying logical conditions in code — all of which are essential skills in the fields of
electronics, robotics, and the Internet of Things (IoT).
CHAPTER 2
LITERATURE SURVEY
CHAPTER 3
PROBLEM ANALYSIS
In modern times, ensuring security and optimizing energy usage are growing concerns in both residential
and public environments. Conventional systems for motion detection, such as CCTV and infrared sensors,
can be costly, power-hungry, or complex to install. Additionally, many public and private spaces suffer
from inefficient energy consumption due to lights and appliances being left on when not in use.
This project addresses these challenges by designing a low-cost, contactless, and real-time motion
detection system using an HC-SR04 ultrasonic sensor and an Arduino Uno microcontroller. The system
detects motion based on changes in distance measurements and responds by activating an LED, simulating
a real-world action like turning on a light or triggering an alert.
By solving these problems, the project contributes to the development of smarter and safer living
environments using simple electronics and embedded programming.
CHAPTER 4
EXISTING SYSTEM
The existing motion detection systems primarily rely on technologies like Passive Infrared (PIR) sensors,
ultrasonic sensors, microwave sensors, and CCTV cameras. PIR sensors are widely used due to their
simplicity and low cost but have limited range and can be triggered by false positives, making them
unsuitable for all applications. Ultrasonic sensors, while more accurate in distance measurement, are
limited by their range and can be affected by environmental factors like interference from other ultrasonic
devices. Microwave sensors provide higher sensitivity and can detect motion through obstacles but come
at a higher cost and power consumption. CCTV and camera-based systems offer comprehensive
surveillance but are expensive, require significant storage, and raise privacy concerns. These systems also
tend to lack flexibility, scalability, and energy efficiency for simpler applications like automated lighting
or small-scale security. This project seeks to address these limitations by offering a low-cost, flexible, and
energy-efficient motion detection solution using an ultrasonic sensor and Arduino Uno, ensuring improved
accuracy and adaptability in various real-world applications
The existing motion detection systems come with several disadvantages that limit their efficiency and
usability in modern applications. PIR sensors, though affordable, have limited range and often produce
false positives due to temperature fluctuations or small animal movement. Ultrasonic sensors can be
affected by environmental interference and have a restricted detection range. More advanced systems like
microwave sensors and CCTV cameras are expensive, consume high power, and require complex
installation and maintenance. Camera-based systems also raise serious privacy concerns, especially in
public or residential areas. Many traditional systems are not flexible or easily scalable, making it difficult
to adapt them for custom or small-scale use cases. Additionally, some systems suffer from delayed
response times, are bulky in design, and rely on manual activation through switches or buttons, which is
not hygienic in settings like hospitals or public restrooms. These drawbacks highlight the need for a low-
cost, contactless, and energy-efficient solution that this project.
PROPOSED SYSTEM
The proposed system utilizes an Arduino Uno microcontroller and an HC-SR04 ultrasonic sensor to
create a low-cost, contactless motion detection mechanism suitable for a wide range of real-world
applications. The system functions by continuously sending ultrasonic waves from the sensor and
measuring the time it takes for the echo to return after bouncing off an object. When a change in
distance is detected—indicating motion—the Arduino processes the signal and activates an LED (or
other output devices like buzzers, alarms, or relays). This setup is not only affordable and easy to
implement but also offers high reliability in indoor environments. Unlike traditional PIR-based
systems, the ultrasonic sensor can detect even slight movements and operates effectively regardless of
ambient light or heat sources. The system is highly scalable and can be enhanced with modules like
Wi-Fi (ESP8266), Bluetooth, GSM, or IoT platforms to enable smart alerts via mobile apps or cloud-
based dashboards. It can be deployed in smart homes for lighting control, in commercial spaces for
security alerts, or in public places to automate trash bins or energy-saving appliances. The use of
Arduino enables rapid prototyping, real-time testing, and future upgrades, making this system an ideal
solution for modern, intelligent automation needs.
The proposed motion detection system offers several advantages over traditional systems. First and
foremost, it is cost-effective and uses easily available components like the Arduino Uno and HC-SR04
ultrasonic sensor, making it ideal for students, hobbyists, and small-scale applications. The system is
contactless, promoting hygiene in public or sensitive environments by eliminating the need for physical
touch. It provides accurate and real-time motion detection, responding instantly when a change in
distance is sensed. Unlike PIR sensors, it is not affected by light or heat, allowing it to function
reliably in varying environmental conditions. The design is flexible and scalable, meaning additional
features like alarms, GSM alerts, or IoT integration can be easily added. It is also energy-efficient, as
it activates connected devices only when motion is detected, helping to conserve power in smart homes
or public infrastructure. Furthermore, the system is simple to build and program, making it an
excellent educational tool for understanding embedded systems, sensor integration, and automation.
CHAPTER 5
Hardware Requirements
1. Arduino Uno
o The main microcontroller board used to control the system, process sensor input,
and activate outputs like LEDs.
2. HC-SR04 Ultrasonic Sensor
o For detecting motion by measuring the distance between the sensor and any object in
the vicinity using ultrasonic sound waves.
3. LED
o Used as an indicator that turns on when motion is detected by the ultrasonic sensor.
4. 220Ω Resistor
o To limit the current going through the LED to prevent damage.
5. Breadboard
o For easy, solderless connections between components to allow for quick prototyping
and testing.
6. Jumper Wires (Male-to-Male)
o Used to connect the Arduino and ultrasonic sensor to the breadboard and complete the
necessary circuits.
Software Requirements
1. Arduino IDE
o The development environment used for writing, compiling, and uploading the code
to the Arduino Uno.
2. Programming Language: Arduino C/C++
o The language used to write the code that controls the sensor and other hardware
components.
3. Ultrasonic Sensor Libraries
o Libraries like NewPing.h (optional) to simplify ultrasonic sensor handling and improve
accuracy.
CHAPTER 6
BLOCK DIAGRAMS
CHAPTER 7
HARDWARE IMPLEMENTATION
The project consists of a basic proximity-based control mechanism. When someone comes within a
certain distance, the LED (representing a light or fan) turns ON. When the area is empty, the LED turns
OFF. This is implemented using:
➢ Arduino Uno
➢ HC-SR04 Ultrasonic Sensor
➢ LED and 220Ω Resistor
➢ Breadboard and Jumper Wires
The Arduino Uno acts as the control unit. It takes distance readings from the HC-SR04 and decides
whether to turn ON or OFF the LED.
This sensor detects the presence of a person by sending and receiving ultrasonic pulses.
Connections:
➢ VCC → 5V
➢ GND → GND
➢ Trig → Digital Pin (e.g., D9)
➢ Echo → Digital Pin (e.g., D10)
The LED is used to simulate the activation of a real-world appliance like a light or fan.
➢ The 220Ω resistor is placed in series with the LED to prevent it from burning out.
➢ LED Anode → Resistor → Arduino pin
➢ LED Cathode → GND
The breadboard provides a reusable platform for connecting all components without soldering. Jumper
wires are used to make all necessary connections cleanly and safely.
CHAPTER 8
RESULTS
FIG 8.1
FIG 8.2
CHAPTER 9
APPLICATIONS
Educational Institutions
➢ In schools, colleges, and universities, classrooms and labs often have lights and fans left on
unnecessarily. This system can reduce such wastage.
➢ Application: Lights and fans in a classroom operate only when students are present.
➢ Benefit: Encourages smart campus models with lower utility bills.
Smart Restrooms
➢ Public and office restrooms often have lights and exhaust fans running continuously. Integrating this
system ensures they only operate when someone enters.
➢ Working: Ultrasonic sensor detects motion and activates the appliances; they switch off
automatically after a timeout.
➢ Advantage: Enhances hygiene and energy efficiency.
CHAPTER 10
ADVANTAGES AND DISADVANTAGES
ADVANTAGES
Energy Efficiency
➢ Automatically switches lights or devices ON only when human presence is detected.
➢ Prevents unnecessary power usage, especially in public places like restrooms,
classrooms, and corridors.
➢ Reduces electricity consumption by a significant margin.
Cost-Effective Solution
➢ Built using low-cost components like Arduino, ultrasonic sensors, and basic electronic
parts.
➢ Requires minimal maintenance compared to traditional systems.
➢ Long-term operational cost savings due to reduced electricity bills.
Environmentally Friendly
➢ Supports sustainable development goals by promoting responsible energy use.
➢ Helps reduce carbon footprint by lowering electricity production needs.
Reliable Detection
➢ Uses ultrasonic sensing, which works effectively in both light and dark environments.
➢ Accurate distance-based detection ensures precise control over connected appliances.
DISADVANTAGES
No Light Sensitivity
➢ The system lacks a light-dependent resistor (LDR), so it operates even during daytime unless
manually programmed otherwise.
➢ Energy may be wasted if lights are turned on when sufficient natural light is available.
No Manual Override
➢ In its basic form, the system does not offer manual control.
➢ In emergencies or special situations, users cannot bypass the sensor-triggered automation
without modifying the circuit.
Environmental Sensitivity
➢ Sensor performance may degrade under extreme weather conditions (humidity, heat, or dust) in
outdoor setups.
➢ Proper casing and calibration are necessary for outdoor or harsh environments.
CONCLUSION
The Smart Energy Saver in Public Places project is a practical and impactful initiative aimed at reducing
energy wastage through automation using microcontroller technology. With increasing concerns over global
energy consumption and sustainability, this project provides a viable solution by using a simple yet effective
combination of an Arduino Uno and an ultrasonic sensor to detect human presence and control devices
such as lights or fans accordingly. This results in intelligent, responsive control of electrical appliances that
significantly reduces unnecessary energy usage, especially in public places where manual monitoring is
inefficient or unreliable.
Through this project, we explored key concepts such as sensor interfacing, real-time decision-making using
microcontrollers, and energy-efficient system design. The hands-on implementation provided valuable
experience in hardware assembly, circuit design, coding using the Arduino IDE, and debugging logical
errors during the testing phase. It also emphasized the importance of combining electronic hardware with
practical societal needs.
From a broader perspective, the system encourages environmentally conscious behavior and demonstrates
how even basic automation can make public infrastructure smarter and more sustainable. The design is
modular, scalable, and cost-effective, making it ideal not only for academic demonstration but also for
real-world deployment in public restrooms, educational institutions, offices, and transportation hubs.
Despite a few limitations such as limited detection range and lack of ambient light sensing, the project opens
the door for numerous enhancements. Future upgrades could include the integration of IoT for remote
monitoring, LDRs for natural light detection, solar power supply for energy independence, and even
AI for predictive control. With such improvements, this system could play a crucial role in smart building
and smart city infrastructure.
FUTURE ASPECTS
Solar-Powered Operation
➢ The entire system can be powered using solar panels, making it fully sustainable and
independent of the grid.
➢ Ideal for outdoor public places like parks, bus stops, and rural areas with unreliable
electricity.
Light-Dependent Control
➢ Integration of a Light Dependent Resistor (LDR) to detect ambient light levels.
➢ Ensures lights only turn on when both motion is detected and natural light is insufficient,
saving more energy.
Multi-Sensor Networks
➢ Multiple ultrasonic or infrared sensors can be connected for wider area coverage.
➢ Useful in large halls, corridors, parking areas, or stadiums.
REFERENCES
N
Dept. Of CSE, MVJCE Page22 2023-24