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

Report

Uploaded by

vimal10505
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Report

Uploaded by

vimal10505
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 92

ABSTRACT:

Recently vehicle tracking system is getting vast popularity because of the


rising number of the stolen vehicles. Vehicle theft is happening on parking and
sometimes driving in unsecured places. This research work explores how to avoid
this kind of stealing and provides more security to the vehicles. In our proposd
system we are using two concepts. First concept is, using mode of switch. If the
switch is OFF condition means, In this proposed security to detect the face of the
driver using AI and compare it with the previously saved face. When no one in the
car and the car was parked anywhere then someone can theft the car. In this proposed
system a small webcam will be hidden in the steering and when a person sits in the
driver seat the webcam take the picture of the face of the person. Then it compares
the face with the previously saved face if it matched then the person can access the
steering wheel of the car. If the face of the person doesn’t match with the previously
saved images then the steering wheel of the car will be locked automatically. Then
the vehicle location is sent to the IoT using GPS module and alert the near by people
using buzzer and police or the owner of the car can trace the car with the help of GPS
system and alert the near by people using buzzer. Then mode switch is ON state
means, we used speech recognition for the safety purpose of the car by using a
password using audio module,which also helps to unlock the car. Second concept of
this project vehicle accident alert. If the vibration sensor is detected means, vehicle
will be stoped and update to IoT through the cloud. In case driver press the button
within 10 secs, vehicle doesn’t stop.

1
CHAPTER - 1

INTRODUCTION:

Then the vehicle location is sent to the IoT using GPS module and alert the near
by people using buzzer and police or the owner of the car can trace the car with the
help of GPS system and alert the near by people using buzzer. Then mode switch is
ON state means, we used speech recognition for the safety purpose of the car by
using a password using audio module,which also helps to unlock the car. Second
concept of this project vehicle accident alert. If the vibration sensor is detected means,
vehicle will be stoped and update to IoT through the cloud. In case driver press the
button within 10 secs, vehicle doesn’t stop. By taking the help of triangulation or
trilateration methods the tracking system enables to measures easy and accurate
location of the vehicle. Vehicle information like details of location etc. can be
displayed on a digital mapping with the help of software via the Internet. It stores
data and downloaded to a computer from the GPS unit at a base station and that can
later be used for analysis. This system is important for tracking vehicle at a given
period and now it is becoming increasingly popular for people having expensive cars
and hence as a theft prevention and retrieval device.

Internet Of Things:

Internet of Things (IOT) is the smart technology which helps devices to stay
connected in the current generation. All devices can be coupled jointly and used to
exchange data with remote login users to make life simpler Security plays an salient
role in today’s emerging technology. The Internet of things(IoT) is a propelled
computerization and examination framework (networks) which abuses organizing,
detecting, enormous information, and manmade brain power innovation to convey

2
finish frameworks for an item or administration. These frameworks (networks)
permit more noteworthy straight forwardness, control and execution when connected
to any industry or framework(network). Internet of Things(IoT) networks have
applications crosswise over ventures through their one of a kind adaptability and
capable to be reasonable in any situation. They upgrade information devices and
capable empowering innovation. The Internet of Things speaks to a dream in which
the internet claims out into the genuine world grasping ordinary articles. Physical
things are no longer separated from the virtual world, yet can be controlled remotely
and can go about as physical get to focuses to internet administrations. An IoT makes
registering really omnipresent. An idea first set for IoT forward by MarkWeiser in
the mid years of1990s. The IoT vision is grounded in the conviction that the
relentless advances in Microelectronics, interchanges and data innovation we have
seen in late years will proceed in to the distant.

3
CHAPTER - 2

LITERATURE SURVEY

1) Vivek Kinage; Piyush Patilet all proposed “IoT Based Intelligent System For

Vehicle Accident Prevention And Detection At Real Time” IEEE 2019.

With an increasing number of vehicles, the number of accidents is also


increasing at an unprecedented rate. Each year, among the total number of deaths
1.24 million deaths occurred due to the vehicle accident. In India, the root causes of
these accidents are due to the drunken driver, drowsiness, and badly designed speed
breakers. There is no effective mechanism to prevent these root causes. Our proposed
system provides an efficient, cost-effective and real-time solution to prevent vehicle
accident. When reading goes beyond predefined threshold values, an alert gets
generated and if a driver does not take some action in specified time then our
proposed system will handle the situation by cutting the fuel supply. Our proposed
system uses a microcontroller named Arduino along with MQ-3 sensor, infrared
sensor, accelerometer, and webcam. Arduino is used to regulate all these sensors.

2) M Navin Kumar; S Pravin Kumar; R Premkumar; L Navaneethakrishnan

At all proposed “Smart Characterization of Vehicle Impact and Accident

Reporting System” IEEE 2021.

As the usage of motor vehicles is increasing continuously, numerous deaths


are caused due to road accidents worldwide. An accident that occurs at a location
where no one is around to help will lead the victims to death and the most accidents
are fatal as a result of delayed medical care. An accident may involve multiple

4
victims and it is important to provide the appropriate number of ambulances to save
all the victims. The primary aim of our project is to overcome these problems and
provide an optimal solution. Our system uses four vibration sensors and a
microcontroller to detect the impact and identify if it is an accident or a minor
collision. When an accident occurs, this system determines whether the accident is a
rear-end collision, head-on collision, rollover, t-bone impact or sandwich accident.
Depending on the type of accident, the number of ambulances required is decided.
Then the accident location is acquired using GPS module and SMS warning is sent to
the hospital using GSM modem. The SMS is composed of the location, type of
accident and required number of ambulances. Our system facilitates urgent
emergency assistance to all accident victims in time.

3) Wan-Jung Chang; Liang-Bi Chen; Ke-Yu Su at all proposed “DeepCrash: A


Deep Learning-Based Internet of Vehicles System for Head-On and Single-
Vehicle Accident Detection With Emergency Notification” IEEE 2019.
Most individuals involved in traffic accidents receive assistance from drivers,
passengers, or other people. However, when a traffic accident occurs in a sparsely
populated area or the driver is the only person in the vehicle and the crash results in
loss of consciousness, no one will be available to send a distress message to the
proper authorities within the golden window for medical treatment. Considering
these issues, a method for detecting high-speed head-on and single-vehicle collisions,
analyzing the situation, and raising an alarm is needed. To address such issues, this
paper proposes a deep learning-based Internet of Vehicles (IoV) system called
DeepCrash, which includes an in-vehicle infotainment (IVI) telematics platform with
a vehicle self-collision detection sensor and a front camera, a cloud-based deep
learning server, and a cloud-based management platform. When a head-on or single-
vehicle collision is detected, accident detection information is uploaded to the cloud-
based database server for self-collision vehicle accident recognition, and a related

5
emergency notification is provided. The experimental results show that the accuracy
of traffic collision detection can reach 96% and that the average response time for
emergency-related announcements is approximately 7 s.

4) Daxin Tian; Chuang Zhang; Xuting Duan; Xixian Wang at all proposed “An

Automatic Car Accident Detection Method Based on Cooperative Vehicle

Infrastructure Systems” IEEE 2019.

Car accidents cause a large number of deaths and disabilities every day, a
certain proportion of which result from untimely treatment and secondary accidents.
To some extent, automatic car accident detection can shorten response time of rescue
agencies and vehicles around accidents to improve rescue efficiency and traffic
safety level. In this paper, we proposed an automatic car accident detection method
based on Cooperative Vehicle Infrastructure Systems (CVIS) and machine vision.
First of all, a novel image dataset CAD-CVIS is established to improve accuracy of
accident detection based on intelligent roadside devices in CVIS. Especially, CAD-
CVIS is consisted of various kinds of accident types, weather conditions and accident
location, which can improve self-adaptability of accident detection methods among
different traffic situations. Secondly, we develop a deep neural network model
YOLO-CA based on CAD-CVIS and deep learning algorithms to detect accident. In
the model, we utilize Multi-Scale Feature Fusion (MSFF) and loss function with
dynamic weights to enhance performance of detecting small objects. Finally, our
experiment study evaluates performance of YOLO-CA for detecting car accidents,
and the results show that our proposed method can detect car accident in 0.0461
seconds (21.6FPS) with 90.02% average precision (AP). In additionally, we compare
YOLO-CA with other object detection models, and the results demonstrate the
comprehensive performance improvement on the accuracy and real-time over other
models.

6
5) Md Habib Ullah Khan; Md Mamun Howlader at all proposed “Design of An

Intelligent Autonomous Accident Prevention, Detection And Vehicle Monitoring

System” IEEE 2020.

In modern days, vehicles are one of the most indispensable transportation


medium. With the increase of vehicles in the roads, incidents of accidents are also
increasing for various reasons. Although in last few decades, driver assistance and
safety system has been upgraded significantly, still the possibility of accident cannot
be discarded. Real time detection including tracing down of accident spot is vital for
swift rescue operation. Therefore, in this work a low priced Arduino uno and nano
based automatic accident prevention, post accidental rescue and a black-box system
has been developed. This system will allow the drivers to avoid accident. In worst
case scenario, if the accident is inevitable, it will help the rescue team through
providing accurate location of the accident spot.

7
CHAPTER – 3

SYSTEM DESIGN:

EXSITING SYSTEM:

This existing system includes a GPS modem which retrieves the location of a

vehicle in terms of its longitude and latitude. This data is fed to the microcontroller

which is interfaced with a GSM modem. Microcontroller retrieves the location

details from the GPS and sends it to the concerned authority in the form of an SMS

over GSM modem on periodical intervals so set by the user. An LCD display is

interfaced to the microcontroller for crossing the data received before being sent over

GSM

PROPOSED SYSTEM:

Face recognition is critical in security systems. We use this feature to secure user
information in a variety of fields. For vehicle security, we propose using a face
recognition system. This system first stores the vehicle owner's face image and then
trains the system to detect the face, which is done by a face recognition system. Then
we are using mode of switch. If the switch is OFF condition means, detect the face
of the driver using camera and compare it with the previously saved face. Then it
compares the face with the previously saved face if it matched then the person can

8
access the steering wheel of the car. If the face of the person doesn’t match with the
previously saved images then the steering wheel of the car will be locked
automatically. Then the vehicle location is sent to the IoT using GPS module and
alert the near by people using buzzer and police or the owner of the car can trace the
car with the help of GPS system and alert the near by people using buzzer. Then
mode switch is ON state means, we used speech recognition for the safety purpose
of the car by using a password using audio module,which also helps to unlock the car.
Next concept of this project vehicle accident alert. If the vibration sensor is detected
means, vehicle will be stoped and update to IoT through the cloud. In case driver
press the button within 10 secs, vehicle doesn’t stop.

