Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

CHAPTER – 1
INTRODUCTION
A significant proportion of Indian firms might have faced data theft issues recently.
Around 41 per cent of these companies saw such instances, compared to the global average of 29
per cent, showed a survey by a risk management and consultancy firm, released on Monday.
India’s number is higher than other countries such as the United States (26 per cent), the United
Kingdom (32 per cent) and Japan (27 per cent). Autonomous security robots are a new
groundbreaking innovation in advanced security and surveillance technology. Guards patrolling
an area with flashlights and batons never worked very well; however, today there is an
immergence of smart security systems with intelligent sensors, embedded systems, autonomous
control mechanism and mobile application. The first security surveillance robot was proposed by
Everett, H. & Gage, D.W, 1999 in “Mobile Detection, Assessment and Response System
(MDARS)”. Since then security robots have become a growing interest with increasing
developments in research and application. The idea behind this is to secure the whole area of a
building or premises. Any small sound results in the alert and robot automatically goes to the
particular area and captures the image of that area and sends it to the user. Raspberry Pi connected
with the camera plays an important role in making an automatic robotic system. During the
occurrence of an abnormal event like theft, the patrol robot detects the sound and captures the
image of the intruder. The image of the intruder is sent to the security department via Email and
Short Messaging Service (SMS). An automatic patrolling vehicle acts as a security patroller in
the security system, which can monitor those dead zones of the traditional fixed surveillance
system. Countless applications today are mobile service security robots, including autonomous
navigation, security patrolling, housework, search-and-rescue operations, material handling,
manufacturing, and automated transportation systems. Autonomous navigation remains one of
the primary challenges in the mobile-robot industry; many control algorithms and techniques have
been recently developed that aim to overcome this challenge. We use line follower with IR
Sensors to perform night patrol navigation. The security patrol robot will utilize several sensors
and motors in order to navigate indoors. It will also be able to communicate and be controlled via
Wi-Fi.

ASRA 1 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

CHAPTER -2
INTRODUCTION TO EMBEDDED SYSTEMS
2.1 INTRODUCTION
Each day, our lives become more dependent on 'embedded systems', digital information
technology that is embedded in our environment. More than 98% of processors applied today are
in embedded systems, and are no longer visible to the customer as 'computers' in the ordinary
sense. An Embedded System is a special-purpose system in which the computer is completely
encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose
computer, such as a personal computer, an embedded system performs one or a few pre-defined
tasks, usually with very specific requirements. Since the system is dedicated to specific tasks,
design engineers can optimize it, reducing the size and cost of the product. Embedded systems
are often mass-produced, benefiting from economies of scale. The increasing use of PC hardware
is one of the most important developments in high-end embedded systems in recent years.
Hardware costs of high-end systems have dropped dramatically as a result of this trend, making
feasible some projects which previously would not have been done because of the high cost of
non-PC-based embedded hardware. But software choices for the embedded PC platform are not
nearly as attractive as the hardware.
Typically, an embedded system is housed on a single microprocessor board with the
programs stored in ROM. Virtually all appliances that have a digital interface -- watches,
microwaves, VCRs, cars -- utilize embedded systems. Some embedded systems include an
operating system, but many are so specialized that the entire logic can be implemented as a single
program.
Physically, Embedded Systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants.In terms of complexity embedded systems can range from very
simple with a single microcontroller chip, to very complex with multiple units, peripherals and
networks mounted inside a large chassis or enclosure.
2.2 DEFINITION OF AN EMBEDDED SYSTEM
Embedded system is defined as, For a particular/specific application implementing the
software code to interact directly with that particular hardware what we built. Software is used

ASRA 2 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

for providing features and flexibility, Hardware = {Processors, ASICs, Memory,...} is used
for Performance (& sometimes security)
There are many definitions of embedded system but all of these can be combined into a
single concept. An embedded system is a special purpose computer system that is used for
particular task.
2.3 FEATURES OF EMBEDDED SYSTEMS
The versatility of the embedded computer system lends itself to utility in all kinds of
enterprises, from the simplification of deliverable products to a reduction in costs in their
development and manufacture. Complex systems with rich functionality employ special operating
systems that take into account major characteristics of embedded systems. Embedded operating
systems have minimized footprint and may follow real-time operating system specifics.
The special computers system is usually less powerful than general-purpose systems,
although some expectations do exist where embedded systems are very powerful and
complicated. Usually a low power consumption CPU with a limited amount of memory is used
in embedded systems. Many embedded systems use very small operating systems; most of these
provide very limited operating system capabilities.
Since the embedded system is dedicated to specific tasks, design engineers can optimize
it, reducing the size and cost of the product, or increasing the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.
Some embedded systems have to operate in extreme environment conditions such as very
high temperature & humidity.For high volume systems such as portable music players or mobile
phones, minimizing cost is usually the primary design consideration. Engineers typically select
hardware that is just “good enough” to implement the necessary functions.
For low volume or prototype embedded systems, general purpose computers may be adapted by
limiting the programs or by replacing the operating system with a real-time operating system.
2.4 CHARACTERISTICS OF EMBEDDED SYSTEMS
Embedded computing systems generally exhibit rich functionality—complex
functionality is usually the reason for introducing CPUs into the design. However, they also
exhibit many non-functional requirements that make the task especially challenging:
• Real-time deadlines that will cause system failure if not met;
• Multi-rate operation

