Uploaded by tjstyle053

coplete FD PROJECT REPORT

advertisement
SOLAR POWERED INTELLIGENT VEHICLE BLACK
BOX WITH EXTENDED MEMORY USING IOT
A PROJECT REPORT
Submitted by
1. KARTHICK. R
110518105002
2. MONISHA. P
110518105005
3. GAUTHAM. T
110518105303
4. MOHAN KUMAR. P
110518105305
in partial fulfillment for the award of the degree
of
BACHELOR OF ENGINEERING
in
ELECTRICAL AND ELECTRONICS ENGINEERING
GOJAN SCHOOL OF BUSINESS AND TECHNOLOGY,
REDHILLS
ANNA UNIVERSITY: CHENNAI
600 025
JUNE 2022
BONAFIDE CERTIFICATE
Certified that this project report “SOLAR POWERED INTELLIGENT
VEHICLE BLACK BOX USING IOT” is the bonafide work of
KARTHICK.R (Register No: 110518105002), MONISHA.P (Register No:
110518105005), GAUTHAM.T (Register No: 110518105303) and MOHAN
KUMAR.P (Register No: 110518105305)
SIGNATURE
SIGNATURE
Dr.G. ARUNSANKAR
Ms.G. DEEPIKA
ASSOSIATE PROFESSOR
SUPERVISOR
Head of the Department
Assistant Professor
Department of EEE
Department of EEE
Gojan School of Business and
Gojan School of Business and
Technology
Technology
Chennai-52
Chennai-52
Submitted to Project Viva-Voce Examination held on
INTERNAL EXAMINER
EXTERNAL EXAMINER
ACKNOWLEDGMENT
We express our deepest gratitude to our Chairman Dr.G. NATARAJAN,
Ph.D., and Chairperson Mrs. BRINDHA NATARAJAN, B. Com, for their
valuable guidance and blessings.
We are deeply indebted to our beloved Principal Dr.C. SELVAKUMAR,
Ph.D., Gojan School of Business and Technology, for providing us an excellent
environment to carry out our course successfully.
We also express our thanks to our Head of the Department Dr.G.
ARUNSANKAR, M.E., Associate Professor, who has been a constant source of
inspiration and guidance in the course of the project.
We record our sincere thanks to our Supervisor Ms. G. DEEPIKA, M.E.,
Assistant Professor, for being instrumental in the completion of our project with
his exemplary guidance. We thank all the Staff Members of our department for
their valuable support and assistance at various stages of our project development.
Finally, we take this opportunity to extend our deep sense of gratitude and
appreciation to our family and friends for all that they meant to us during the
crucial times of the completion of our project.
ABSTRACT
Autonomous vehicles require reliable and resilient sensor suites and
ongoing validation through fleet-wide data collection. This paper discusses the
composition and
performance of a
of automobile recording
machine.
sophisticated
The
system
controller
system
cannot solely record
the
most driving information of the automobile comprehensively and accurately in
period, however additionally re-construct the accident with information method
code,which may facilitate folks analyze the accident quickly and lawfully when a
collision. The SD card module is used to take a log of sensor parameters which is
continuously monitored by a controller and the system will update the
information whenever an abnormal system event happened. With finite storage,
prioritized data recording discards low-value buffers to make room for new data.
Further, no metrics have been established to optimize long-term data collection
for on-road vehicles. Additionally, globally optimizing data compression and
deletion decisions would require buffering all data over a long-term trajectory.
TABLE OF CONTENTS
CHAPTER
TITLE
ACKNOWLEDGEMENT
ABSTRACT
iv
LIST OF FIGURES
viii
LIST OF ABBREVIATION
1
1.1 GENERAL
1
1.2 SCOPE OF THE PROJECT
1
1.3 OBJECTIVES
1
LITERATURE SURVEY
3
EXISTING SYSTEM
2
3.1 INTRODUCTION
7
3.2 WORKING PRINCIPLE
8
PROPOSED SYSTEM
4.1 BLOCK DIAGRAM
10
4.2 WORKING OF MODULES
10
4.2.1 SOLAR POWER SUPPLY UNIT
10
4.2.2 DETECTION OF ACCIDENT
11
4.2.3 COLLECTION AND STORAGE OF
INFORMATION
4.2.4 SENDING OF INFORMATION
12
4.3 WORKING OF BLOCK DIAGRAM
5
x
INTRODUCTION
2
4
PAGE
NO.
iii
HARDWARE DESCRIPTION
5.1 ARDUINO
12
13
14
5.1.1 INTRODUCTION TO ARDUINO
14
5.1.2 WHY ARDUINO?
15
5.1.3 ARDUINO MEGA
16
5.1.4 TECHNICAL SPECIFICATIONS
17
5.1.5 HARDWARE
18
5.1.6 PROGRAMMING
5.1.7 WARNINGS
20
22
5.1.8 POWER
5.2 MEMORY
22
23
5.2.1 INPUT AND OUTPUT
5.2.3 ARDUINO MEGA 2560 PIN
MAPPING TABLE
5.2.4 COMMUNICATION
5.2.5 AUTOMATIC (SOFTWARE) RESET
5.2.6 REVISIONS
5.3 POWER SUPPLY
24
24
5.4 LIQUID CRYSTAL DISPLAY
33
30
30
31
32
5.4.1 16X2 LCD PINOUT DIAGRAM
5.4.2 RS (REGISTER SELECT)
34
35
5.4.3 COMMAND REGISTER
36
5.4.4 DATA REGISTER
36
5.5 VIBRATION SENSOR
36
5.5.1 FEATURES
37
5.5.2 VIBRATION SENSOR SW-18010P
38
5.5.3 SPECIFICATIONS OF SW-18010P
38
5.6 TEMPERATURE SENSOR
39
5.7 GAS SENSOR (MQ-2 )
40
5.8 GSM
5.9 GPS
41
41
5.10 SD CARD MODULE INTERFACE
WITH ARDUINO
5.10.1 INTRODUCING THE SD
CARD MODULE
5.10.2 PIN WIRING
6
7
42
42
43
5.10.3 PREPARING THE SD CARD
44
5.10.4 TESTING THE SD CARD MODULE
45
5.11 SWITCH
46
5.12 APPLICATIONS
47
5.13 ADVANTAGES
RESULTS
47
6.1 HARDWARE KIT
48
6.2 OUTPUTS
48
FUTURE SCOPE
7.1 FUTURE ENHANCEMENT
50
7.2CONCLUSION
50
REFERENCES
51
LIST OF FIGURES
FIGURE
NO.
3.1
BLOCK DIAGRAM OF EXISTING SYSTEM
PAGE
NO.
8
4.1
BLOCK DIAGRAM OF PROPOSED SYSTEM
10
4.2
BLOCK DIAGRAM OF POWER SUPPLY UNIT
10
4.3
BLOCK DIAGRAM OF DETECTION OF ACCIDENT
11
4.4
12
5.1
BLOCK DIAGRAM OF COLLECTION AND
STORAGE OF INFORMATION
BLOCK DIAGRAM OF SENDING OF
INFORMATION
ARDUINO MEGA 2560
5.2
PIN DIAGRAM OF ATMEGA 2560
18
5.3
WORKSPACE OF ARDUINO IDE
21
5.4
PIN DIAGRAM
24
5.5
POWER SUPPLY
32
5.6
LCD DISPLAY
33
5.7
16X2 LCD PINOUT DIAGRAM
34
5.8
VIBRATION SENSOR
36
5.9
SW-18010P PIN DIAGRAM
38
5.10
LM35
39
5.11
MQ-2 GAS SENSOR
40
5.12
GSM Module (GSM800C)
41
5.13
GPS Module
42
5.14
SD CARD MODULE
43
4.5
FIGURE NAME
12
17
5.15
SD CARD MODULE WITH SD CARD
43
5.16
SD CARD FORMATTING
44
5.17
FORMATTING INITIALIZATION
44
5.18
TESTING THE SD CARD MODULE
45
5.19
INITIALIZATION OF SD CARD IN ARDUINO IDE
45
5.20
SWITCH
46
6.1
HARDWARE KIT
48
6.2
MESSAGES SENT BY THE BLACK BOX
48
6.3
CLOUD DATA OF THE BLACK BOX SYSTEM
49
6.4
DETECTION OF GAS OR ALCOHOL BY THE
49
BLACK BOX
6.5
TEMPERATURE DETECTED BY THE BLACK BOX
49
LIST OF ABBREVIATIONS
IOT
INTERNET OF THINGS
GSM
GLOBAL SYSTEM MOBILE COMMUNICATION
GPS
GLOBAL POSITIONING SYSTEM
TDMA
TIME DIVISION MULTIPLE ACCESS
LED
LIGHT EMITTING DIODE
LCD
LIQUID CRYSTAL DISPLAY
CHAPTER-1
INTRODUCTION
1.1 GENERAL
In generally the black box system is used in aero plane to get the accident
information for investigation purpose. In our proposed system the same black box
technology implemented on the road vehicles. The important information like
vehicle temperature, vibration occurs, driver alcohol consumes saved locally.
And get all the information through the IOT.
1.2 SCOPE OF THE PROJECT
The technological developments in the sensor design, advancement in
communication protocols and remote monitoring methods can provide effective
solutions for the real-time monitoring in the road vehicles for investigation
purpose.
1.3 OBJECTIVES
To get various types of information if in any case any mishap has occurred. In
case of any accidents we show that the black box is capable of calculating and
informing certain parameters that are further discussed and explained. To send
the and save the data in the cloud along with the storage module investigation
purpose.
BLACKBOX: Black box is an electronic device used to record any instructions
and specific aircraft performance parameters. It records specific aircraft
performance parameters and conversations in the cockpit. The first prototype of
black box was made in 1956 by David Warren. Black box consists of
i) Flight Data Recorder (FDR)
ii) Cockpit Voice Recorder (CVR)
1
CHAPTER-2
LITERATURE SURVEY
Hossam M. Sherif, M. Ameer Shedid, Samah A. Senbel “REAL TIME
TRAFFIC ACCIDENT DETECTION SYSTEM USING WIRELESS
SENSOR NETWORK”,2014 IEEE International Conference of Soft
Computing and Pattern.
Automatic vehicle accident detection is a life-saving application that is vital
in today’s high speed motorways. In case of motorway accidents, notification to
the proper authorities must be done efficiently and expediently. The main
objective of this paper is to create a Real Time Traffic Accident Detection System
(RTTADS) using Wireless Sensor Network (WSN) and Radio-Frequency
Identification (RFID) Technologies. This paper explains the hardware prototype
setup for RTTADS, the algorithms used, the advantages and the limitations of the
entire system.
R. Ramani, S. Valarmathy, Dr. N Suthanthira, S. Selavaraju, M.
Thiruppathi, R. Thagam, “VEHICLE TRACKING AND LOCKING
BASED GSM AND GPS”, Issue Date: Sept 2013).
Currently almost of the public having an own vehicle, theft is happening on
parking and sometimes driving insecurity places. The safe of vehicles is
extremely essential for public vehicles. Vehicle tracking and locking system
installed in the vehicle, to track the place and locking engine motor. The place of
the vehicle identified using Global Positioning system (GPS) and Global system
mobile communication (GSM). These systems constantly watch a moving
Vehicle and report the status on demand. When the theft identified, the
responsible person sends SMS to the microcontroller, then microcontroller issue
the control signals to stop the engine motor. Authorized person need to send the
2
password to controller to restart the vehicle and open the door. This is more
secured, reliable and low cost.
Gowda C P Mallikarjuna, Raju Hajare, C S Mala, K R Rakshith, Anuj R
Nadig, P Prtathana, “DESIGN AND IMPLEMENTATION OF REAL
TIME WIRELESS SYSTEM FOR VEHICLE SAFETY AND VEHICLE
TO VEHICLE COMMUNICATION” IEEE 2017.
The proposed system aims at developing and designing a suitable system for
automobile purposes using ZigBee protocols. The main problems faced in the
existing system are inaccuracies in the calculation of speed, distance
measurement, and slow response time, etc. The proposed system solves many of
the problems faced by the existing systems by using a GPS module instead of the
conventional speedometer and also uses sensors which are reliable in areas where
human intervention is either unintended or where it puts life to risk.
T Kalyani, S Monika, B Naresh, Mahendra Vucha, “ACCIDENT
DETECTION AND ALERT SYSTEM”, IEEE, 2019.
As the usage of vehicles is increasing drastically, the hazards due to vehicles
is also increased. The main cause for accidents is high speed, drink and drive,
diverting minds, over stress and due to electronic gadgets. This paper deals with
accident detection system that occurs due to carelessness of the person who is
driving the vehicle. This introduces accident alerting system which alerts the
person who is driving the vehicle. If the person is not in a position to control the
vehicle, then the accident occurs. Once the accident occurs to the vehicle this
system will send information to registered mobile number.
Dinesh Kumar HSDK, Shreya Gupta, Sumeet Kumar, Sonali Srivastava,
“ACCIDENT DETECTION AND REPORTING SYSTEM USING GPS
AND GSM MODULE,” IN INTERNATIONAL SYMPOSIUM ON
WIRELESS SYSTEMS AND NETWORKS (ISWSN), IEEE, 2019.
3
With the growing population the use of vehicles has become superfluous and
this has led to the accidents increasing at an alarming rate resulting in a large loss
of property and human life. This project aims at finding the occurrence of any
accident and reporting the location of accident to the previously coded numbers
so that immediate help can be provided by ambulance or the relatives concerned.
GSM technology is used to intimate the vehicle position in the form of latitude
and longitude coordinates through SMS.
Gowshika.B, Madhu Mitha.G, Jayashree.S, S. Mutharasu ,“VEHICLE
ACCIDENT DETECTION SYSTEM BY USING GSM AND GPS”, 2019
IEEE.
This paper deals with Arduino Based Vehicle Accident Alert System using
GPS, GSM and Accelerometer. Accelerometer detects the sudden change in the
axes of vehicle and GSM module send the alert message on your Mobile Phone
with the location of the accident. The advancing technology has made our day to
day lives easier. Since every coin has two sides similarly technology has its
benefits as well as its disadvantages. The rise in technology has increased the rate
of road accidents which causes huge loss of life. The poor emergency facilities
available in our country just add to this problem. Our project is going to provide
a solution to this problem.
Derick A. Johnson and Mohan M. Trivedi “DRIVING STYLE
RECOGNITION USING A SMARTPHONE AS A SENSOR PLATFORM”
2011,14th International IEEE Conference on Intelligent Transportation
Systems.
Driving style can characteristically be divided into two categories: “typical”
(non-aggressive) and aggressive. Understanding and recognizing driving events
that fall into these categories can aid in vehicle safety systems. To increase
awareness and promote driver safety, we are proposing a novel system that uses
4
Dynamic Time Warping (DTW) and smartphone based sensor-fusion
(accelerometer, gyroscope, magnetometer, GPS, video) to detect, recognize and
record these actions without external processing. This system differs from past
driving pattern recognition research by fusing related inter-axial data from
multiple sensors into a single classifier. All processing is done completely on the
smartphone.
J. Z. C. T. C. Juan Carlos Cano, Pietro Manzoni, “PROVIDING
ACCIDENT DETECTION IN VEHICULAR NETWORKS THROUGH
OBD-II DEVICES AND ANDROID-BASED SMARTPHONES,” in
Proceedings of the 5th IEEE Workshop On User Mobility and Vehicular
Networks, 2011.
In this paper we propose an Android- based application that monitors the
vehicle through an On Board Diagnostics (OBD-II) interface, being able to detect
accidents. This proposed application estimates the G force experienced by the
passengers in case of a frontal collision, which is used together with airbag
triggers to detect accidents. The application reacts to positive detection by
sending details about the accident through either e-mail or SMS to pre-defined
destinations, immediately followed by an automatic phone call to the emergency
services. Experimental results using a real vehicle show that the application is
able to react to accident events in less than 3 seconds, a very low time, validating
the feasibility of smartphone based solutions for improving safety on the road.
B. Fernandes, V. Gomes, J. Ferreira, and A. Oliveira, “MOBILE
APPLICATION FOR AUTOMATIC ACCIDENT DETECTION AND
MULTIMODAL ALERT,” in Vehicular Technology Conference (VTC
Spring). IEEE, 2015, pp. 1–5.
This paper presents HDy Co-pilot, an Android application for accident
detection integrated with multimodal alert dissemination, both via eCall and IEEE
5
802.11p. The proposed accident detection algorithm receives inputs from the
vehicle, via ODB-II, and from the smartphone sensors, namely the accelerometer,
the magnetometer and the gyroscope. The Android smartphone is also used as
human machine interface, so that the driver can configure the application, receive
road hazard warnings issued by other vehicles in the vicinity and cancel
countdown
procedures
upon
false
accident
detection.
A
prototype
implementation was validated via laboratory tests.
R. Kannan, R. Nammily, S. Manoj, A. Vishwa, “WIRELESS VEHICULAR
ACCIDENT DETECTION AND REPORTING SYSTEM”, International
Conference on Mechanical and Electrical Technology (ICMET 2010).
This paper suggests a method to intelligently detect an accident at any place
and any time and report the same to the nearby 'service provider’. The service
provider arranges for the necessary help. Accident Detection and Reporting
System (ADRS) which can be placed in any vehicle uses a sensor to detect the
accident. The sensor output is monitored and processed by the PIC16F877A
microcontroller. The microcontroller takes decision on the traffic accident based
on the input from the sensors. The RF transmitter module which is interfaced with
the microcontroller will transmit the accident information to the nearby
Emergency Service Provider (ESP). This information is received by the RF
receiver module at the 'service provider' control room in the locality. The RF
transceiver module used has a range up to 100 meters under ideal conditions. The
service provider can use this information to arrange for ambulance and also
inform police and hospital.
6
CHAPTER-3
EXISTING SYSTEM
3.1 INTRODUCTION
Vehicles accident may be a terribly huge downside in Asian nation and
different countries too. Most of the deaths within the world area unit because of
road accidents. Asian nation faces the very best death rate within the world
consistent with the govt road transport survey , the quantitative relation of road
accidents in 2018 is 4.61 lakhs within which variety of deaths is 1.47 lakhs i.e.,
402 folks dies per day in Asian nation. Reasons for road accidents square measure
speed driving, drink and drive, not following rule. in keeping with some survey
the most reason for deaths within the road accidents is delay in providing
emergency services. If the delay is often reduced the person may get saved. For
Associate in Nursing accident victim it's terribly tough to alert the police room or
the relations concerning the accidents. The projected system is employed to scale
back the time delay between the accident and providing emergency services.
The vehicle pursuit and accident detection device are often put in in any
vehicle. Whenever a vehicle is taken or associate accident happened to the vehicle
the coordinates is taken through international positioning system (GPS) module
and is regenerate into Google map link through the formula within the
microcontroller. The formula is preinstalled within the microcontroller.In the
event of associate accident, the traveller should receive facilitate promptly and
also the folks related to the person should be notified immediately. The paper
proposes a system wherever label sensors mounted on the vehicle will observe a
crash and signal the small controller that successively passes the information
containing the coordinate location of the crash beside the identification details to
server.
7
The google map link is distributed through International System of Units for
mobile communication GSM module to a predefined mobile sort of members of
the family and near police headquarters. The accident is detected through
measuring device and also the price is compared with the brink price planned
within the formula. The friend will get the exact location of the vehicle by
clicking on the google map link provided among the SMS.
3.2 WORKING PRINCIPLE
Fig.3.1 Block diagram of Existing system
Once the vehicle detects abrupt modification within the threshold values with
the assistance of measuring device detector, that set the flag little bit of Arduino
UNO as before long as accident is detected. Set the effective sensitive value for
measuring instrument detector, throughout that accident or crash is detected.
Once Arduino detects the accident or set bit through measuring instrument
detector, Arduino activates the GSM module that has a manually saved signal of
friend of accident victim, sends a pre-stored SMS to that selection.
Simultaneously, it further offers the message to the many friends that accident
had occurred. This technique is known as automatic emergency message system.
This system is intended to tell regarding associate in nursing accident or crash
that had occurred to the members of the family of the move persons. AMS system
8
uses a electricity device which could realize the abrupt vibration once associate
in nursing accident or crash had occurred. This sends a symbol to microcontroller.
A GSM equipment is interfaced with the Arduino unit. The GSM equipment
sends associate in nursing SMS to the predefined mobile variety and informs
regarding the accident.
9
CHAPTER 4
PROPOSED SYSTEM
4.1 BLOCK DIAGRAM
Fig.4.1 Block diagram of Proposed system
4.2 WORKING OF MODULES
Working of the proposed system is divided into three modules. The modules
are:
 Detection of accident
 Collection and storage of information
 Sending of information
