Accidenct Detection&Rescue System
Accidenct Detection&Rescue System
MASTER OF TECHNOLOGY
Submitted By
CH. DIVYA VALMIKA (22X41D5804)
DEPARTMENT OF CSE
DEPARTMENT OF CSE
CERTIFICATE
I Ch. Divya Valmika hereby declare that the project report entitled
“SMART ACCIDENT DETECTION AND RESCUE SYSTEM” is an
original work done in the Department of Master Of Technology, SRK Institute
of Technology, Enikepadu, Vijayawada, during the academic year 2022-2023,
in partial fulfillment for the award of the Degree of Master of Technology. I
assure that this project is not submitted to any other College or University.
ACKNOWLEDGEMENT
Firstly, I would like to convey my heart full thanks to the Almighty for the blessings on me
to carry out this project work without any disruption.
I am extremely thankful to Dr. N. Neelima Priyanka, Project guide who guided me throughout
the project. I am thankful to her for giving me the most independence and freedom throughout various
phases of the project.
I am very much grateful to Dr. B. Asha Latha, H.O.D of CSE Department, for her valuable
guidance which helped me to bring out this project successfully. Her wise approach made me to learn the
minute details of the subject. Her matured and patient guidance paved a way for completing my project
with the sense of satisfaction and pleasure.
I am very much thankful to our principal Dr. M. Ekambaram Naidu for his kind support and
facilities provided at our campus which helped me to bring out this project successfully.
Finally, I would like to convey my heart full thanks to all Technical Staff, for their guidance and
support in every step of this project. I convey my sincere thanks to all the faculty and friends who
directly or indirectly helped me for the successful completion of this project.
PROJECT ASSOCIATE
Ch. Divya Valmika (22X41D5804)
Abstract
Now a day, technology rapidly growth, but also people do not survive his/her life after road accident
because there is no emergency facilities available in our country. So, we design a technology which
facilitates the emergency facilities. This project informs about an accident that is occurred to vehicle to
rescue team and the family members of the travelling persons. This uses IR sensor which can detect the
abrupt vibration when an accident is occurred, that information sends to the rescue team by using IOT
technology and locate the position by GPS receiver modems in the form of latitude and longitude. We
are using Blynk mobile application to get the notification alerts and accident occurred location.
TABLE OF CONTENTS
1. Introduction
2. Methodology
3. Hardware Components
4. Software Components
5. Program Implementation
6. Result and Discussion
7. Conclusion and Future Work
INTRODUCTION
All embedded systems are including computers or microprocessors. Some of these computers are
however very simple systems as compared with a personal computer.
The very simplest embedded systems are capable of performing only a single function or set of
functions to meet a single predetermined purpose. In more complex systems an application program that
enables the embedded system to be used for a particular purpose in a specific application determines the
functioning of the embedded system. The ability to have programs means that the same embedded
system can be used for a variety of different purposes. In some cases, a microprocessor may be designed
in such a way that application software for a particular purpose can be added to the basic software in a
second process, after which it is not possible to make further changes. The applications software on such
processors is sometimes referred to as firmware.
The simplest devices consist of a single microprocessor (often called a "chip”), which may itself
be packaged with other chips in a hybrid system or Application Specific Integrated Circuit (ASIC). Its
input comes from a detector or sensor and its output goes to a switch or activator which (for example)
may start or stop the operation of a machine or, by operating a valve, may control the flow of fuel to an
engine.
Embedded
System
Software Hardware
ALP Processor
C Peripherals
VB memory
Etc.,
Software deals with the languages like ALP, C, and VB etc., and Hardware deals with Processors,
Peripherals, and Memory.
Construction industry
Transport
Buildings and premises
Domestic service
Communications
Office systems and mobile equipment
Banking, finance and commercial
Medical diagnostics, monitoring and life support
Testing, monitoring and diagnostic systems
Instruction set: The set of instructions that the microprocessor can execute.
Bandwidth : The number of bits processed in a single instruction.
Clock speed : Given in megahertz (MHz), the clock speed determines how many instructions
per second the processor can execute.
In both cases, the higher the value, the more powerful the CPU. For example, a 32-bit microprocessor
that runs at 50MHz is more powerful than a 16-bit microprocessor that runs at 25MHz. In addition to
bandwidth and clock speed, microprocessors are classified as being either RISC (reduced instruction set
computer) or CISC (complex instruction set computer).
A microprocessor has three basic elements, as shown above. The ALU performs all arithmetic
computations, such as addition, subtraction and logic operations (AND, OR, etc). It is controlled by the
Control Unit and receives its data from the Register Array. The Register Array is a set of registers used
for storing data. These registers can be accessed by the ALU very quickly. Some registers have specific
functions - we will deal with these later. The Control Unit controls the entire process. It provides the
timing and a control signal for getting data into and out of the registers and the ALU and it synchronizes
the execution of instructions (we will deal with instruction execution at a later date).
CU
There are two different types of computer instruction set there are:
A RISC (reduced instruction set computer) is a microprocessor that is designed to perform a smaller
number of types of computer instruction so that it can operate at a higher speed (perform more million
instructions per second, or millions of instructions per second). Since each instruction type that a
computer must perform requires additional transistors and circuitry, a larger list or set of computer
instructions tends to make the microprocessor more complicated and slower in operation.
Besides performance improvement, some advantages of RISC and related design improvements are:
A new microprocessor can be developed and tested more quickly if one of its aims is to be less
complicated.
Operating system and application programmers who use the microprocessor's instructions will
find it easier to develop code with a smaller instruction set.
The simplicity of RISC allows more freedom to choose how to use the space on a
microprocessor.
Higher-level language compilers produce more efficient code than formerly because they have
always tended to use the smaller set of instructions to be found in a RISC computer.
RISC characteristics
Simple instruction set:
In a RISC machine, the instruction set contains simple, basic instructions, from which more complex
instructions can be composed.
Same length instructions.
Each instruction is the same length, so that it may be fetched in a single operation.
1 machine-cycle instructions.
Most instructions complete in one machine cycle, which allows the processor to handle several
instructions at the same time. This pipelining is a key technique used to speed up RISC machines.
Complex Instruction Set Computer (CISC)
CISC, which stands for Complex Instruction Set Computer, is a philosophy for designing chips that
are easy to program and which make efficient use of memory. Each instruction in a CISC instruction set
might perform a series of operations inside the processor. This reduces the number of instructions
required to implement a given program, and allows the programmer to learn a small but flexible set of
instructions.
Earlier generations of a processor family generally were contained as a subset in every new
version --- so instruction set & chip hardware become more complex with each generation of computers.
So that as many instructions as possible could be stored in memory with the least possible
wasted space, individual instructions could be of almost any length---this means that different
instructions will take different amounts of clock time to execute, slowing down the overall performance
of the machine.
Many specialized instructions aren't used frequently enough to justify their existence ---
approximately 20% of the available instructions are used in a typical program.
CISC instructions typically set the condition codes as a side effect of the instruction. Not only
does setting the condition codes take time, but programmers have to remember to examine the condition
code bits before a subsequent instruction changes them.
Memory Architecture
There two different type’s memory architectures there are:
Harvard Architecture
Von-Neumann Architecture
Harvard Architecture
Computers have separate memory areas for program instructions and data. There are two or more
internal data buses, which allow simultaneous access to both instructions and data. The CPU fetches
program instructions on the program memory bus.
The Harvard architecture is a computer architecture with physically separate storage and signal
pathways for instructions and data. The term originated from the Harvard Mark I relay-based computer,
which stored instructions on punched tape (24 bits wide) and data in electro-mechanical counters. These
early machines had limited data storage, entirely contained within the central processing unit, and
provided no access to the instruction storage as data. Programs needed to be loaded by an operator, the
processor could not boot itself.
Figure: Harvard Architecture
The von Neumann architecture is a design model for a stored-program digital computer that uses a
central processing unit (CPU) and a single separate storage structure ("memory") to hold both
instructions and data. It is named after the mathematician and early computer scientist John von
Neumann. Such computers implement a universal Turing machine and have a sequential architecture.
A stored-program digital computer is one that keeps its programmed instructions, as well as its data, in
read-write, random-access memory (RAM). Stored-program computers were advancement over the
program-controlled computers of the 1940s, such as the Colossus and the ENIAC, which were
programmed by setting switches and inserting patch leads to route data and to control signals between
various functional units. In the vast majority of modern computers, the same memory is used for both
data and program instructions. The mechanisms for transferring the data and instructions between the
CPU and memory are, however, considerably more complex than the original von Neumann
architecture.
The terms "von Neumann architecture" and "stored-program computer" are generally used
interchangeably, and that usage is followed in this article.
The primary difference between Harvard architecture and the Von Neumann architecture is in
the Von Neumann architecture data and programs are stored in the same memory and managed by the
same information handling system.
Whereas the Harvard architecture stores data and programs in separate memory devices and they
are handled by different subsystems.
In a computer using the Von-Neumann architecture without cache; the central processing unit
(CPU) can either be reading and instruction or writing/reading data to/from the memory. Both of these
operations cannot occur simultaneously as the data and instructions use the same system bus.
In a computer using the Harvard architecture the CPU can both read an instruction and access
data memory at the same time without cache. This means that a computer with Harvard architecture can
potentially be faster for a given circuit complexity because data access and instruction fetches do not
contend for use of a single memory pathway.
Today, the vast majority of computers are designed and built using the Von Neumann
architecture template primarily because of the dynamic capabilities and efficiencies gained in designing,
implementing, operating one memory system as opposed to two. Von Neumann architecture may be
somewhat slower than the contrasting Harvard Architecture for certain specific tasks, but it is much
more flexible and allows for many concepts unavailable to Harvard architecture such as self-
programming, word processing and so on.
Harvard architectures are typically only used in either specialized systems or for very specific
uses. It is used in specialized digital signal processing (DSP), typically for video and audio processing
products. It is also used in many small microcontrollers used in electronics applications such as
Advanced RISK Machine (ARM) based products for many vendors.
PROPOSED SCHEME
Block diagram:
Power Supply
Buzzer
Node
MCU
Vibration
Sensor
Cloud
GPS Module
Blynk
Application
While the Internet of Things (IOT) will ultimately have an enormous impact on consumers,
enterprises and society as a whole, it is still at an early stage in its development. As mobile
operators and their partners pilot new services across multiple sectors, ranging from health to
automotive, they have identified several distinctive features of the Internet of Things. A common
understanding of the distinctive nature of this nascent opportunity should help hasten the
development of this market.
The Internet of Things can enable the next wave of life enhancing services across several
fundamental sectors of the economy.
As the Internet of Things evolves, the proliferation of smart connected devices supported by
mobile networks, providing pervasive and seamless connectivity, will unlock opportunities to
provide life-enhancing services for consumers while boosting productivity for enterprises. As
can be seen in Figure 5 below, thirteen industry sectors are likely to show significant adoption of
IoT services.
In cities, the development of smart grids, data analytics and autonomous vehicles will provide an
intelligent platform to deliver innovations in energy management, traffic management and
security, sharing the benefits of this technology throughout society.
IOT Service Segmentation
W
h
i
l
e
the potential impact of the IoT is considerable, a concerted effort is required to move beyond this
early stage. In order to optimize the development of the market, a common understanding of the
distinct nature of the opportunity is required.
Another important characteristic of IoT services can be the deployment of a large number of the
same type of devices and applications.
Each device and application performs the same activity and transports information to a service
centre at the same time. Regardless of the amount of data transmitted by each device, this simple
operation could cause network congestion. Mobile networks need to provide several mechanisms
to protect and better utilize their capabilities for delivering such M2M/IoT services.
Mechanisms for remotely managing such devices and applications could allow intelligent
scheduling, which would facilitate an appropriate application development and reduce the
vulnerability of the network to application misbehaviour.
An additional feature of the IoT market is, that in some scenarios, devices and applications may
be deployed and actively work for a large number of years, operating on batteries or using
limited power. In this case, the communication module needs to consume very little energy to
guarantee a longer device lifetime.
In summary, the IoT will require mobile networks to offer a much more diversified set of
capabilities, while providing protection mechanisms for identifying and blocking any application
misbehaviour and guaranteeing all other services. Mobile operators are working to identify these
requirements and develop appropriate capabilities in order to support the vast range of IoT
applications.
APPLICATIONS
In cities, the development of smart grids, data analytics and autonomous vehicles will
provide an intelligent platform to deliver innovations in energy management, traffic management
and security, sharing the benefits of this technology throughout society.
IOT health applications
The IoT will also help widen access and improve quality of education and health.
As demand for healthcare doubles8, connected smart devices will help address this challenge by
supporting a range of e-health services that improve access and enable monitoring of chronic
diseases and age-related conditions in the home.
In doing so, they will improve the quality of care and quality of life for patients, while reducing
the strain on the wider healthcare system.
In education, mobile-enabled solutions will tailor the learning process to each student’s needs,
improving overall proficiency levels, while linking virtual and physical classrooms to make
learning more convenient and accessible.
Mobile education solutions have already been shown to improve learners’ proficiency rates and
reduce dropout rates, and have the potential to enable, by 2017, the education of up to 180
million additional students in developing countries who will be able to stay in school due to
mEducation.
For enterprises, the ability of IoT to combine innovations in data analytics, 3D printing
and sensors, will improve productivity by enabling a step change in the quality of decision
making, efficiency of production, personalization of retail and productivity of food production.
ADVANTAGES OF IOT
The IoT will increase the range of services, each requiring varying levels of bandwidth, mobility
and latency.
For example, services that are related to public safety or personal safety will generally require
low latency, but not high bandwidth per sec. alternatively, services that provide surveillance
might also require high bandwidth. Due to the differing level of service demand, mobile
networks may need the ability to identify the service which is generating traffic and meet its
specific needs.
For example, alert services related to public safety or personal health would require a higher
priority compared to metering information, which is a normal monitoring activity. Varying
levels of mobility (the degree to which devices and applications need to be nomadic) is another
important characteristic of IoT service demand. For nomadic services, location information and
geo-fencing becomes a crucial enabler.
Proximity services in general will play an important role in the IoT ecosystem. In this context,
the mobile network faces the challenge of being able to recognize different type of devices.
For example, in the automotive sector, only cars in the proximity of an accident need to be
notified, rather than every vehicle. Conversely, there are devices and applications that are not
mobile by nature, such as a smart meter or a street lamp. Any movement of such
devices/applications might indicate an anomaly in the service.
Conclusion
The Internet of Things promises to deliver a step change in individuals’ quality of life and
enterprises’ productivity.
Through a widely distributed, locally intelligent network of smart devices, the IoT has the
potential to enable extensions and enhancements to fundamental services in transportation,
logistics, security, utilities, education, healthcare and other areas, while providing a new
ecosystem for application development.
A concerted effort is required to move the industry beyond the early stages of market
development towards maturity, driven by common understanding of the distinct nature of the
opportunity.
This market has distinct characteristics in the areas of service distribution, business and charging
models, capabilities required to deliver IoT services, and the differing demands these services
will place on mobile networks.
GSMA’s Connected Living Program is an industry initiative which seeks to expedite the
development of mobile-enabled IoT services.
It is hoped that a common understanding of the characteristics of IoT will enable industry
stakeholders to collaborate more effectively in order to propel the market forward for the benefit
of consumers and society.
HARDWARE COMPONENTS
POWER SUPPLY:
Block diagram:
Figure: Power Supply
Circuit diagram:
Description:
Transformer:
A transformer is a device that transfers electrical energy from one circuit to another through
inductively coupled conductors—the transformer's coils. A varying current in the first or primary
winding creates a varying magnetic flux in the transformer's core, and thus a varying magnetic field
through the secondary winding. This varying magnetic field induces a varying electromotive force
(EMF) or "voltage" in the secondary winding. This effect is called mutual induction.
(or)
Transformer is a device that converts the one form energy to another form of energy like a transducer.
Figure: Transformer
Basic Principle:
A transformer makes use of Faraday's law and the ferromagnetic properties of an iron core to efficiently
raise or lower AC voltages. It of course cannot increase power so that if the voltage is raised, the current
is proportionally lowered and vice versa.
A transformer consists of two coils (often called 'windings') linked by an iron core, as shown in figure
below. There is no electrical connection between the coils, instead they are linked by a magnetic field
created in the core.
Transformers are used to convert electricity from one voltage to another with minimal loss of power.
They only work with AC (alternating current) because they require a changing magnetic field to be
created in their core. Transformers can increase voltage (step-up) as well as reduce voltage (step-down).
Alternating current flowing in the primary (input) coil creates a continually changing magnetic field in
the iron core. This field also passes through the secondary (output) coil and the changing strength of the
magnetic field induces an alternating voltage in the secondary coil. If the secondary coil is connected to
a load the induced voltage will make an induced current flow. The correct term for the induced voltage
is 'induced electromotive force' which is usually abbreviated to induced e. m. f.
The iron core is laminated to prevent 'eddy currents' flowing in the core. These are currents produced by
the alternating magnetic field inducing a small voltage in the core, just like that induced in the
secondary coil. Eddy currents waste power by needlessly heating up the core but they are reduced to a
negligible amount by laminating the iron because this increases the electrical resistance of the core
without affecting its magnetic properties.
Transformers have two great advantages over other methods of changing voltage:
1. They provide total electrical isolation between the input and output, so they can be safely used to
reduce the high voltage of the mains supply.
2. Almost no power is wasted in a transformer. They have a high efficiency (power out / power in)
of 95% or more.
Classification of Transformer:
Step-Up Transformer
Step-Down Transformer
Step-Down Transformer:
Step-down transformers are designed to reduce electrical voltage. Their primary voltage is greater than
their secondary voltage. This kind of transformer "steps down" the voltage applied to it. For instance, a
step-down transformer is needed to use a 110v product in a country with a 220v supply.
Step down transformers convert electrical voltage from one level or phase configuration usually down to
a lower level. They can include features for electrical isolation, power distribution, and control and
instrumentation applications. Step down transformers typically rely on the principle of magnetic
induction between coils to convert voltage and/or current levels.
Step down transformers are made from two or more coils of insulated wire wound around a core made
of iron. When voltage is applied to one coil (frequently called the primary or input) it magnetizes the
iron core, which induces a voltage in the other coil, (frequently called the secondary or output). The
turn’s ratio of the two sets of windings determines the amount of voltage transformation.
An example of this would be: 100 turns on the primary and 50 turns on the secondary, a ratio of 2 to 1.
Step down transformers can be considered nothing more than a voltage ratio device.
With step down transformers the voltage ratio between primary and secondary will mirror the "turn’s
ratio" (except for single phase smaller than 1 kva which have compensated secondary). A practical
application of this 2 to 1 turn’s ratio would be a 480 to 240 voltage step down. Note that if the input
were 440 volts, then the output would be 220 volts. The ratio between input and output voltage will stay
constant. Transformers should not be operated at voltages higher than the nameplate rating, but may be
operated at lower voltages than rated. Because of this it is possible to do some non-standard applications
using standard transformers.
Single-phase step-down transformers 1 kva and larger may also be reverse connected to step-down or
step-up voltages. (Note: single phase step up or step-down transformers sized less than 1 KVA should
not be reverse connected because the secondary windings have additional turns to overcome a voltage
drop when the load is applied. If reverse connected, the output voltage will be less than desired.)
Step-Up Transformer:
A step-up transformer has more turns of wire on the secondary coil, which makes a larger induced
voltage in the secondary coil. It is called a step-up transformer because the voltage output is larger than
the voltage input.
Step-up transformer 110v 220v design is one whose secondary voltage is greater than its primary
voltage. This kind of transformer "steps up" the voltage applied to it. For instance, a step-up transformer
is needed to use a 220v product in a country with a 110v supply.
A step-up transformer 110v 220v converts alternating current (AC) from one voltage to another voltage.
It has no moving parts and works on a magnetic induction principle; it can be designed to "step-up" or
"step-down" voltage. So, a step-up transformer increases the voltage and a step down transformer
decreases the voltage.
The primary components for voltage transformation are the step-up transformer core and coil. The
insulation is placed between the turns of wire to prevent shorting to one another or to ground. This is
typically comprised of Mylar, Nomex, Kraft paper, varnish, or other materials. As a transformer has no
moving parts, it will typically have a life expectancy between 20 and 25 years.
Figure: Step-Up Transformer
Applications
The ratio of the number of turns on the primary and secondary coils determines the ratio of the
voltages...
...where Vp is the primary (input) voltage, Vs is the secondary (output) voltage, Np is the number of turns
on the primary coil, and Ns is the number of turns on the secondary coil.
Diodes:
Diodes allow electricity to flow in only one direction. The arrow of the circuit symbol shows the
direction in which the current can flow. Diodes are the electrical version of a valve and early diodes
were actually called valves.
Figure: Diode Symbol
A diode is a device which only allows current to flow through it in one direction. In this direction, the
diode is said to be 'forward-biased' and the only effect on the signal is that there will be a voltage loss of
around 0.7V. In the opposite direction, the diode is said to be 'reverse-biased' and no current will flow
through it.
Rectifier
The purpose of a rectifier is to convert an AC waveform into a DC waveform (OR) Rectifier converts
AC current or voltages into DC current or voltage. There are two different rectification circuits, known
as 'half-wave' and 'full-wave' rectifiers. Both use components called diodes to convert AC into DC.
The half-wave rectifier is the simplest type of rectifier since it only uses one diode, as shown in figure.
Figure 2 shows the AC input waveform to this circuit and the resulting output. As you can see, when
the AC input is positive, the diode is forward-biased and lets the current through. When the AC input is
negative, the diode is reverse-biased and the diode does not let any current through, meaning the output
is 0V. Because there is a 0.7V voltage loss across the diode, the peak output voltage will be 0.7V less
than Vs.
While the output of the half-wave rectifier is DC (it is all positive), it would not be suitable as a power
supply for a circuit. Firstly, the output voltage continually varies between 0V and Vs-0.7V, and
secondly, for half the time there is no output at all.
The circuit in figure 3 addresses the second of these problems since at no time is the output voltage 0V.
This time four diodes are arranged so that both the positive and negative parts of the AC waveform are
converted to DC. The resulting waveform is shown in figure 4.
Figure: Full-Wave Rectifier
When the AC input is positive, diodes A and B are forward-biased, while diodes C and D are reverse-
biased. When the AC input is negative, the opposite is true - diodes C and D are forward-biased, while
diodes A and B are reverse-biased.
While the full-wave rectifier is an improvement on the half-wave rectifier, its output still isn't suitable as
a power supply for most circuits since the output voltage still varies between 0V and Vs-1.4V. So, if
you put 12V AC in, you will 10.6V DC out.
Capacitor Filter
The capacitor-input filter, also called "Pi" filter due to its shape that looks like the Greek letter pi, is a
type of electronic filter. Filter circuits are used to remove unwanted or undesired frequencies from a
signal.
Figure: Capacitor Filter
A typical capacitor input filter consists of a filter capacitor C1, connected across the rectifier output, an
inductor L, in series and another filter capacitor connected across the load.
1. The capacitor C1 offers low reactance to the AC component of the rectifier output while it offers
infinite reactance to the DC component. As a result, the capacitor shunts an appreciable amount
of the AC component while the DC component continues its journey to the inductor L
2. The inductor L offers high reactance to the AC component but it offers almost zero reactance to
the DC component. As a result, the DC component flows through the inductor while the AC
component is blocked.
3. The capacitor C2 bypasses the AC component which the inductor had failed to block. As a
result, only the DC component appears across the load RL.
Voltage Regulator:
78xx:’78’ indicate the positive series and ‘xx’indicates the voltage rating. Suppose 7805 produces the
maximum 5V.’05’indicates the regulator output is 5V.
79xx:’78’ indicate the negative series and ‘xx’indicates the voltage rating. Suppose 7905 produces the
maximum -5V.’05’indicates the regulator output is -5V.
Pin3: It is used for output pin. Through this pin we get the output.
Figure: Regulator
2. Pin Definition:
The most basic way to use the ESP8266 module is to use serial commands, as the chip is basically a
Wi-Fi/Serial transceiver. However, this is not convenient. What we recommend is using the very cool
Arduino ESP8266 project, which is a modified version of the Arduino IDE that you need to install on
your computer. This makes it very convenient to use the ESP8266 chip as we will be using the well-
known Arduino IDE. Following the below step to install ESP8266 library to work in Arduino IDE
environment.
3.2 Install the ESP8266 Board Package
Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board
Manager URLs
field in the Arduino v1.6.4+ preferences.
Select ‘115200’ baud upload speed is a good place to start - later on you can try higher speeds but
115200 is a good safe place to start.
Go to your Windows ‘Device Manager’ to find out which Com Port ‘USB-Serial CH340’ is
assigned to. Select the matching COM/serial port for your CH340 USB-Serial interface.
SOFTWARE IMPLEMENTATION
If you want to program your Arduino Uno while offline you need to install the Arduino Desktop
IDE The Uno is programmed using the Arduino Software (IDE), our Integrated Development
Environment common to all our boards. Before you can move on, you must have installed the Arduino
Software (IDE) on your PC, as explained in the home page of our Getting Started. Connect your Uno
board with an A B USB cable; sometimes this cable is called a USB printer cable.
The USB connection with the PC is necessary to program the board and not just to power it up.
The Uno automatically draw power from either the USB or an external power supply. Connect the board
to your computer using the USB cable. The green power LED (labelled PWR) should go on.
If you used the Installer, Windows - from XP up to 10 - will install drivers automatically as soon as you
connect your board. If you downloaded and expanded the Zip package or, for some reason, the board
wasn't properly recognized, please follow the procedure below.
Click on the Start Menu, and open up the Control Panel. While in the Control Panel, navigate to System
and Security. Next, click on System. Once the System window is up, open the Device Manager. Look
under Ports (COM & LPT). You should see an open port named "Arduino UNO (COMxx)". If there is
no COM & LPT section, look under "Other Devices" for "Unknown Device". Right click on the
"Arduino UNO (COmxx)" port and choose the "Update Driver Software" option. Next, choose the
"Browse my computer for Driver software" option. Finally, navigate to and select the driver file
named "arduino.inf", located in the "Drivers" folder of the Arduino Software download (not the "FTDI
USB Drivers" sub-directory). If you are using an old version of the IDE (1.0.3 or older), choose the Uno
driver file named "Arduino UNO.inf" Windows will finish up the driver installation from there. Open
your first sketch and then open the LED blink example sketch: File > Examples >01.Basics > Blink.
You'll need to select the entry in the Tools > Board menu that corresponds to your Arduino board.
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.
Now, simply click the "Upload" button in the environment. 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.
A few seconds after the upload finishes, you should see the pin 13 (L) LED on the board start to blink
(in orange). If it does, congratulations! You've gotten Arduino up-and-running. 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. To do so you use the Arduino
programming language (based on Wiring), and the Arduino Software (IDE), based on Processing. 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.
Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the
text editor and are saved with the file extension. ino. The editor has features for cutting/pasting and for
searching/replacing text. The message area gives feedback while saving and exporting and also displays
errors. The console displays text output by the Arduino Software (IDE), including complete error
messages and other information. The bottom right-hand corner of the window displays the configured
board and serial port. The toolbar buttons allow you to verify and upload programs, create, open, and
save sketches, and open the serial monitor. The software, too, is open-source, and it is growing through
the contributions of users worldwide. Thanks to its simple and accessible user experience, Arduino has
been used in thousands of different projects and applications. The Arduino software is easy-to-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, Net media’s BX-24, Phidgets, MIT's Handy board, 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
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.
4.6 Sketchbook
The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store your programs
(or sketches). The sketches in your sketchbook can be opened from the File > Sketchbook menu or from
the Open button on the toolbar. The first time you run the Arduino software, it will automatically create
a directory for your sketchbook. You can view or change the location of the sketchbook location from
with the Preferences dialog. 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 Key span USB-to-Serial adapter). On Windows, it's probably COM1 or
COM2 (for a serial board) or COM4, COM5, COM7, or higher (for a USB board) - to find out, you look
for USB serial device in the ports section of the Windows Device Manager. On Linux, it should be
/dev/ttyACMx, /dev/ttyUSBx or similar. Once you've selected the correct serial port and board, press the
upload button in the toolbar or select the Upload item from the Sketch menu. Current Arduino boards
will reset automatically and begin the upload. With older boards (pre-Diecimila) that lack auto-reset,
you'll need to press the reset button on the board just before starting the upload. On most boards, you'll
see the RX and TX LEDs blink as the sketch is uploaded. The Arduino Software (IDE) will display a
message when the upload is complete, or show an error. When you upload a sketch, you're using the
Arduino boot loader, 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 boot loader is active for a few
seconds when the board resets; then it starts whichever sketch was most recently uploaded to the
microcontroller. The boot loader will blink the on-board (pin 13) LED when it starts (i.e., when the
board resets).
4.7 Libraries
Libraries provide extra functionality for use in sketches, e.g., working with hardware or manipulating
data. To use a library in a sketch, select it from the Sketch > Import Library menu. This will insert one
or more #include statements at the top of the sketch and compile the library with your sketch. Because
libraries are uploaded to the board with your sketch, they increase the amount of space it takes up. If a
sketch no longer needs a library, simply delete its #include statements from the top of your code. There
is a list of libraries in the reference. Then the Library Manager will open and you will find a list of
libraries that are already installed or ready for installation. In this example we will install the Bridge
library. Scroll the list to find it, click on it, then select the version of the library you want to install.
Sometimes only one version of the library is available. If the version selection menu does not appear,
don't worry: it is normal. Finally click on install and wait for the IDE to install the new library.
Downloading may take time depending on your connection speed. Once it has finished, an Installed tag
should appear next to the Bridge library. You can close the library manager. Arduino libraries are
managed in three different places: inside the IDE installation folder, inside the core folder and in the
libraries folder inside your sketchbook.
Figure 4.5: Manage Libraries
Some libraries are included with the Arduino software. Others can be downloaded from a variety of
sources or through the Library Manager. Starting with version 1.0.5 of the IDE, you do can import a
library from a zip file and use it in an open sketch. See these instructions for installing a third-party
library. To install a new library into your Arduino IDE you can use the Library Manager (available from
IDE version 1.6.2). Open the IDE and click to the "Sketch" menu and then Include Library > Manage
Libraries.
The way libraries are chosen during compilation is designed to allow the update of libraries present in
the distribution. This means that placing a library in the “libraries” folder in your sketchbook overrides
the other libraries versions. This is why we recommend that you only install libraries to the sketchbook
folder so they are not deleted during the Arduino IDE update process.
Support for third-party hardware can be added to the hardware directory of your sketchbook directory.
Platforms installed there may include board definitions (which appear in the board menu), core libraries,
boot loaders, and programmer definitions. To install, create the hardware directory, then unzip the third-
party platform into its own sub-directory. (Don't use "arduino" as the sub-directory name or you'll
override the built-in Arduino platform.) To uninstall, simply delete its directory [31]. For details on
creating packages for third-party hardware, see the Arduino IDE 1.5 3rd party Hardware specification.
Figure 4.8: IDE Preferences
This displays serial sent from the Arduino or Genuino 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 [32], you can use an external terminal
program and connect it to the COM port assigned to your Arduino board.
4.10 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 boot loader
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 boot loader. You can
find a comparison table between the various boards here. Arduino Software (IDE) includes the built in
support for the boards in the following list, all based on the AVR Core. The Boards Manager included in
the standard installation allows to add support for the growing number of new boards based on different
cores like Arduino Due, Arduino Zero, Edison, Galileo and so on. An ATmega168 running at 16 MHz
without auto-reset. Compilation and upload is equivalent to Arduino Diecimila or Duemilanove w/
ATmega168, but the boot loader burned has a slower timeout (and blinks the pin 13 LED three times on
reset); 6 Analog In, 14 Digital I/O and 6 PWM.
The boot loader is a small piece of software that allows your Arduino board to communicate with the
Arduino IDE when you want to upload a sketch. Normally when you want to load a program on a
microcontroller you need an external programmer, like the Arduino ISP. The boot loader eliminates the
needs of an external programmer because, the protocol that allows your computer to program the flash
memory of the AVR is contained inside the boot loader.
All the AVR-based Arduino boards comes with the boot loader pre-installed but sometimes the upload
process or some sketches can corrupt the memory where the boot loader resides causing the failure of
future upload procedures. Burning again the boot loader with the Arduino ISP can restore the boot
loader and bring back your Arduino to upload using the USB port again. You can also use the Arduino
ISP to burn the boot loader in a brand new AT Mega. If you replace the AT Mega microcontroller on
your Arduino you will need to burn the boot loader in order to load sketches in the usual way. You can
simply do it with the Arduino ISP. Burning the boot loader is an easy-to-go feature provided by the
Arduino IDE. To upload the boot loader on your board just connect everything as described before and
click on Burn boot loader in the Tools menu.
4.12 Shield with Older Boards
If you are using the Wi-Fi shield with an Arduino earlier than the Uno rev3, you need to make the
connection below for the board to work. The Wi-Fi board uses the IOREF pin on newer Arduino pin
layouts (Uno rev3, Mega2560 rev3, and later) to sense the reference voltage for the I/O pins of the board
to which it is attached. If you are using the shield with an older board, you need to connect the shield's
IOREF pin to 3.3V. You can do this either with a jumper wire connecting IOREF to 3.3V as shown in
the photo below, or by soldering the IOREF jumper on the bottom of the shield, shown
below. WARNING: If you use the solder jumper, do not connect the shield to a rev3 or later board. To
be safe, remove the IOREF pin on the shield. Otherwise, you will be shorting 3.3V to 5V through the
IOREF pin. To use the shield, mount it on top of an Arduino board (e.g., the Uno). To upload sketches
to the board, connect it to your computer with a USB cable as you normally would. Once the sketch has
been uploaded, you can disconnect the board from your computer and power it with an external power
supply. Connect the shield to your computer or a network hub or router using a standard ethernet cable
(CAT5 or CAT6 with RJ45 connectors). Connecting to a computer may require the use of a cross-over
cable (although many computers, including all recent Macs can do the cross-over internally).
4.13 SD Library
The SD library allows for reading from and writing to SD cards, e.g. on the Arduino Ethernet Shield.
The library supports FAT16 and FAT32 file systems on standard SD cards and SDHC cards. It uses
short 8.3 names for files. The file names passed to the SD library functions can include paths
separated by forward-slashes, /, e.g. "directory/filename.txt". Because the working directory is
always the root of the SD card, a name refers to the same file whether or not it includes a leading
slash (e.g. "/file.txt" is equivalent to "file.txt"). As of version 1.0, the library supports opening
multiple files. The communication between the microcontroller and the SD card uses SPI, which
takes place on digital pins 11, 12, and 13 (on most Arduino boards) or 50, 51, and 52 (Arduino
Mega). Additionally, another pin must be used to select the SD card. This can be the hardware SS pin
- pin 10 (on most Arduino boards) or pin 53 (on the Mega) - or another pin specified in the call to
SD.begin(). Note that even if you don't use the hardware SS pin, it must be left as an output or the
SD library won't work.
Devices are physical objects like a hardware board that can be contained inside a product (e.g.,
MKR Wi-Fi 1010). They’re the hardware that runs the software, reads sensors, controls actuators and
communicates with the Arduino IoT Cloud. Things represent the inherent properties of the object, with
as little reference to the actual hardware used to implement them. Each thing is represented by a
collection of properties (e.g., temperature, light). Properties are the qualities defining the characteristics
of a system. A property can be something like a 'read-only' (RO) setting to indicate the
Arduino IoT Cloud can read the data, but cannot change the value of the property. A property might be
designed as 'read and write' (RW) if the Arduino IoT Cloud can also remotely change the property’s
value and send an event notification to the device. For example, a device might have a sensor which will
provide the room temperature. That would be read-only. It might also include a thermostat to be able
which will change the room’s temperature. The Arduino IoT Cloud becomes aware of events when it
receives application messages that indicate the something has happened. For example, it might be
informed by a face-recognition application that someone is at a door, or it has received a request from
another app that light has to be turned on. Arduino boards usually require you to program them, to enter
some code by way of an Arduino Sketch. The Arduino IoT Cloud will quickly and automatically
generate a Sketch when setting up a new thing: this is one of its convenient features [33].
Arduino IoT Cloud allows other methods o interaction, including HTTP REST API, MQTT, Command-
Line Tools, JavaScript, and WebSocket’s. It’s a very versatile system. To understand better how this
might work, suppose we want to build an IoT greenhouse (i.e., a small enclosure constructed primarily
of glass, used for growing plants). The goal is to control remotely this greenhouse: to be able to turn off
and on the lights, start the irrigation system, read the temperature inside the garden, etc. We’ll use an
Arduino MKR Wi-Fi 1010, attached to a couple of sensors for measuring the temperature, light, etc.
Also attached will be actuators such as an irrigation pump, as well as light and fan switches. The
software (i.e., an Arduino Sketch) that will be uploaded to the MKR board, will automatically control
the properties of the actuators. For instance, it will make changes to activate the ventilation fans when
there is too much humidity or it’s too hot in the greenhouse. The properties will be stored in the Cloud
and may be remotely changed from there.
BUZZER
A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, household
appliances such as a microwave oven, or game shows.
It most commonly consists of a number of switches or sensors connected to a control unit that
determines if and which button was pushed or a preset time has lapsed, and usually illuminates a light
on the appropriate button or control panel, and sounds a warning in the form of a continuous or
intermittent buzzing or beeping sound. Initially this device was based on an electromechanical system
which was identical to an electric bell without the metal gong. Often these units were anchored to a wall
or ceiling and used the ceiling or wall as a sounding board. Another implementation with some AC-
connected devices was to implement a circuit to make the AC current into a noise loud enough to drive a
loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a
ceramic-based piezoelectric sounder like a son alert which makes a high-pitched tone. Usually these
were hooked up to "driver" circuits which varied the pitch of the sound or pulsed the sound on and off.
In game shows it is also known as a "lockout system," because when one person signals ("buzzes in"),
all others are locked out from signaling. Several game shows have large buzzer buttons which are
identified as "plungers". The word "buzzer" comes from the rasping noise that buzzers made when they
were electromechanical devices, operated from stepped-down AC line voltage at 50 or 60 cycles. Other
sounds commonly used to indicate that a button has been pressed are a ring or a beep.
Although four satellites are required for normal operation, fewer apply in special cases. If one variable
is already known, a receiver can determine its position using only three satellites. For example, a ship or
aircraft may have known elevation. Some GPS receivers may use additional clues or assumptions (such
as reusing the last known altitude, dead reckoning, inertial navigation, or including information from the
vehicle computer) to give a less accurate (degraded) position when fewer than four satellites are visible.
To provide an introductory description of how a GPS receiver works, error effects are deferred to a later
section. Using messages received from a minimum of four visible satellites, a GPS receiver is able to
determine the times sent and then the satellite positions corresponding to these times sent. The x, y, and
z components of position, and the time sent, are designated as where the subscript i is the
satellite number and has the value 1, 2, 3, or 4. Knowing the indicated time the message was received ,
the GPS receiver could compute the transit time of the message as , if would be equal to correct
reception time, . A pseudo range, , would be the traveling distance of the message,
assuming it traveled at the speed of light, c.
A satellite's position and pseudo range define a sphere, centered on the satellite, with radius equal to the
pseudo range. The position of the receiver is somewhere on the surface of this sphere. Thus, with four
satellites, the indicated position of the GPS receiver is at or near the intersection of the surfaces of four
spheres. In the ideal case of no errors, the GPS receiver would be at a precise intersection of the four
surfaces. If the surfaces of two spheres intersect at more than one point, they intersect in a circle. The
article trilateration shows this mathematically. A figure, Two Sphere Surfaces Intersecting in a Circle, is
shown below. Two points where the surfaces of the spheres intersect are clearly shown in the figure.
The distance between these two points is the diameter of the circle of intersection. The intersection of a
third spherical surface with the first two will be its intersection with that circle; in most cases of
practical interest, this means they intersect at two points.[39] Another figure, Surface of Sphere
Intersecting a Circle (not a solid disk) at Two Points, illustrates the intersection. The two intersections
are marked with dots. Again, the article trilateration clearly shows this mathematically. For automobiles
and other near-earth vehicles, the correct position of the GPS receiver is the intersection closest to the
Earth's surface.[40] For space vehicles, the intersection farthest from Earth may be the correct one. The
correct position for the GPS receiver is also the intersection closest to the surface of the sphere
corresponding to the fourth satellite.
NMEA input
Some units also support an NMEA input mode. While not too many programs support this mode it
does provide a standardized way to update or add waypoint and route data. Note that there is no
handshaking or commands in NMEA mode so you just send the data in the correct sentence and the unit
will accept the data and add or overwrite the information in memory. If the data is not in the correct
format, it will simply be ignored. A carriage return/line feed sequence is required. If the waypoint name
is the same you will overwrite existing data but no warning will be issued. The sentence construction is
identical to what the unit downloads so you can, for example, capture a WPL sentence from one unit
and then send that same sentence to another unit but be careful if the two units support waypoint names
of different lengths since the receiving unit might truncate the name and overwrite a waypoint
accidently. If you create a sentence from scratch, you should create a correct checksum. Be sure you
know and have set you unit to the correct datum. Many units support the input of WPL sentences and a
few support RTE as well.
On NMEA input the receiver stores information based on interpreting the sentence itself. While some
receivers accept standard NMEA input this can only be used to update a waypoint or similar task and
not to send a command to the unit. Proprietary input sentences could be used to send commands. Since
the Magellan upload and download maintenance protocol is based on NMEA sentences they support a
modified WPL message that adds comments, altitude, and icon data.
Some marine units may accept input for alarms such as deep or shallow water based on the DPT
sentence or MTW to read the water temperature. For example, the Garmin Map76 supports DPT, MTW
(temperature), and VHW (speed) input sentences. Other units may use NMEA input to provide
initialization data via proprietary sentences, or to select which NMEA sentences to output.
The most important NMEA sentences include the GGA which provides the current Fix data, the RMC
which provides the minimum GPS sentences information, and the GSA which provides the Satellite
status data.
Some units do not report negative altitudes at all. This is the only sentence that reports altitude. GSA -
GPS DOP and active satellites. This sentence provides details on the nature of the fix. It includes the
numbers of the satellites being used in the current solution and the DOP. DOP (dilution of precision) is
an indication of the effect of satellite geometry on the accuracy of the fix. It is a unitless number where
smaller is better. For 3D fixes using 4 satellites a 1.0 would be considered to be a perfect number,
however for overdetermined solutions it is possible to see numbers below 1.0. There are differences in
the way the PRNs are presented which can affect the ability of some programs to display this data. For
example, in the example shown below there are 5 satellites in the solution and the null fields are
scattered indicating that the almanac would show satellites in the null positions that are not being used
as part of this solution. Other receivers might output all of the satellites used at the beginning of the
sentence with the null field all stacked up at the end. This difference accounts for some satellite display
programs not always being able to display the satellites being tracked. Some units may show all
satellites that have ephemeris data without regard to their use as part of the solution but this is non-
standard.
GSV - Satellites in View shows data about the satellites that the unit might be able to find based on its
viewing mask and almanac data. It also shows current ability to track this data. Note that one GSV
sentence only can provide data for up to 4 satellites and thus there may need to be 3 sentences for the
full information. It is reasonable for the GSV sentence to contain more satellites than GGA might
indicate since GSV may include satellites that are not used as part of the solution. It is not a requirement
that the GSV sentences all appear in sequence. To avoid overloading the data bandwidth some receivers
may place the various sentences in totally different samples since each sentence identifies which one it
is. The field called SNR (Signal to Noise Ratio) in the NMEA standard is often referred to as signal
strength. SNR is an indirect but more useful value that raw signal strength. It can range from 0 to 99 and
has units of dB according to the NMEA standard, but the various manufacturers send different ranges of
numbers with different starting numbers so the values themselves cannot necessarily be used to evaluate
different units. The range of working values in a given gps will usually show a difference of about 25 to
35 between the lowest and highest values, however 0 is a special case and may be shown on satellites
that are in view but not being tracked.
Vibration Sensor:
If the emitter and detector (aka phototransistor) are not blocked, then the output on pin 2 of the 74LS14
will be high (app. 5 Volts). When they are blocked, then the output will be low (app. 0 Volts). The
74LS14 is a Schmitt triggered hex inverter. A Schmitt trigger is a signal conditioner. It ensures that
above a threshold value, we will always get "clean" HIGH and LOW signals. Not Blocked Case: Pin 2
High Current from Vcc flows through the detector. The current continues to flow through the base of
Q2. Current from Vcc also flows through R2, and Q2's Drain and Emitter to ground.
As a result of this current path, there will be no current flowing through Q1's base. The signal at U1's
pin 1 will be low, and so pin 2 will be high. Blocked Case: Pin 2 Low Current "stops" at the detector.
Q2's base is not turned on. The current is re-routed passing through R2 and into the base of Q1. This
allows current to flow from Q1's detector and exiting out Q1's emitter. Pin 1 is thus high and pin 2 will
be low.
To detect a line to be followed, we are using two or more number of photo-reflectors. Its output current
that proportional to reflection rate of the floor is converted to voltage with a resister and tested it if the
line is detected or not. However, the threshold voltage cannot be fixed to any level because optical
current by ambient light is added to the output current. Most photo-detecting modules are using
moderated light to avoid interference by the ambient light. The detected signal is filtered with a band
pass filter and disused signals are filtered out. Therefore, only the moderated signal from the light
emitter can be detected. Of course, the detector must not be saturated by ambient light; this is effective
when the detector is working in linear region.
The line position is compeered to the center value to be tracked; the position error is processed with
Proportional/Integral/Defense filters to generate steering command. The line following robot tracks the
line in PID control that the most popular algorithm for servo control. The proportional term is the
common process in the servo system. It is only a gain amplifier without time dependent process.
The differential term is applied in order to improve the response to disturbance, and it also compensate
phase lag at the controlled object. The D term will be required in most case to stabilize tracking motion.
The I term that boosts DC gain is applied in order to remove left offset error, however, it often decreases
servo stability due to its phase lag. When any line sensing error has occurred for a time due to getting
out of line or end of line, the motors are stopped and the microcontroller enters sleep state of zero power
consumption.
Figure: Vibration sensor
PROGRAM IMPLEMENTATION
#include <TinyGPS++.h>
#include <ESP8266WiFi.h>
#define vibration D7
#define buzzer D8
BlynkTimer timer;
void setup()
pinMode(LED_BUILTIN,OUTPUT);
digitalWrite(LED_BUILTIN,HIGH);
pinMode(vibration,INPUT);
pinMode(buzzer,OUTPUT);
ss.begin(GPSBaud);
digitalWrite(LED_BUILTIN,LOW);
}
void checkGPS(){
void loop()
int value=digitalRead(vibration);
if (value==0)
digitalWrite(buzzer,HIGH);
else
digitalWrite(buzzer,LOW);
if (gps.encode(ss.read()))
displayInfo();
Blynk.run();
void displayInfo()
{
if (gps.location.isValid() )
Serial.print("LAT: ");
Serial.print("LONG: ");
Serial.println(longitude, 6);
Blynk.virtualWrite(V1, String(latitude));
Blynk.virtualWrite(V2, String(longitude));
Blynk.virtualWrite(V3, spd);
Blynk.virtualWrite(V4, sats);
Blynk.virtualWrite(V5, bearing);
Serial.println();
CONCLUSION
The complete module is successfully detecting accidents using sensor, this module is connected to GPS
to send the notification. This module is successfully transmitting the location coordinates of accident
spots to mobile via the BLYNK App. As of now there is no technology to detect accidents.