ASRA 3 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

• In many cases, low power consumption;


• Low manufacturing cost, which often means limited code size.
Workstation programmers often concentrate on functionality. They may consider the
performance characteristics of a few computational kernels of their software, but rarely analyze
the total application. They almost never consider power consumption and manufacturing cost.
The need to juggle all these requirements makes embedded system programming very challenging
and is the reason why embedded system designers need to understand computer architecture.
2.5 OVERVIEW OF AN EMBEDDED SYSTEM ARCHITECTURE
Every Embedded system consists of a custom-built hardware built around a central
processing unit. This hardware also contains memory chips onto which the software is loaded.

Application
Software

Operating
System
H/
W

Fig 2.5 Embedded system Architecture


The operating system runs above the hardware and the application software runs above
the operating system. The same architecture is applicable to any computer including desktop
computer. However these are significant differences. It is not compulsory to have an operating
system in every embedded system. For small applications such as remote control units, air
conditioners, toys etc.
2.6 APPLICATIONS OF EMBEDDED SYSTEMS
Some of the most common embedded systems used in everyday life are
Small embedded controllers:8-bit CPUs dominate, simple or no operating system
(e.g., thermostats)
Control systems: Often use DSP chip for control computations
(e.g., automotive engine control)

ASRA 4 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Distributed embedded control: Mixture of large and small nodes on a real-time


Embedded networks
(e.g., cars, elevators, factory automation)
System on chip: ASIC design tailored to application area
(e.g., consumer electronics, set-top boxes)
Network equipment: Emphasis on data movement/packet flow
(e.g., network switches; telephone switches)
Critical systems: Safety and mission critical computing
(e.g., pacemakers, automatic trains)
Signal processing: Often use DSP chips for vision, audio, or other signal
Processing (e.g., face recognition)
Robotics: Uses various types of embedded computing (especially
Vision and control) (e.g., autonomous vehicles)
Computer peripherals: Disk drives, keyboards, laser printers, etc.
Wireless systems: Wireless network-connected “sensor networks” and
“Motes” to gather and report information
Embedded PCs: Palmtop and small form factor PCs embedded into
Equipment
Command and control: Often huge military systems and “systems of systems”
(e.g., a fleet of warships with interconnected
Computers)
Home Appliances, intercom, telephones, security systems, garage door openers, answering
machines, fax machines, home computers, TVs, cable TV tuner, VCR, camcorder, remote
controls, video games, cellular phones, musical instruments, sewing machines, lighting control,
paging, camera, pinball machines, toys, exercise equipment
Office Telephones, computers, security systems, fax machines, microwave, copier, laser printer,
color printer, paging
Auto Trip computer, engine control, air bag, ABS, instrumentation, security system, transmission
control, entertainment, climate control, cellular phone, keyless entry

ASRA 5 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

2.7 TYPES OF EMBEDDED SYSTEMS


Based on functionality and performance embedded systems categorized as 4 types
1. Stand alone embedded systems
2. Real time embedded systems
3. Networked information appliances
4. Mobile devices
5. Existed system
1.Stand alone embedded systems:-
As the name implies, stand alone systems work in stand alone mode. They take i/p, process
them and produce the desire o/p. The i/p can be an electrical signal from transducer or temperature
signal or commands from human being. The o/p can be electrical signal to drive another system
an led or LCD display
ex digital camera, microwave oven, CD player, Air conditioner etc
2.Real time embedded systems:-
In this type of an embedded system a specific work has to be complete in a particular
period of time.
Hard Real time systems: - embedded real time used in missiles
Soft Real time systems: - DVD players
3. Networked information appliances:-
Embedded systems that are provided with n/w interfaces and accessed by n/w such as
local area n/w or internet are called Network Information Appliances
Ex A web camera is connected to the internet. Camera can send pictures in real time to any
computers connected to the internet
4. Mobile devices:-
Actually it is a combination of both VLSI and Embedded System Mobile devices such as
Mobile phone, Personal digital assistants, smart phones etc are special category of embedded
systems
5.Existed system
In the existing system, robot has to be controlled remotely where the person has to monitor
the area using remote control and more human resource is needed for this operation of the patrol
robot. Some systems require a smart phone for controlling the night vision robot.

ASRA 6 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

CHAPTER -3
BLOCK DIAGRAM, HARDWARE COMPONENTS AND SOFTWARE

3.1 BLOCK DIAGRAM:

Lcd

Power
supply

Arduino
L298N

Sound M
sensor M1
2

cam

Fig 3.1 Women’s Safety Patroling Robot Using Aurdino, Iot Blockdiagram

ASRA 7 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

3.2 SOFTWARE
Arduino Idle
Embedded c language
3.2.1 STRUCTURE
Arduino programs can be divided in three main parts: Structure, Values (variables and
constants), and Functions. In this tutorial, we will learn about the Arduino software program, step
by step, and how we can write the program without any syntax or compilation error.
Let us start with the Structure. Software structure consist of two main functions −
• Setup( ) function
• Loop( ) function