4.2.1 SOLAR POWER SUPPLY UNIT
Fig.4.2 Block diagram of Power Supply unit
10
Solar panel is vulnerable to accumulated dust on its surface. The efficiency of
the solar panel gradually decreases because of dust accumulation. In this paper,
an Arduino based solar panel cleaning system is designed and implemented for
dust removal. A charge controller or charge regulator is basically a voltage and/or
current regulator to keep batteries from overcharging. It regulates the voltage and
current coming from the solar panels going to the battery. A solar charger is a
charger that employs solar energy to supply electricity to devices or batteries.
They are generally portable. Solar chargers can charge lead acid or Ni-Cd
battery banks up to 48 V and hundreds of ampere hours (up to 4000 Ah) capacity.
Such type of solar charger setups generally uses an intelligent charge controller.
We are using 9v solar panel for the power supply for the three level air purifier
system. The solar charger unit is used to charge the 7Ah battery. If the solar output
is low the charger unit boost the voltage for storing purpose. If the solar output is
High, its bug the voltage and store the power. The battery is a power storage
device for air purifier.
4.2.2 DETECTION OF ACCIDENT
Fig.4.3 Block diagram of Detection of accident
Detect the accident through the crash sensor and the temperature sensor
monitor the engine temperature. The gas sensor is used to detect the driver
11
consuming alcohol or not. The GPS is used to get the exact location of the
accident. Whenever the abnormality in the sensor the microcontroller receives
some kind of data. So these of the sensor used to detect the accident.
4.2.3 COLLECTION AND STORAGE OF INFORMATION
Fig.4.4 Block diagram of collection and storage of information
The use of the SD card module we can store the collective information from
the sensor. If accident occurs the use of these data police can easily investigate
and found the correct reason for the accident. Kind of information make a
investigation easy and effective with the accurate values.
4.2.4 SENDING OF INFORMATION
Fig.4.5 Block diagram of sending of information
12
Collection of the data from the sensor we want to send the information to the
relative persons and police. So we use the GSM and IOT module for the
communication purpose. Black box is made by strongest material so it doesn’t
break. In case the black box got damaged we can get all the information through
the IOT. The GSM is used to send the alert the message.
4.3 WORKING OF BLOCK DIAGRAM
In this proposed method, ARDUINO MEGA microcontroller is used to
interface with the sensors and to the communication devices. The LCD is used to
update the latest information in the LCD. The crash sensor, Temperature sensor
and SD card are interfaced with the micro controller. The ESP8266 IOT module
is used to update the information to the cloud. The GPS device is used to get the
information of the location of the vehicle. The GSM is used to send the SMS to
the owner and other rescue persons. In accident zone the black box system collect
the information and store the information then give the valuable data. Whenever
the accident occur we can find the perfect reason for the accident.
13
CHAPTER 5
HARDWARE DESCRIPTION
5.1 ARDUINO
5.1.1 INTRODUCTION TO ARDUINO
Arduino is an open-source electronics platform based on easy-to-use hardware
and software. Arduino boards are able to read inputs - light on a sensor, a finger
on a button, or a Twitter message - and turn it into an output - activating a motor,
turning on an LED, publishing something online. You can tell your board what
to do by sending a set of instructions to the microcontroller on the board.
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.
14
5.1.2 WHY ARDUINO?
Thanks to its simple and accessible user experience, Arduino has been used in
thousands of different projects and applications. The Arduino software is easyto-use for beginners, yet flexible enough for advanced users. It runs on Mac,
Windows, and Linux. Teachers and students use it to build low cost scientific
instruments, to prove chemistry and physics principles, or to get started with
programming and robotics. Designers and architects build interactive prototypes,
musicians and artists use it for installations and to experiment with new musical
instruments. Makers, of course, use it to build many of the projects exhibited at
the Maker Faire, for example. Arduino is a key tool to learn new things. Anyone
- children, hobbyists, artists, programmers - can start tinkering just following the
step by step instructions of a kit, or sharing ideas online with other members of
the Arduino community.
There are many other microcontrollers and microcontroller platforms
available for physical computing. Parallax Basic Stamp, Netmedia's BX-24,
Phidgets, MIT's Handyboard, and many others offer similar functionality. All of
these tools take the messy details of microcontroller programming and wrap it up
in an easy-to-use package. Arduino also simplifies the process of working with
microcontrollers, but it offers some advantage for teachers, students, and
interested amateurs over other systems:
 Inexpensive - Arduino boards are relatively inexpensive compared to
