0% found this document useful (0 votes)
14 views

Accidenct Detection&Rescue System

This document is a project report submitted to Jawaharlal Nehru Technological University for a Master of Technology degree. It proposes a smart accident detection and rescue system that uses an IR sensor to detect vehicle vibrations during an accident. When an accident occurs, it sends information to a rescue team using IoT technology and locates the position using GPS receiver modems with latitude and longitude coordinates. A Blynk mobile application is used to receive notification alerts and the accident location. The system aims to facilitate emergency response for road accidents.

Uploaded by

Divya Valmika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Accidenct Detection&Rescue System

This document is a project report submitted to Jawaharlal Nehru Technological University for a Master of Technology degree. It proposes a smart accident detection and rescue system that uses an IR sensor to detect vehicle vibrations during an accident. When an accident occurs, it sends information to a rescue team using IoT technology and locates the position using GPS receiver modems with latitude and longitude coordinates. A Blynk mobile application is used to receive notification alerts and the accident location. The system aims to facilitate emergency response for road accidents.

Uploaded by

Divya Valmika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 59

A PROJECT REPORT ON

SMART ACCIDENT DETECTION AND RESCUE


SYSTEM
Submitted to
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, KAKINADA

For Partial Fulfilment of Award of the Degree of

MASTER OF TECHNOLOGY

Submitted By
CH. DIVYA VALMIKA (22X41D5804)

Under the esteemed guidance of


Dr . N. NEELIMA PRIYANKA
Associate Professor, Department of CSE

DEPARTMENT OF CSE

S.R.K INSTITUTE OF TECHNOLOGY

(AFFILIATED TO JNTU, KAKINADA)


Enikepadu, Vijayawada – 521108.
July 2023
S.R.K INSTITUTE OF TECHNOLOGY
ENIKEPADU, VIJAYAWADA.

DEPARTMENT OF CSE

CERTIFICATE

This is to certify that this project report entitled “SMART ACCIDENT


DETECTION AND RESCUE SYSTEM” is the bonafide work of Ms. CH.
DIVYA VALMIKA (22X41D5804), in partial fulfillment of the requirements for
the award of the post graduate degree in MASTER OF TECHNOLOGY during the
academic year 2020-2021. This Work has carried out under our supervision and
guidance.

(Dr. N. Neelima Priyanka) (Dr. B. ASHA LATHA)

Signature of the Guide Signature of the HOD

Signature of the External Examiner


DECLARATION

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.

Roll No Name of the Student Signature

22X41D5804 CH. DIVYA VALMIKA

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.

Keywords: Vibration Sensor, IOT (internet of things),emergency, GPS ,Microcontroller.

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

An embedded system is a system which is going to do a predefined specified task is the


embedded system and is even defined as combination of both software and hardware. A general-purpose
definition of embedded systems is that they are devices used to control, monitor or assist the operation
of equipment, machinery or plant. "Embedded" reflects the fact that they are an integral part of the
system. At the other extreme a general-purpose computer may be used to control the operation of a large
complex processing plant, and its presence will be obvious.

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.

As the embedded system is the combination of both software and hardware

Embedded
System

Software Hardware

ALP Processor
C Peripherals
VB memory
Etc.,

Figure: Block diagram of Embedded System

Software deals with the languages like ALP, C, and VB etc., and Hardware deals with Processors,
Peripherals, and Memory.

Memory: It is used to store data or address.


Peripherals: These are the external devices connected
Processor: It is an IC which is used to perform some task
Applications of embedded systems
 Manufacturing and process control

 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

Processors are classified into four types like:


 Micro Processor (µp)
 Micro controller (µc)
 Digital Signal Processor (DSP)
 Application Specific Integrated Circuits (ASIC)
Micro Processor (µp):
A silicon chip that contains a CPU. In the world of personal computers, the terms microprocessor and
CPU are used interchangeably. At the heart of all personal computers and most workstations sits a
microprocessor. Microprocessors also control the logic of almost all digital devices, from clock radios to
fuel-injection systems for automobiles.

Three basic characteristics differentiate microprocessors:

 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).

Three Basic Elements of a Microprocessor

Micro Controller (µc):


A microcontroller is a small computer on a single integrated circuit containing a processor core,
memory, and programmable input/output peripherals. Program memory in the form of NOR flash or
OTP ROM is also often included on chip, as well as a typically small amount of RAM.
Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in
personal computers or other general purpose applications.
ALU