Fig 3.2.1 Arduino IDE


Void setup ( )

ASRA 8 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

}
• PURPOSE − The setup() function is called when a sketch starts. Use it to initialize the
variables, pin modes, start using libraries, etc. The setup function will only run once, after
each power up or reset of the Arduino board.
• INPUT − -
• OUTPUT − -
• RETURN − -
• Void Loop () {

• }
• PURPOSE − After creating a setup() function, which initializes and sets the initial values,
the loop() function does precisely what its name suggests, and loops consecutively,
allowing your program to change and respond. Use it to actively control the Arduino
board.
• INPUT − -
• OUTPUT − -
• RETURN − -

3.3 HARDWARE
1. Arduino
2. Power supply
3. Lcd
4. Sound sensor
5. motor
6. Esp32 cam
7. L298n
8. Jumper wires
9. Hc-Sr 501

ASRA 9 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

3.3.1 ARDUINO
Arduino is a prototype platform (open-source) based on an easy-to-use hardware and
software. It consists of a circuit board, which can be programed (referred to as a microcontroller)
and a ready-made software called Arduino IDE (Integrated Development Environment), which is
used to write and upload the computer code to the physical board.
The key features are −
• Arduino boards are able to read analog or digital input signals from different sensors and
turn it into an output such as activating a motor, turning LED on/off, connect to the cloud
and many other actions.
• You can control your board functions by sending a set of instructions to the
microcontroller on the board via Arduino IDE (referred to as uploading software).
• Unlike most previous programmable circuit boards, Arduino does not need an extra piece
of hardware (called a programmer) in order to load a new code onto the board. You can
simply use a USB cable.
• Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn
to program.
• Finally, Arduino provides a standard form factor that breaks the functions of the micro-
controller into a more accessible package.
• Board Types
• Various kinds of Arduino boards are available depending on different microcontrollers
used. However, all Arduino boards have one thing in common: they are programed
through the Arduino IDE.
The differences are based on the number of inputs and outputs (the number of sensors, LEDs,
and buttons you can use on a single board), speed, operating voltage, form factor etc. Some boards
are designed to be embedded and have no programming interface (hardware), which you would
need to buy separately. Some can run directly from a 3.7V battery, others need at least 5V.
we will learn about the different components on the Arduino board. We will study the Arduino
UNO board because it is the most popular board in the Arduino board family. In addition, it is the
best board to get started with electronics and coding. Some boards look a bit different from the
one given below, but most Arduinos have majority of these components in common.

ASRA 10 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Fig 3.3.1.a Arduino Uno Board

Power USB
Arduino board can be powered by using the USB cable from your computer.
All you need to do is connect the USB cable to the USB connection (1).

Power (Barrel Jack)


Arduino boards can be powered directly from the AC mains power supply
by connecting it to the Barrel Jack (2).

ASRA 11 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Voltage Regulator
The function of the voltage regulator is to control the voltage given to the
Arduino board and stabilize the DC voltages used by the processor and other
elements.

Crystal Oscillator
The crystal oscillator helps Arduino in dealing with time issues. How does
Arduino calculate time? The answer is, by using the crystal oscillator. The
number printed on top of the Arduino crystal is 16.000H9H. It tells us that
the frequency is 16,000,000 Hertz or 16 MHz.

Arduino Reset
You can reset your Arduino board, i.e., start your program from the
beginning. You can reset the UNO board in two ways. First, by using the
reset button (17) on the board. Second, you can connect an external reset
button to the Arduino pin labelled RESET (5).

Pins (3.3, 5, GND, Vin)


• 3.3V (6) − Supply 3.3 output volt
• 5V (7) − Supply 5 output volt
• Most of the components used with Arduino board works fine with 3.3 volt
and 5 volt.
• GND (8)(Ground) − There are several GND pins on the Arduino, any of
which can be used to ground your circuit.
• Vin (9) − This pin also can be used to power the Arduino board from an
external power source, like AC mains power supply.

ASRA 12 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Analog pins
The Arduino UNO board has six analog input pins A0 through A5. These
pins can read the signal from an analog sensor like the humidity sensor or
temperature sensor and convert it into a digital value that can be read by the
microprocessor.

Main microcontroller
Each Arduino board has its own microcontroller (11). You can assume it as
the brain of your board. The main IC (integrated circuit) on the Arduino is
slightly different from board to board. The microcontrollers are usually of
the ATMEL Company. You must know what IC your board has before
loading up a new program from the Arduino IDE. This information is
available on the top of the IC. For more details about the IC construction
and functions, you can refer to the data sheet.

ICSP pin
Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino
consisting of MOSI, MISO, SCK, RESET, VCC, and GND. It is often
referred to as an SPI (Serial Peripheral Interface), which could be considered
as an "expansion" of the output. Actually, you are slaving the output device
to the master of the SPI bus.

ASRA 13 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Power LED indicator


This LED should light up when you plug your Arduino into a power source
to indicate that your board is powered up correctly. If this light does not turn
on, then there is something wrong with the connection.