other microcontroller platforms. The least expensive version of the
Arduino module can be assembled by hand, and even the pre-assembled
Arduino modules cost less than $50.
15
 Cross-platform - The Arduino Software (IDE) runs on Windows,
Macintosh OSX, and Linux operating systems. Most microcontroller
systems are limited to Windows.
 Simple, clear programming environment - The Arduino Software (IDE)
is easy-to-use for beginners, yet flexible enough for advanced users to take
advantage of as well. For teachers, it's conveniently based on the
Processing programming environment, so students learning to program in
that environment will be familiar with how the Arduino IDE works.
 Open source and extensible software - The Arduino software is
published as open source tools, available for extension by experienced
programmers. The language can be expanded through C++ libraries, and
people wanting to understand the technical details can make the leap from
Arduino to the AVR C programming language on which it's based.
Similarly, you can add AVR-C code directly into your Arduino programs
if you want to.
 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 it. Even relatively inexperienced users can build the breadboard
version of the module in order to understand how it works and save money.
5.1.3 ARDUINO MEGA
The MEGA 2560 is designed for more complex projects. With 54 digital
I/O pins, 16 analog inputs and a larger space for your sketch it is the
recommended board for 3D printers and robotics projects. This gives your
projects plenty of room and opportunities.
16
Fig.5.1 Arduino Mega 2560
The Arduino Mega 2560 is a microcontroller board based on
the ATmega2560. It has 54 digital input/output pins (of which 15 can be
used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports),
a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP
header, and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or
power it with an AC-to-DC adapter or battery to get started. The Mega
2560 board is compatible with most shields designed for the Uno and the
former boards Duemilanove or Diecimila.
5.1.4 TECHNICAL SPECIFICATIONS
Microcontroller
ATmega2560
Operating Voltage
5V
Input Voltage (recommended)
7-12V
Input Voltage (limit)
6-20V
Digital I/O Pins
54 (of which 15 provide PWM output)
Analog Input Pins
16
DC Current per I/O Pin
20 mA
DC Current for 3.3V Pin
50 mA
Flash Memory
256 KB of which 8 KB used by boot loader
SRAM
8 KB
17
EEPROM
4 KB
Clock Speed
16 MHz
LED_BUILTIN
13
Length
101.52 mm
Width
53.3 mm
Weight
37 g
Fig 5.2 Pin diagram of ATMEGA 2560
5.1.5 HARDWARE
Arduino is open-source hardware. The hardware reference designs are
distributed under a Creative Commons Attribution Share-Alike 2.5 license and
are available on the Arduino website. Layout and production files for some
versions of the hardware are also available.
Although the hardware and software designs are freely available under copy
left licenses, the developers have requested the name Arduinoto be exclusive to
the official product and not be used for derived works without permission. The
official policy document on use of the Arduino name emphasizes that the project
18
is open to incorporating work by others into the official product. Several Arduinocompatible products commercially released have avoided the project name by
using various names ending in -duino. An early Arduino board with an RS232 serial interface (upper left) and an Atmel ATmega8 microcontroller chip
(black, lower right); the 14 digital I/O pins are at the top, the 6 analog input pins
at the lower right, and the power connector at the lower left.
Most
Arduino
boards
consist
of
an Atmel 8-bit AVR
microcontroller (ATmega8, ATmega168, ATmega328,ATmega1280,ATmega2
560) with varying amounts of flash memory, pins, and features. The 32bit Arduino Due, based on the Atmel SAM3X8E was introduced in 2012. The
boards use single or double-row pins or female headers that facilitate connections
for programming and incorporation into other circuits. These may connect with
add-on modules termed shields. Multiple and possibly stacked shields may be
individually addressable via an I²C serial bus. Most boards include a 5 V linear
regulator and a 16 MHz crystal oscillator or ceramic resonator. Some designs,
such as the LilyPad, run at 8 MHz and dispense with the on board voltage
regulator due to specific form-factor restrictions.
Arduino microcontrollers are pre-programmed with a boot loader that
simplifies uploading of programs to the on-chip flash memory. The default
bootloader of the Arduino UNO is the optiboot bootloader. Boards are loaded
with program code via a serial connection to another computer. Some serial
Arduino boards contain a level shifter circuit to convert between RS-232 logic
levels and transistor–transistor logic (TTL) level signals. Current Arduino boards
are programmed via Universal Serial Bus (USB), implemented using USB-toserial adapter chips such as the FTDI FT232. Some boards, such as later-model
Uno boards, substitute the FTDI chip with a separate AVR chip containing USBto-serial firmware, which is reprogrammable via its own ICSP header. Other
variants, such as the Arduino Mini and the unofficial Boarduino, use a detachable
19
USB-to-serial adapter board or cable, Bluetooth or other methods. When used
with traditional microcontroller tools, instead of the Arduino IDE, standard
AVR in-system programming (ISP) programming is used. An official Arduino
Uno R2 with descriptions of the I/O locations
The Arduino board exposes most of the microcontroller's I/O pins for use by
other circuits. The Diecimila, Duemilanove, and current Uno provide 14 digital
I/O pins, six of which can produce pulse-width modulated signals, and six analog
inputs, which can also be used as six digital I/O pins. These pins are on the top of
the board, via female 0.1-inch (2.54 mm) headers. Several plug-in application
shields are also commercially available. The Arduino Nano, and Arduinocompatible Bare Bones Board and Boarduino boards may provide male header
pins on the underside of the board that can plug into solderless breadboards.
Many Arduino-compatible and Arduino-derived boards exist. Some are
functionally equivalent to an Arduino and can be used interchangeably. Many
enhance the basic Arduino by adding output drivers, often for use in school-level
education, to simplify making buggies and small robots. Others are electrically
equivalent but change the form factor, sometimes retaining compatibility with
shields, sometimes not. Some variants use different processors, of varying
compatibility.
5.1.6 PROGRAMMING
The Mega 2560 board can be programmed with the Arduino Software
(IDE). For details, see the reference and tutorials.
The ATmega2560 on the Mega 2560 comes pre -programmed with
a boot loader that allows you to upload new code to it without the use of
an external hardware programmer. It communicates using the original
STK500 protocol (reference, C header files).
20
You can also bypass the boot loader and program the microcontroller
through the ICSP (In-Circuit Serial Programming) header using Arduino
ISP or similar; see these instructions for details.
Fig 5.3 Workspace of Arduino IDE
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware
source code is available in the Arduino repository. The ATmega16U2/8U2
is loaded with a DFU boot loader, which can be activated by:

