Professional Documents
Culture Documents
ULTRASONIC SENSOR
MINIPROJECT REPORT-2020
ON
AKHIL MOHAN
AKHIL KR
AKSHAY AS
AKSHAY VARGHESE
Guided by:
RAJESH P
JINESH M S
(Lecturers in electronics & communication Engineering)
CERTIFICATE
This is to certify that the project entitled “HOME SECURITY
SYSTEM USING ARDUINO AND ULTRASONIC SENSOR
“ work done by AJITH NANDHANAN,AKHIL MOHAN,AKHIL
KR,AKSHAY AS,AKSHAY VARGHESE in the year 2020.
Place:Kalamassery.
Date:30-May-2020. Staff in charge Head of department
CONTENT PAGE
1) INTRODUCTION ………………………………………………
….......7
2) DESCRIPTION OF
PROJECT ………………………………......8
3) BLOCK
DIAGRAM ………………………………………………….…9
DESCRIPTION OF EACH BLOCK ……………………….……..
Ultrasonic sensor
NODE MCU
5) CIRCUIT DIAGRAM OF
PROJECT …………………………….13
6) CONCLUSION …………………………………..........................
14
.
7) REFERENCE ……………………………………………………
………15
8) APPENDIX ………………………………………………………
………16
LIST OF FIGURES
INTRODUCTION
With the emergence of new technology, security can be provided
in a smarter way. This paper proposes Home security system and
introduces many technologies for making the system installation
easy and secure. Most of the system makes use of mobile
communication like GSM and Wi-Fi for security systems. The
Central Processing Unit for the proposed system is developed
using the Arduino microcontroller which is a low cost and
efficient controller used in many applications.
The system consists of ultrasonic sensor and NodeMCU which is
connected to the microcontroller. The Fig - 1 describes the system
with the help of block diagram.
The wireless communication system used in this system is
NodeMCU, which sends notification to the owner.
The system also uses microcontroller board such as Arduino
along with the combination of NodeMCU and ultrasonic sensor
to provide a complete security system.
Figure :1
Ultrasonic sensor
Ultrasonic sensor also known as transceivers as they send and
receive signals.
NODE MCU
NodeMCU is an open-source firmware and development kit that helps you
to prototype or build IoT product. It includes firmware which runs on the
ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based
on the ESP-12 module.
Power supply:
Used a cheap power supply which can output 5 volts as well as
3.3 volts. I bought it online from china. 5 volts side of power
supply is supplying power to hcsr04 and 3.3 volt side is used to
power nodemcu. Note the grounds of 3.3v and 5v are made
common
DESCRIPTION OF INTERFACING
COMPONENTS
Arduino [6] is a tool for making computers that can sense and
control more of the physical world than your desktop computer.
It's an open-source physical computing platform based on a
simple microcontroller board and a development environment for
writing software for the board. The Fig - 3 shows the Arduino
board.
The Arduino can be used to develop interactive objects
considering inputs from a variety of switches or sensors, and
controlling a variety of lights, motors, and other physical outputs.
The Arduino projects can be stand-alone, or they can
communicate with software running on your computer (e.g.
Flash, Processing, and MaxMSP.) The boards can be assembled by
hand or purchased preassembled. Arduino simplifies the process
ULTRASONIC SENSOR
NODE MCU
void loop() {
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 18
GOVERNMENT POLYTECHNIC COLLEGE
KALAMASSERY
PROJECT ON ARDUINO HOME SECURITY USING
ULTRASONIC SENSOR
long duration , cm;
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(10);
digitalWrite(pingPin, LOW);
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
//inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
Serial.print(cm);
Serial.print("cm");
Serial.println();
delay(1000);
long microsecondsToCentimeters(long
microseconds) {
return microseconds / 29 / 2;
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 20
GOVERNMENT POLYTECHNIC COLLEGE
KALAMASSERY
PROJECT ON ARDUINO HOME SECURITY USING
ULTRASONIC SENSOR
}
#include <ESP8266WiFi.h>
void changeDoorStatus() {
state = !state;
if (state) {
door_state = "opened";
}
else {
door_state = "closed";
}
flag = true;
Serial.println(state);
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 22
GOVERNMENT POLYTECHNIC COLLEGE
KALAMASSERY
PROJECT ON ARDUINO HOME SECURITY USING
ULTRASONIC SENSOR
Serial.println(door_state);
}
void setup() {
Serial.begin(115200);
delay(100);
Serial.println("Preparing the Door Status Monitor
project...");
pinMode(pin, OUTPUT);
attachInterrupt(digitalPinToInterrupt(pin),
changeDoorStatus, CHANGE);
Serial.println();
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 23
GOVERNMENT POLYTECHNIC COLLEGE
KALAMASSERY
PROJECT ON ARDUINO HOME SECURITY USING
ULTRASONIC SENSOR
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
if (flag) {
Serial.print("connecting to ");
Serial.println(host);
WiFiClient client;
const int httpPort = 80;
if (!client.connect(host, httpPort)) {
Serial.println("connection failed");
return;
}
String url =
"https://maker.ifttt.com/trigger/esp/with/key/d3yyZ
qPXjZJmCcb0oygknb";