TX and RX LEDs
On your board, you will find two labels: TX (transmit) and RX (receive).
They appear in two places on the Arduino UNO board. First, at the digital
pins 0 and 1, to indicate the pins responsible for serial communication.
Second, the TX and RX led (13). The TX led flashes with different speed
while sending the serial data. The speed of flashing depends on the baud
rate used by the board. RX flashes during the receiving process.

Digital I/O
The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide
PWM (Pulse Width Modulation) output. These pins can be configured to
work as input digital pins to read logic values (0 or 1) or as digital output
pins to drive different modules like LEDs, relays, etc. The pins labeled “~”
can be used to generate PWM.

AREF
AREF stands for Analog Reference. It is sometimes, used to set an external
reference voltage (between 0 and 5 Volts) as the upper limit for the analog
input pins.

After learning about the main parts of the Arduino UNO board, we are ready to learn how
to set up the Arduino IDE. Once we learn this, we will be ready to upload our program on the
Arduino board. In this section, we will learn in easy steps, how to set up the Arduino IDE on our
computer and prepare the board to receive the program via USB cable.
STEP 1 − First you must have your Arduino board (you can choose your favorite board) and a
USB cable. In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega 2560, or

ASRA 14 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Diecimila, you will need a standard USB cable (A plug to B plug), the kind you would connect
to a USB printer as shown in the following image.

Fig 3.3.1.b Mini-B cable


In case you use Arduino Nano, you will need an A to Mini-B cable instead as shown in the
following image.

STEP 2 − DOWNLOAD ARDUINO IDE SOFTWARE.


You can get different versions of Arduino IDE from the Download page on the Arduino
Official website. You must select your software, which is compatible with your operating system
(Windows, IOS, or Linux). After your file download is complete, unzip the file

ASRA 15 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Fig 3.3.1.c Download Arduino Ide Software.


STEP 3 − POWER UP YOUR BOARD.
The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw power from
either, the USB connection to the computer or an external power supply. If you are using an
Arduino Diecimila, you have to make sure that the board is configured to draw power from the
USB connection. The power source is selected with a jumper, a small piece of plastic that fits
onto two of the three pins between the USB and power jacks. Check that it is on the two pins
closest to the USB port. Connect the Arduino board to your computer using the USB cable. The
green power LED (labeled PWR) should glow.
STEP 4 − LAUNCH ARDUINO IDE.
After your Arduino IDE software is downloaded, you need to unzip the folder. Inside the
folder, you can find the application icon with an infinity label (application.exe). Double-click the
icon to start the IDE.

ASRA 16 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Fig 3.3.1.d Launch Arduino Ide


STEP 5 − OPEN YOUR FIRST PROJECT.
Once the software starts, you have two options −
• Create a new project.
• Open an existing project example.
• To create a new project, select File → New

ASRA 17 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Fig 3.3.1.e Arduino software


To open an existing project example, select File → Example → Basics → Blink.

ASRA 18 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Here, we are selecting just one of the examples with the name Blink. It turns the LED on
and off with some time delay. You can select any other example from the list.
STEP 6 − SELECT YOUR ARDUINO BOARD.
To avoid any error while uploading your program to the board, you must select the correct
Arduino board name, which matches with the board connected to your computer.
Go to Tools → Board and select your board.

Fig 3.3.1.f Select Your Arduino Board


Here, we have selected Arduino Uno board according to our tutorial, but you must select
the name matching the board that you are using.

ASRA 19 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

STEP 7 − SELECT YOUR SERIAL PORT.


Select the serial device of the Arduino board. Go to Tools → Serial Port menu. This is
likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports).
To find out, you can disconnect your Arduino board and re-open the menu, the entry that
disappears should be of the Arduino board. Reconnect the board and select that serial port.

Fig 3.3.1.g Select Your Serial Port


STEP 8 − UPLOAD THE PROGRAM TO YOUR BOARD.
Before explaining how we can upload our program to the board, we must demonstrate the
function of each symbol appearing in the Arduino IDE toolbar.

ASRA 20 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Fig 3.3.1.h Upload The Program To Your Board


A − Used to check if there is any compilation error.
B − Used to upload a program to the Arduino board.
C − Shortcut used to create a new sketch.
D − Used to directly open one of the example sketch.
E − Used to save your sketch.
F − Serial monitor used to receive serial data from the board and send the serial data to the board.
Now, simply click the "Upload" button in the environment. Wait a few seconds; you will
see the RX and TX LEDs on the board, flashing. If the upload is successful, the message "Done
uploading" will appear in the status bar. The Arduino program structure and we will learn more
new terminologies used in the Arduino world. The Arduino software is open-source. The source
code for the Java environment is released under the GPL and the C/C++ microcontroller libraries
are under the LGPL.
Sketch − The first new terminology is the Arduino program called “sketch”.
3.3.2 POWER SUPPLY MODULES:
• Step down transformer
• Bridge rectifier with filter
• Voltage regulators

ASRA 21 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Fig 3.3.2.a Power Supply Modules


TRANSFORMER
Transformers convert AC electricity from one voltage to another with little loss of
power. Transformers work only with AC and this is one of the reasons why mains electricity is
AC. Step-up transformers increase voltage, step-down transformers reduce voltage.
A step down power transformer is used to step down the AC voltage from the line voltage
of 110 VAC or 220 VAC i.e, it converts higher voltage at the input side to a lower voltage at the
output.

