Survillence Camera
Survillence Camera
A PROJECT REPORT
Submitted by
Of
BACHELOR OF ENGINEERING
In
ELECTRONICS & COMMUNICATION ENGINEERING
1
MAY 2025 ANNA UNIVERSITY::CHENNAI- 600 025
BONAFIDE CERTIFICATE
Certified that this report titled “SMART LOAD THEFT AND
BREAKDOWN DETECTION SYSTEM USING GPS AND GSM” is the
Bonafide work of ARUNKUMAR R (812021106008), ASWIN G
(812021106010), MADHESH B (812021106023), ESWARAN V
(8120201106302) who carried out the project work under my supervision.
SIGNATURE SIGNATURE
2
ACKNOWLEDGEMENT
I also thank all the teaching faculties and non-teaching staff of the
Electronics and Communication Engineering, my parents, and all my friends for
their help and support to complete this project successfully.
3
ABSTRACT
4
TABLE OF CONTENTS
ABSTRACT 3
LIST OF FIGURE 7
LIST OF ABREVATION 8
1 INTRODUCTION 6
2 LITERATURE SURVEY 9
3 EXISTING SYSTEM 14
4 PROPOSED SYSTEM 16
4.1 PROPOSED SYSTEM 17
4.1.1 BLOCK DIAGRAM 18
4.2 ADRUINO NANO 19
4.3 ESP32CAM 20
4.4 ROBOTIC MODULE 21
4.5 BATTERY 22
4.6 BLUETOOTH 22
4.7 L298NDRIVER 22
5 SYSTEM REQUIREMENT 23
5.1 HARDWARE DESIGN 24
5.2 SOFTWARE DESIGN 44
5.3 RESULT 59
6 CONCLUSION 60
CODE 62
REFERENCES 70
5
CHAPTER 1
INTRODUCTION
6
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
7
people to enter the forest areas without any permission from the forest officers.
Usage of fire 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.
8
CHAPTER 2
LITERATURE SURVEY
9
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
10
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.
11
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.
12
Computer Technology, Pune, India. The primary goal of this article is to
demonstrate that in today's world, when everyone wants to keep their assets safe
and secure, video surveillance robot for viewing a specific region has become a
need. To address this issue, we developed a smart monitoring system for
locations such as bank 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.
13
CHAPTER 3
EXISTING SYSTEM
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.
14
during the time of war saving the lives from opponents or enemy nations and
from environmental condition such as extreme cold and heat.
DISADVANTAGES
15
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.
• Solar with battery power system will operate the visual surveillance robot
system.
16
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:
ARDUINO NANO
ESP32 CAM
17
The ESP32-CAM is a development board with an ESP32-S chip, an
OV2640 camera, microSD card slot and several GPIOs to connect peripherals.
ESP integrates WiFi, traditional Bluetooth, and BLE Beacon, with 2 high-
performance 32-bit LX6 CPUs, 7-stage pipeline architecture. It has the main
frequency adjustment range of 80MHz to 240MHz, on-chip sensor, Hall sensor,
temperature sensor, etc.
ROBOTIC MODULE
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.
18
Fig. Robotic Frame
19
BATTERY
(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.
Fig. Battery
20
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 DRIVER
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.
21
Fig. Driver Module
22
CHAPTER 5
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS
ESP32 Cam
Arduino NANO
LCD Display
Robot Model
Battery
Charge Controller
Power Supply
SOFTWARE REQUIREMENTS
23
HARDWARE DESIGN
Power Supply
5V Power Supply
Transformer
24
field induces a changing voltage in the second circuit (the secondary). By
adding a load to the secondary circuit, one can make current flow in the
transformer, thus transferring energy from one circuit to the other. The
secondary induced voltage VS is scaled from the primary VP by a factor ideally
equal to the ratio of the number of turns of wire in their respective windings:
25
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.
Rectifier
26
components of power supplies and as detectors of radio signals. Mainly there
are three types of rectifier i.e. half wave rectifier, full wave rectifier and Bridge
Rectifier.
Bridge Rectifier
Basic operation
27
Operation of bridge rectifier
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
28
selected for operation with load currents from hundreds of milliamperes to tens
of amperes, corresponding to power ratings from milliwatts to tens of watts.
29
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.
79xx series
7805 +5 7.3
7806 +6 8.3
7808 +8 10.5
30
7810 +10 12.5
ESP32
31
Figure 1: Block Diagram of ESP32S3
SOLUTION HIGHLIGHTS
FEATURES
WiFi
BLUETOOTH
34
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
SPECIFICATIONS
35
SPECIFICATIONS – ESP32 DEVKIT V1 DOIT
Architecture 32 bits
RAM 512 KB
36
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.
37
ESP32 V1.1 38Pin NodeMCU Pin Diagram
38
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
39
Analog Input - A0. A1, A2,m A3, A4, A5
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
40
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)
41
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.
42
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.
43
SOFTWARE DESIGN
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, 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.
44
FEATURES
45
ARDUINO SOFTWARE (IDE)
Writing Sketches
46
Arduino IDE
47
Arduino IDE Tool Icon
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.
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.
48
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.
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.
49
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.
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.
50
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.
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.
51
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.
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
52
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
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.
53
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
Third-Party Hardware
54
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.
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
55
boards based on different cores like Arduino Due, Arduino Zero, Edison,
Galileo and so on.
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.
56
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.
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.
57
Select Board Type
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.
58
RESULTS
CIRCUIT DIAGRAM
59
CHAPTER 6
CONCLUSION
60
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);
61
//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();
62
//
// 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);
63
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;
64
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;
65
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:
66
# 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
67
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]]
68
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()
69
REFERENCES
70
[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
71