PROPOSED BLOCK DIAGRAM:

9
CHAPTER 4

HARDWARE DESCRIPTION

POWER SUPPLY

Power supply is a reference to a source of electrical power. A device or system

that supplies electrical or other types of energy to an output load or group of loads is

called a power supply unit or PSU. The term is most commonly applied to electrical

energy supplies, less often to mechanical ones, and rarely to others.

Power supplies for electronic devices can be broadly divided into linear and

switching power supplies. The linear supply is a relatively simple design that

becomes increasingly bulky and heavy for high current devices; voltage regulation in

a linear supply can result in low efficiency. A switched-mode supply of the same

rating as a linear supply will be smaller, is usually more efficient, but will be more

complex.

Linear Power supply:

10
An AC powered linear power supply usually uses a transformer to convert the

voltage from the wall outlet (mains) to a different, usually a lower voltage. If it is

used to produce DC, a rectifier is used. A capacitor is used to smooth the pulsating

current from the rectifier. Some small periodic deviations from smooth direct current

will remain, which is known as ripple. These pulsations occur at a frequency related

to the AC power frequency (for example, a multiple of 50 or 60 Hz).

The voltage produced by an unregulated power supply will vary depending on

the load and on variations in the AC supply voltage. For critical electronics

applications a linear regulator will be used to stabilize and adjust the voltage. This

regulator will also greatly reduce the ripple and noise in the output direct current.

Linear regulators often provide current limiting, protecting the power supply and

attached circuit from over current.

Adjustable linear power supplies are common laboratory and service shop test

equipment, allowing the output voltage to be set over a wide range. For example, a

bench power supply used by circuit designers may be adjustable up to 30 volts and

up to 5 amperes output. Some can be driven by an external signal, for example, for

applications requiring a pulsed output.

11
Transformer:

Transformers convert AC electricity from one voltage to another with little

loss of power. Transformers work only with AC and this is one of the reasons why

mains electricity is AC.

Step-up transformers increase voltage, step-down transformers reduce voltage.

Most power supplies use a step-down transformer to reduce the dangerously high

mains voltage (230V in UK) to a safer low voltage.

The input coil is called the primary and the output coil is called the secondary.

There is no electrical connection between the two coils; instead they are linked by an

alternating magnetic field created in the soft-iron core of the transformer. The two

lines in the middle of the circuit symbol represent the core.

Transformers waste very little power so the power out is (almost) equal to the

power in. Note that as voltage is stepped down current is stepped up.

The ratio of the number of turns on each coil, called the turn’s ratio,

determines the ratio of the voltages. A step-down transformer has a large number of

12
turns on its primary (input) coil which is connected to the high voltage mains supply,

and a small number of turns on its secondary (output) coil to give a low output

voltage.

Turns ratio=Vp/Vs=Nn/Ns and Power out=Power in

Vs*Is=Vp * Ip

Vp = primary (input) voltage Vs = secondary (output) voltage

Np = number of turns on primary coil Ns = number of turns on secondary coil

Ip = primary (input) current Is = secondary (output) current

The low voltage AC output is suitable for lamps, heaters and special AC motors. It is

not suitable for electronic circuits unless they include a rectifier and a smoothing

capacitor.

Rectifier:

13
There are several ways of connecting diodes to make a rectifier to convert AC

to DC. The bridge rectifier is the most important and it produces full-wave varying

DC. A full-wave rectifier can also be made from just two diodes if a centre-tap

transformer is used, but this method is rarely used now that diodes are cheaper. A

single diode can be used as a rectifier but it only uses the positive (+) parts of the AC

wave to produce half-wave varying DC.

The varying DC output is suitable for lamps, heaters and standard motors. It is

not suitable for electronic circuits unless they include a smoothing capacitor.

Bridge rectifier:

A bridge rectifier can be made using four individual diodes, but it is also

available in special packages containing the four diodes required. It is called a