Fig 3.3.2.b Transformer


RECTIFIER
There are several ways of connecting diodes to make a rectifier to convert AC to DC.
The bridge rectifier is the most important and it produces full-wave varying DC

Bridge rectifier Output: full-wave varying DC


Fig 3.3.2.c Rectifier

ASRA 22 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

FILTER
Filtering is performed by a large value electrolytic capacitor connected across the DC
supply to act as a reservoir, supplying current to the output when the varying DC voltage from
the rectifier is falling. The diagram shows the unfiltered varying DC (dotted line) and the filtered
DC (solid line). The capacitor charges quickly near the peak of the varying DC, and then
discharges as it supplies current to the output.

Fig 3.3.2.d Typically 1000 Μf Capacitor Is Used In Microcontroller Of 8051.


This is a simple DC regulated supply project using 7805 voltage regulator to obtain a variable
DC voltage range from 5V to 15V

Fig 3.3.2.e Regulator


Pin out of the 7805 regulator IC.
1. Unregulated voltage in
2. Ground
3. Regulated voltage out
If you need other voltages than +5V, you can modify the circuit by replacing the 7805
chips with another regulator with different output voltage from regulator 78xx chip family. The
last numbers in the the chip code tells the output voltage. Remember that the input voltage must
be at least 3V greater than regulator output voltage ot otherwise the regulator does not work well.

ASRA 23 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

3.3.3 ALPHANUMERIC LCD


Liquid Crystal Display also called as LCD is very helpful in providing user interface as
well as for debugging purpose. The most commonly used Character based LCDs are based on
Hitachi's HD44780 controller or other which are compatible with HD44580. The most commonly
used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1
controller and support at most of 80 characters, whereas LCDs supporting more than 80 characters
make use of 2 HD44780 controllers.
PIN DESCRIPTION

Fig 3.3.3.a LCD Pin diagram

Pin No. Name Description


1 VSS Power supply (GND)
2 VCC Power supply (+5V)
3 VEE Contrast adjusts
0 = Instruction input
4 RS
1 = Data input
0 = Write to LCD module
5 R/W
1 = Read from LCD module
6 EN Enable signal
7 D0 Data bus line 0 (LSB)
8 D1 Data bus line 1
9 D2 Data bus line 2
10 D3 Data bus line 3
11 D4 Data bus line 4
12 D5 Data bus line 5

ASRA 24 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

13 D6 Data bus line 6


14 D7 Data bus line 7 (MSB)
15 LED+ Back Light VCC
16 LED- Back Light GND
LCD INTERFAC WITH MICROCONTROLLER

Microcontroller

P
O
R
T
P
I
N
S

Fig 3.3.3.b Lcd Interfac With Microcontroller


INTERFACING LCD TO MICROCONTROLLER
The LCD is generally interfaced in 8-bit mode or 4-bit mode. in this project LCD is
connected in 4-bit mode the interface connections of LCD with microcontroller are as follows
1. RS of LCD is connected to p0.0 of microcontroller
2. EN of LCD is connected to p0.1 of microcontroller
3. D4 of LCD is connected to p0.4 of microcontroller
4. D5 of LCD is connected to p0.5 of microcontroller
5. D6 of LCD is connected to p0.6 of microcontroller
6. D7 of LCD is connected to p0.7 of microcontroller
In 8-bit mode, the complete ASCII code is sent at once along with the control signals.
But in 4-bit mode, the data is divided into two parts, i.e. MSB & LSB, and are called upper nibble
& lower nibble.

ASRA 25 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

To transfer the data/command in 8-bit mode, the data is written to the 8-bit data bus after
selecting the required register and setting the mode to write mode. The E signal pin is then given
a high to low signal to transfer the data.
To transfer the data/command in 4-bit mode, the higher nibble is first written to the MSB
of the data port and the E is given a high to low signal. After a little delay or when the LCD is not
busy, the lower nibble is transferred in the same procedure.
3.3.4 SOUND SENSOR

Fig 3.3.4 Sound Sensor


The sound sensor is one type of module used to notice the sound. Generally, this module
is used to detect the intensity of sound. The applications of this module mainly include switch,
security, as well as monitoring. The accuracy of this sensor can be changed for the ease of usage.
This sensor employs a microphone to provide input to buffer, peak detector and an amplifier. This
sensor notices a sound, & processes an o/p voltage signal to a microcontroller. After that, it
executes required processing. This sensor is capable to determine noise levels within DB’s or
decibels at 3 kHz 6 kHz frequencies approximately wherever the human ear is sensitive. In
smartphones, there is an android application namely decibel meter used to measure the sound
level.
PIN CONFIGURATION OF SOUND SENSOR
• Pin1 (VCC): 3.3V DC to 5V DC
• Pin2 (GND): This is aground pin
• Pin3 (DO): This is an output pin