CU

Timer, Counter, serial


Memory
communication ROM,
ADC, DAC, Timers,
USART, Oscillators
Etc.,

Figure: Block Diagram of Micro Controller (µc)


Digital Signal Processors (DSPs):
Digital Signal Processors is one which performs scientific and mathematical operation. Digital Signal
Processor chips - specialized microprocessors with architectures designed specifically for the types of
operations required in digital signal processing. Like a general-purpose microprocessor, a DSP is a
programmable device, with its own native instruction code. DSP chips are capable of carrying out
millions of floating point operations per second, and like their better-known general-purpose cousins,
faster and more powerful versions are continually being introduced. DSPs can also be embedded within
complex "system-on-chip" devices, often containing both analog and digital circuitry.
Application Specific Integrated Circuit (ASIC)
ASIC is a combination of digital and analog circuits packed into an IC to achieve the desired
control/computation function

ASIC typically contains

 CPU cores for computation and control


 Peripherals to control timing critical functions
 Memories to store data and program
 Analog circuits to provide clocks and interface to the real world which is analog in nature
 I/O’s to connect to external components like LEDs, memories, monitors etc.
Computer Instruction Set

There are two different types of computer instruction set there are:

1. RISC (Reduced Instruction Set Computer) and


2. CISC (Complex Instruction Set computer)

Reduced Instruction Set Computer (RISC)

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.

The advantages of CISC


At the time of their initial development, CISC machines used available technologies to optimize
computer performance.
 Microprogramming is as easy as assembly language to implement, and much less expensive than
hardwiring a control unit.
 The ease of micro-coding new instructions allowed designers to make CISC machines upwardly
compatible: a new computer could run the same programs as earlier computers because the new
computer would contain a superset of the instructions of the earlier computers.
 As each instruction became more capable, fewer instructions could be used to implement a given
task. This made more efficient use of the relatively slow main memory.
 Because micro program instruction sets can be written to match the constructs of high-level
languages, the compiler does not have to be as complicated.
The disadvantages of CISC
Still, designers soon realized that the CISC philosophy had its own problems, including:

 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

Modern uses of the Harvard architecture:


The principal advantage of the pure Harvard architecture - simultaneous access to more than one
memory system - has been reduced by modified Harvard processors using modern CPU cache systems.
Relatively pure Harvard architecture machines are used mostly in applications where tradeoffs, such as
the cost and power savings from omitting caches, outweigh the programming penalties from having
distinct code and data address spaces.
 Digital signal processors (DSPs) generally execute small, highly-optimized audio or video
processing algorithms. They avoid caches because their behavior must be extremely reproducible. The
difficulties of coping with multiple address spaces are of secondary concern to speed of execution.
 As a result, some DSPs have multiple data memories in distinct address spaces to facilitate
SIMD and VLIW processing. Texas Instruments TMS320 C55x processors, as one example, have
multiple parallel data busses (two write, three read) and one instruction bus.
 Microcontrollers are characterized by having small amounts of program (flash memory) and data
(SRAM) memory, with no cache, and take advantage of the Harvard architecture to speed processing by
concurrent instruction and data access.
 The separate storage means the program and data memories can have different bit depths, for
example using 16-bit wide instructions and 8-bit wide data. They also mean that instruction pre-fetch
can be performed in parallel with other activities. Examples include, the AVR by Atmel Corp, the PIC
by Microchip Technology, Inc. and the ARM Cortex-M3 processor (not all ARM chips have Harvard
architecture).
Even in these cases, it is common to have special instructions to access program memory as data for
read-only tables, or for reprogramming.
Von-Neumann Architecture
A computer has a single, common memory space in which both program instructions and data are
stored. There is a single internal data bus that fetches both instructions and data. They cannot be
performed at the same time

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.

Figure: Schematic of the Von-Neumann Architecture.

Basic Difference between Harvard and Von-Neumann Architecture

 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

Internet of Things (IOT)


 The Internet of Things (IOT) refers to the use of intelligently connected devices and systems to
leverage data gathered by embedded sensors and actuators in machines and other physical
objects. IOT is expected to spread rapidly over the coming years and this convergence will
unleash a new dimension of services that improve the quality of life of consumers and
productivity of enterprises, unlocking an opportunity that the GSMA refers to as the ‘Connected
Life’. For consumers, the IoT has the potential to deliver solutions that dramatically improve
energy efficiency, security, health, education and many other aspects of daily life.
 For enterprises, IOT can underpin solutions that improve decision-making and productivity in
