Final Report
Final Report
A PROJECT REPORT
Submitted by
Of
BACHELOR OF ENGINEERING
In
ELECTRONICS & COMMUNICATION ENGINEERING
i
BONAFIDE CERTIFICATE
Certified that this report titled “ANDROID CONTROLLED 360 DEGREE
INSPECTION SURVEILLANCE TRACKING ROBOT” is the Bonafide
work of ABDUL RAHMAN J (812021106001), ARVIND P(812021106009),
RAVI KANNAN B (812021106031), SURYA SUBASH R (8120201106038)
who carried out the project work under my supervision.
SIGNATURE SIGNATURE
Dr.G.HARIDOSS, M.E., Ph.D., Mr.M.SYED ABDUL SALAM.,M.E
ii
ACKNOWLEDGEMENT
With warm hearts and immense pleasure, I thank the almighty for his
grace and blessing bestowed on me, which drove me to the successful
completion of this project. I take this opportunity to express my sincere
thanks to the respected Director Dr.M.A. Maluk Mohammed, M.E.,
Ph.D., and Secretary & Correspondent Mrs. Fathima Bathool Maluk,
M.B.A., who is guiding light for all activities in our college.
I take this opportunity to express my sincere thanks to the respected
Principal Dr.X.Susan Christina, M.E., Ph.D., who acts as the mentor
figure for all operations in our college.
I would like to thank our Head of the department Dr. G. Haridoss,
M.E., Ph.D., for his co-operation, advice and suggestions at every
stage of my project work.
I would also like to express with gratitude and my sincere thanks to my
guide Mr.M.Syed Abdul salam, Associate Professor, Department of
Electronics and Communication Engineering for motivating me
throughout the project work.
I am very proud to extend my sincere gratitude to our Project
coordinator Mrs. S. Kavitha, M.E., Associate Professor, Department
of Electronics and Communication Engineering, M.A.M College of
Engineering & Technology, for his excellent guidance, advice and
encouragement which boosted up our energy throughout the project
development.
I also thank all the teaching faculties and non-teaching staff of the
Electronics and Communication Engineering, my parents, and all my
friends fortheir help and support to complete this project successfully.
iii
ABSTRACT
iv
TABLE OF CONTENTS
TABLE OF CONTENT V
LIST OF FIGURE Vi
INTRODUCTION 1
1
LITERATURE SURVEY 4
2
EXISTING SYSTEM 8
3
PROPOSED SYSTEM 10
4
5.1.1 Features 25
5.1.2 Specification 27
5.1.3 Microcontroller 35
6 CONCLUSION 50
60
REFERENCE
v
LIST OF FIGURES
4.1.4 Battery 20
vi
CHAPTER 1
INTRODUCTION
1
INTERNET OF THINGS
On one hand, forest fires present a significant challenge to human life and
natural ecological environment. If a forest fire cannot be promptly extinguished,
it will have a bad impact on a wide area. Reaction time is one of the key factors
that determine the success of forest fire suppression. On the other hand, there was
extensive research on photoelectric- or ionization-based fire smoke detectors.
However, these sensors are limited by the fact that these always serve as point
sensors in space, which are unsuitable at monitoring larger areas such as early
forest fire detection. The limitations of current smoke sensors have prompted
researches on vision-based smoke detection methods.
Lightning is one of the reasons for natural forest fire .It occurs due to
combustion of dry fuel in the forest like leaves. Fire caused due to man-made are
more like smoking, due to any miscellaneous activities. The fire caused due to
man-made is more than natural forest fire. But large area damage is caused by
natural forest fire because it cannot be predicted.
So from this we can find that the damage in the forest are more and an
immediate precautions has to be taken to reduce the forest fires. A possible action
has to be taken by the government and also by the forest department to reduce the
fire. Some of the actions taken by the government is restricting the people to enter
the forest areas without any permission from the forest officers. Usage of fire
2
causing materials are prohibited inside the forest areas ,in any wild life
sanctuaries and also in local forest areas. Regular monitoring activities are taken
by the forest department by using cameras in the forest areas. To avoid huge
damage of forest from the natural fire an precautions are taken by the government
and forest departments by having some emergency equipment’s to reduce the fire
like fire extinguisher and some rangers are appointed in the forest areas to give
immediate information about the fire in the forest so that immediate necessary
actions can be taken. So to reduce the damages in the forest area due to forest
fires a device can be used were the device is built with some modern technologies.
In the modern world immediate information are send and received in a quick time.
Even normal activities are informed through this technologies, it is possible and
important to inform this kind of information in a quicker time. This information
helps the government to reduce the damage in the forest by fire.
3
CHAPTER 2
LITERATURE SURVEY
IoT Based Smart Surveillance robot System. This paper is presented by M Sri
Lakshmi., C Padma IoT technology is being used in almost each and every aspect
in this modern world. This paper elaborates the way of using the power of Iot in
the field of Surveillance robot. The IoT based surveillance robot systems enables
the user to view the activity from a remote location. It also facilitates the user to
receive notifications whenever the intrusion is detected with the help of sensors
connected with the surveillance robot cameras. This reduces the human
intervention in the Surveillance robot monitoring and reduces the errors of
manual surveillance robot.
4
Rishabh Paunikar, Shubham Thakare, Utkarsh Anuse “ ACTION
RECOGNITION USING SURVEILLANCE ROBOT SYSTEM ”
International Journal of Engineering Applied Science and Technology (IJEAST
) Volume: 04 Issue:12| April-2020
5
Prashant Balraj Balla , K.T.Jadhao “IOT BASED FACIAL
RECOGNITION SECURITY SYSTEM” International Conference on Smart
City and Emerging Technology (ICSCET) Volume:01 Issue:04| May- 2018.
M. Van Der Werff, X. Gui and W.L. xu, “A MOBILE BASED HOME
AUTOMATION SYSTEM,” 2005 2nd Asia pacific conference on Mobile
Technology, Applications and systems, 2005, pp.5, doi:
10.1109/MTAS.2005.207158.
6
and implemented using the GSM cellular connection network. This design
incorporates the controlled device, the microcontroller, and the GSM Module,
allowing it to be used in a variety of applications. Instead of a microcontroller,
the proposed M2M system in this study uses a PC as the terminal user.
7
vaults and houses where human presence is not available. It is not necessary to
continuously monitor the area with cameras in such situations. This consumes
both the power and the storage space required for the footages. Using a PIR
sensor, our system will detect human presence. For remote sensing and
surveillance robot, Raspberry Pi operates and controls motiondetecting sensors
and video cameras, transmits live video and records it for later viewing.
CHAPTER 3
EXISTING SYSTEM
8
An embedded system is a set of computer hardware and software that is either
fixed in capabilities or programmable and is built for a certain type of application
device. Embedded systems can be found in a variety of places, including
industrial machines, automobiles, medical equipment, cameras, household
appliances, aeroplanes, vending machines, and toys (in addition to the more
visible cellular phone and PDA). A programming interface is provided for
programmable embedded systems, and embedded systems programming is a
specialist vocation. Embedded Java and Windows XP Embedded, for example,
are operating systems and language platforms specifically designed for the
embedded market.
Here, to control the usage of security guard, the robot was designed with flipper
arm mechanism, camera, Wi-Fi module and some sensors like ultrasonic, thermal
and sound. This robot can be operated through Arduino UNO.
9
DISADVANTAGES
CHAPTER 4
PROPOSED SYTEM
The proposed functionalities of the design; we divide the system into two main
units: data acquisition and system control. The data acquisition is modelled using
the Arduino, IR sensor. Control system is through single-chip microcomputer
controlling the ESP Camera, then the real-time display of the received
information is achieved using ESPCamera.
• We can build a web system using the ESP32- CAM module without any
complex programming or additional components.
10
A surveillance robot using ESP32-CAM is a system that utilizes the ESP32-CAM
board and a robot chassis to create a mobile surveillance device. The ESP32-
CAM is a low-cost development board that integrates a small camera module and
Wi-Fi connectivity.The robot chassis allows the device to move around and
capture video in different locations. The system can be controlled through a
Arduino NANO based Bluetooth Control APK and PC interface based object
detection surveillance on the ESP32-CAM board. The PC interface allows the
user to monitor and bluetooth control the robot's movement, view live video
streams, and take snapshots of the video feed.
BLOCK DIAGRAM:
The fundamental idea behind a wheeled or track robot lies in it's drive mechanism
– differential drive and skid drive. Differential drive robots have 2 wheels and
one or two caster wheels/balls, while skid steer drive robots have either tracks, or
4 or more wheels. Differential drives robots are simpler to build and control, but
that skid steer drive robots, especially track robots look more cool.
12
Fig.4.3.1 Robotic Frame
13
4.1.4BATTERY
(12V/ 1.2A – LEAD ACID)
• The ambient light energy from the sun is harvested by the solar modules
and renewed into electrical energy (D.C. voltage).
• This D.C. voltage can be directly applied to power the WSN node load or
can be stored in a rechargeable battery for later use.
• This D.C. power obtained from solar energy is unregulated, and therefore,
we need voltage regulation/ power conditioning circuits.
14
4.1.5 BLUETOOTH
HC-05 6 Pin Wireless Serial Bluetooth Module is a Bluetooth module for use
with any microcontroller. It uses the UART protocol to make it easy to send and
receive data wirelessly. The HC-06 module is a slave only device. This means
that it can connect to most phones and computers with Bluetooth but it cannot
connect to another slave-only device such as keyboards and other HC-06
modules. To connect with other slave devices a master module would be
necessary such as the HC-05 version which can do both master and slave.
L298N 2A Based Motor Driver is a high power motor driver perfect for driving
DC Motors and Stepper Motors. It uses the popular L298 motor driver IC and
has an onboard 5V regulator which it can supply to an external circuit. It can
control up to 4 DC motors, or 2 DC motors with directional and speed control.
This motor driver is perfect for robotics and mechatronics projects and perfect
for controlling motors from microcontrollers, switches, relays, etc. Perfect for
driving DC and Stepper motors for micro mouse, line following robots, robot
arms, etc.
15
Fig. 4.1.6 Driver Module
CHAPTER 5
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS
ESP32 Cam
Arduino NANO
LCD Display
Robot Model
Battery
Charge Controller
Power Supply
16
SOFTWARE REQUIREMENTS
Power Supply
5V Power Supply
17
Transformer
Transformers are some of the most efficient electrical 'machines', with some large
units able to transfer 99.75% of their input power to their output. Transformers
come in a range of sizes from a thumbnail-sized coupling transformer hidden
18
inside a stage microphone to huge gigavolt-ampere-rated units used to
interconnect portions of national power grids. All operate with the same basic
principles, though a variety of designs exist to perform specialized roles
throughout home and industry.
The transformer is based on two principles: first, that an electric current can
produce a magnetic field (electromagnetism) and, second, that a changing
magnetic field within a coil of wire induces a voltage across the ends of the coil
(electromagnetic induction). By changing the current in the primary coil, one
changes the strength of its magnetic field; since the secondary coil is wrapped
around the same magnetic field, a voltage is induced across the secondary.
19
Rectifier
Bridge Rectifier
Basic operation
20
negative pole. In actuality, free electrons in a conductor nearly always flow from
the negative to the positive pole. In the vast majority of applications, however,
the actual direction of current flow is irrelevant. Therefore, in the discussion
below the conventional model is retained.
In each case, the upper right output remains positive and lower right output
negative. Since this is true whether the input is AC or DC, this circuit not only
produces a DC output from an AC input, it can also provide what is sometimes
called "reverse polarity protection". That is, it permits normal functioning of
DC-powered equipment when batteries have been installed backwards, or when
the leads (wires) from a DC power source have been reversed, and protects the
equipment from potential damage caused by reverse polarity.
IC Voltage Regulators
21
supply line to step the ac voltage to desired amplitude, then rectifying that ac
voltage, filtering with a capacitor and RC filter, if desired, and finally regulating
the dc voltage using an IC regulator. The regulators can be selected for operation
with load currents from hundreds of milliamperes to tens of amperes,
corresponding to power ratings from milliwatts to tens of watts.
22
vary over some acceptable range, the output voltage remains constant within
specified voltage variation limits. These limitations are spelled out in the
manufacturer’s specification sheets. There are two types of voltage regulator they
are 78xx series and 79xx series.
78xx series
There are common configurations for 78xx ICs, including 7805 (5 V), 7806 (6
V), 7808 (8 V), 7809 (9 V), 7810 (10 V), 7812 (12 V), 7815 (15 V), 7818 (18 V),
and 7824 (24 V) versions. The 7805 is the most common, as its regulated 5-volt
supply provides a convenient power source for most TTL components.
Less common are lower-power versions such as the LM78Mxx series (500 mA)
and LM78Lxx series (100 mA) from National Semiconductor. Some devices
provide slightly different voltages than usual, such as the LM78L62 (6.2 volts)
and LM78L82 (8.2 volts) as well as the STMicroelectronics L78L33ACZ (3.3
volts).
79xx series
The 79xx devices have a similar "part number" to "voltage output" scheme, but
their outputs are negative voltage, for example 7905 is -5 V and 7912 is -12 V.
The 7912 has been a popular component in ATX power supplies, and 7905 was
popular component in ATX before -5 V was removed from the ATX specification.
7805 +5 7.3
7806 +6 8.3
7808 +8 10.5
23
7810 +10 12.5
SOLUTION HIGHLIGHTS
24
A complete WiFi subsystem that complies with IEEE 802.11b/g/n
protocol and supports Station, SoftAP, and SoftAP + Station modes
A Bluetooth LE subsystem that supports features of Bluetooth 5 and
Bluetooth mesh
Highly integrated RF module that provides industry-leading power and
RF performance
State of the art power management designed for a wide range of
applications with its multiple low-power modes. The ULP coprocessor can
operate in ultra-low-power mode.
Powerful storage capacities ensured by 512 KB SRAM and 384 KB
ROM on the chip, and SPI, Dual SPI, Quad SPI, Octal SPI, QPI, and OPI
interfaces that allow connection to flash and external RAM
Rich set of peripheral interfaces and GPIOs, ideal for various scenarios
and complex applications
5.1.1 FEATURES
WiFi
ESP32 - NodeMCU
BLUETOOTH
26
Xtensa® dual-core 32-bit LX7 microprocessor, up to 240 MHz
CoreMark® score:
- 1 core at 240 MHz: 613.86 CoreMark; 2.56 CoreMark/MHz
- 2 cores at 240 MHz: 1181.60 CoreMark; 4.92 CoreMark/MHz
128-bit data bus and SIMD commands
384 KB ROM
512 KB SRAM
16 KB SRAM in RTC
SPI, Dual SPI, Quad SPI, Octal SPI, QPI and OPI interfaces that allow
connection to multiple flash and external RAM
Flash controller with cache is supported
Flash in-Circuit Programming (ICP) is supported
5.1.2 SPECIFICATIONS
27
It also has wide variety of peripherals available, like: capacitive touch,
ADCs, DACs, UART, SPI, I2C and much more.
It comes with built-in hall effect sensor and built-in temperature sensor.
Architecture 32 bits
RAM 512 KB
28
ESP32 PINOUT GUIDE
The ESP32 has more GPIOs with more functionality compared to the ESP826.
With the ESP32 you can decide which pins are UART, I2C, or SPI – you just
need to set that on the code. This is possible due to the ESP32 chip’s multiplexing
feature that allows to assign multiple functions to the same pin. If you don’t set
them on the code, the pins will be used as default – as shown in the figure below
(the pin location can change depending on the manufacturer).
The core of this module is the ESP32 chip, which is scalable and adaptive. Two
CPU cores can be individually controlled. The clock frequency is adjustable from
80 MHz to 240 MHz and supports RTOS. It is a general-purpose Wi-Fi+BT+BLE
MCU module.ESP-WROOM-32s. The module integrates traditional Bluetooth,
Bluetooth low energy and Wi-Fi. Wide range of uses: Wi-Fi supports a wide
range of communication connections, as well as direct connection to the Internet
via a router; Bluetooth allows users to connect to a mobile phone or broadcast a
BLE Beacon for signal detection. The module supports data rates up to 150 Mbps
and antenna output power of 20 dBm for maximum wireless communication. As
a result, this module has industry-leading specifications and performs well in
terms of high integration, wireless transmission distance, power consumption,
and network connectivity.
29
ESP32 V1.1 38 Pin NodeMCU Pin Diagram
30
5.1.3 ARDUINO:
Introduction:
Arduino is an open source platform for prototyping based on user-friendly
software. It provides a flexible base for engineers to experiment on designing
interactive environments. They can be programmed for specific applications to
create embedded systems which can control and sense real time parameters. It
consists of a microcontroller ATmega328 which is programmed using the arduino
software. The Arduino R3/Genuino R3 is the Indian version of the Arduino Uno
Board with an Arduino Uno Boot loader. It behaves like the arduino board
and programmed using the arduino IDE.
Its main components are
14 digital input/output pins ( 6 can be used as PWM outputs)
6 analog inputs(can also be used for digital I/O - so a total of 20 digital
I/O's)
16 MHz crystal oscillator
USB connection
ICSP header
reset button
List of On-Board Peripherals
31
5.1.4 THE MICROCONTROLLER
The Arduino R3 comes with an ATmega 328 Microcontroller with an
Arduino Uno Bootloader. The Bootloader facilitates the Programming of the IC
from within the Arduino IDE.
Memory
Memory can be broadly divided into 3 classes:
32KB Flash memory –This is the storage space of the compiled
program of which the boot loader uses 0.5 KB.
2KB SRAM – This is mainly used during run time.
1KB EEPROM –This is used for storing data that should not be
erased upon switching off power.
Power Setup
32
The Arduino R3 operates at 5 Volts. It can either be powered through USB
cable from the computer or through the DC jack provided on the Board.
The DC Jack
The voltage regulator 7805 is provided in the board for obtaining 5v
regulated output voltage. The input voltage applied can be between 7-25 volts
DC power.
USB Power
When powered through the USB, the 500mA Re-settable fuse on the USB
power line is used to abstain the board from drawing current in excess.
USB Connectivity
Since the ATmega328 does not use USB communication directly, the need
for a dedicated IC arises. FTDI FT232 IC is used to communicate between the
microcontroller and USB serially .The drivers required for the Serial to
USB converter has to be installed.
Summary
Microcontroller - ATmega328
Operating Voltage - 5V
Input Voltage - 7-12V
Digital I/O Pins - 14 (of which 6 provide PWM output)
Analog Input Pins -6
DC Current per I/O Pin - 40 mA
DC Current for 3.3V Pin - 50 mA
Flash Memory - 32 KB (ATmega328) of which 0.5 KB used by
Bootloader
SRAM - 2 KB (ATmega328)
EEPROM - 1 KB (ATmega328)
33
Clock Speed - 16 MHz
Hardware
The Arduino R3 / Arduino Uno Boards have 20 programmable I/O's.They
are grouped mainly as
Pins 0 to 13
Pins 0 to 5 [Analog Inputs 0 to 5]
Digital I/O's
The 20 I/O’s can accept digital signals as input as well as outputs. The
digital pins are numbered from 0 to 19.The Digital Pins can be used for
controlling LED's, Relays and for accepting input from Push-Buttons, Digital
Sensors
Analog I/O's
Analog inputs can be given to pins A0-A5.An inbuilt ADC analog to digital
converter is present that converts analog voltages in the range of 0 to 5 volts to
a 10-bit value. Analog sensors that sense changes in temperature or light can
work with these inputs.
34
Analog Output
The six pins marked PWM are pins dedicated to produce Analog Output
Signal. They can produce analog voltages in the range of 0 to 5 volts with a
resolution of 8-bits. They can be used for Intensity Control, Speed Control, Etc.
ARDUINO
Over the years Arduino has been the brain of thousands of projects, from
everyday objects to complex scientific instruments. A worldwide community of
makers - students, hobbyists, artists, programmers, and professionals - has
gathered around this open-source platform, their contributions have added up to
an incredible amount of accessible knowledge that can be of great help to novices
and experts alike.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool
for fast prototyping, aimed at students without a background in electronics and
programming. As soon as it reached a wider community, the Arduino board
started changing to adapt to new needs and challenges, differentiating its offer
from simple 8-bit boards to products for IoT applications, wearable, 3D printing,
and embedded environments. All Arduino boards are completely open-source,
35
empowering users to build them independently and eventually adapt them to their
particular needs. The software, too, is open-source, and it is growing through the
contributions of users worldwide.
5.2.1 FEATURES
Open source and extensible hardware - The plans of the Arduino boards
are published under a Creative Commons license, so experienced circuit
designers can make their own version of the module, extending it and improving
36
it. Even relatively inexperienced users can build the breadboard version of the
module in order to understand how it works and save money.
Writing Sketches
Programs written using Arduino Software (IDE) are called sketches. These
sketches are written in the text editor and are saved with the file extension .ino.
The editor has features for cutting/pasting and for searching/replacing text. The
message area gives feedback while saving and exporting and also displays errors.
The console displays text output by the Arduino Software (IDE), including
complete error messages and other information. The bottom righthand corner of
the window displays the configured board and serial port.
37
Arduino IDE
Additional commands are found within the five menus: File, Edit, Sketch,
Tools, Help. The menus are context sensitive, which means only those items
relevant to the work currently being carried out are available.
38
File
New Creates a new instance of the editor, with the bare minimum structure
of a sketch already in place.
Open Allows to load a sketch file browsing through the computer drives
and folders.
Open Recent Provides a short list of the most recent sketches, ready to be
opened.
Sketchbook Shows the current sketches within the sketchbook folder
structure; clicking on any name opens the corresponding sketch in a new
editor instance.
Examples Any example provided by the Arduino Software (IDE) or
library shows up in this menu item. All the examples are structured in a
tree that allows easy access by topic or library.
Close Closes the instance of the Arduino Software from which it is clicked.
Save Saves the sketch with the current name. If the file hasn't been named
before, a name will be provided in a "Save as.." window.
Save as... Allows to save the current sketch with a different name.
Page Setup It shows the Page Setup window for printing.
Print Sends the current sketch to the printer according to the settings
defined in Page Setup.
Preferences Opens the Preferences window where some settings of the
IDE may be customized, as the language of the IDE interface.
39
Quit Closes all IDE windows. The same sketches open when Quit was
chosen will be automatically reopened the next time you start the IDE.
Edit
Undo/Redo Goes back of one or more steps you did while editing; when
you go back, you may go forward with Redo.
Cut Removes the selected text from the editor and places it into the
clipboard.
Copy Duplicates the selected text in the editor and places it into the
clipboard.
Copy for Forum Copies the code of your sketch to the clipboard in a form
suitable for posting to the forum, complete with syntax coloring.
Copy as HTML Copies the code of your sketch to the clipboard as HTML,
suitable for embedding in web pages.
Paste Puts the contents of the clipboard at the cursor position, in the editor.
Select All Selects and highlights the whole content of the editor.
Comment/Uncomment Puts or removes the // comment marker at the
beginning of each selected line.
Increase/Decrease Indent Adds or subtracts a space at the beginning of
each selected line, moving the text one space on the right or eliminating a
space at the beginning.
Find Opens the Find and Replace window where you can specify text to
search inside the current sketch according to several options.
Find Next Highlights the next occurrence - if any - of the string specified
as the search item in the Find window, relative to the cursor position.
40
Find Previous Highlights the previous occurrence - if any - of the string
specified as the search item in the Find window relative to the cursor
position.
Sketch
Verify/Compile Checks your sketch for errors compiling it; it will report
memory usage for code and variables in the console area.
Upload Compiles and loads the binary file onto the configured board
through the configured Port.
Upload Using Programmer This will overwrite the bootloader on the
board; you will need to use Tools > Burn Bootloader to restore it and be
able to Upload to USB serial port again. However, it allows you to use the
full capacity of the Flash memory for your sketch. Please note that this
command will NOT burn the fuses. To do so a Tools -> Burn Bootloader
command must be executed.
Export Compiled Binary Saves a .hex file that may be kept as archive or
sent to the board using other tools.
Show Sketch Folder Opens the current sketch folder.
Include Library Adds a library to your sketch by inserting #include
statements at the start of your code. For more details, see libraries below.
Additionally, from this menu item you can access the Library Manager and
import new libraries from .zip files.
Add File... Adds a source file to the sketch (it will be copied from its
current location). The new file appears in a new tab in the sketch window.
Files can be removed from the sketch using the tab menu accessible
clicking on the small triangle icon below the serial monitor one on the right
side o the toolbar.
41
Tools
Auto Format This formats your code nicely: i.e. indents it so that opening
and closing curly braces line up, and that the statements inside curly braces
are indented more.
Archive Sketch Archives a copy of the current sketch in .zip format. The
archive is placed in the same directory as the sketch.
Fix Encoding & Reload Fixes possible discrepancies between the editor
char map encoding and other operating systems char maps.
Serial Monitor Opens the serial monitor window and initiates the
exchange of data with any connected board on the currently selected Port.
This usually resets the board, if the board supports Reset over serial port
opening.
Board Select the board that you're using. See below for descriptions of the
various boards.
Port This menu contains all the serial devices (real or virtual) on your
machine. It should automatically refresh every time you open the top-level
tools menu.
Programmer For selecting a hardware programmer when programming a
board or chip and not using the onboard USB-serial connection. Normally
you won't need this, but if you're burning a bootloader to a new
microcontroller, you will use this.
Burn Bootloader The items in this menu allow you to burn a bootloader
onto the microcontroller on an Arduino board. This is not required for
normal use of an Arduino board but is useful if you purchase a new
ATmega microcontroller (which normally comes without a bootloader).
Ensure that you've selected the correct board from the Boards menu before
burning the bootloader on the target board. This command also set the right
fuses.
42
Help
Here you find easy access to a number of documents that come with the Arduino
Software (IDE). You have access to Getting Started, Reference, this guide to
the IDE and other documents locally, without an internet connection. The
documents are a local copy of the online ones and may link back to our online
website.
Find in Reference This is the only interactive function of the Help menu: it
directly selects the relevant page in the local copy of the Reference for the
function or command under the cursor.
Sketchbook
The Arduino Software (IDE) uses the concept of a sketchbook: a standard place
to store your programs (or sketches). The sketches in your sketchbook can be
opened from the File > Sketchbook menu or from the Open button on the toolbar.
The first time you run the Arduino software, it will automatically create a
directory for your sketchbook. You can view or change the location of the
sketchbook location from with the Preferences dialog.
Allows you to manage sketches with more than one file (each of which
appears in its own tab). These can be normal Arduino code files (no visible
extension), C files (.c extension), C++ files (.cpp), or header files (.h).
Before compiling the sketch, all the normal Arduino code files of the sketch (.ino,
.pde) are concatenated into a single file following the order the tabs are shown in.
The other file types are left as is.
Uploading
43
Before uploading your sketch, you need to select the correct items from the Tools
> Board and Tools > Port menus. The boards are described below. On the Mac,
the serial port is probably something like /dev/tty.usbmodem241 (for an Uno or
Mega2560 or Leonardo) or /dev/tty.usbserial-1B1 (for a Duemilanove or earlier
USB board), or /dev/tty.USA19QW1b1P1.1 (for a serial board connected with a
Keyspan USB-to-Serial adapter). On Windows, it's probably COM1 or COM2
(for a serial board) or COM4, COM5, COM7, or higher (for a USB board) - to
find out, you look for USB serial device in the ports section of the Windows
Device Manager. On Linux, it should be /dev/ttyACMx , /dev/ttyUSBx or similar.
Once you've selected the correct serial port and board, press the upload button in
the toolbar or select the Upload item from the Sketch menu. Current Arduino
boards will reset automatically and begin the upload. With older boards (pre-
Diecimila) that lack auto-reset, you'll need to press the reset button on the board
just before starting the upload. On most boards, you'll see the RX and TX LEDs
blink as the sketch is uploaded. The Arduino Software (IDE) will display a
message when the upload is complete, or show an error.
When you upload a sketch, you're using the Arduino bootloader, a small program
that has been loaded on to the microcontroller on your board. It allows you to
upload code without using any additional hardware. The bootloader is active for
a few seconds when the board resets; then it starts whichever sketch was most
recently uploaded to the microcontroller. The bootloader will blink the on-board
(pin 13) LED when it starts (i.e. when the board resets).
Libraries
Libraries provide extra functionality for use in sketches, e.g. working with
hardware or manipulating data. To use a library in a sketch, select it from the
Sketch > Import Library menu. This will insert one or more #include statements
at the top of the sketch and compile the library with your sketch. Because libraries
44
are uploaded to the board with your sketch, they increase the amount of space it
takes up. If a sketch no longer needs a library, simply delete its #include
statements from the top of your code.
There is a list of libraries in the reference. Some libraries are included with the
Arduino software. Others can be downloaded from a variety of sources or through
the Library Manager. Starting with version 1.0.5 of the IDE, you do can import a
library from a zip file and use it in an open sketch. See these instructions for
installing a third-party library.
Third-Party Hardware
Support for third-party hardware can be added to the hardware directory of your
sketchbook directory. Platforms installed there may include board definitions
(which appear in the board menu), core libraries, bootloaders, and programmer
definitions. To install, create the hardware directory, then unzip the third-party
platform into its own sub-directory. (Don't use "arduino" as the sub-directory
name or you'll override the built-in Arduino platform.) To uninstall, simply delete
its directory.
Serial Monitor
This displays serial sent from the Arduino board over USB or serial connector.
To send data to the board, enter text and click on the "send" button or press enter.
Choose the baud rate from the drop-down menu that matches the rate passed to
Serial.begin in your sketch. Note that on Windows, Mac or Linux the board will
reset (it will rerun your sketch) when you connect with the serial monitor. Please
note that the Serial Monitor does not process control characters; if your sketch
needs a complete management of the serial communication with control
characters, you can use an external terminal program and connect it to the COM
port assigned to your Arduino board.
45
Preferences
Some preferences can be set in the preferences dialog (found under the Arduino
menu on the Mac, or File on Windows and Linux). The rest can be found in the
preferences file, whose location is shown in the preference dialog.
Boards
The board selection has two effects: it sets the parameters (e.g. CPU speed
and baud rate) used when compiling and uploading sketches; and sets and the file
and fuse settings used by the burn bootloader command. Some of the board
definitions differ only in the latter, so even if you've been uploading successfully
with a particular selection you'll want to check it before burning the bootloader.
Arduino Software (IDE) includes the built in support for the boards in the
following list, all based on the AVR Core. The Boards Manager included in the
standard installation allows to add support for the growing number of new boards
based on different cores like Arduino Due, Arduino Zero, Edison, Galileo and so
on.
46
Arduino NANO Interface
The Arduino Nano is programmed using the Arduino Software (IDE), our
Integrated Development Environment common to all our boards and running both
online and offline. For more information on how to get started with the Arduino
Software visit the Getting Started page.
Open the LED blink example sketch: File > Examples > 01.Basics > Blink.
Select Tools > Board > Arduino AVR Boards > Arduino Nano.
NOTE: We have updated the Nano board with a fresh bootloader. Boards
sold by us from January 2018 have this new bootloader, while boards
manufactured before that date have the old bootloader. First, check that Tools >
Board > Boards Manager shows you have the Arduino AVR Boards 1.16.21
or later installed. Then, to program the NEW Arduino NANO boards you need to
choose Tools > Processor > ATmega328P. To program old boards you need to
choose Tools > Processor > ATmega328P (Old Bootloader). If you get an error
while uploading or you are not sure which bootloader you have, try each Tools >
Processor menu option until your board gets properly programmed.
47
Select the NANO Processor Type
Select the serial device of the board from the 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 board and re-open
the menu; the entry that disappears should be the Arduino board. Reconnect the
board and select that serial port.
48
To upload the sketch to the Arduino Nano, click the Upload button in the
upper left to load and run the sketch on your board:
Upload to Nano
Wait a few seconds - you should 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.
RESULTS
CIRCUIT DIAGRAM
49
50
CHAPTER 6
CONCLUSION
51
CODE
#include <Wire.h>
#include <SoftwareSerial.h>
//Define I/O
int incomingByte = 0;
//Define I/O
//L298N
//Left Motor A
//Right Motor B
//Main program
void setup()
//Pump Motor
pinMode(motor, OUTPUT);
52
//L293D Output
pinMode(L1, OUTPUT);
pinMode(L2, OUTPUT);
pinMode(R1, OUTPUT);
pinMode(R2, OUTPUT);
//Serial Begin
Serial.begin(9600);
mySerial.begin(9600);
delay(500);
Serial.println("System Ready...!");
mySerial.println("System Ready...!");
delay(100);
//Loop program
void loop()
// Serial.print(data);
// Serial.print(" ");
// Serial.println();
53
//
// mySerial.print(data);
// mySerial.print(" ");
// mySerial.println();
//
serialmotor();
delay(500);
void serialmotor()
if (mySerial.available() > 0)
incomingByte = mySerial.read();
switch(incomingByte)
case '1':
digitalWrite(L2, LOW);
digitalWrite(R1, LOW);
digitalWrite(R2, LOW);
54
Serial.println("STOP\n");
mySerial.println("STOP\n");
incomingByte='*';
break;
case '2':
digitalWrite(L2, LOW);
digitalWrite(R1, HIGH);
digitalWrite(R2, LOW);
Serial.println("FORWARD\n");
mySerial.println("FORWARD\n");
incomingByte='*';
break;
case '3':
digitalWrite(L2, HIGH);
digitalWrite(R1, LOW);
digitalWrite(R2, HIGH);
Serial.println("BACK\n");
mySerial.println("BACK\n");
incomingByte='*';
break;
55
case '4':
digitalWrite(L2, LOW);
digitalWrite(R1, LOW);
digitalWrite(R2, HIGH);
Serial.println("LEFT\n");
mySerial.println("LEFT\n");
incomingByte='*';
break;
case '5':
digitalWrite(L2, HIGH);
digitalWrite(R1, HIGH);
digitalWrite(R2, LOW);
Serial.println("RIGHT\n");
mySerial.println("RIGHT\n");
incomingByte='*';
break;
56
OBJECT DETECTION CODE
import cv2
import numpy as np
import yagmail
import time
# Load Yolo
print("Loading Data...!")
classes = []
layer_names = net.getLayerNames()
print("Video Started...!")
#http://192.168.115.41:81/stream http://192.168.118.41
#video_capture = cv2.VideoCapture('http://192.168.118.41:81/stream')
video_capture = cv2.VideoCapture(0)
while True:
57
# Capture frame-by-frame
re,img = video_capture.read()
swapRB=True, crop=False)
#Detecting objects
net.setInput(blob)
outs = net.forward(output_layers)
class_ids = []
confidences = []
boxes = []
count = 0
scores = detection[5:]
class_id = np.argmax(scores)
confidence = scores[class_id]
# Object detected
58
center_x = int(detection[0] * width)
w = int(detection[2] * width)
h = int(detection[3] * height)
# Rectangle coordinates
x = int(center_x - w / 2)
y = int(center_y - h / 2)
boxes.append([x, y, w, h])
confidences.append(float(confidence))
class_ids.append(class_id)
font = cv2.FONT_HERSHEY_PLAIN
for i in range(len(boxes)):
if i in indexes:
x, y, w, h = boxes[i]
label = str(classes[class_ids[i]])
color = colors[class_ids[i]]
59
cv2.putText(img, label, (x, y + 30), font, 1.5, color, 1)
if label == "knife":
print('Knife Detected..!')
color = colors[class_ids[i]]
cv2.imwrite('Knife.jpg',img)
#if count == 0:
#mail_send()
#count = count+1
cv2.imshow("Image",cv2.resize(img, (800,600)))
break
video_capture.release()
cv2.destroyAllWindows()
60
REFERENCES
61
[7] Alheraish, “Design and implementation of home automation system,” in
IEEE Transactions on consumer Electronics,vol.50,no.4,pp.1087-
1092,nov.2004,doi: 10.1109/TCE.2004.1362503.
[8] Y. Gu et al., “Design and implementation of Upnp-Based Surveillance
robot Camera system for Home security”,2013 International conference on
information science and
Applications(ICISA),2013,pp.4,doi:10.1109/ICISA.2013. 6698209
[9] Jain, S. Basantwani, O. Kazi and Y. Bang, “ smart surveillance robot
monitoring system,”2017 international conference on Data Management
,Analytics and innovation (ICDMAI),2017,pp.269-273,doi:
10.1109/ICDMAI.2107.
[10] Van Thanh Trung and N. Van Cuong, “Monitoring and controlling devices
system by GPRS on FPGA platform”, 2013 International conference on
Advanced Technologies for communications (ATC 2013), 2013, pp.713-
717
62