ASRA 26 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Working Principle The working principle of this sensor is related to human ears.
Because human eye includes a diaphragm and the main function of this diaphragm is, it uses the
vibrations and changes into signals. Whereas in this sensor, it uses a microphone and the main
function of this is, it uses the vibrations and changes into current otherwise voltage. Nowadays, a
lot of security events are initiated due to some sort of sound which includes gunshots, aggressive
behaviour, breaking the glass. But cameras with inbuilt sound exposure facilities can add huge
value to the security system. Because they give an alert automatically when real and potential
incidents occur. Then immediately they activate quick and appropriate actions to reduce the
consequences
SPECIFICATIONS
• The range of operating voltage is 3.⅗ V
• The operating current is 4~5 mA
• The voltage gain 26 dB ((V=6V, f=1kHz)
• The sensitivity of the microphone (1kHz) is 52 to 48 dB
• The impedance of the microphone is 2.2k Ohm
• The frequency of m microphone is16 to 20 kHz
• The signal to noise ratio is 54 dB
A sound sensor is defined as a module that detects sound waves through its intensity and
converting it to electrical signals. But do you know how sound sensor work? What it is used for?
and How to pair a sound sensor with Arduino? Fear not, with today’s guide, I’ll be answering all
of these questions!
In today’s sound sensor guide, I’ll be covering:
• How does a sound sensor work?
• Sound sensor applications
• Sound sensor Arduino tutorial
• Sound sensor projects to help you get started
Sound detection sensor works similarly to our Ears, having diaphragm which converts
vibration into signals. However, what’s different as that a sound sensor consists of an in-built
capacitive microphone, peak detector and an amplifier (LM386, LM393, etc.) that’s highly
sensitive to sound.

ASRA 27 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Application
1. Consumer electronics such as phones, computers, music systems
2. Security and Monitoring systems such as burglar alarms, door alarm, etc.
3. Home automation such as lighting your house by detecting whistle/clap instead of
physically turning the light switch
4. Ambient sound recognition and sound level recognition
3.3.5 DETAILS ABOUT DC MOTORS
Permanent magnet DC motor responds to both voltage and current. The steady state voltage
across a motor determines the motor’s running speed, and the current through its armature
windings determines the torque. Apply a voltage and the motor will start running in one direction;
reverse the polarity and the direction will be reversed. If you apply a load to the motor shaft, it
will draw more current, if the power supply does not able to provide enough current, the voltage
will drop and the speed of the motor will be reduced. However, if the power supply can maintain
voltage while supplying the current, the motor will run at the same speed. In general, you can
control the speed by applying the appropriate voltage, while current controls torque. In most
cases, DC motors are powered up by using fixed DC power supply, therefore; it is more efficient
to use a chopping circuit.
Consider what happens when a voltage applied to a motor’s windings is rapidly turned ON
and OFF in such a way that the frequency of the pulses produced remains constant, but the width
of the ON pulse is varied. This is known as Pulse Width Modulation (PWM). Current only flows
through the motor during the ON portion of the PWM waveform. If the frequency of the PWM
input is high enough, the mechanical inertia of the motor cannot react to the ripple wave; instead,
the motor behaves as if the current were the DC average of the ripple wave. Therefore, by
changing the width of pulse, we can control the motor speed.

ASRA 28 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

At the most basic level, electric motors exist to convert electrical energy into mechanical
energy. This is done by way of two interacting magnetic fields -- one stationary, and another
attached to a part that can move. A number of types of electric motors exist, but most BEAM bots
use DC motors in some form or another. DC motors have the potential for very high torque
capabilities (although this is generally a function of the physical size of the motor), are easy to
miniaturize, and can be "throttled" via adjusting their supply voltage. DC motors are also not only
the simplest, but the oldest electric motors.
Oersted, Gauss, and Faraday discovered the basic principles of electromagnetic
induction in the early 1800’s. By 1820, Hans Christian Oersted and Andre Marie Ampere had
discovered that an electric current produces a magnetic field. The next 15 years saw a flurry of
cross-Atlantic experimentation and innovation, leading finally to a simple DC rotary motor. A
number of men were involved in the work, so proper credit for the first DC motor is really a
function of just how broadly you choose to define the word "motor
PRINCIPLES OF OPERATION
In any electric motor, operation is based on simple electromagnetism. A current carrying
conductor generates a magnetic field; when this is then placed in an external magnetic field, it
will experience a force proportional to the current in the conductor, and to the strength of the
external magnetic field. As you are well aware of from playing with magnets as a kid, opposite
(North and South) polarities attract, while like polarities (North and North, South and South)
repel. The internal configuration of a DC motor is designed to harness the magnetic interaction
between a current -carrying conductor and an external magnetic field to generate rotational
motion. Let's start by looking at a simple 2-pole DC electric motor (here dark black represents a
magnet or winding with a "North" polarization, while light color represents a magnet or winding
with a "South" polarization).
Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator, commutator,
field magnet’s, and brushes. In most common DC motors, the external magnetic field is produced
by high-strength permanent magnets. The stator is the stationary part of the motor -- this includes
the motor casing, as well as two or more permanent magnet pole pieces. The rotor (together with
the axle and attached commutator) rotates with respect to the stator. The rotor consists of windings
(generally on a core), the windings being electrically connected to the commutator. The above
diagram shows a common motor layout -- with the rotor inside the stator (field) magnets.

ASRA 29 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

Fig 3.3.5 DC Motor working