On Rev1 boards: connecting the solder jumper on the back of the
board (near the map of Italy) and then resetting the 8U2.

On Rev2 or later boards: there is a resistor that pulling the
8U2/16U2 HWB line to ground, making it easier to put into DFU
mode. You can then use Atmel's FLIP software (Windows) or
the DFU programmer (Mac OS X and Linux) to load a new
firmware. Or you can use the ISP header with an external
21
programmer (overwriting the DFU boot loader). See this usercontributed tutorial for more information.
5.1.7 WARNINGS
The Mega 2560 has a resettable poly fuse that protects your computer's
USB ports from shorts and overcurrent. Although most computers provide
their own internal protection, the fuse provides an extra layer of
protection. If more than 500 mA is applied to the USB port, the fuse will
automatically break the connection until the short or overload is removed.
5.1.8 POWER
The Mega 2560 can be powered via the USB connection or with an
external power supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter
(wall-wart) or battery. The adapter can be connected by plugging a 2.1mm
center-positive plug into the board's power jack. Leads from a battery can
be inserted in the GND and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied
with less than 7V, however, the 5V pin may supply less than five volts and
the board may become unstable. If using more than 12V, the voltage
regulator may overheat and damage the board. The recommended range is
7 to 12 volts.
22
The power pins are as follows:

Vin. The input voltage to the board when it's using an external power
source (as opposed to 5 volts from the USB connection or other
regulated power source). You can supply voltage through this pin,
or, if supplying voltage via the power jack, access it through this
pin.

5V. This pin outputs a regulated 5V from the regulator on the board.
The board can be supplied with power either from the DC power
jack (7 - 12V), the USB connector (5V), or the VIN pin of the board
(7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't advise it.

3V3. A 3.3 volt supply generated by the on-board regulator.
Maximum current draw is 50 mA.

GND. Ground pins.

IOREF. This pin on the board provides the voltage reference with
which the microcontroller operates. A properly configured shield
can read the IOREF pin voltage and select the appropriate power
source or enable voltage translators on the outputs for working with
the 5V or 3.3V.
5.2 MEMORY
The ATmega2560 has 256 KB of flash memory for storing code (of
which 8 KB is used for the bootloader), 8 KB of SRAM and 4 KB of
EEPROM (which can be read and written with the EEPROM library).
23
5.2.1 INPUT AND OUTPUT
Below is the pin mapping for the Atmega2560. The chip used in Arduino
2560. There are pin mappings to Atmega8 and Atmega 168/328 as well.
Fig 5.4 Pin Diagram
5.2.3 ARDUINO MEGA 2560 PIN MAPPING TABLE
Pin Number
Pin Name
Mapped Pin Name
1
PG5 ( OC0B )
Digital pin 4 (PWM)
2
PE0 ( RXD0/PCINT8 )
Digital pin 0 (RX0)
3
PE1 ( TXD0 )
Digital pin 1 (TX0)
4
PE2 ( XCK0/AIN0 )
5
PE3 ( OC3A/AIN1 )
Digital pin 5 (PWM)
6
PE4 ( OC3B/INT4 )
Digital pin 2 (PWM)
24
7
PE5 ( OC3C/INT5 )
Digital pin 3 (PWM)
8
PE6 ( T3/INT6 )
9
PE7 ( CLKO/ICP3/INT7 )
10
VCC
VCC
11
GND
GND
12
PH0 ( RXD2 )
Digital pin 17 (RX2)
13
PH1 ( TXD2 )
Digital pin 16 (TX2)
14
PH2 ( XCK2 )
15
PH3 ( OC4A )
Digital pin 6 (PWM)
16
PH4 ( OC4B )
Digital pin 7 (PWM)
17
PH5 ( OC4C )
Digital pin 8 (PWM)
18
PH6 ( OC2B )
Digital pin 9 (PWM)
19
PB0 ( SS/PCINT0 )
Digital pin 53 (SS)
20
PB1 ( SCK/PCINT1 )
Digital pin 52 (SCK)
21
PB2 ( MOSI/PCINT2 )
Digital pin 51 (MOSI)
22
PB3 ( MISO/PCINT3 )
Digital pin 50 (MISO)
23
PB4 ( OC2A/PCINT4 )
Digital pin 10 (PWM)
24
PB5 ( OC1A/PCINT5 )
Digital pin 11 (PWM)
25
PB6 ( OC1B/PCINT6 )
Digital pin 12 (PWM)
26
PB7 ( OC0A/OC1C/PCINT7 )
Digital pin 13 (PWM)
27
PH7 ( T4 )
28
PG3 ( TOSC2 )
29
PG4 ( TOSC1 )
30
RESET
RESET
31
VCC
VCC
32
GND
GND
33
XTAL2
XTAL2
34
XTAL1
XTAL1
25
35
PL0 ( ICP4 )
Digital pin 49
36
PL1 ( ICP5 )
Digital pin 48
37
PL2 ( T5 )
Digital pin 47
38
PL3 ( OC5A )
Digital pin 46 (PWM)
39
PL4 ( OC5B )
Digital pin 45 (PWM)
40
PL5 ( OC5C )
Digital pin 44 (PWM)
41
PL6
Digital pin 43
42
PL7
Digital pin 42
43
PD0 ( SCL/INT0 )
Digital pin 21 (SCL)
44
PD1 ( SDA/INT1 )
Digital pin 20 (SDA)
45
PD2 ( RXDI/INT2 )
Digital pin 19 (RX1)
46
PD3 ( TXD1/INT3 )
Digital pin 18 (TX1)
47
PD4 ( ICP1 )
48
PD5 ( XCK1 )
49
PD6 ( T1 )
50
PD7 ( T0 )
Digital pin 38
51
PG0 ( WR )
Digital pin 41
52
PG1 ( RD )
Digital pin 40
53
PC0 ( A8 )
Digital pin 37
54
PC1 ( A9 )
Digital pin 36
55
PC2 ( A10 )
Digital pin 35
56
PC3 ( A11 )
Digital pin 34
57
PC4 ( A12 )
Digital pin 33
58
PC5 ( A13 )
Digital pin 32
59
PC6 ( A14 )
Digital pin 31
60
PC7 ( A15 )
Digital pin 30
61
VCC
VCC
62
GND
GND
26
63
PJ0 ( RXD3/PCINT9 )
Digital pin 15 (RX3)
64
PJ1 ( TXD3/PCINT10 )
Digital pin 14 (TX3)
65
PJ2 ( XCK3/PCINT11 )
66
PJ3 ( PCINT12 )
67
PJ4 ( PCINT13 )
68
PJ5 ( PCINT14 )
69
PJ6 ( PCINT 15 )
70
PG2 ( ALE )
Digital pin 39
71
PA7 ( AD7 )
Digital pin 29
72
PA6 ( AD6 )
Digital pin 28
73
PA5 ( AD5 )
Digital pin 27
74
PA4 ( AD4 )
Digital pin 26
75
PA3 ( AD3 )
Digital pin 25
76
PA2 ( AD2 )
Digital pin 24
77
PA1 ( AD1 )
Digital pin 23
78
PA0 ( AD0 )
Digital pin 22
79
PJ7
80
VCC
VCC
81
GND
GND
82
PK7 ( ADC15/PCINT23 )
Analog pin 15
83
PK6 ( ADC14/PCINT22 )
Analog pin 14
84
PK5 ( ADC13/PCINT21 )
Analog pin 13
85
PK4 ( ADC12/PCINT20 )
Analog pin 12
86
PK3 ( ADC11/PCINT19 )
Analog pin 11
87
PK2 ( ADC10/PCINT18 )
Analog pin 10
88
PK1 ( ADC9/PCINT17 )
Analog pin 9
89
PK0 ( ADC8/PCINT16 )
Analog pin 8
90
PF7 ( ADC7 )
Analog pin 7
27
91
PF6 ( ADC6 )
Analog pin 6
92
PF5 ( ADC5/TMS )
Analog pin 5
93
PF4 ( ADC4/TMK )
Analog pin 4
94
PF3 ( ADC3 )
Analog pin 3
95
PF2 ( ADC2 )
Analog pin 2
96
PF1 ( ADC1 )
Analog pin 1
97
PF0 ( ADC0 )
Analog pin 0
98
AREF
Analog Reference
99
GND
GND
100
AVCC
VCC
Each of the 54 digital pins on the Mega can be used as an input or
output,
using pinMode(),
digitalWrite(),
and digitalRead() functions.
They operate at 5 volts. Each pin can provide or receive 20 mA as
recommended operating condition and has an internal pull -up resistor
(disconnected by default) of 20-50 k ohm. A maximum of 40mA is the
value that must not be exceeded to avoid permanent damage to the
microcontroller.
In addition, some pins have specialized functions:
 Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2:
17 (RX) and 16 (TX); Serial 3: 15 (RX) and 14 (TX). Used to receive
(RX) and transmit (TX) TTL serial data. Pins 0 and 1 are also
connected to the corresponding pins of the ATmega16U2 USB -toTTL Serial chip.
 External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt
5), 19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2). These pins
can be configured to trigger an interrupt on a low level, a rising or
28
falling edge, or a change in level. See the attachInterrupt() function
for details.
 PWM: 2 to 13 and 44 to 46. Provide 8-bit PWM output with