manufacturing, retail, agriculture and other sectors. Machine to Machine (M2M) solutions - a
subset of the IOT – already use wireless networks to connect devices to each other and the
Internet, with minimal direct human intervention, to deliver services that meet the needs of a
wide range of industries. In 2013, M2M connections accounted for 2.8% of global mobile
connections (195 million), indicating that the sector is still at a relatively early stage in its
development. An evolution of M2M, the IOT represents the coordination of multiple vendors’
machines, devices and appliances connected to the Internet through multiple networks.

Understanding the Internet of Things

 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

Internet of Things industry sector categories


 For consumers, connectivity provided by the IoT could enhance their quality of life in multiple
ways, such as, but not limited to, energy efficiency and security at home and in the city.
 In the home, the integration of connected smart devices and cloud-based services will help
address the pressing issue of energy efficiency and security.
 Connected smart devices will enable a reduction in utility bills and outages, while also
improving home security via remote monitoring.

IOT smart cities 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.

IOT education applications

 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.

IOT productivity applications

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.

Figure: Transformer Symbol

(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.

Figure: Basic Principle


Transformer Working:

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.

Figure: Basic Transformer

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.

Figure: Step-Down Transformer

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

Generally, these Step-Up Transformers are used in industries applications only.

Turns Ratio and Voltage

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

The half-wave rectifier is the simplest type of rectifier since it only uses one diode, as shown in figure.

Figure: Half Wave Rectifier

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.

Figure: Half-Wave Rectification

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 Full-wave Rectifier

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

Figure: Full-Wave Rectification

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.

Figure: Centered Tapped Full-Wave Rectifier with a Capacitor Filter

Voltage Regulator:

A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage


level. It may use an electromechanical mechanism, or passive or active electronic components.
Depending on the design, it may be used to regulate one or more AC or DC voltages. There are two
types of regulator are they.

 Positive Voltage Series (78xx) and


 Negative Voltage Series (79xx)

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.

These regulators consists the three pins there are

Pin1: It is used for input pin.

Pin2: This is ground pin for regulator

Pin3: It is used for output pin. Through this pin we get the output.

Figure: Regulator

ESP8266 Node MCU


The ESP8266 is the name of a micro controller designed by Espressif Systems. The ESP8266
itself is a self-contained Wi-Fi networking solution offering as a bridge from existing micro
controller to Wi-Fi and is also capable of running self-contained applications.
This module comes with a built in USB connector and a rich assortment of pin-outs. With a micro-
USB cable, you can connect Node MCU devkit to your laptop and flash it without any Specification:
• Voltage:3.3V.
• Wi-Fi Direct (P2P), soft-AP.
• Current consumption: 10uA~170mA.
• Flash memory attachable: 16M B max (512K normal).
• Integrated TCP/IP protocol stack.
• Processor: Tensilica L106 32-bit.
• Processor speed: 80~160MHz.
• RAM: 32K + 80K.
• GPIOs: 17 (multiplexed with other functions).
• Analog to Digital: 1 input with 1024 step resolution.
• +19.5dBm output power in 802.11b mode
• 802.11 support: b/g/n.
• Maximum concurrent TCP connections: 5.

2. Pin Definition:

3. Using Arduino IDE

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

4.1 Arduino Uno on the Arduino Desktop IDE

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.

4.2 Install the board drivers

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.

Figure 4.1: Select the board driver

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.

4.3 Select your board type and port

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.

Figure 4.2: Select the type of board


Figure 4.3: Select the COM port

4.4 Upload the program

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.

Figure 4.4: Sketch the program

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.

4.5 Writing Sketches

Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the
text editor and are saved with the file extension. ino. The editor has features for cutting/pasting and for
searching/replacing text. The message area gives feedback while saving and exporting and also displays
errors. The console displays text output by the Arduino Software (IDE), including complete error
messages and other information. The bottom 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.

Figure 4.6: Library Manager


The same happens for the libraries present in additional cores installations. It is also important to note
that the version of the library you put in your sketchbook may be lower than the one in the distribution
or core folders, nevertheless it will be the one used during compilation. When you select a specific core
for your board, the libraries present in the core’s folder are used instead of the same libraries present in
the IDE distribution folder.
Last, but not least important is the way the Arduino Software (IDE) upgrades itself: all the files in
Programs/Arduino (or the folder where you installed the IDE) are deleted and a new folder is created
with fresh content.

Figure 4.7: Add library files

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.

4.8 Third-Party Hardware

Support for third-party hardware can be added to the hardware directory of your sketchbook directory.
Platforms installed there may include board definitions (which appear in the board menu), core libraries,
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

4.9 Serial Monitor

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.

4.11 Burning the boot loader

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.

Figure 4.9: Burn 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.

4.14 Arduino IoT Cloud

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.

Basic concept of GPS


A GPS receiver calculates its position by precisely timing the signals sent by GPS satellites high above
the Earth. Each satellite continually transmits messages that include the time the message was
transmitted precise orbital information (the ephemeris) the general system health and rough orbits of all
GPS satellites (the almanac). The receiver uses the messages it receives to determine the transit time of
each message and computes the distance to each satellite. These distances along with the satellites'
locations are used with the possible aid of trilateration, depending on which algorithm is used, to
compute the position of the receiver. This position is then displayed, perhaps with a moving map display
or latitude and longitude; elevation information may be included. Many GPS units show derived
information such as direction and speed, calculated from position changes. Three satellites might seem
enough to solve for position since space has three dimensions and a position near the Earth's surface can
be assumed. However, even a very small clock error multiplied by the very large speed of light[35] —
the speed at which satellite signals propagate — results in a large positional error. Therefore, receivers
use four or more satellites to solve for the receiver's location and time. The very accurately computed
time is effectively hidden by most GPS applications, which use only the location. A few specialized
GPS applications do however use the time; these include time transfer, traffic signal timing, and
synchronization of cell phone base stations.

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.

Position calculation introduction

Two sphere surfaces intersecting in a circle

Surface of sphere intersecting a circle (not a solid disk) at two points

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.

GPS COMMANDS LIST

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>

#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>

#define vibration D7

#define buzzer D8

static const int RXPin = 4, TXPin = 5;

TinyGPSPlus gps; // The TinyGPS++ object

WidgetMap myMap(V0); // V0 for virtual pin of Map Widget

SoftwareSerial ss(RXPin, TXPin); // The serial connection to the GPS device

BlynkTimer timer;

float spd; //Variable to store the speed

float sats; //Variable to store no. of satellites response

String bearing; //Variable to store orientation or direction of GPS

char auth[] = "6vPKJbCuGgCa7UYBijvUBhecXXLbLzL";

char ssid[] = "project";

char pass[] = "0123456789";

unsigned int move_index = 1;

void setup()

pinMode(LED_BUILTIN,OUTPUT);

digitalWrite(LED_BUILTIN,HIGH);

pinMode(vibration,INPUT);

pinMode(buzzer,OUTPUT);

ss.begin(GPSBaud);

Blynk.begin(auth, ssid, pass);

digitalWrite(LED_BUILTIN,LOW);

}
void checkGPS(){

if (gps.charsProcessed() < 10)

Serial.println(F("No GPS detected: check wiring."));

Blynk.virtualWrite(V4, "GPS ERROR"); // Value Display widget on V4 if GPS not detected

void loop()

int value=digitalRead(vibration);

if (value==0)

Blynk.notify("Emergency Message: Accident Occured");

digitalWrite(buzzer,HIGH);

else

digitalWrite(buzzer,LOW);

while (ss.available() > 0)

if (gps.encode(ss.read()))

displayInfo();

Blynk.run();

void displayInfo()
{

if (gps.location.isValid() )

float latitude = (gps.location.lat()); //Storing the Lat. and Lon.

float longitude = (gps.location.lng());

Serial.print("LAT: ");

Serial.println(latitude, 6); // float to x decimal places

Serial.print("LONG: ");

Serial.println(longitude, 6);

Blynk.virtualWrite(V1, String(latitude));

Blynk.virtualWrite(V2, String(longitude));

myMap.location(move_index, latitude, longitude, "GPS_Location");

spd = gps.speed.kmph(); //get speed

Blynk.virtualWrite(V3, spd);

sats = gps.satellites.value(); //get number of satellites

Blynk.virtualWrite(V4, sats);

bearing = TinyGPSPlus::cardinal(gps.course.value()); // get the direction

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.

You might also like