The geometry of the brushes, commutator contacts, and rotor windings are such that
when power is applied, the polarities of the energized winding and the stator magnet(s) are
misaligned, and the rotor will rotate until it is almost aligned with the stator's field magnets. As
the rotor reaches alignment, the brushes move to the next commutator contacts, and energize the
next winding. Given our example two-pole motor, the rotation reverses the direction of current
through the rotor winding, leading to a "flip" of the rotor's magnetic field, driving it to continue
rotating.
In real life, though, DC motors will always have more than two poles (three is a very
common number). In particular, this avoids "dead spots" in the commutator. You can imagine how
with our example two-pole motor, if the rotor is exactly at the middle of its rotation (perfectly
aligned with the field magnets), it will get "stuck" there. Meanwhile, with a two-pole motor, there
is a moment where the commutator shorts out the power supply (i.e., both brushes touch both
commutator contacts simultaneously). This would be bad for the power supply, waste energy, and
damage motor components as well. Yet another disadvantage of such a simple motor is that it
would exhibit a high amount of torque "ripple" (the amount of torque it could produce is cyclic
with the position of the rotor).
D.C. Motors with field coils are classified as series. Shunt, compound and separately
excited according to how the field windings and armature windings are connected. With the series

ASRA 30 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

wound motor the armature and fields coils are in series. Such a motor exerts the highest starting
torque and has the greatest no-load speed. With light loads there is a danger that a series wound
motor might run at too high a speed. Reversing the polarity of the supply to the coils has no effect
on the direction of rotation of the motor, it will continue rotating in the same direction since both
the field and armature currents have been reversed.
With the shunt wound motor the armature and field coils are in parallel. it provides the
lowest starting torque, a much lower no- load speed and has good speed regulation. Because of
this almost constant speed regardless of load, shunt wound motors are very widely used to reverse
the direction of rotation, either the armature or field supplied must be reversed. For this reason,
the separately excited windings are preferable for such a situation.
The compound motor has two field windings, one in series with the armature and one
in parallel. Compound wound motors aim to got the best features of the series and shunt wound
motors, namely a high starting torque and good speed regulation. The separately excited motor
has separate control of the armature and field currents and can be considered to be a special case
of the shunt wound motor. The torque-speed characteristics of the above motors and the speed of
such D.C. Motors can be changed by either changing the armature current or the field current.
Generally it is the armature current that is varied. The choice of motor will depend on its
application. For example, with a robot, manipulator, and the robot wrist might use a series wound
motor because the speed decreases as the load increases. a shunt wound motor would be used
where a constant speed was required, regardless of the load. The speed of a permanent magnet
motor depends on the current through the armature coil. With a field coil motor either varying the
armature current or the field current can change the speed; generally it is the armature current that
is varied. Thus speed control can be obtained by controlling the voltage applied to the armature.
However, because fixed voltage supplies are often used, an electronic circuit obtains a variable
voltage.
With an alternating current supply, the thyristor circuit can be used to control the average
voltage applied to the armature. However, we are often concerned with the control of D.C. Motors
by means of control signals emanating from microprocessors. In such cases the technique known
as pulse width modulation (PWM) is generally used. This basically involves taking a constant
D.C. supply voltage and chopping it so that the average value is varied.

ASRA 31 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

3.3.6 ESP32-CAM

Fig 3.3.6 E32-Cam


• The board is powered by an ESP32-S SoC from Espressif, a powerful, programmable
MCU with out-of-the-box WIFI and Bluetooth.
• It’s the cheapest ESP32 dev board that offers an onboard camera module, MicroSD
card support, and 4MB PSRAM at the same time.
• Adding an external wifi antenna for signal boosting requires extra soldering work.
• The board does not have a conventional USB port, you will have to use either an FTDI
programmer, or an add-on HAT, or an Arduino UNO along with the Arduino IDE/ESP-
IDF DEV tools to upload codes to it.
• Being a low-cost board in a small enough form factor has made it extremely popular for
many IoT and machine vision applications.
• The outdated spec sheet and many tutorial pages say that the ESP32-CAM only supports
two camera modules (OV2640 & OV7670), while in fact you can use many cameras
with it, simply scroll down for more details.
3.3.7 L298N Module
L298N module is a high voltage, high current dual full-bridge motor driver module for
controlling DC motor and stepper motor. It can control both the speed and rotation direction of
two DC motors. This module consists of an L298 dual-channel H-Bridge motor driver IC. This
module uses two techniques for the control speed and rotation direction of the DC motors. These
are PWM – For controlling the speed and H-Bridge – For controlling rotation direction. These
modules can control two DC motor or one stepper motor at the same time.

ASRA 32 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

L298N Motor Driver Hardware Overview


This motor driver module consists of two main key components, these are L298 motor
driver IC and a 78M05 5V regulator.

Fig 3.3.7.a Motor Driver Hardware Overview