the analogWrite() function.
 SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support
SPI communication using theSPI library. The SPI pins are also
broken out on the ICSP header, which is physically compatible with
the Arduino /Genuino Uno and the old Duemilanove and Diecimila
Arduino boards.
 LED: 13. There is a built-in LED connected to digital pin 13. When
the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
 TWI: 20 (SDA) and 21 (SCL). Support TWI communication using
the Wire library. Note that these pins are not in the same location as
the TWI pins on the old Duemilanove or Diecimila Arduino boards.
See also the mapping Arduino Mega 2560 PIN diagram.
The Mega 2560 has 16 analog inputs, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from
ground to 5 volts, though is it possible to change the upper end of their
range using the AREF pin and analogReference() function.
There are a couple of other pins on the board:
 AREF. Reference voltage for the analog inputs. Used with
analogReference().
 Reset. Bring this line LOW to reset the microcontroller. Typically
used to add a reset button to shields which block the one on the
board.
29
5.2.4 COMMUNICATION
The Mega 2560 board has a number of facilities for communicating
with a computer, another board, or other microcontrollers. The
ATmega2560 provides four hardware UARTs for TTL (5V) serial
communication. An ATmega16U2 (ATmega 8U2 on the revision 1 and
revision 2 boards) on the board channels one of these over USB and
provides a virtual com port to software on the computer (Windows
machines will need a .inf file, but OSX a nd Linux machines will recognize
the board as a COM port automatically. The Arduino Software (IDE)
includes a serial monitor which allows simple textual data to be sent to
and from the board. The RX and TX LEDs on the board will flash when
data is being transmitted via the ATmega8U2/ATmega16U2 chip and USB
connection to the computer (but not for serial communication on pins 0
and 1).
A Software Serial library allows for serial communication on any of
the Mega 2560's digital pins.
The Mega 2560 also supports TWI and SPI communication. The
Arduino Software (IDE) includes a Wire library to simplify use of the TWI
bus; see the documentation for details. For SPI communication, use
the SPI library.
5.2.5 AUTOMATIC (SOFTWARE) RESET
Rather than requiring a physical press of the reset button before an
upload, the Mega 2560 is designed in a way that allows it to be reset by
software running on a connected computer. One of the hardware flow
control lines (DTR) of the ATmega8U2 is connected to the reset line of
the ATmega2560 via a 100 nanofarad capacitor. When this line is asserted
30
(taken low), the reset line drops long enough to reset the chip. The Arduino
Software (IDE) uses this capability to allow you to upload code by simply
pressing the upload button in the Arduino environment. This means that
the bootloader can have a shorter timeout, as the lowering of DTR can be
well-coordinated with the start of the upload.
This setup has other implications. When the Mega 2560 board is
connected to either a computer running Mac OS X or Linux, it resets each
time a connection is made to it from software (via USB). For the following
half-second or so, the bootloader is running on the ATMega2560. While
it is programmed to ignore malformed data (i.e. anything besides an
upload of new code), it will intercept the first few bytes of data sent to the
board after a connection is opened. If a sketch running on the board
receives one-time configuration or other data when it first starts, make
sure that the software with which it communicates waits a second after
opening the connection and before sending this data.
The Mega 2560 board contains a trace that can be cut to disable the
auto-reset. The pads on either side of the trace can be soldered together to
re-enable it. It's labelled "RESET-EN". You may also be able to disable
the auto-reset by connecting a 110 ohm resistor from 5V to the reset line;
see this forum thread for details.
5.2.6 REVISIONS
The Mega 2560 does not use the FTDI USB-to-serial driver chip used
in past designs. Instead, it features the ATmega16U2 (ATmega8U2 in the
revision 1 and revision 2 Arduino boards) programmed as a USB -to-serial
converter. Revision 2 of the Mega 2560 board has a resistor pulling the
8U2 HWB line to ground, making it easier to put into DFU mode. Revision
31
3 of the Arduino board and the current Genuino Mega 2560 have th e
following improved features:

1.0 pinout: SDA and SCL pins - near to the AREF pin - and two
other new pins placed near to the RESET pin, the IOREF that allow
the shields to adapt to the voltage provided from the board. In future,
shields will be compatible both with the board that use the AVR,
which operate with 5V and with the board that uses ATSAM3X8E,
that operate with 3.3V. The second one is a not connected pin, that
is reserved for future purposes.

Stronger RESET circuit.

Atmega 16U2 replace the 8U2.
5.3 POWER SUPPLY
This section describes how to generate +5V DC power supply
Fig 5.5 Power Supply
The power supply section is the important one. It should deliver constant
output regulated power supply for successful working of the project. A 0-12V/1
mA transformer is used for this purpose. The primary of this transformer is
connected in to main supply through on/off switch& fuse for protecting from
overload and short circuit protection. The secondary is connected to the diodes to
32
convert 12V AC to 12V DC voltage. And filtered by the capacitors, which is
further regulated to +5v, by using IC 7805.
5.4 LIQUID CRYSTAL DISPLAY
LCD screen is an electronic display module and find a wide range of
applications. A 16x2 LCD display is very basic module and is very commonly
used in various devices and circuits. These modules are preferred over seven
segments and other multi segment LEDs. The reasons being: LCDs are
economical; easily programmable; have no limitation of displaying special &
even custom characters (unlike in seven segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such
lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has
two registers, namely, Command and Data. The command register stores the
command instructions given to the LCD. A command is an instruction given to
LCD to do a predefined task like initializing it, clearing its screen, setting the
cursor position, controlling display etc. The data register stores the data to be
displayed on the LCD. The data is the ASCII value of the character to be
displayed on the LCD. Click to learn more about internal structure of a LCD.
Fig 5.6 LCD Display
We come across LCD displays everywhere around us. Computers, calculators,
television sets, mobile phones, digital watches use some kind of display to display
the time. An LCD is an electronic display module which uses liquid crystal to
produce a visible image. The 16×2 LCD display is a very basic module commonly
33
used in projects. The 16×2 translates to a display 16 characters per line in 2 such
lines. In this LCD each character is displayed in a 5×7 pixel matrix.
5.4.1 16X2 LCD PINOUT DIAGRAM
Fig 5.7 16X2 LCD PINOUT DIAGRAM
PIN
FUNCTION
NAME
NO.
1
Ground (0V)
Ground
2
Supply voltage; 5V (4.7V – 5.3V)
VCC
3
Contrast adjustment; the best way is to use a variable
Vo / VEE
resistor such as a potentiometer. The output of the
potentiometer is connected to this pin. Rotate the
potentiometer knob forward and backwards to adjust the
LCD contrast.
34
4
Selects command register when low, and data register RS
when high
(Register
Select )
5
Low to write to the register; High to read from the register Read/write
6
Sends data to data pins when a high to low pulse is given; Enable
Extra voltage push is required to execute the instruction
and EN(enable) signal is used for this purpose. Usually, we
make it en=0 and when we want to execute the instruction
we make it high en=1 for some milliseconds. After this we
again make it ground that is, en=0.
7
8-bit data pins
DB0
8
DB1
9
DB2
10
DB3
11
DB4
12
DB5
13
DB6
14
DB7
15
Backlight VCC (5V)
Led+
16
Backlight Ground (0V)
Led-
5.4.2 RS (REGISTER SELECT)
A 16X2 LCD has two registers, namely, command and data. The register
select is used to switch from one register to other. RS=0 for command register,
whereas RS=1 for data register.
35
5.4.3 COMMAND REGISTER
The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing
it, clearing its screen, setting the cursor position, controlling display etc.
Processing for commands happens in the command register.
5.4.4 DATA REGISTER
The data register stores the data to be displayed on the LCD. The data is the
ASCII value of the character to be displayed on the LCD. When we send data to
LCD it goes to the data register and is processed there. When RS=1, data register
is selected.
5.5 VIBRATION SENSOR
Fig 5.8 Vibration Sensor
Vibration Sensor is a high sensitivity non-directional vibration sensor. When
the module is stable, the circuit is turned on and the output is high. When the
movement or vibration occurs, the circuit will be briefly disconnected and output
low. At the same time, you can also adjust the sensitivity according to your own
needs. The vibration switch that opens when vibration is detected and closes
when there is no vibration.
36
This sensor module produce logic states depends on vibration and external
force applied on it. When there is no vibration this module gives logic LOW
output. When it feels vibration then output of this module goes to logic HIGH.
The working bias of this circuit is between 3.3V to 5V DC.
The vibration sensor Comes with breakout board that includes comparator
LM 393 and Adjustable on board potentiometer for sensitivity threshold
selection, and signal indication LED.
The breakout board contains an LM393 op-amp IC but it is used as a
comparator and not an amplifier. Basically, the D0 pin goes high when there
is vibration and goes low when there isn’t. You can adjust the sensitivity of
the sensor by turning the trimmer on the board.
The board comes with two LEDs: one for power indication and one tied
directly to D0. When the D0 pin is high, the D0 LED turns off and vice
versa. Yeah, it’s the opposite of what we would like the LED to do. My
breakout board gives a high pulse every time I give it a shake. I could use
the pulse width to indicate that there is vibration going on.
5.5.1 FEATURES
 The default state of the switch is close.
 Digital output Supply voltage:3.3V-5V.
 On-board indicator LED to show the results.
 This is Open-Type Vibration Sensor Module.
 Fixed bolt hole, convenient installation.
37
5.5.2 VIBRATION SENSOR SW-18010P
Fig 5.9 SW-18010P Pin diagram
Can be used in variety of vibration detection projects. The two contacts of
sensor are not connected in idle condition. When external force is acted upon
either my movement or vibration, the sensor's two contact pin are closed and
contact is made between the two pins. When the force is removed the sensor
terminals returns back to open contacts.
The working principle of vibration sensor is a sensor which operates based on
different optical otherwise mechanical principles for detecting observed system
vibrations. The sensitivity of these sensors normally ranges from 10 mV/g to 100
mV/g, and there are lower and higher sensitivities are also accessible. The
sensitivity of the sensor can be selected based on the application. So it is essential
to know the levels of vibration amplitude range to which the sensor will be
exposed throughout measurements.
5.5.3 SPECIFICATIONS OF SW-18010P

Maximum working voltage (Vmax) : 12V.

Maximum current (Imax) : less than 20mA.

Open circuit resistance: more than 10 Mega Ohms.

On resistance: less than 5 ohms.
38

Ambient temperature: less than 100℃.

Life expectancy: 5,00,000 times.

Suitable for small current control circuit of trigger.

Response time: 2ms.

Sensor is in airtight seal.

Gold Plated Contacts.
5.6 TEMPERATURE SENSOR
Fig 5.10 LM35
The LM35 series are precision integrated-circuit temperature devices with an
output voltage linearly proportional to the Centigrade temperature. The LM35
device has an advantage over linear temperature sensors calibrated in Kelvin, as
the user is not required to subtract a large constant voltage from the output to
obtain convenient Centigrade scaling. The LM35 device does not require any
external calibration or trimming to provide typical accuracies of ±¼°C at room
temperature and ±¾°C over a full −55°C to 150°C temperature range. Lower cost
is assured by trimming and calibration at the water level. The low-output
impedance, linear output, and precise inherent calibration of the LM35 device
makes interfacing to readout or control circuitry especially easy. The device is
used with single power supplies, or with plus and minus supplies. As the LM35
device draws only 60 μA from the supply, it has very low self-heating of less than
0.1°C in still air. The LM35 device is rated to operate over a −55°C to 150°C
39
temperature range, while the LM35C device is rated for a −40°C to 110°C range
(−10° with improved accuracy). The LM35-series devices are available packaged
in hermetic TO transistor packages, while the LM35C, LM35CA, and LM35D
devices are available in the plastic TO-92 transistor package. The LM35D device
is available in an 8-lead surface-mount small-outline package and a plastic TO220 package.
5.6 GAS SENSOR (MQ-2)
Fig 5.11 MQ-2 Gas Sensor
Sensitive material of MQ-2 gas sensor is SnO2, which with lower conductivity
in clean air. When the target combustible gas exists, the sensor’s conductivity is
higher along with the gas concentration rising. Please use simple electro circuit,
Convert change of conductivity to correspond output signal of gas concentration.
MQ-2 gas sensor has high sensitivity to LPG, Propane and Hydrogen, also could
be used to Methane and other combustible steam, it is with low cost and suitable
for different application. Sensor is sensitive to flammable gas and smoke. Smoke
sensor is given 5 volts to power it. Smoke sensor indicate smoke by the voltage
that it outputs. More smoke more output. A potentiometer is provided to adjust
the sensitivity. But when smoke exist sensor provides an analog resistive output
based on concentration of smoke. The circuit has a heater. Power is given to
heater by VCC and GND from power supply. The circuit has a variable resistor.
The resistance across the pin depends on the smoke in air in the sensor. The
40
resistance will be lowered if the content is more. And voltage is increased
between the sensor and load resistor.
5.7 GSM
Fig 5.12 GSM Module (GSM800C)
Throughout the evolution of cellular telecommunications, various systems
have been developed without the benefit of standardized specifications. This
presented many problems directly related to compatibility, especially with the
development of digital radio technology. The GSM standard is intended to
address these problems.
From 1982 to 1985 discussions were held to decide between building an
analog or digital system. After multiple field tests, a digital system was adopted
for GSM. The next task was to decide between a narrow or broadband solution.
In May 1987, the narrowband time division multiple access (TDMA) solution
was chosen. A summary of GSM milestones is given in Table.
5.9 GPS
GPS or Global Positioning System is a satellite navigation system that
furnishes location and time information in all climate conditions to the user. GPS
is used for navigation in planes, ships, cars and trucks also. The system gives
critical abilities to military and civilian users around the globe. GPS provides
41
continuous real time, 3-dimensional positioning, navigation and timing
worldwide.
Fig 5.13 GPS Module
The Global Positioning System (GPS) is a satellite-based navigation system
made up of at least 24 satellites. GPS works in any weather conditions, anywhere
in the world, 24 hours a day, with no subscription fees or setup charges. The U.S.
Department of Defence (USDOD) originally put the satellites into orbit for
military use, but they were made available for civilian use in the 1980s.
5.10 SD CARD MODULE INTERFACE WITH ARDUINO
5.10.1 INTRODUCING THE SD CARD MODULE
The SD card module is especially useful for projects that require data logging.
The Arduino can create a file in an SD card to write and save data using the
SD library.
There are different models from different suppliers, but they all work in a
similar way, using the SPI communication protocol. The module used in this
tutorial is the one shown in figure below (front and back view).
42
Fig 5.14 SD Card Module
Fig 5.15 SD Card Module with SD card
5.10.2 PIN WIRING
SD
MODULE
VCC
CS
MOSI
CLK
MISO
GND
CARD WIRING TO ARDUINO UNO WIRING
TO
ARDUINO
MEGA
3.3V or 5V (check module’s 3.3V or 5V (check module’s
datasheet)
datasheet)
4
53
11
51
13
52
12
50
GND
GND
43
5.10.3 PREPARING THE SD CARD
The first step when using the SD card module with Arduino is formatting the
SD card as FAT16 or FAT32. Follow the instructions below.
1) To format the SD card, insert it in your computer. Go to My
Computer and right click on the SD card. Select Format as shown in
figure below.
Fig 5.16 SD Card Formatting
2) A new window pops up. Select FAT32, press Start to initialize the
formatting process and follow the onscreen instructions.
Fig 5.17 Formatting initialization
44
5.10.4 TESTING THE SD CARD MODULE
Insert the formatted SD card in the SD card module.
Connect the SD card module to the Arduino as shown in the circuit schematics
below or check Pin Wiring in previous section.
Fig 5.18 Testing the SD Card module
CODE – CARDINFO:
To make sure everything is wired correctly and the SD card is working
properly, in the Arduino IDE window go to File> Examples > SD > CardInfo.
Upload the code to your Arduino board. Make sure you have the right board
and COM port selected.
Open the Serial Monitor at a baud rate of 9600 and you should see your SD
card information.
If everything is working properly you’ll see a similar message on the serial
monitor.
Fig 5.19 Initialization of SD card in Arduino IDE
45
5.11 SWITCH
Fig 5.20 Switch
Switch is an electrical component which can make or break electrical circuit
automatically or manually. Switch is mainly works with ON (open) and OFF
(closed) mechanism. Numerous circuits hold switches that control how the circuit
works or actuate different characteristics of the circuit. The classification of
switches depends on the connection they make. Two vital components that
confirm what sorts of connections a switch makes are pole and throw.
These are classified on based the connections they make. If you were under
the impression that switches simply turn circuits on and off, guess again. The
terms pole and throw are also used to describe switch contact variations. The
number of “poles” is the number of separate circuits which are controlled by a
switch. The number of “throws” is the number of separate positions that the
switch can adopt. A single-throw switch has one pair of contacts that can either
be closed or open. A double-throw switch has a contact that can be connected to
either of two other contacts; a triple-throw has a contact which can be connected
to one of three other contacts, etc.
 Pole: The amount of circuits controlled by the switch is indicated by poles.