14
full-wave rectifier because it uses the entire AC wave (both positive and negative

sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V when

conducting and there are always two diodes conducting, as shown in the diagram

below. Bridge rectifiers are rated by the maximum current they can pass and the

maximum reverse voltage they can withstand (this must be at least three times the

supply RMS voltage so the rectifier can withstand the peak voltages). Please see the

Diodes page for more details, including pictures of ridge rectifiers.

Alternate pairs of diodes conduct, changing over the connections so the

alternating directions of AC are converted to the one direction of DC.

Output: full-wave varying DC: (using the entire AC wave):

15
Single diode rectifier:

A single diode can be used as a rectifier but this produces half-wave varying

DC which has gaps when the AC is negative. It is hard to smooth this sufficiently

well to supply electronic circuits unless they require a very small current so the

smoothing capacitor does not significantly discharge during the gaps. Please see the

Diodes page for some examples of rectifier diodes.

Output: half-wave varying DC (using only half the AC wave):

16
Smoothing:

Smoothing is performed by a large value electrolytic capacitor connected

across the DC supply to act as a reservoir, supplying current to the output when the

varying DC voltage from the rectifier is falling. The diagram shows the unsmoothed

varying DC (dotted line) and the smoothed DC (solid line). The capacitor charges

quickly near the peak of the varying DC, and then discharges as it supplies current to

the output.

Note that smoothing significantly increases the average DC voltage to almost

the peak value (1.4 × RMS value). For example 6V RMS AC is rectified to full wave

DC of about 4.6V RMS (1.4V is lost in the bridge rectifier), with smoothing this

increases to almost the peak value giving 1.4 × 4.6 = 6.4V smooth DC.

Smoothing is not perfect due to the capacitor voltage falling a little as it

discharges, giving a small ripple voltage. For many circuits a ripple which is 10% of

the supply voltage is satisfactory and the equation below gives the required value for

17
the smoothing capacitor. A larger capacitor will give fewer ripples. The capacitor

value must be doubled when smoothing half-wave DC.

Smoothing Capacitor for 10% ripple, C=5*10/vs.*f

C = smoothing capacitance in farads (F)

Io = output current from the supply in amps (A)

Vs = supply voltage in volts (V), this is the peak value of the unsmoothed DC

f = frequency of the AC supply in hertz (Hz), 50Hz in the UK.

The smooth DC output has a small ripple. It is suitable for most electronic circuits.

Regulator:

18
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or

variable output voltages. They are also rated by the maximum current they can pass.

Negative voltage regulators are available, mainly for use in dual supplies.

Most regulators include some automatic protection from excessive current ('overload

protection') and overheating ('thermal protection').

The LM78XX series of three terminal regulators is available with several fixed

output voltages making them useful in a wide range of applications. One of these is

local on card regulation, eliminating the distribution problems associated with single

point regulation. The voltages available allow these regulators to be used in logic

systems, instrumentation, HiFi, and other solid state electronic equipment. Although

designed primarily as fixed voltage regulators these devices can be used with

external components to obtain adjustable voltages and current.

Many of the fixed voltage regulator ICs has 3 leads and look like power

transistors, such as the 7805 +5V 1A regulator shown on the right. They include a

hole for attaching a heat sink if necessary.

1. Positive regulator

1. input pin

2. ground pin

3. output pin

It regulates the positive voltage

19
2. Negative regulator

1. ground pin

2. input pin

3. output pin

It regulate the negative voltage

The regulated DC output is very smooth with no ripple. It is suitable for all electronic

circuits.

Vibrations: Vibration sensors attached to the ATM machine will trigger when

the robber tries to cut the ATM machine using any of cutting tools such as hacksaw

20
or any drilling machine. This generates a lot of vibration, more than the average

activates in the ATM booth.

Vibration Sensor

This sensor buffers a piezoelectric transducer. As the transducer is displaced

from the mechanical neutral axis, bending creates strain within the piezoelectric

element and generates voltages.

A piezoelectric sensor is a device that uses the piezoelectric effect, to measure

changes in pressure, acceleration, temperature, strain, or force by converting them to

an electrical charge. The prefix piezo- is Greek for 'press' or 'squeeze'.

Specifications

The Vibration Sensor Detector is designed for the security practice When

Vibration Sensor Alarm recognizes movement or vibration, it sends a signal to either

control panel Developed a new type of omni-directional high sensitivity Security

Vibration Detector with omni-directional detection

• Sensitivity: Height adjustable

• Consistency and Interchangeability: Good

21
• Reliability and Interference: Accurate triggering strong anti-interference

• Automatic Reset: Automatic reset is strong

• Signal Post-processing: Simple

• Output Signal: Switch signal

• No External Vibration Analysis of Plates: Product design vibration analysis

of the internal amplifier circuit

• Detection Direction: Omni-directional

• Signal Output: Switch signals

• Output Pulse Width: The vibration signal amplitude is proportional to

• Operating Voltage: 12VDC (red V + shield V-)

• Sensitivity: Greater than or equal 0.2g

• Frequency Range: 0.5HZ ~ 20HZ

• Operating Temperature Range: -10 ~ 50

APPLICATIONS

Piezoelectric sensors are versatile tools for the measurement of various

processes. They are used for quality assurance, process control, and for research and

development in many industries. Pierre Curie discovered the piezoelectric effect in

1880, but only in the 1950s did manufacturers begin to use the piezoelectric effect in

industrial sensing applications. Since then, this measuring principle has been

22
increasingly used, and has become a mature technology with excellent inherent

reliability.

They have been successfully used in various applications, such as

in medical, aerospace, nuclear instrumentation, and as a tilt sensor in consumer

electronics or a pressure sensor in the touch pads of mobile phones. In

the automotive industry, piezoelectric elements are used to monitor combustion when

developing internal combustion engines. The sensors are either directly mounted into

additional holes into the cylinder head or the spark/glow plug is equipped with a

built-in miniature piezoelectric sensor.

The rise of piezoelectric technology is directly related to a set of inherent

advantages. The high modulus of elasticity of many piezoelectric materials is

comparable to that of many metals and goes up to 106 N/m². Even though

piezoelectric sensors are electromechanical systems that react to compression, the

sensing elements show almost zero deflection. This gives piezoelectric sensors

ruggedness, an extremely high natural frequency and an excellent linearity over a

wide amplitude range. Additionally, piezoelectric technology is insensitive

to electromagnetic fields and radiation, enabling measurements under harsh

conditions. Some materials used (especially gallium phosphate or tourmaline) are

extremely stable at high temperatures, enabling sensors to have a working range of

up to 1000 °C. Tourmaline shows pyroelectricity in addition to the piezoelectric

23
effect; this is the ability to generate an electrical signal when the temperature of the

crystal changes. This effect is also common to piezoceramic materials. Gautschi

in Piezoelectric Sensorics(2002) offers this comparison table of characteristics of

piezo sensor materials vs other types

IoT MODULE:

Node MCU is an open source IoT platform. Its operating voltage is 5v dc

supply.It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif

Systems, and hardware which is based on the ESP-12 module.The term "Node

MCU" by default refers to the firmware rather than the dev kits. The firmware uses

the Lua scripting language.In our Project IOT is used to monitor ATM robbery using

vibration and accelerometer sensor and updated tocayenne app using ESP module

and cayenne server.Once the predefined threshold level is crossed the

microcontroller is trigger indicating the ATM machine is being tried to shift out of its

place.

We can muscle activity , rotator cuff hand acceleration and tilt angle by using

IOT module from remote places likewise programmed for the NODE MCU which

consists of inbuild wifi Shield, and transmitted to the Cayenne Server which works

on the MQTT protocol.Wi-Fi controller board Node MCU has a 32-bit Tensilica

Xtensa LX106 core clocked at 8 MHz’s It is a self-contained Wi-Fi networking

24
solution that acts as a bridge between existing microcontrollers to Wi-Fi and is

capable of running self-contained applications.

MQTT is a lightweight, publish-subscribe network protocol that transports

messages between devices. The protocol usually runs over TCP/IP, however, any

network protocol that provides ordered, lossless, bi-directional connections can

support MQTT.According to measurements in 3G networks, throughput of MQTT is

93 times faster than HTTP's. Besides, in comparison to HTTP, MQTT Protocol

ensures high delivery guarantees.HTTP is the most popular and widely used protocol.

25
But over the last years MQTT rapidly gain transactions. Developers have to choose

between them when we are talking about IoT development.

An IoT module is an essential component in an IoT-based automatic vehicle

accident detection and rescue system, as it enables the system to collect, transmit,

and receive data over the internet. Here's how an IoT module can be used in the

system:

 Data Collection: The IoT module collects data from various sensors in the

vehicle, such as accelerometers, gyroscopes, and vibration sensors, which detect

the conditions of the vehicle during an accident.

 Data Transmission: The IoT module transmits the data collected by the sensors

to a cloud server over the internet. The data is encrypted to ensure security and

privacy

 Data Processing: The cloud server processes the data transmitted by the IoT

module to determine if an accident has occurred. The server uses algorithms to

analyze the data and compare it to pre-defined threshold values.

 Notification: If the server determines that an accident has occurred, it sends a

notification to the relevant authorities, such as the police, ambulance services,

and fire departments. The notification includes real-time information on the

location of the accident and the condition of the vehicle and its occupants.

26
 Remote Monitoring: The IoT module also enables remote monitoring of the

vehicle, allowing the authorities to monitor the location and condition of the

vehicle and its occupants in real-time.

By using an IoT module, the system can efficiently and securely transmit data over

the internet, enabling prompt and effective rescue operations in the event of an

accident. The IoT module plays a crucial role in ensuring the success of the IoT-

based automatic vehicle accident detection and rescue system.

ESP8266 Pin Configuration

Pin Pin Alternate Normally used for Alternate purpose

Number Name Name

1 Ground - Connected to the -

ground of the circuit

2 TX GPIO – 1 Connected to Rx pin of Can act as a General purpose

programmer/uC to Input/output pin when not used as TX

upload program

3 GPIO-2 - General purpose -

Input/output pin

27
4 CH_EN - Chip Enable – Active -

high

5 GPIO - Flash General purpose Takes module into serial

0 Input/output pin programming when held

low during start up

6 Reset - Resets the module -

7 RX GPIO - 3 General purpose Can act as a General

Input/output pin purpose Input/output pin

when not used as RX

8 Vcc - Connect to +3.3V only

ESP8266-01 Features

• Low cost, compact and powerful Wi-Fi Module

• Power Supply: +3.3V only

• Current Consumption: 100mA

• I/O Voltage: 3.6V (max)

28
• I/O source current: 12mA (max)

• Built-in low power 32-bit MCU @ 80MHz

• 512kB Flash Memory

• Can be used as Station or Access Point or both combined

• Supports Deep sleep (<10uA)

• Supports serial communication hence compatible with many development

platform like Arduino

• Can be programmed using Arduino IDE or AT-commands or Lua Script

ESP8266 Equivalents

ESP-12 (Has more GPIO pins that support ADC, PWM, SPI etc).

GLOBAL POSITIONING SYSTEM (GPS)


The Global Positioning System (GPS) is a space-based global navigation
satellite system that provides reliable location and time information in all weather
and at all times and anywhere on or near the Earth when and where there is an
unobstructed line of sight to four or more GPS satellites. It is maintained by the
United States government and is freely accessible by anyone with a GPS receiver. In
addition to GPS other systems are in use or under development. The Russian GLObal
Navigation Satellite System (GLONASS) is for use by the Russian military. There
are also the planned Chinese Compass navigation system and Galileo positioning
system of the European Union (EU). GPS was created and realized by the U.S.

29
Department of Defense (DOD) and was originally run with 24 satellites. It was
established in 1973 to overcome the limitations of previous navigation systems.

Structure

GPS consists of three parts: the space segment, the control segment, and the user
segment. The U.S. Air Force develops, maintains, and operates the space and control
segments. GPS satellites broadcast signals from space, which each GPS receiver uses
to calculate its three-dimensional location (latitude, longitude, and altitude) plus the
current time.

The space segment is composed of 24 to 32 satellites in medium Earth orbit and also
includes the payload adapters to the boosters required to launch them into orbit. The
control segment is composed of a master control station, an alternate master control
station, and a host of dedicated and shared ground antennas and monitor stations. The
user segment is composed of hundreds of thousands of U.S. and allied military users
of the secure GPS Precise Positioning Service, and tens of millions of civil,
commercial, and scientific users of the Standard Positioning Service (see GPS
navigation devices).

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

30
The receiver utilizes 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 — 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.

System segmentation

31
The current GPS consists of three major segments. These are the space segment
(SS), a control segment (CS), and a user segment (US).

Space segment

The space segment (SS) is composed of the orbiting GPS satellites, or Space Vehicles
(SV) in GPS parlance. The GPS design originally called for 24 SVs, eight each in three
circular orbital planes, but this was modified to six planes with four satellites each.
The orbital planes are centered on the Earth, not rotating with respect to the
distant stars. The six planes have approximately 55° inclination (tilt relative to
Earth's equator) and are separated by 60° right ascension of the ascending node
(angle along the equator from a reference point to the orbit's intersection).The
orbits are arranged so that at least six satellites are always within line of sight from
almost everywhere on Earth's surface.

Orbiting at an altitude of approximately 20,200 kilometers (about 12,550 miles or


10,900 nautical miles; orbital radius of approximately 26,600 km (about 16,500 mi
or 14,400 NM)), each SV makes two complete orbits each sidereal day, repeating
the same ground track each day.This was very helpful during development, since
even with just four satellites, correct alignment means all four are visible from one
spot for a few hours each day. For military operations, the ground track repeat can
be used to ensure good coverage in combat zones.

32
As of March 2008, there are 31 actively broadcasting satellites in the GPS
constellation, and two older, retired from active service satellites kept in the
constellation as orbital spares. The additional satellites improve the precision of GPS
receiver calculations by providing redundant measurements. With the increased
number of satellites, the constellation was changed to a nonuniform arrangement.
Such an arrangement was shown to improve reliability and availability of the system,
relative to a uniform system, when multiple satellites fail. About eight satellites are
visible from any point on the ground at any one time (see animation at right).

Control segment

The control segment is composed of

1. a master control station (MCS),


2. an alternate master control station,
3. four dedicated ground antennas and
4. six dedicated monitor stations.

The MCS can also access U.S. Air Force Satellite Control Network (AFSCN) ground
antennas (for additional command and control capability) and NGA (National
Geospatial-Intelligence Agency) monitor stations. The flight paths of the satellites
are tracked by dedicated U.S. Air Force monitoring stations in Hawaii, Kwajalein,
Ascension Island, Diego Garcia, Colorado Springs, Colorado and Cape Canaveral,
along with shared NGA monitor stations operated in England, Argentina, Ecuador,
Bahrain, Australia and Washington DC. The tracking information is sent to the Air
Force Space Command's MCS at Schriever Air Force Base 25 km (16 miles) ESE of
Colorado Springs, which is operated by the 2nd Space Operations Squadron (2 SOPS)
of the United States Air Force (USAF). Then 2 SOPS contacts each GPS satellite
regularly with a navigational update using dedicated or shared (AFSCN) ground

33
antennas (GPS dedicated ground antennas are located at Kwajalein, Ascension
Island, Diego Garcia, and Cape Canaveral). These updates synchronize the atomic
clocks on board the satellites to within a few nanoseconds of each other, and adjust
the ephemeris of each satellite's internal orbital model. The updates are created by
a Kalman filter, which uses inputs from the ground monitoring stations, space
weather information, and various other inputs.

Satellite maneuvers are not precise by GPS standards. So to change the orbit of a
satellite, the satellite must be marked unhealthy, so receivers will not use it in their
calculation. Then the maneuver can be carried out, and the resulting orbit tracked
from the ground. Then the new ephemeris is uploaded and the satellite marked
healthy again.

User segment

The user segment is composed of hundreds of thousands of U.S. and allied military
users of the secure GPS Precise Positioning Service, and tens of millions of civil,
commercial and scientific users of the Standard Positioning Service. In general, GPS
receivers are composed of an antenna, tuned to the frequencies transmitted by the
satellites, receiver-processors, and a highly stable clock (often a crystal oscillator).
They may also include a display for providing location and speed information to the
user. A receiver is often described by its number of channels: this signifies how
many satellites it can monitor simultaneously. Originally limited to four or five, this
has progressively increased over the years so that, as of 2007, receivers typically
have between 12 and 20 channels.

GPS receivers may include an input for differential corrections, using the RTCM SC-
104 format. This is typically in the form of an RS-232 port at 4,800 bit/s speed. Data

34
is actually sent at a much lower rate, which limits the accuracy of the signal sent
using RTCM. Receivers with internal DGPS receivers can outperform those using
external RTCM data. As of 2006, even low-cost units commonly include Wide Area
Augmentation System (WAAS) receivers.

Many GPS receivers can relay position data to a PC or other device using the NMEA
0183 protocol, or the newer and less widely used NMEA 2000. Although these
protocols are officially defined by the National Marine Electronics Association
(NMEA),[55] references to these protocols have been compiled from public records,
allowing open source tools like gpsd to read the protocol without violating
intellectual property laws. Other proprietary protocols exist as well, such as the SiRF
and MTK protocols. Receivers can interface with other devices using methods
including a serial connection, USB, or Bluetooth.

Communication

The navigational signals transmitted by GPS satellites encode a variety of


information including satellite positions, the state of the internal clocks, and the
health of the network. These signals are transmitted on two separate carrier
frequencies that are common to all satellites in the network. Two different
encodings are used, a public encoding that enables lower resolution navigation, and
an encrypted encoding used by the U.S. military.

Message format

GPS message format

Subframes Description

35
Satellite clock,
1
GPS time relationship

Ephemeris
2–3
(precise satellite orbit)

Almanac component
4–5 (satellite network synopsys,
error correction)

Each GPS satellite continuously broadcasts a navigation message at a rate of 50 bits


per second. Each complete message is composed of 30-second frames, distinct
groupings of 1,500 bits of information. Each frame is further subdivided into 5 sub
frames of length 6 seconds and with 300 bits each. Each sub frame contains
10 words of 30 bits with length 0.6 seconds each. Each 30 second frame begins
precisely on the minute or half minute as indicated by the atomic clock on each
satellite.

The first part of the message encodes the week number and the time within the
week, as well as the data about the health of the satellite. The second part of the
message, the ephemeris, provides the precise orbit for the satellite. The last part of
the message, the almanac, contains coarse orbit and status information for all
satellites in the network as well as data related to error correction.

All satellites broadcast at the same frequencies. Signals are encoded using code
division multiple access (CDMA) allowing messages from individual satellites to be
distinguished from each other based on unique encodings for each satellite (which
the receiver must be aware of). Two distinct types of CDMA encodings are used: the

36
coarse/acquisition (C/A) code, which is accessible by the general public, and the
precise (P) code, that is encrypted so that only the U.S. military can access it.

The ephemeris is updated every 2 hours and is generally valid for 4 hours, with
provisions for updates every 6 hours or longer in non-nominal conditions. The
almanac is updated typically every 24 hours. Additionally data for a few weeks
following is uploaded in case of transmission updates that delay data upload.

Satellite frequencies

All satellites broadcast at the same two frequencies, 1.57542 GHz (L1 signal) and
1.2276 GHz (L2 signal). The satellite network uses a CDMA spread-spectrum
technique where the low-bitrate message data is encoded with a high-rate pseudo-
random (PRN) sequence that is different for each satellite. The receiver must be
aware of the PRN codes for each satellite to reconstruct the actual message data.
The C/A code, for civilian use, transmits data at 1.023 million chips per second,
whereas the P code, for U.S. military use, transmits at 10.23 million chips per
second. The L1 carrier is modulated by both the C/A and P codes, while the
L2 carrier is only modulated by the P code.[59] The P code can be encrypted as a so-
called P(Y) code which is only available to military equipment with a proper
decryption key. Both the C/A and P(Y) codes impart the precise time-of-day to the
user. GPS Modernization added a third frequency, 1.17645 GHZ (L5 signal). The L5
consists of two carrier components that are in phase quadrature with each other.
Each carrier component is bi-phase shift key (BPSK) modulated by a separate bit
train.

37
Demodulation and decoding

Since all of the satellite signals are modulated onto the same L1 carrier frequency,
there is a need to separate the signals after demodulation. This is done by assigning
each satellite a unique binary sequence known as a Gold code. The signals are
decoded, after demodulation, using addition of the Gold codes corresponding to the
satellites monitored by the receiver.[60][61]

If the almanac information has previously been acquired, the receiver picks which
satellites to listen for by their PRNs, unique numbers in the range 1 through 32. If
the almanac information is not in memory, the receiver enters a search mode until a
lock is obtained on one of the satellites. To obtain a lock, it is necessary that there
be an unobstructed line of sight from the receiver to the satellite. The receiver can
then acquire the almanac and determine the satellites it should listen for. As it
detects each satellite's signal, it identifies it by its distinct C/A code pattern. There
can be a delay of up to 30 seconds before the first estimate of position because of
the need to read the ephemeris data.

Processing of the navigation message enables the determination of the time of


transmission and the satellite position at this time.

Features

• Model: VK16U6
• Based on u-Blox chip: UBX-G6010-ST
• C / A code 1.023MHz code stream
• Receive bands: L1 [1575.42 MHz]
• Tracking channels: 50

38
• Support DGPS [WAAS, EGNOS and MSAS]
• Positioning performance
• 2D plane: 5m [average]
• 2D plane: 3.5m [average], DGPS auxiliary.
• Drift: <0.02m / s
• Timing accuracy: 1us
• Reference coordinate system: WGS-84
• Maximum Altitude: 18,000 m
• Maximum speed: 500 m / s
• Acceleration: <4g
• Electrical properties:
• Tracking Sensitivity:-162dBm
• Acquisition sensitivity:-146dBm
• Cold start time: 32s [average]
• Warm start: 32s [average]
• Hot start time: 1s [average]
• Recapture Time: 0.1s [average]
• Operating temperature:
• -30 Degree to 80 Degree
• Package size:
• 28 * 28 * 8.4mm;
• Line length 2m

Technical Specifications

• Industry-standard 25 * 25 * 4MM high sensitivity GPS antenna


• UART / TTL 3.3V

39
• KDS 0.5ppm high-precision TCXO
• Built-in RTC crystal and picofarads capacitance faster hot start
• Built-in EEPROM, free rich configuration parameters
• 1Hz-5 Hz positioning update rate
• Support AssistNow Online and AssistNow Offline A-GPS services
• GPS, GALILEO, SBAS (WAAS, EGNOS, MSAS, GAGAN) hybrid engine
• Power Supply: 3.3V

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 (which makes the ringing noise).

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

40
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 Sonalert 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 signalling. Several game shows

have large buzzer buttons which are identified as "plungers".

FIG:Buzzer

The word "buzzer" comes from the rasping noise that buzzers made when they

were electro-mechanical 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.

There are many ways to communicate between the user and a product. One of

the best ways is audio communication using a buzzer IC. So during the design

process, understanding some technologies with configurations is very helpful. So,

41
this article discusses an overview of an audio signaling device like a beeper or a

buzzer and its working with applications.

An audio signaling device like a beeper or buzzer may be electromechanical

or piezoelectric or mechanical type. The main function of this is to convert the signal

from audio to sound. Generally, it is powered through DC voltage and used in timers,

alarm devices, printers, alarms, computers, etc. Based on the various designs, it can

generate different sounds like alarm, music, bell & siren.

Buzzer Pin Configuration

The pin configuration of the buzzer is shown below. It includes two pins namely

positive and negative. The positive terminal of this is represented with the ‘+’ symbol

or a longer terminal. This terminal is powered through 6Volts whereas the negative

42
terminal is represented with the ‘-‘symbol or short terminal and it is connected to the

GND terminal.

History

The history of an electromechanical buzzer and piezoelectric is discussed below.

Electromechanical

This buzzer was launched in the year 1831 by an American Scientist namely Joseph

Henry but, this was used in doorbells until they were eliminated in 1930 in support of

musical bells, which had a smooth tone.

Piezoelectric

These buzzers were invented by manufacturers of Japanese & fixed into a broad

range of devices during the period of 1970s – 1980s. So, this development primarily

came due to cooperative efforts through the manufacturing companies of Japanese. In

the year 1951, they recognized the Application Research Committee of Barium

Titanate that allows the corporations to be cooperative competitively & bring about

numerous piezoelectric creations.

Specifications

43
The specifications of the buzzer include the following.

• Color is black

• The frequency range is 3,300Hz

• Operating Temperature ranges from – 20° C to +60°C

• Operating voltage ranges from 3V to 24V DC

• The sound pressure level is 85dBA or 10cm

• The supply current is below 15mA

Types of Buzzer

A buzzer is available in different types which include the following.

• Piezoelectric

• Electromagnetic

• Mechanical

• Electromechanical

• Magnetic

Piezoelectric

As the name suggests, the piezoelectric type uses the piezoelectric ceramic’s

piezoelectric effect & pulse current to make the metal plate vibrate & generate sound.

44
This kind of buzzer is made with a resonance box, multi resonator, piezoelectric plate,

housing, impedance matcher, etc. Some of the buzzers are also designed with LEDs.

The multi resonator of this mainly includes ICs and transistors. Once the supply is

given to this resonator, it will oscillate and generates an audio signal with 1.5 to

2.kHz. The impedance matcher will force the piezoelectric plate to produce sound.

Electromagnetic

This type of buzzer is made with a magnet, solenoid coil, oscillator, housing,

vibration diaphragm, and magnet. Once the power supply is given, the oscillator

which produces the audio signal current will supply throughout the solenoid coil to

generate a magnetic field.

Sometimes, the vibration diaphragm will vibrate & generates sound under the magnet

& solenoid coil interaction. The frequency range of this ranges from 2 kHz to 4kHz.

Mechanical

These types of buzzers are subtypes of electromagnetic, so the components used in

this type are also similar. But the main difference is that the vibrating buzzer is

placed on the outside instead of the inside.

Electromechanical

45
The designing of these types of buzzers can be done with a bare metal disc & an

electromagnet. The working principle of this is similar to magnetic and

electromagnetic. It generates sound throughout the disc movement & magnetism.

Magnetic

Like a piezo type, magnetic is also used to generate a sound but they are different

due to core functionality. The magnetic type is more fixed as compared to the piezo

type because they work through a magnetic field.

Magnetic buzzers utilize an electric charge instead of depending on piezo materials

to generate a magnetic field, after that it permits another element of the buzzer to

vibrate & generate sound.

The applications of magnetic buzzers are similar to the piezo type in household

devices, alarms such as watches, clocks & keyboards.

Working Principle

The working principle of a buzzer depends on the theory that, once the voltage is

given across a piezoelectric material, then a pressure difference is produced. A piezo

type includes piezo crystals among two conductors.

46
Once a potential disparity is given across these crystals, then they thrust

one conductor & drag the additional conductor through their internal property. So

this continuous action will produce a sharp sound signal.

Mounting Configurations

The mounting configurations of buzzers include the following.

• Panel Mount

• Wire Leads

• Screw Terminals

• Through Hole

• Spring Contact

• Surface Mount

How to use a Buzzer?

A buzzer is an efficient component to include the features of sound in our system or

project. It is an extremely small & solid two-pin device thus it can be simply utilized

on breadboard or PCB. So in most applications, this component is widely used.

There are two kinds of buzzers commonly available like simple and readymade.

Once a simple type is power-driven then it will generate a beep sound continuously.

47
A readymade type looks heavier & generates a Beep. Beep. Beep. This sound is

because of the internal oscillating circuit within it.

This buzzer uses a DC power supply that ranges from 4V – 9V. To operate this, a

9V battery is used but it is suggested to utilize a regulated +5V/+6V DC supply.

Generally, it is connected through a switching circuit to switch ON/OFF the buzzer at

the necessary time interval.

Advantages

The advantages of a buzzer include the following.

• Simply Compatible

• Frequency Response is Good

• Size is small

• Energy Consumption is less

• The Range of Voltage usage is Large

• Sound Pressure is high

Disadvantages

The disadvantages of the buzzer include the following.

• Controlling is a little hard

• Generates Annoying Sound

48
• Training is necessary to know how to repair the condition without just turning

off.

Applications

The applications of the buzzer include the following.

• Communication Devices

• Electronics used in Automobiles

• Alarm Circuits

• Portable Devices

• Security Systems

• Timers

• Household Appliances

• Electronic Metronomes

• Sporting Events

• Annunciator Panels

• Game Shows

Thus, this is all about an overview of a buzzer data sheet that includes its working

principle, pin configuration, specifications, circuit, advantages, disadvantages & its

applications. It is an electromechanical, electromagnetic, mechanical, piezoelectric,

electro-acoustic audio signaling device. This buzzer works through an audio signal

49
source or oscillating circuit. A ring or beep or click indicates that a switch has been

pushed.

PUSH BUTTON:

A push button is an electrical switch that can be activated or inactived by

pressing it.It is a simple mechanism that controls an electrical circuit by making or

breaking a connection. They can also be classified based on the type of action they

provide, such as normally open, normally closed, and change-over contacts.

We encounter various push button switches almost every day, such as medical

equipment, automated production lines, and communication equipment. It is a very

simple component, but because it controls the entire control circuit, it is called the

"Control switch".

Introduction

The push button switch is usually used to turn on and off the control circuit, and it is

a kind of control switch appliance that is widely used. It is used in electrical

50
automatic control circuits to manually send control signals to control contactors,

relays, electromagnetic starters, etc. Its characteristic is that it is installed in the

machine and instrument in the process of work, most of the time is in the initial free

state position, and only when needed, it is converted to the second state (position)

under the action of external force. Once the external force is removed, due to With

the action of the spring, the switch returns to the initial position.

The push button switch can complete basic controls such as start, stop, forward and

reverse rotation, speed change and interlock. Usually each push button switch has

two pairs of contacts. Each pair of contacts consists of a NO contact and a NC

contact. When the button is pressed, the two pairs of contacts act simultaneously, the

NC contact is disconnected, and the NO contact is closed.

In order to indicate the function of each button and avoid misoperation, the button

caps are usually made into different colors to show the difference, as shown in the

figure below. Its colors are red, green, black, yellow, blue, white, etc. For example,

red means stop button, green means start button, etc. The main parameters, type,

mounting hole size, number of contacts and current capacity of the button switch are

described in detail in the product manual.

51
Siemens-APT Switches

Structure:

The push button switch generally consists of a button cap, a return spring, a

bridge-type moving contact, a static contact, a pillar connecting rod and a shell.

According to the opening and closing state of the contacts when the push button

switch is not subjected to external force (ie static), it is divided into start push button

switch (normally open button), stop push button switch (normally closed button) and

composite push button switch (NO and NCd contact combination buttons).

The contact of the start push button switch is closed when the button cap is

pressed, and the contact is automatically disconnected and reset when released.

When the stop push button switch is pressed down on the button cap, the contacts are

separated, and the contacts are automatically closed and reset when released. When

the composite push button switch presses the button cap, the bridge-type moving

contact moves downwards, the NC contact is opened first, and then the NO contact is

closed.

52
When the button cap is released, the NO contact is first broken and reset, and

then the NC contact is closed and reset. Extended learning: What is the internal

structure diagram of the push button switch?

Working principle:

The working principle of the push button switch is shown in the figure below:

There is an electromagnet adsorption device inside the button.

53
When the button is pressed down, the electromagnet is energized to generate

magnetism, and the circuit is connected or disconnected by the adsorption device to

realize functions such as remote control circuit.

MICROCONTROLLER

PIC is a family of Harvard architecture microcontrollers made by Microchip


Technology, derived from the PIC1640. Originally developed by General
Instrument's Microelectronics Division. The name PIC initially referred to
"Programmable Interface Controller".

PICs are popular with both industrial developers and hobbyists alike due to
their low cost, wide availability, large user base, extensive collection of application
notes, availability of low cost or free development tools, and serial programming

54
(and re-programming with flash memory) capability. Microchip announced on
February 2008 the shipment of its six billionth PIC processor.
The PIC microcontroller PIC16f877a is one of the most renowned microcontrollers in
the industry. This controller is very convenient to use, the coding or programming of
this controller is also easier. One of the main advantages is that it can be write-
erase as many times as possible because it use FLASH memory technology. It has a
total number of 40 pins and there are 33 pins for input and output. PIC16F877A is
used in many pic microcontroller projects. PIC16F877A also have many application
in digital electronics circuits.

FIG 4.3 .1IC PIN


PIC16f877a finds its applications in a huge number of devices. It is used in remote
sensors, security and safety devices, home automation and in many industrial
instruments. An EEPROM is also featured in it which makes it possible to store some
of the information permanently like transmitter codes and receiver frequencies and
some other related data. The cost of this controller is low and its handling is also
easy. Its flexible and can be used in areas where microcontrollers have never been
used before as in coprocessor applications and timer functions etc.
Microcontroller is a general purpose device, which integrates a number of the
components of a microprocessor system on to single chip. It has inbuilt CPU,

55
memory and peripherals to make it as a mini computer. A microcontroller combines
on to the same microchip:
• CPU core

• Memory (both ROM and RAM)

• Some parallel digital input/output

Microcontrollers will combine other devices such as:


• A timer module to allow the microcontroller to perform tasks for certain time
periods.

• A serial I/O port to allow data to flow between the controller and other devices
such as a PIC or another microcontroller.

• An ADC to allow the microcontroller to accept analogue input data for


processing.

Microcontrollers are:
• Smaller in size

• Consumes less power

• Inexpensive

Microcontroller is a standalone unit, which can perform functions on its own


without any requirements for additional hardware like I/O ports and external memory.
The heart of the microcontroller is the CPU core. In the past, this has traditionally
been based on an 8 bit microprocessor unit. For example, Motorola uses a basic 6800
microprocessor core their 6805/6808 microcontroller devices. In the recent years,
microcontrollers have been developed around specifically designed CPU cores, for
example the microchip PIC range of microcontrollers.
Introduction to PIC:

56
The microcontroller that has been used for this project is from PIC series. PIC
microcontroller is the first RISC based microcontroller fabricated in CMOS
(complementary metal oxide semiconductor) that uses separate bus for instruction
and data allowing simultaneous access of program and data memory. The main
advantage of CMOS and RISC combination is low power consumption resulting in a
very small chip size with a small pin count. The main advantage of CMOS is that has
immunity to noise than other fabrication techniques.
PIC 16877A:
Various microcontrollers offer different kinds of memories. EEPROM,
EPROM, FLASH etc. are some of the memories of which FLASH is the most
recently developed. Technology that is used in PIC 16877 is flash technology, so that
data is retained even when the power is switched off. Easy programming and erasing
are other features of PIC 16F877. PIC16F877A microcontroller is used in the project.
The following are some of the important features of the controller.
Core features:
• High performance RISC CPU

• Only 35 single word instructions to learn

• All single cycle instructions except for program branches which are two cycle

• Operating speed: DC- 20MHz clock input

DC- 200 ns instruction cycle


• Up to 8K x 14 words of FLASH Program Memory,

Up to 368 x 8 bytes of Data Memory (RAM)


Up to 256 x 8 bytes of EEPROM data memory
• Pin out compatible to the PIC 16c73/74/76/77

57
• Interrupt capability (up to 14 external/internal)

• Eight level deep hardware stack

• Direct, indirect and relative dressing modes

• Power –On Reset

• Power – Up Timer (PWRT) and Oscillator Start – Up Timer (OST)

• Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable
operation

• Programmable code operation

• Power saving SLEEP mode

• Selectable oscillator options

• Low-power, high speed CMOS EPROM/EEPROM technology

• Fully static design

• In-circuit Serial Programming (ISCP) via two pins

• Only single 5V source needed for programming capability

• In-circuit Debugging via two pins

• Processor read/write access to program memory

• Wide operating voltage range: 2.5v - 5.5v

• High sink source current: 25mA

• Commercial and industrial temperature ranges

• Low-power consumption:

58
<2mA typical at 5V, 4MHz
20mA typical at 3V, 32 kHz
<1mA typical standby current
Peripheral features:
• Timer0: 8bit timer/counter with 8-bit prescaler

• Timer1: 16-bit timer/counter with prescaler, can be incremented during sleep


via external clock/crystal

• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler

• 10-bit multichannel Analog-to-Digital converter

• Synchronous Serial Port (SSP) with SPI (Master mode) and 12C (Master/
Slave)

• Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI)


with 9-bit address detection

• Brown – out detection circuitry for Brown out Reset (BOR)

Pin Description:
PIC16F877A consists of 40 pins enclosed in 5 ports. Each port holds 8 pins
which are bidirectional input/output pins. Pin diagram of PIC 16F877 is represented
in Fig.

59
FIG 4.3.2 PIN DESCRIPTION

PIN 1: MCLR
The first pin is the master clear pin of this IC. It resets the microcontroller and is
active low, meaning that it should constantly be given a voltage of 5V and if 0 V are
given then the controller is reset. Resetting the controller will bring it back to the
first line of the program that has been burned into the IC.

60
A push button and a resistor is connected to the pin. The pin is already being
supplied by constant 5V. When we want to reset the IC we just have to push the
button which will bring the MCLR pin to 0 potential thereby resetting the controller.

PIN 2: RA0/AN0
PORTA consists of 6 pins, from pin 2 to pin 7, all of these are bidirectional
input/output pins. Pin 2 is the first pin of this port. This pin can also be used as an
analog pin AN0. It is built in analog to digital converter.
PIN 3: RA1/AN1
This can be the analog input 1.

PIN 4: RA2/AN2/Vref-
It can also act as the analog input2. Or negative analog reference voltage can be
given to it.

PIN 5: RA3/AN3/Vref+
It can act as the analog input 3. Or can act as the analog positive reference voltage.

PIN 6: RA0/T0CKI
To timer0 this pin can act as the clock input pin, the type of output is open drain.

PIN 7: RA5/SS/AN4
This can be the analog input 4. There is synchronous serial port in the controller also
and this pin can be used as the slave select for that port.

PIN 8: RE0/RD/AN5
PORTE starts from pin 8 to pin 10 and this is also a bidirectional input output port. It
can be the analog input 5 or for parallel slave port it can act as a ‘read control’ pin
which will be active low.

61
PIN 9: RE1/WR/AN6
It can be the analog input 6. And for the parallel slave port it can act as the ‘write
control’ which will be active low.

PIN 10: RE2/CS/A7


It can be the analog input 7, or for the parallel slave port it can act as the ‘control
select’ which will also be active low just like read and write control pins.

PIN 11 and 32: VDD


These two pins are the positive supply for the input/output and logic pins. Both of
them should be connected to 5V.

PIN 12 and 31: VSS


These pins are the ground reference for input/output and logic pins. They should be
connected to 0 potential.

PIN 13: OSC1/CLKIN


This is the oscillator input or the external clock input pin.

PIN 14: OSC2/CLKOUT


This is the oscillator output pin. A crystal resonator is connected between pin 13
and 14 to provide external clock to the microcontroller. ¼ of the frequency of OSC1
is outputted by OSC2 in case of RC mode. This indicates the instruction cycle rate.

62
PIN 15: RC0/T1OCO/T1CKI
PORTC consists of 8 pins. It is also a bidirectional input output port. Of them, pin 15
is the first. It can be the clock input of timer 1 or the oscillator output of timer 2.

PIN 16: RC1/T1OSI/CCP2


It can be the oscillator input of timer 1 or the capture 2 input/compare 2 output/
PWM 2 output.

PIN 17: RC2/CCP1


It can be the capture 1 input/ compare 1 output/ PWM 1 output.

PIN 18: RC3/SCK/SCL


It can be the output for SPI or I2C modes and can be the input/output for
synchronous serial clock.

PIN 23: RC4/SDI/SDA


It can be the SPI data in pin. Or in I2C mode it can be data input/output pin.

PIN 24: RC5/SDO


It can be the data out of SPI in the SPI mode.

PIN 25: RC6/TX/CK


It can be the synchronous clock or USART Asynchronous transmit pin.

63
PIN 26: RC7/RX/DT
It can be the synchronous data pin or the USART receive pin.

PIN 19,20,21,22,27,28,29,30:
All of these pins belong to PORTD which is again a bidirectional input and output
port. When the microprocessor bus is to be interfaced, it can act as the parallel
slave port.

PIN 33-40: PORT B


All these pins belong to PORTB. Out of which RB0 can be used as the external
interrupt pin and RB6 and RB7 can be used as in-circuit debugger pins.

Architecture of PIC 16F877:


The basic building block of PIC 16F877A is based on Harvard architecture. The
memory of a PIC 16F877A is divided into 3 sections. They are:
▪ Program memory

▪ Data Memory

▪ Data EEPROM

Program memory
The PIC 16F877A devices have a 13-bit program counter capable of
addressing an 8K word x 14 bit program memory space. The PIC16F877A devices
have 8K words x 14 bits of flash program memory.
Data memory
The data memory is partitioned into multiple banks which contain the General
Purpose Registers and the Special Function Registers. Bits RP1 and RP0 are the bank
select bits. The lower locations of each bank are reserved for the Special Function
Registers. Above the Special Function Registers are General Purpose Registers,

64
implemented as static RAM. All implemented banks contain Special Function
Registers.
Data EEPROM
The data EEPROM and flash program memory is readable and writing during
normal operation. This memory is not directly mapped in the register file space.
Instead, it is indirectly addressed through the special function registers. The
EEPROM data memory allows single-byte reads and writes. The flash memory
allows single-word reads and four-word block writes.

Registers:
The module has four registers for operation. These are:
• Control Register
• Status Register
• Serial Receive/Transmit Buffer Register
• Shift Register
CR and SR are the control and status registers used in operation. The CS
register is readable and writable. The lower six bits of the SR are read only. The
upper two bits of SR are read/write. SSPSR is the shift register used for shifting data
in or out. SSPBUF is the buffer register to which data bytes are written to or read
form. In receive operations: SSPSR and SSPBUF together create a double-buffered
receiver. During transmission, the SSPBUF is not double-buffered.
Timer Modules:
The PIC16F877A incorporates timer modules for the purpose of producing software
interrupts. These interrupts are part and parcel of microcontroller programming.
There are three timers available. They are:
• Timer0 module
• Timer1 module
• Timer2 module

65
Architecture of PIC 16F877
Master Synchronous Serial Port (MSSP) Module:

66
The Master Synchronous Serial Port (MSSP) module is a serial interface, useful for
communicating with other peripheral or microcontroller devices. These peripheral
devices may be serial EEPROMs, shift registers, display drivers, A/D converters, etc.
The MSSP module can operate in one of two modes:
• Serial Peripheral Interface (SPI)
• Inter- Integrated Circuit (I2C)
• Full Master mode
• Slave mode (with general address call)
The I2C interface supports the following modes in hardware:
• Master mode
• Multi-Master mode
• Slave mode
Control Registers:
The MSSP module has three associated registers. These include a status register
(SSPSTAT) and two control registers (SSPCON and SSPCON2). The use of these
registers and their individual configuration bits differ significantly, depending on
whether the MSSP module is operated in SPI or I2C mode.
Analog to Converter Module:
The Analog-to-Digital Converter module has five inputs for the 28-pi devices and
eight for the 40/44 pin devices. The conversion of an analog input signal results in a
corresponding 10-bit digital number. The A/D module has high and low voltage
reference input that is software selectable to some combination of VDD, VSS, RA2
or RA3. The A/D converter has a unique feature of being able to operate while the
device is in sleep mode. To operate in sleep mode, the A/D clock must be derived
from the A/D internal RC oscillator.

Core architecture

The PIC architecture is characterized by the following features:

67
• Separate code and data spaces (Harvard architecture) for devices other than
PIC32, which has a Von Neumann architecture.
• A small number of fixed length instructions
• Most instructions are single cycle execution (2 clock cycles), with one delay
cycle on branches and skips
• One accumulator (W0), the use of which (as source operand) is implied (i.e. is
not encoded in the opcode)
• All RAM locations function as registers as both source and/or destination of
math and other functions.
• A hardware stack for storing return addresses
• A fairly small amount of addressable data space (typically 256 bytes),
extended through banking
• Data space mapped CPU, port, and peripheral registers
• The program counter is also mapped into the data space and writable (this is
used to implement indirect jumps).

There is no distinction between memory space and register space because the RAM
serves the job of both memory and registers, and the RAM is usually just referred to
as the register file or simply as the registers.

Data space (RAM)

PICs have a set of registers that function as general purpose RAM. Special purpose
control registers for on-chip hardware resources are also mapped into the data space.
The addressability of memory varies depending on device series, and all PIC devices
have some banking mechanism to extend addressing to additional memory. Later
series of devices feature move instructions which can cover the whole addressable
space, independent of the selected bank. In earlier devices, any register move had to
be achieved via the accumulator.

68
To implement indirect addressing, a "file select register" (FSR) and "indirect
register" (INDF) are used. A register number is written to the FSR, after which reads
from or writes to INDF will actually be to or from the register pointed to by FSR.
Later devices extended this concept with post- and pre- increment/decrement for
greater efficiency in accessing sequentially stored data. This also allows FSR to be
treated almost like a stack pointer (SP).

External data memory is not directly addressable except in some high pin count
PIC18 devices.

Code space

The code space is generally implemented as ROM, EPROM or flash ROM. In


general, external code memory is not directly addressable due to the lack of an
external memory interface. The exceptions are PIC17 and select high pin count
PIC18 devices.

Word size

The word size of PICs can be a source of confusion. All PICs handle (and address)
data in 8-bit chunks, so they should be called 8-bit microcontrollers. However, the
unit of addressability of the code space is not generally the same as the data space.
For example, PICs in the baseline and mid-range families have program memory
addressable in the same wordsize as the instruction width, i.e. 12 or 14 bits
respectively. In contrast, in the PIC18 series, the program memory is addressed in 8-
bit increments (bytes), which differs from the instruction width of 16 bits.

In order to be clear, the program memory capacity is usually stated in number of


(single word) instructions, rather than in bytes.

Stacks

69
PICs have a hardware call stack, which is used to save return addresses. The
hardware stack is not software accessible on earlier devices, but this changed with
the 18 series devices.

Hardware support for a general purpose parameter stack was lacking in early series,
but this greatly improved in the 18 series, making the 18 series architecture more
friendly to high level language compilers.

Instruction set

A PIC's instructions vary from about 35 instructions for the low-end PICs to over 80
instructions for the high-end PICs. The instruction set includes instructions to
perform a variety of operations on registers directly, the accumulator and a literal
constant or the accumulator and a register, as well as for conditional execution, and
program branching.

Some operations, such as bit setting and testing, can be performed on any numbered
register, but bi-operand arithmetic operations always involve W (the accumulator) ;
writing the result back to either W or the other operand register. To load a constant, it
is necessary to load it into W before it can be moved into another register. On the
older cores, all register moves needed to pass through W, but this changed on the
"high end" cores.

HOW TO PROGRAM THE INPUT AND OUTPUT PORTS of PIC16F877A

As we have studied 5 input and output ports namely PORTA, PORTB, PORTC, PORTD
and PORTE which can be digital as well as analog. We will configure them according
to our requirements. But in case of analog mode, the pins or the ports can only act
as inputs. There is a built in A to D converter which is used in such cases.
Multiplexer circuits are also used.

70
But in digital mode, there is no restriction. We can configure the ports as output or
as input. This is done through programming. For PIC the preferable compiler is
mikro C pro which can be downloaded from their website.

There is a register named as ‘TRIS’ which controls the direction of ports. For
different ports there are different registers such as TRISA, TRISB etc.

▪ If we set a bit of the TRIS register to 0, the corresponding port bit will act as
the digital output.
▪ If we set a bit of the TRIS register to 1, the corresponding port bit will act as
the digital input.
For example to set the whole portb to output we can write the program statement
as:

TRISB=0;

Now the port will act as the output port and we can send any value on the output
such as

PORTB=0XFF;

FF represents all 1’s in binary i.e. FF=11111111, now all the pins of port b are high. If
we connect LEDs at all the pins then they will all start glowing in this condition.

If we want to negate the values of the port b we can use the statement:

PORTB=~PORTB;

Now all the pins of the port b will be low.

CODE TO LIGHT UP A SINGLE LED/ FLASHING LED

71
void main()

TRISB.F0 = 0 // the direction of RB0 is set as output

//or TRISB = 0xFE (0xFE = 11111110)

do // setting the infinite loop

PORTB.F0 = 1; // setting the RB0 pin to high

Delay_ms(500); // delay of 500 milli seconds

PORTB.F0 = 0; // setting the RB0 pin to low

Delay_ms(500); // again a delay of 500 milli seconds

while(1);

LCD DISPLAY

INTRODUCTION:

72
Liquid crystal cell displays (LCDs) are used in similar applications where LEDs
are used. These applications are display of display of numeric and alphanumeric
characters in dot matrix and segmental displays.

LCDs are of two types:

I. Dynamic scattering type


II. Field effect type

The construction of a dynamic scattering liquid crystal cell:


The liquid crystal material may be one of the several components, which
exhibit optical properties of a crystal though they remain in liquid form. Liquid
crystal is layered between glass sheets with transparent electrodes deposited on
the inside faces.
When a potential is applied across the cell, charge carriers flowing through
the liquid disrupt the molecular alignment and produce turbulence. When the
liquid is not activated, it is transparent. When the liquid is activated the molecular
turbulence causes light to be scattered in all directions and the cell appear to be
bright.
This phenomenon is called dynamic scattering.
The construction of a field effect liquid crystal display is similar to that of
the dynamic scattering type, with the exception that two thin polarizing optical
filters are placed at the inside of each glass sheet. The liquid crystal material in
the field effect cell is also of different type from employed in the dynamic
scattering cell. The material used is twisted numeric type and actually twists the
light passing through the cell when the latter is not energised.

73
A liquid crystal display (LCD) is an electronically-modulated optical device
shaped into a thin, flat panel made up of any number of color or monochrome pixels
filled with liquid crystals and arrayed in front of a light source (backlight) or reflector.
It is often utilized in battery-powered electronic devices because it uses very small
amounts of electric power. LCD has material, which continues the properties of both
liquids and crystals. Rather than having a melting point, they have a temperature
range within which the molecules are almost as mobile as they would be in a liquid,
but are grouped together in an ordered from similar to a crystal.
LCD consists of two glass panels, with the liquid crystal materials sandwiched
in between them. The inner surface of the glass plates is coated with transparent
electrodes which define in between the electrodes and the crystal, which makes the
liquid crystal molecules to maintain a defined orientation angle. When a potential is
applied across the cell, charge carriers flowing through the liquid will disrupt the
molecular alignment and produce turbulence.
When the liquid is not activated, it is transparent. When the liquid is activated
the molecular turbulence causes light to be scattered in all directions and the cell
appears to be bright. Thus the required message is displayed. When the LCD is in the
off state, the two polarizer’s and the liquid crystal rotate the light rays, such that they
come out of the LCD without any orientation, and hence the LCD appears
transparent.

Working:

When sufficient voltage is applied to the electrodes the liquid crystal


molecules would be aligned in a specific direction. The light rays passing through the
LCD would be rotated by the polarizer, which would result in activating/highlighting
the desired characters. The power supply should be of +5v, with maximum allowable
transients of 10mv. To achieve a better/suitable contrast for the display the voltage

74
(VL) at pin 3 should be adjusted properly. A module should not be removed from a
live circuit.
The ground terminal of the power supply must be isolated properly so that
voltage is induced in it. The module should be isolated properly so that stray voltages
are not induced, which could cause a flicking display. LCD is lightweight with only a
few, millimeters thickness since the LCD consumes less power, they are compatible
with low power electronic circuits, and can be powered for long durations. LCD does
not generate light and so light is needed to read the display. By using backlighting,
reading is possible in the dark. LCDs have long life and a wide operating temperature
range. Before LCD is used for displaying proper initialization should be done.
LCDs with a small number of segments, such as those used in digital watches
and pocket calculators, have individual electrical contacts for each segment. An
external dedicated circuit supplies an electric charge to control each segment. This
display structure is unwieldy for more than a few display elements. Small
monochrome displays such as those found in personal organizers, or older laptop
screens have a passive-matrix structure employing super-twisted nematic (STN) or
double-layer STN (DSTN) technology—the latter of which addresses a color-shifting
problem with the former—and color-STN (CSTN)— wherein color is added by using
an internal filter. Each row or column of the display has a single electrical circuit.
The pixels are addressed one at a time by row and column addresses. This type
of display is called passive-matrix addressed because the pixel must retain its state
between refreshes without the benefit of a steady electrical charge. As the number of
pixels (and, correspondingly, columns and rows) increases, this type of display
becomes less feasible.
Very slow response times and poor contrast are typical of passive matrix
addressed LCDs. High-resolution color displays such as modern LCD computer
monitors and televisions use an active matrix structure. A matrix of thin-film
transistors (TFTs) is added to the polarizing and color filters. Each pixel has its own

75
dedicated transistor, allowing each column line to access one pixel. When a row line
is activated, all of the column lines are connected to a row of pixels and the correct
voltage is driven onto all of the column lines.
The row line is then deactivated and the next row line is activated. All of the
row lines are activated in sequence during a refresh operation. Active-matrix
addressed displays look "brighter" and "sharper" than passive-matrix addressed
displays of the same size, and generally have quicker response times, producing
much better images. A general purpose alphanumeric LCD, with two lines of 16
characters. So the type of LCD used in this project is16 characters * 2 lines with 5*7
dots with cursor, built in controller, +5v power supply, 1/16 duty cycle.

PIN DESCRIPTION FOR LCD:


PIN SYMBOL FUNCTION
NO
1 Vss Ground terminal of Module
2 Vdd Supply terminal of Module, +

76
5v
3 Vo Power supply for liquid crystal drive
4 RS Register select
RS=0…Instruction register
RS=1…Data register
5 R/W Read/Write
R/W=1…Read
R/W=0…Write
6 EN Enable

7-14 DB0-DB7 Bi-directional Data Bus.


Data Transfer is performed once ,thru DB0-DB7,incase of
interface data length is 8-bits;and twice, thru DB4-DB7 in
the case of interface data length is 4-bits.Upper four bits
first then lower four bits.

15 LAMP-(L-) LED or EL lamp power supply terminals

16 LAMP+(L+) Enable
(E2)

LCD PIN DESCRIPTIONS:

77
The function of each pins of LCD is described below VCC, VSS and VEE while v
and v provide +5v and ground, respectively, v is used for controlling LCD contrast.

RS, register select


There are two very important registers inside the LCD. The RS pin is used for
their selection as follows. If RS=0, the instruction code register is selected, allowing
the user to send a command such as clear display, cursor at home,etc.if RS=1 the data
register is selected, allowing the user to send data to be displayed on the LCD.

R/W, read/write
R/W input allows the user to write information to the LCD or read information
from it. R/W=1 when reading; R/W=0 when writing.

E, enable
The enable pin is used by the LCD to latch information presented on its data
pins. When data is supplied to data pins, a high to low pulse must be applied to this
pin in order for the LCD to latch in the data present at the data pins.

D0 - D7
The 8-bit data pins, D0 – D7, are used to send information to the LCD or read
contents of the LCD’S internal registers. There are also instruction codes that can be
sent to the LCD to clear the display or force the cursor to the home position or blink
the cursor. RS=0 is used to check the busy flag bit to see if the LCD is ready to
receive information. The busy flag is D7 and can be read when R/W=1 and RS=0, as
follows: if R/W=1, RS=0.when D7=1, the LCD is busy taking care of internal
operation and will not accept any new information, when D7=0, the LCD is ready to
receive new information.

78
LCD INTERFACING WITH MICROCONTROLLER:

ADVANTAGES:
1. Consume much lesser energy (i.e. low power) when compared to LEDs.
2. Utilizes the light available outside and no generation of light.
3. Since very thin layer of liquid crystal is used, more suitable to act as display
elements (in digital watches, pocket calculators, ect.)
4. Since reflectivity is highly sensitive to temperature, used as temperature
measuring sensor.
5. Very cheap.

DISADVANTAGES:

1. Angle of viewing is very limited.


2. External light is a must for display.
3. Since not generating its own light and makes use of external light for display,
contrast is poor.

79
4. Cannot be used under wide range of temperature.

APPLICATIONS:
1. Watches
2. Fax & Copy machines & Calculators.

SOFTWARE DESCRIPTION

MPLAB IDE

INTRODUCTION

MPLAB is a proprietary freeware integrated development environment for


the development of embedded applications on PIC and dsPIC microcontrollers, and
is developed by Microchip Technology.

MPLAB X is the latest edition of MPLAB, and is developed on the NetBeans platform.
MPLAB and MPLAB X support project management, code editing, debugging and
programming of Microchip 8-bit, 16-bit and 32-bit PIC microcontrollers.

MPLAB is designed to work with MPLAB-certified devices such as the MPLAB ICD
3 and MPLAB REAL ICE, for programming and debugging PIC microcontrollers using
a personal computer. PICKit programmers are also supported by MPLAB.

MPLAB 8.X is the last version of the legacy MPLAB IDE technology, custom built
by Microchip Technology in Microsoft Visual C++. MPLAB supports project
management, editing, debugging and programming of Microchip 8-bit, 16-bit and
32-bit PICmicrocontrollers. MPLAB only works on Microsoft Windows. MPLAB is
still available from Microchip's archives, but is not recommended for new projects.

MPLAB supports the following compilers:

80
• MPLAB MPASM Assembler
• MPLAB ASM30 Assembler
• MPLAB C Compiler for PIC18
• MPLAB C Compiler for PIC24 and dsPIC DSCs
• MPLAB C Compiler for PIC32
• HI-TECH C

MPLAB X is the latest version of the MPLAB IDE built by Microchip Technology,
and is based on the open-source NetBeans platform. MPLAB X supports editing,
debugging and programming of Microchip 8-bit, 16-bit and 32-
bit PIC microcontrollers.

MPLAB X is the first version of the IDE to include cross-platform support for Mac
OS X and Linux operating systems, in addition to Microsoft Windows.

MPLAB X supports the following compilers:

• MPLAB XC8 — C compiler for 8-bit PIC devices


• MPLAB XC16 — C compiler for 16-bit PIC devices
• MPLAB XC32 — C/C++ compiler for 32-bit PIC devices
• HI-TECH C — C compiler for 8-bit PIC devices
• SDCC — open-source C compiler

HI-TECH C compiler for PIC10/12/16 MCUs (PRO)

This compiler has been discontinued and is no longer supported. This


compiler has been replaced by the MPLAB® XC8 PRO (SW006021-2).
HI-TECH C Compiler for PIC10/12/16 MCUs - PRO fully implements the optimizations

81
of Omniscient Code Generation™ - a whole-program compilation technology - to
provide denser code and better performance on PIC MCUs. This ANSI C compiler
integrates into Microchips MPLAB(R) IDE and is compatible with Microchip
debuggers and emulators.

SKETCH IDE – IOT PROGRAMMING SOFTWARE

In the getting started guide (Windows, Mac OS X, Linux), you uploaded a


sketch that blinks an LED. In this tutorial, you'll learn how each part of that sketch
works.

A sketch is the name that Arduino uses for a program. It's the unit of code that
is uploaded to and run on an Arduino board.

Arduino is an open source, computer hardware and software company, project,


and user community that designs and manufactures microcontroller kits for building
digital devices and interactive objects that can sense and control objects in the
physical world. The project's products are distributed as open-source
hardware and software, which are licensed under the GNU Lesser General Public
License (LGPL) or the GNU General Public License (GPL),[1] permitting the
manufacture of Arduino boards and software distribution by anyone. Arduino boards
are available commercially in preassembled form, or as do-it-yourself kits.

Arduino board designs use a variety of microprocessors and controllers. The


boards are equipped with sets of digital and analog input/output (I/O) pins that may
be interfaced to various expansion boards (shields) and other circuits. The boards
feature serial communications interfaces, including Universal Serial Bus (USB) on
some models, which are also used for loading programs from personal computers.
The microcontrollers are typically programmed using a dialect of features from the
programming languages C and C++. In addition to using traditional compiler

82
toolchains, the Arduino project provides an integrated development
environment (IDE) based on the Processing language project.

The Arduino project started in 2003 as a program for students at


the Interaction Design Institute Ivrea in Ivrea, Italy,[2] aiming to provide a low-cost
and easy way for novices and professionals to create devices that interact with their
environment using sensors and actuators. Common examples of such devices
intended for beginner hobbyists include simple robots, thermostats, and motion
detectors.

Arduino

Arduino is an open-source electronics platform based on easy-to-use hardware and


software. Arduino boards are able to read inputs - light on a sensor, a finger on a
button, or a Twitter message - and turn it into an output - activating a motor,
turning on an LED, publishing something online. You can tell your board what to do
by sending a set of instructions to the microcontroller on the board. 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.

83
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and
programming. As soon as it reached a wider community, the Arduino board started
changing to adapt to new needs and challenges, differentiating its offer from simple
8-bit boards to products for IoT applications, wearable, 3D printing, and embedded
environments. All Arduino boards are completely open-source, empowering users
to build them independently and eventually adapt them to their particular needs.
The software, too, is open-source, and it is growing through the contributions of
users worldwide.

There are many other microcontrollers and microcontroller platforms available for
physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's
Handyboard, and many others offer similar functionality. All of these tools take the
messy details of microcontroller programming and wrap it up in an easy-to-use
package. Arduino also simplifies the process of working with microcontrollers, but it
offers some advantage for teachers, students, and interested amateurs over other
systems:

• Inexpensive - Arduino boards are relatively inexpensive compared to other


microcontroller platforms. The least expensive version of the Arduino module can be
assembled by hand, and even the pre-assembled Arduino modules cost less than $50
• 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

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

Variables

A variable is a place for storing a piece of data. It has a name, a type, and a value.
For example, the line from the Blink sketch above declares a variable with the
name ledPin, the type int, and an initial value of 13. It's being used to indicate
which Arduino pin the LED is connected to. Every time the name ledPin appears
in the code, its value will be retrieved. In this case, the person writing the program
could have chosen not to bother creating the ledPin variable and instead have
simply written 13 everywhere they needed to specify a pin number. The advantage
of using a variable is that it's easier to move the LED to a different pin: you only
need to edit the one line that assigns the initial value to the variable.

Functions

85
A function (otherwise known as a procedure or sub-routine) is a named piece of code
that can be used from elsewhere in a sketch. For example, here's the definition of
the setup() function from the Blink example:

void setup()
{
pinMode(ledPin, OUTPUT);
}
The first line provides information about the function, like its name, "setup". The text
before and after the name specify its return type and parameters: these will be
explained later. The code between the { and } is called the body of the function: what
the function does.

pinMode(), digitalWrite(), and delay()

The pinMode() function configures a pin as either an input or an output. To use it,
you pass it the number of the pin to configure and the constant INPUT or OUTPUT.
When configured as an input, a pin can detect the state of a sensor like a
pushbutton; As an output, it can drive an actuator like an LED.

The digitalWrite() functions outputs a value on a pin.

For example, the line:

digitalWrite(ledPin, HIGH);
The delay() causes the Arduino to wait for the specified number of milliseconds
before continuing on to the next line. There are 1000 milliseconds in a second, so the
line:

86
delay(1000);

setup() and loop()

There are two special functions that are a part of every Arduino
sketch: setup() and loop(). The setup() is called once, when the sketch
starts. It's a good place to do setup tasks like setting pin modes or initializing
libraries. The loop() function is called over and over and is heart of most sketches.
You need to include both functions in your sketch, even if you don't need them for
anything.

Everything between the /* and */ is ignored by the Arduino when it runs the sketch
(the * at the start of each line is only there to make the comment look pretty, and isn't
required). It's there for people reading the code: to explain what the program does,
how it works, or why it's written the way it is. It's a good practice to comment your
sketches, and to keep the comments up-to-date when you modify the code. This helps
other people to learn from or modify your code.

CHAPTER -5

ADVANTAGES

87
• We can monitor the speed of the vehicle.
• We can find the location of the vehicle.
• Alert message to mobile phone for remote information.
• It is used to vehicle accident evidence and is useful to found victim easily
without human intervention
• It is mainly used as a tracking device and we can monitor driver rash driving
behavior

APPLICATIONS:

IoT-based automatic vehicle accident detection and rescue system has various

applications, some of which are:

1. Road Safety: The system can be integrated into vehicles to detect accidents and

provide real-time alerts to emergency services, improving the response time and

chances of survival for those involved in the accident.

2. Fleet Management: The system can be used to monitor and manage large fleets of

vehicles, providing real-time data on their location, speed, and other important

metrics. This can help fleet managers improve safety and reduce the risk of

accidents.

88
3. Smart City Planning: The system can provide valuable data on the location and

frequency of accidents, which can be used by city planners to improve road

infrastructure and reduce the number of accidents.

4. Insurance Claims: The system can provide accurate information about accidents,

which can be used by insurance companies to process claims more efficiently and

fairly.

5. Automated Emergency Response: The system can automatically send alerts to

emergency services in the event of an accident, reducing response time and

improving the chances of survival for those involved.

6. Predictive Maintenance: The system can be used to monitor the health of vehicles

and provide real-time alerts about potential issues, allowing for proactive

maintenance and reducing the risk of accidents.

RESULT & CONCLUSION:

• The project is aimed at implementing an anti-theft device with real time

tracking and user control.

• Vehicle location can be tracked and prevention of it from theft with face

recognition is done with minimum cost in quasi real-time mode.

• Face and Voice recognition technology is very effective security check

technology and also in lower cost to avoid stealing of vehicles.

• This is achieved with the help of GPS and IoT technology.

89
• The project provides an extra layer of security by including AI in the form of

face recognition to grant access to the vehicle.

• To prevent all possible ways of vehicle theft, a sensor which detects the

vehicle being dragged has also been included in the project.

REFERENCES:

90
1. Stephen Eduku, Mohammed Okoe Alhassan and Joseph Sekyi, "Design of

Vehicle Accident Prevention System Using Wireless Technology", International

Journal of Scientific and Research Publications, vol. 7, no. 10, pp. 397.

2. R. Saranya and R. Arun Kumar, "vehicle accident prevention using sensors",

International Research Journal of Engineering and Technology (IRJET), vol. 4.

3. "Road traffic injuries", World Health Organization, Feb 2021, [online] Available:

https://www.who.int/news-room/fact-sheets/detail/road-traffic-injuries.

4. N. T. S. A. Wadhahi, S. M. Hussain, K. M. Yosof, S. A. Hussain and A. V. Singh,

"Accidents Detection and Prevention System to reduce Traffic Hazards using IR

Sensors", 2018 7th International Conference on Reliability Infocom Technologies

and Optimization (Trends and Future Directions) (ICRITO), pp. 737-741, 2018.

5. N. R. Vatti, P. L. Vatti, R. Vatti and C. Garde, "Smart Road Accident Detection

and communication System", 2018 International Conference on Current Trends

towards Converging Technologies (ICCTCT), pp. 1-4, 2018.

6. R. Rishi, S. Yede, K. Kunal and N. V. Bansode, "Automatic Messaging System

for Vehicle Tracking and Accident Detection", 2020 International Conference on

Electronics and Sustainable Communication Systems (ICESC), pp. 831-834,

2020.

91
7. S. M. Gowri, P. Anitha, D. Srivaishnavi and M. Nithya, "Internet of Things based

Accident Detection System", 2019 Third International conference on I-SMAC

(IoT in Social Mobile Analytics and Cloud) (I-SMAC), pp. 159-163, 2019.

8. V. Kinage and P. Patil, "IoT Based Intelligent System For Vehicle Accident

Prevention And Detection At Real Time", 2019 Third International conference on

I-SMAC (IoT in Social Mobile Analytics and Cloud) (I-SMAC), pp. 409-413,

2019.

9. P. J. B. Princess, S. Silas and E. B. Rajsingh, "Performance Analysis of Edge

Detection Algorithms for Object Detection in Accident Images", 2019 Global

Conference for Advancement in Technology (GCAT), pp. 1-5, 2019.

10. Y.-K. Lai, Y.-H. Huang and T. Schumann, "Intelligent vehicle collision warning

system based on a deep learning approach", Proc. IEEE Int. Conf. Consum.

Electron.-Taiwan (ICCE-TW), pp. 1-2, May 2018.

92

You might also like