L298N Motor Driver Module Hardware Overview
L298 motor driver IC
L298 is a high voltage, high current dual full-bridge motor driver IC. It accepts standard TTL
logic levels (Control Logic) and controls inductive loads such as relays, solenoids, DC and
Stepper motors. This is a 15 pin IC. According to the L298 datasheet, its operating voltage is +5
to +46V, and the maximum current allowed to draw through each output 3A. This IC has two
enable inputs, these are provided to enable or disable the device independently of the input
signals.
A black color heat sink is attached to the L298 IC of the module. A heat sink is a passive
heat exchanger that transfers the heat generated by an electronic or a mechanical device to a fluid
medium, often air or a liquid coolant.
78M05 5V REGULATOR
The module has an on-board 78M05 5V Voltage regulator. This Voltage regulator will be
performed only when the 5V Enable jumper is placed. When the power supply is less than or
equal to 12V, then the internal circuitry will be powered by the voltage regulator, and the 5V pin
can be used as an output pin to power the microcontroller or other circuitry (sensor).

ASRA 33 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

The jumper should not be placed when the power supply is greater than 12V and separate 5V
should be given through 5V terminal to power the internal circuitry.
L298N Motor Driver Module Pin Diagram

Fig 3.3.7.b L298N Motor Driver Module Pin Diagram/Pinout/Pin configuration


HOW MOTOR DRIVER MODULE WORKS
This module uses two techniques for the control speed and rotation direction of the DC
motors. These are H-Bridge – For controlling rotation direction and PWM – For controlling the
speed.
H-BRIDGE TECHNIQUES
L298n motor driver module uses the H-Bridge technique to control the direction of
rotation of a DC motor. In this technique, H-Bridge controlled DC motor rotating direction by
changing the polarity of its input voltage.
An H-Bridge circuit contains four switching elements, like transistors (BJT or MOSFET), with
the motor at the center forming an H-like configuration. Input IN1, IN2, IN3, and IN4 pins
actually control the switches of the H-Bridge cir`cuit inside L298N IC.

ASRA 34 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

We can change the direction of the current flow by activating two particular switches at
the same time, this way we can change the rotation direction of the motor.
PWM (Pulse Width Modulation) Techniques L298n motor driver module uses the PWM
technique to control the speed of rotation of a DC motor. In this technique, the speed of a DC
motor can be controlled by changing its input voltage.
Pulse Width Modulation is a technique where the average value of the input voltage is
adjusted by sending a series of ON-OFF pulses. The average voltage is proportional to the width
of the pulses, these pulses known as Duty Cycle.
If the duty cycle higher, then the average voltage is applied to the DC motor (High
Speed), and the lower the duty cycle, the less the average voltage being applied to the dc
motor(Low Speed).
3.3.8 JUMPER WIRES
These are male to male jumper wires used in connecting the male header pin of any
development board to other development boards having a male connector.
They are simple wires that have connector pins at each end allowing them to be used to connect
two points to each other. Jumper wires are typically used with breadboards and other
prototyping tools in order to make it easy to change a circuit as needed.
40 strip Male to Male jumper wire each cable length about 20cm or 8-inch.

Fig 3.3.8 Jumper wires


WORKING
This has two ends where both male ends have a pin protruding and can plug into things.
Male-to-male jumper wires are the most common and what you likely will use most often. When
connecting two ports on a breadboard, a male-to-male wire is used.

ASRA 35 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

FEATURES
• It connects two points to each other without soldering
• It is reusable
APPLICATIONS
It is used to interconnect the components of a breadboard or other prototype or test circuit
internally or with other equipment or components without soldering.
3.3.9 HC-SR501

Fig 3.3.9 HC-SR 501 Module


All objects, including the human body, at temperatures above absolute zero (0 Kelvin /
-273.15 °C) emit heat energy in the form of infrared radiation. The hotter an object is, the more
radiation it emits. This radiation is not visible to the human eye because it is emitted at infrared
wavelengths. The PIR sensor is speci fically designed to detect such levels of infrared radiation.

ASRA 36 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

CHAPTER -4
RESULT

Fig 4 Project kit and result

ASRA 37 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

CHAPTER -5
FUTURE SCOPE

1. There are numerous enhancements to the current design and technology that can be
made, as well as numerous introduced. extra features that may be
2. Different types of sensors, such as temperature sensors, pressure sensors, heat sensors,
position sensors, and proximity sensors, can be used to use robots in many fields.
3. A wireless network can be used to create a multipurpose robot, with applications ranging
from surveillance and home security to industrial applications where the user does not
need to be physically present at the work site but may do it from his house

ASRA 38 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

CHAPTER -6
CONCLUSION
According to this system, whole area surveillance is done using the night vision camera
and also automatic system when the sound is detected robot will follow the particular path and go
to that area and capture the area and send using IOT Esp32 module. This system is an automatic
smart way for night vision patrolling.

ASRA 39 DEPT
WOMEN’S SAFTEY PATROLLING ROBOT USING ARDUINO, IOT

CHAPTER -7
REFERENCES
[1] “Review of human detection techniques in night vision” in 2017 International Conference on
Wireless Communications, Signal Processing and Networking (WiSPNET)
[2] Eun Som Jeon et al., "Human detection based on the generation of a background image by
using a far-infrared light camera", Sensors, vol. 15, no. 3, pp. 6763-6788, 2015.
[3] Dushyant Kumar Singh, Dharmender Singh Kushwaha, "automatic intruder combat system:
a way to smart border surveillance", Defence Science Journal, vol. 6

ASRA 40 DEPT

You might also like