Single pole (SP) switch controls only one electrical circuit. Double pole
(DP) switch controls two independent circuits.
 Throw: The number of throws indicates how many different output
connections every switch pole can connect its input. A single throw (ST)
switch is a simple on/off switch. When the switch is ON, the two terminals
of switch are connected and current flows between them. When the switch
is OFF the terminals are not connected, so current does not flow.
46
5.12 APPLICATIONS
 This system is used in vehicle for monitoring purpose and get the
respective information.
5.1 3 ADVANTAGES
 The accident information is recorded and the data is updated to the cloud.
 Monitoring of vehicle is easier.
 Investigation report got more accurate and less time.
 Additional storage is also provided and it can be referred in case the cloud
cannot be accessed.
47
CHAPTER 6
RESULTS
6.1 HARDWARE KIT
Fig 6.1 Hardware kit
6.2 OUTPUTS
Fig 6.2 Messages sent by the black box
48
Fig 6.3 Cloud data of the black box system
Fig 6.4 Detection of gas or alcohol by the black box
Fig 6.5 Temperature detected by the black box
49
CHAPTER 7
FUTURE SCOPE
7.1 FUTURE ENHANCEMENT
 In future we can use the camera and image processing techniques to get
the more information about the accidents.
 Further it can be implemented in two wheeler and heavy vehicles.
 It can also be implemented in various microcontroller technologies with
higher configurations like Raspberry pi.
7.2 CONCLUSION
In this paper, we proposed an intelligent black box based safety information
gathering system. We added additional functionalities to the ordinary car black
box such as license plate number and colour recognition of neighbouring vehicles
and IOT functionality to receive the information request message and upload the
stored information. We also show the simulation of coding and implementation
details of the proposed system.
50
REFERENCES
[1]. A. Milan, K. Schindler, and S. Roth, “Detection- and trajectory-level
exclusion in multiple object tracking,” in CVPR, 2013, pp. 3682–3689.
[2].Abdallah Kassem, Rabih Jabr, Ghady Salamouni, Ziad Khairallah
Maalouf, “Vehicle Black Box System”, Proceedings of the 2 nd Annual IEEE
System Conference, IEEE 2008, pp. 1-6.
[3]. Ashish Kushwaha, Gaurav Katiyar, &Harshita Katiyar, Hemant Yadav,
Saxena ‘GPS And GSM Based Accident Alarm System’ ;National Student
Conference On “Advances in Electrical & Information Communication
Technology”AEICT-2014 .
[4]. C.Prabha , R.Sunitha , R.Anitha ;Automatic Vehicle Accident Detection
and Messaging System Using GSM and GPS Modem;International Journal of
Advanced
Research
in
Electrical,Electronics
and
Instrumentation
Engineering.
[5]. D. B. Reid, “An algorithm for tracking multiple targets,” IEEE Trans.
Autom. Control, vol. 24, no. 6, pp. 843–854, 1979.
[6]. D. Jiang, and L. Delgrossi, “IEEE 802.11p: Towards an International
Standard for Wireless Access in Vehicular Environments,”in Technology
Conference (VTC), pp. 2036-2040, May 2008.
[7]. Douglas, "Engineering Web Technologies for Embedded Applications,"
IEEE Internet Computing, May/June 1998.
[8]. GONG xiaoyan, TANG shuming, WANG feiyue, “Traffic Incident
Detection Algorithm Based on Non-parameter Regression” IEEE 2002.
[9].Hu Jian-Ming; Li Jie; Li Guang-Hui, "Automobile Anti-theft System
Based on GSM and GPS Module," Intelligent Networks and Intelligent
51
Systems (ICINIS), 2012 Fifth International Conference on , vol., no.,
pp.199,201, 1-3 Nov. 2012.
[10]. Jacek W, "Embedded Internet technology in process control devices,"
IEEE Internet Computing, Vol. 34, 2000.
[11]. N. Wojke, A. Bewley, and D. Paulus, “Simple online and realtime
tracking with a deep association metric,” in Proc. IEEE Int. Conf. Image
Process. (ICIP), Sep. 2017, pp. 3645–3649.
[12]. NiravThakor, TanmayVyas, Divyang Shah; Automatic Vehicle Accident
Detection System Based on ARM &GPS ;International Journal for Research
in Technological Studies ISSN: - Applied (Online) Vol-1, Issue - 1, Dec 2013.
[13]. R. Ramani,
S.Valarmathy, Dr. N Suthanthira, S.Selavaraju,
M.Thiruppathi, R.Thagam, “Vehicle Tracking and Locking Based GSM and
GPS”, Issue Date: Sept 2013).
[14]. R. Girshick, J. Donahue, T. Darrell, and J. Malik, “Rich feature
hierarchies for accurate object detection and semantic segmentation,” in Proc.
CVPR, 2014, pp. 580–587.
[15]. Raj Kamal, “Embedded System Architecture Programming and Design”
(2nd edition) ,Tata McGraw Hill.
[16]. Sri Krishna Chaitanya Varma, Poornesh, Tarun Varma, Harsha;
Automatic Vehicle Accident Detection And Messaging System Using GPS
and GSM Modems; International Journal of Scientific & Engineering
Research, Volume 4, Issue 8, August-2013.
[17]. T.E. Fortmann, Y. Bar-Shalom, and M. Scheffe, “Sonar tracking of
multiple targets using joint probabilistic data association,” IEEE J. Ocean.
Eng., vol. 8, no. 3, pp.173–184, 1983.
52
[18]. T. Krishna Kishore, T. Sasi Vardhan, N. Lakshmi Narayana “Vehicle
Tracking using A Reliable Embedded Data Acquisition System with GPS and
GSM” International Journal of Computer Science and Network Security,
February 2010.
[19]. Y. Xiang, A. Alahi, and S. Savarese, “Learning to track: Online multiobject tracking by decision making,” in Proc. ICCV, 2015, pp. 4705–4713.
[20]. Watthanawisuth, N., Lomas, T., and Tuantranont, A.,“Wireless Black
Box Using MEMS Accelerometer and GPS Tracking for Accidental
Monitoring of Vehicles”, Proceedings of IEEE.
53
Download