You are on page 1of 67

A Project on

Fault Detection In Transmission Line Using GSM

Technology

Submitted in Partial fulfillment of the requirement for the award of degree A Project Report of

BACHELOR OF ENGINEERING

IN

ELECTRICAL AND ELECTRONICS ENGINEERING

B. SRIKANTH (160716734301)

G. NAVEEN (160716734304)

SABIYA BEGUM (160716734313)

Under the Esteemed guidance of

Mr. N. NIREEKSHAN

Associate Professor, EEE, MCET

DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING

Methodist College of Engineering and Technology

(Affiliated to Osmania University)

King Koti, Abids, Hyderabad, Telangana-50000


ACKNOWLEDGEMENTS
We wish to express our deep sense of gratitude to our project guide Mr. N. Nireekshan
(Associate professor), of EEE department in Methodist College of Engineering and
Technology for his inspiring guidance, meticulous counsel, constructive criticism and generous
gift of time he has devoted, which enabled us to complete the project successfully.

We are also thankful to Dean, College of Technology for providing us with the
opportunity and necessary materials for the development of this project. We would also like to
thank the Department of Electrical and Electronics Engineering, Methodist College of
Engineering and Technology for providing us the opportunity to develop this project.

We would like to thank Prof. Y. MASTANAMMA, Head of the Department of


Electrical and Electronics Engineering for giving moral support throughout period of my study in
Methodist College of Engineering and Technology.

we are thankful to Mr. N. Nireekshan (Project In-charge), Assistant Professor,


Department of Electrical and Electronics Engineering from Methodist College of Engineering
and Technology, for his coordination regarding project.

We are highly indebted to my parents for their constant encouragement and support
during our project work.

We are honestly thankful to my friends for their motivation and help during the
preparation of our project.

Finally yet importantly, We are very much thankful to all who helped me directly or indirectly
in this endeavour.
Methodist College of Engineering and Technology

(Affiliated to Osmania University)

King Koti, Abids, Hyderabad, Telangana, 500001

DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING

CERTIFICATE

This is to certify that the project entitled “FAULT DETECTION IN


TRANSMISSION USING GSM TECHNOLOGY” is submitted by
B.SRIKANTH (160716734301), G.NAVEEN (160716734304), SABIYA
BEGUM (160716734315) to Methodist college of Engineering and Technology, in
partial fulfillment of the degree of Bachelor of Engineering in Electrical and
Electronics Engineering. This is a bonafide work done under guidance and
supervision and the result embodied in this Project report has not been submitted to
any other university or institute for the award of any other
degree/diploma/fellowship
.

Project guide: Project In-charge Head Of The Department


Mr. N. Nireekshan Mr. N. Nireekshan Y. Mastanamma
Associate Professor, EEE Associate Professor, EEE Associate professor
MCET MCET HOD-EEE ,MCET

External Examiner
DECLARATION

This is to declare that the work submitted in the present project work report titled
“FAULT DETECTION IN TRANSMISSION LINE USING GSM
TECHNOLOGY” is a record of bonafide work done by me in the Department
of Electrical and Electronics Engineering in Methodist College of Engineering and
Technology, Abids, Hyderabad.

No part of the report is copied from books, journals, internet and wherever the
subject content is taken, the same has been duly referred in the text. The report
generated is based on the project work carried out entirely by us and not copied
from any other source.

B.SRIKANTH (160716734301)

G.NAVEEN (16071673404)

SABIYA BEGUM (160716734313)

Place: Hyderabad,

Date: 27/06/2020.
ABSTRACT

In this paper, a new technique for the fault detection, classification & protection of
transmission lines is proposed. The proposed system uses different protective
equipment’s, voltage sense section, microcontroller section, LED display section &
GSM (global system for mobile communication) module. The faults like 0pen
circuit, shunt circuit, line to ground and over voltage faults get detected &
classified according to characteristics condition of current & voltage at the
occurrence of fault in the three phase overhead lines. The sensed signals are given
to microcontroller for detection & classification of faults. . Also wireless mobile
communication technique i.e. GSM is used simultaneously to send message to
responsible person on mobile. Type of fault gets displayed on fault display section.
Simultaneously fault gets interrupted using protective devices.

Keywords—GSM technology, series & shunt fault detection, voltage sense


section, microcontroller section, fault display section

Project guide:
Mr. N. Nireekshan
(Associate Professor, EEE, MCET)

Head of the Department


Y. Mastanamma
INDEX

SI. Ch. Title of the chapter Page


No No
1. 1. 0 Introduction 1
2. 1.1 Objective Of Project 2
3. 2. 1 Embedded Systems 2-3
4. 2.1.1 History 4
5. 2.1.2 Tools 4
6. 2.1.3 Resources 4-5
7. 2.1.4 Real Time Issues 5
8. 2.2 Need For Embedded Systems 5
9. 2.2.1 Debugging 5-6
10. 2.2.2 Reliability 6
11. 2.3 Explanation of Embedded systems 8-9
12. 2.3.1 Software Architecture 9-10
13. 2.3.2 Stand Alone Embedded System 10-12
14. 2.3.3 Real-Time Embedded System 12
15. 2.3.4 Network Communication Embedded System 12
16. 2.3.5 Different Types Of Processing Units 12
17. 2.4 Applications Of Embedded System 12-13
18. 2.4.1 Computer Networking 13
19. 2 .4.2 Tele Communication 13
20. 3.0 Arduino Nano 13
21. 3.1 Introduction of Arduino Nano Board 13-14
22. 3.2 Pin Diagram 14-23
23. 3.3 Feature of Ardunio 24
24. 3.4 Arduino with ATmege328 24-26
25. 4.0 Fire Sensor 26-28
26. 5.0 LCD Module 29-31
27. 5.1 Pin Destription 32-41
28. 6.0 Relay 42
29. 6.1 Basic Design and operation 43-44
30. 7.0 Buzzer 44-46
31. 8.0 GSM Modem 46-47
32. 8.1 Basic working and Specification Of GSM 48-49
33. 8.2 Architecture And Building Blocks 49
34. 8.3 Signaling Schemes And Ciphering Codes Used 49-53
35. 8.4 Two Main Interface 53-58
36. Result 59
37. Conclusion 60
List Of figures
SL Ch Title Of The Figure Page
No. No. No.
1 2 Embedded System 2-13
2.2 Network communication of embedded system 10
2.3 Computer networking 12
2.4 Tele communication 12
2 3 Ardunio nano 13-26
3.1 Ardunio nano board 13
3.2 Pin configuration of ATmega328 14
3 4 Fire Sensor 26-28
4.1 Fire Sensor Diagram 26
4.2 Circuit diagram of fire sensor 27
4 5 LCD module 28-41
.5.1 LCD display 28
5.2 2*16 Character LCD type HD447780 pin diagram 32
5.3 Interfacing diagram of LCD 36
5 6 Relay 42-43
6.1 Simple electromagnetic relay 42
6 7 Buzzer 44-46
7.1 Piezo electric buzzer 45
7 8 GSM modem 47-64
8.1 Basic black diagram of the whole GSM system 48
8.2 Transmitter and receiver for the signal 50
8.3 Signaling between air and abis interface 52
1.INTRODUCTION

Transmission line protection is an important issue in power system engineering because 85-
87% of power system faults are occurring in transmission lines The paper presents design
and implementation of transmission line fault detection, classification & protection
technique. The three phase voltage sensed is continuously given to microcontroller. The
implemented system completely meets the demand of low cost by using the microcontroller
and mobile communication technology with the aim to detect the abnormality and fault
occurred in the overhead electric line.

Under normal or safe operating conditions, the electric equipment’s in a power system
network operate at normal voltage and current ratings. Once the fault takes place in a circuit
or device, voltage and current values deviates from their nominal ranges. Usually power
system networks are protected with switchgear protection equipment’s such as circuit
breakers and relays in order to limit the loss of service due to the electrical failures after the
occurrence of fault.

The design of systems to detect and interrupt power system faults is the main objective of
power-system protection. The main types of faults are symmetric and asymmetric. A
symmetric or balanced fault affects each of the three phases equally. In transmission line
faults, roughly 5% are symmetric. This is in contrast to an asymmetrical fault, where the
three phases are not affected equally. An asymmetric or unbalanced fault does not affect each
of the three phases equally. Common types of asymmetric faults, and their causes:

 Line-to-line - a short circuit between lines, caused by ionization of air, or when lines
come into physical contact, for example due to a broken insulator.
 Line-to-ground - a short circuit between one line and ground, very often caused by
physical contact, for example due to lightning or other storm damage.

1
Objective of Project:

The project is detect the line to line, line to ground, open circuit and over voltage
faults. It will be detected the fault and trip the circuit with the help of relay unit and
send the fault location point though the SMS to concern mobile with GSM Modem
technology.

CHAPTER 2: EMBEDDED SYSTEMS

2.1 Embedded Systems:

An embedded system is a computer system designed to perform one or a few dedicated


functions often with real-time computing constraints. It is embedded as part of a complete device
often including hardware and mechanical parts. By contrast, a general-purpose computer, such as
a personal computer (PC), is designed to be flexible and to meet a wide range of end-user needs.
Embedded systems control many devices in common use today.

Embedded systems are controlled by one or more main processing cores that are typically
either microcontrollers or digital signal processors (DSP). The key characteristic, however, is
being dedicated to handle a particular task, which may require very powerful processors. For
example, air traffic control systems may usefully be viewed as embedded, even though they
involve mainframe computers and dedicated regional and national networks between airports and
radar sites. (Each radar probably includes one or more embedded systems of its own.)

Since the embedded system is dedicated to specific tasks, design engineers can optimize
it to reduce the size and cost of the product and increase the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.

Physically embedded systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants. Complexity varies from low, with a single microcontroller
chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or
enclosure.

2
In general, "embedded system" is not a strictly definable term, as most systems have
some element of extensibility or programmability. For example, handheld computers share some
elements with embedded systems such as the operating systems and microprocessors which
power them, but they allow different applications to be loaded and peripherals to be connected.
Moreover, even systems which don't expose programmability as a primary feature generally need
to support software updates. On a continuum from "general purpose" to "embedded", large
application systems will have subcomponents at most points even if the system as a whole is
"designed to perform one or a few dedicated functions", and is thus appropriate to call
"embedded".

2.1.1 History:

In the earliest years of computers in the 1930–40s, computers were sometimes dedicated
to a single task, but were far too large and expensive for most kinds of tasks performed by
embedded computers of today. Over time however, the concept of programmable controllers
evolved from traditional electromechanical sequencers, via solid state devices, to the use of
computer technology.

One of the first recognizably modern embedded systems was the Apollo Guidance
Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the
project's inception, the Apollo guidance computer was considered the riskiest item in the Apollo
project as it employed the then newly developed monolithic integrated circuits to reduce the size
and weight. An early mass-produced embedded system was the Autonetics D-17 guidance
computer for the Minuteman missile, released in 1961. It was built from transistor logic and had
a hard disk for main memory. When the Minuteman II went into production in 1966, the D-17
was replaced with a new computer that was the first high-volume use of integrated circuits.

2.1.2 Tools:

Embedded development makes up a small fraction of total programming. There's also a


large number of embedded architectures, unlike the PC world where 1 instruction set rules, and
the UNIX world where there's only 3 or 4 major ones. This means that the tools are more
expensive. It also means that they're lowering featured, and less developed. On a major
embedded project, at some point you will almost always find a compiler bug of some sort.

3
Debugging tools are another issue. Since you can't always run general programs on your
embedded processor, you can't always run a debugger on it. This makes fixing your program
difficult. Special hardware such as JTAG ports can overcome this issue in part. However, if you
stop on a breakpoint when your system is controlling real world hardware (such as a motor),
permanent equipment damage can occur. As a result, people doing embedded programming
quickly become masters at using serial IO channels and error message style debugging.

2.1.3 Resources:

To save costs, embedded systems frequently have the cheapest processors that can do the
job. This means your programs need to be written as efficiently as possible. When dealing with
large data sets, issues like memory cache misses that never matter in PC programming can hurt
you. Luckily, this won't happen too often- use reasonably efficient algorithms to start, and
optimize only when necessary. Of course, normal profilers won't work well, due to the same
reason debuggers don't work well.
Memory is also an issue. For the same cost savings reasons, embedded systems usually
have the least memory they can get away with. That means their algorithms must be memory
efficient (unlike in PC programs, you will frequently sacrifice processor time for memory, rather
than the reverse). It also means you can't afford to leak memory. Embedded applications
generally use deterministic memory techniques and avoid the default "new" and "malloc"
functions, so that leaks can be found and eliminated more easily. Other resources programmers
expect may not even exist. For example, most embedded processors do not have hardware FPUs
(Floating-Point Processing Unit). These resources either need to be emulated in software, or
avoided altogether.

2.1.4 Real Time Issues:

Embedded systems frequently control hardware, and must be able to respond to them in
real time. Failure to do so could cause inaccuracy in measurements, or even damage hardware
such as motors. This is made even more difficult by the lack of resources available. Almost all
embedded systems need to be able to prioritize some tasks over others, and to be able to put
off/skip low priority tasks such as UI in favor of high priority tasks like hardware control.

4
2.2 Need For Embedded Systems:

The uses of embedded systems are virtually limitless, because every day new products
are introduced to the market that utilizes embedded computers in novel ways. In recent years,
hardware such as microprocessors, microcontrollers, and FPGA chips have become much
cheaper. So when implementing a new form of control, it's wiser to just buy the generic chip and
write your own custom software for it. Producing a custom-made chip to handle a particular task
or set of tasks costs far more time and money. Many embedded computers even come with
extensive libraries, so that "writing your own software" becomes a very trivial task indeed. From
an implementation viewpoint, there is a major difference between a computer and an embedded
system. Embedded systems are often required to provide Real-Time response. The main
elements that make embedded systems unique are its reliability and ease in debugging.
2.2.1 Debugging:

Embedded debugging may be performed at different levels, depending on the facilities


available. From simplest to most sophisticate they can be roughly grouped into the following
areas:
 Interactive resident debugging, using the simple shell provided by the embedded
operating system (e.g. Forth and Basic)
 External debugging using logging or serial port output to trace operation using either a
monitor in flash or using a debug server like the Remedy Debugger which even works for
heterogeneous multi core systems.
 An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via
a JTAG or Nexus interface. This allows the operation of the microprocessor to be
controlled externally, but is typically restricted to specific debugging capabilities in the
processor.
 An in-circuit emulator replaces the microprocessor with a simulated equivalent,
providing full control over all aspects of the microprocessor.
 A complete emulator provides a simulation of all aspects of the hardware, allowing all of
it to be controlled and modified and allowing debugging on a normal PC.

5
 Unless restricted to external debugging, the programmer can typically load and run
software through the tools, view the code running in the processor, and start or stop its
operation. The view of the code may be as assembly code or source-code.

Because an embedded system is often composed of a wide variety of elements, the


debugging strategy may vary. For instance, debugging a software (and microprocessor) centric
embedded system is different from debugging an embedded system where most of the processing
is performed by peripherals (DSP, FPGA, co-processor). An increasing number of embedded
systems today use more than one single processor core. A common problem with multi-core
development is the proper synchronization of software execution. In such a case, the embedded
system design may wish to check the data traffic on the busses between the processor cores,
which requires very low-level debugging, at signal/bus level, with a logic analyzer, for instance.

2.2.2 Reliability:

Embedded systems often reside in machines that are expected to run continuously for
years without errors and in some cases recover by them if an error occurs. Therefore the software
is usually developed and tested more carefully than that for personal computers, and unreliable
mechanical moving parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
 The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Examples include space systems, undersea cables, navigational beacons, bore-hole
systems, and automobiles.
 The system must be kept running for safety reasons. "Limp modes" are less tolerable.
Often backup s are selected by an operator. Examples include aircraft navigation, reactor
control systems, safety-critical chemical factory controls, train signals, engines on single-
engine aircraft.
 The system will lose large amounts of money when shut down: Telephone switches,
factory controls, bridge and elevator controls, funds transfer and market making,
automated sales and service.

6
A variety of techniques are used, sometimes in combination, to recover from errors—
both software bugs such as memory leaks, and also soft errors in the hardware:
 Watchdog timer that resets the computer unless the software periodically notifies the
watchdog
 Subsystems with redundant spares that can be switched over to
 software "limp modes" that provide partial function
 Designing with a Trusted Computing Base (TCB) architecture[6] ensures a highly secure
& reliable system environment
 An Embedded Hypervisor is able to provide secure encapsulation for any subsystem
component, so that a compromised software component cannot interfere with other
subsystems, or privileged-level system software. This encapsulation keeps faults from
propagating from one subsystem to another, improving reliability. This may also allow a
subsystem to be automatically shut down and restarted on fault detection.
 Immunity Aware Programming
2.3 Explanation of Embedded Systems:
2.3.1 Software Architecture:

There are several different types of software architecture in common use.

 Simple Control Loop:

In this design, the software simply has a loop. The loop calls subroutines, each of which
manages a part of the hardware or software.

 Interrupt Controlled System:

Some embedded systems are predominantly interrupt controlled. This means that tasks
performed by the system are triggered by different kinds of events. An interrupt could be
generated for example by a timer in a predefined frequency, or by a serial port controller
receiving a byte. These kinds of systems are used if event handlers need low latency and the
event handlers are short and simple.

Usually these kinds of systems run a simple task in a main loop also, but this task is not
very sensitive to unexpected delays. Sometimes the interrupt handler will add longer tasks to a

7
queue structure. Later, after the interrupt handler has finished, these tasks are executed by the
main loop. This method brings the system close to a multitasking kernel with discrete processes.

 Cooperative Multitasking:

A non-preemptive multitasking system is very similar to the simple control loop scheme,
except that the loop is hidden in an API. The programmer defines a series of tasks, and each task
gets its own environment to “run” in. When a task is idle, it calls an idle routine, usually called
“pause”, “wait”, “yield”, “nop” (stands for no operation), etc.The advantages and disadvantages
are very similar to the control loop, except that adding new software is easier, by simply writing
a new task, or adding to the queue-interpreter.

 Primitive Multitasking:

In this type of system, a low-level piece of code switches between tasks or threads based
on a timer (connected to an interrupt). This is the level at which the system is generally
considered to have an "operating system" kernel. Depending on how much functionality is
required, it introduces more or less of the complexities of managing multiple tasks running
conceptually in parallel.

As any code can potentially damage the data of another task (except in larger systems
using an MMU) programs must be carefully designed and tested, and access to shared data must
be controlled by some synchronization strategy, such as message queues, semaphores or a non-
blocking synchronization scheme.

Because of these complexities, it is common for organizations to buy a real-time


operating system, allowing the application programmers to concentrate on device functionality
rather than operating system services, at least for large systems; smaller systems often cannot
afford the overhead associated with a generic real time system, due to limitations regarding
memory size, performance, and/or battery life.

 Microkernels And Exokernels:

A microkernel is a logical step up from a real-time OS. The usual arrangement is that the
operating system kernel allocates memory and switches the CPU to different threads of

8
execution. User mode processes implement major functions such as file systems, network
interfaces, etc.

In general, microkernels succeed when the task switching and intertask communication is
fast, and fail when they are slow. Exokernels communicate efficiently by normal subroutine
calls. The hardware and all the software in the system are available to, and extensible by
application programmers. Based on performance, functionality, requirement the embedded
systems are divided into three categories:

2.3.2 Stand Alone Embedded System:

These systems takes the input in the form of electrical signals from transducers or
commands from human beings such as pressing of a button etc.., process them and produces
desired output. This entire process of taking input, processing it and giving output is done in
standalone mode. Such embedded systems comes under stand alone embedded systems

Eg: microwave oven, air conditioner etc..

2.3.3 Real-time embedded systems:

Embedded systems which are used to perform a specific task or operation in a specific
time period those systems are called as real-time embedded systems. There are two types of real-
time embedded systems.

 Hard Real-time embedded systems:

These embedded systems follow an absolute dead line time period i.e.., if the tasking is
not done in a particular time period then there is a cause of damage to the entire equipment.

Eg: consider a system in which we have to open a valve within 30 milliseconds. If this
valve is not opened in 30 ms this may cause damage to the entire equipment. So in such cases we
use embedded systems for doing automatic operations.

 Soft Real Time embedded systems:

Eg: Consider a TV remote control system, if the remote control takes a few milliseconds delay it
will not cause damage either to the TV or to the remote control. These systems which will not cause

9
damage when they are not operated at considerable time period those systems comes under soft real-time
embedded systems.

2.3.4 Network communication embedded systems:

A wide range network interfacing communication is provided by using embedded


systems.

Eg:

 Consider a web camera that is connected to the computer with internet can be used
to spread communication like sending pictures, images, videos etc.., to another
computer with internet connection throughout anywhere in the world.

 Consider a web camera that is connected at the door lock.

Whenever a person comes near the door, it captures the image of a person and sends to
the desktop of your computer which is connected to internet. This gives an alerting message with
image on to the desktop of your computer, and then you can open the door lock just by clicking
the mouse. Fig: 2.2 show the network communications in embedded systems.

Fig 2.1: Network communication embedded systems

2.3.5 Different types of processing units:

10
The central processing unit (c.p.u) can be any one of the following microprocessor,
microcontroller, digital signal processing.

 Among these Microcontroller is of low cost processor and one of the main advantage of
microcontrollers is, the components such as memory, serial communication interfaces,
analog to digital converters etc.., all these are built on a single chip. The numbers of
external components that are connected to it are very less according to the application.

 Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements. But the microprocessor requires
many external components like memory, serial communication, hard disk, input output
ports etc.., so the power consumption is also very high when compared to
microcontrollers.

 Digital signal processing is used mainly for the applications that particularly involved
with processing of signals

2.4 APPLICATIONS OF EMBEDDED SYSTEMS:

2.4.1 Computer networking:

Embedded systems are used as bridges routers etc..

Fig2.2: Computer networking

2.4.2 Tele communications:

11
Cell phones, web cameras etc.

Fig2.3: Cell Phone Fig2.4: Web camera

3.0 ARDUINO NANO (Micro controller)

3.1 Introduction to the Arduino NANO Board

The Arduino Nano, as the name suggests is a compact, complete and bread-board
friendly microcontroller board. The Nano board weighs around 7 grams with dimensions of 4.5
cms to 1.8 cms (L to B). This article discusses about the technical specs most importantly the
pinout and functions of each and every pin in the Arduino Nano board.
Arduino Nano has similar functionalities as Arduino Duemilanove but with a different
package. The Nano is inbuilt with the ATmega328P microcontroller, same as the Arduino UNO.
The main difference between them is that the UNO board is presented in PDIP (Plastic Dual-In-
line Package) form with 30 pins and Nano is available in TQFP (plastic quad flat pack) with 32
pins. The extra 2 pins of Arduino Nano serve for the ADC functionalities, while UNO has 6
ADC ports but Nano has 8 ADC ports. The Nano board doesn’t have a DC power jack as other
Arduino boards, but instead has a mini-USB port. This port is used for both programming and
serial monitoring. The fascinating feature in Nano is that it will choose the strongest power
source with its potential difference, and the power source selecting jumper is invalid.

12
Figure 3.1 Arduino nano Board

Arduino Nano – Specification

Arduino Nano Specifications

Analog I/O Pins 8

Architecture AVR

Clock Speed 16 MHz

DC Current per I/O Pins 40 milliAmps

Digital I/O Pins 22

EEPROM 1 KB

Flash Memory 32 KB of which 2 KB used by Bootloader

Input Voltage (7-12) Volts

Microcontroller ATmega328P

Operating Voltage 5 Volts

PCB Size 18 x 45 mm

Power Consumption 19 milliAmps

13
Arduino Nano Specifications

PWM Output 6

SRAM 2KB

Weight 7 gms

3.2 Pin diagram

Figure 3.2 Pin Configuration of Atmega328

14
Pin Description

Arduino Nan0 – Pin Description


Pins 1 to 30

Arduino Nano Pin


Type Function
Pin Name

1 D1/TX I/O Digital I/O Pin


Serial TX Pin

2 D0/RX I/O Digital I/O Pin


Serial RX Pin

3 RESET Input Reset ( Active Low)

4 GND Power Supply Ground

5 D2 I/O Digital I/O Pin

6 D3 I/O Digital I/O Pin

7 D4 I/O Digital I/O Pin

8 D5 I/O Digital I/O Pin

9 D6 I/O Digital I/O Pin

10 D7 I/O Digital I/O Pin

15
Arduino Nano Pin
Type Function
Pin Name

11 D8 I/O Digital I/O Pin

12 D9 I/O Digital I/O Pin

13 D10 I/O Digital I/O Pin

14 D11 I/O Digital I/O Pin

15 D12 I/O Digital I/O Pin

16 D13 I/O Digital I/O Pin

17 3V3 Output +3.3V Output (from FTDI)

18 AREF Input ADC reference

19 A0 Input Analog Input Channel 0

20 A1 Input Analog Input Channel 1

21 A2 Input Analog Input Channel 2

22 A3 Input Analog Input Channel 3

23 A4 Input Analog Input Channel 4

16
Arduino Nano Pin
Type Function
Pin Name

24 A5 Input Analog Input Channel 5

25 A6 Input Analog Input Channel 6

26 A7 Input Analog Input Channel 7

27 +5V Output or +5V Output (From On-board Regulator)


Input or
+5V (Input from External Power Supply

28 RESET Input Reset ( Active Low)

29 GND Power Supply Ground

30 VIN Power Supply voltage

17
ICSP Pins

Arduino Nano ICSP Pin Name Type Function

MISO Input or Output Master In Slave Out

Vcc Output Supply Voltage

SCK Output Clock from Master to Slave

MOSI Output or Input Master Out Slave In

RST Input Reset (Active Low)

GND Power Supply Ground

Arduino Nano Digital Pins

Pins - 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, and 16

As mentioned earlier, Arduino Nano has 14 digital I/O pins that can be used either as digital
input or output. The pins work with 5V voltage as maximum, i.e., digital high is 5V and digital
low is 0V. Each pin can provide or receive a current of 20mA, and has a pull-up resistance of
about 20-50k ohms. Each of the 14 digital pins on the Nano pinout can be used as an input or
output, using pinMode(), digitalWrite(), and digitalRead() functions.

Other than the digital input and output functions, the digital pins have some additional
functionality as well.

Serial Communication Pins

Pins - 1, 2

18
1 - RX and 2 - TX

These two pins RX- receive and TX- transmit are used for TTL serial data communication. The
pins RX and TX are connected to the corresponding pins of the USB-to-TTL Serial chip.

PWM Pins

Pins - 6, 8, 9, 12, 13, and 14

Each of these digital pins provide a Pulse Width Modulation signal of 8-bit resolution. The PWM
signal can be generated using analogWrite () function.

External Interrupts

Pins - 5, 6

When we need to provide an external interrupt to other processor or controller we can make use
of these pins. These pins can be used to enable interrupts INT0 and INT1 respectively by using
the attachInterrupt () function. These pins can be used to trigger three types of interrupts such as
interrupt on a low value, a rising or falling edge interrupt and a change in value interrupt.

SPI Pins

Pins - 13, 14, 15, and 16

When you don’t want the data to be transmitted asynchronously you can use these Serial
Peripheral Interface pins. These pins support synchronous communication with SCK as the
19
synchronizing clock. Even though the hardware has this feature, the Arduino software doesn’t
have this by default. So you have to include a library called SPI Library for using this feature.

LED

Pin - 16

If you remember your first Arduino code, blinking LED, then you’ll definitely came across this
Pin16. The pin 16 is being connected to the blinking LED on the board.

Arduino Nano Analog Pins

Pins - 18, 19, 20, 21, 22, 23, 24, 25, and 26

As mentioned earlier UNO got 6 analog input pins but Arduino Nano has 8 analog inputs (19 to
26), marked A0 through A7. This means you can connect *8 channel analog sensor inputs for
processing. Each of these analog pins has a inbuilt ADC of resolution of 1024 bits (so it will give
1024 values). By default, the pins are measured from ground to 5V. If you want the reference
voltage to be 0V to 3.3V, we can give 3.3V to AREF pin (18 th Pin) by using the analogReference
() function.

Similar to digital pins in Nano, analog pins also got some other functions as well.

I2C

Pins 23, 24 as A4 and A5

Since SPI communication also has its disadvantages such as 4 essential pins and limited within a
device. For long distance communication we use the I2C protocol. I2C supports multi master and
multi slave with only two wires. One for clock (SCL) and another for data (SDA). For using this
I2C feature we need to import a library called Wire library.

20
AREF

Pin 18

As mentioned already the AREF- Analog Reference pin is used as a reference voltage for analog
input for the ADC conversion.

Reset

Pin 28

Reset pins in Arduino are active LOW pins which means if we make this pin value as LOW i.e.,
0v, it will reset the controller. Usually used to be connected with switches to use as reset button.

ICSP

ICSP stands for In Circuit Serial Programming, which represents one of the several methods
available for programming Arduino boards. Ordinarily, an Arduino bootloader program is used
to program an Arduino board, but if the bootloader is missing or damaged, ICSP can be used
instead. ICSP can be used to restore a missing or damaged bootloader.

21
Each ICSP pin usually is cross-connected to another Arduino pin with the same name or
function. For example, MISO on Nano’s ICSP header is connected to MISO / digital pin 12 (Pin
15); MOSI on the ISCP header is connected to MOSI / digital pin 11 (Pin 16); and so forth. Note,
MISO, MOSI, and SCK pins taken together make up most of an SPI interface.

We can use one Arduino to program another Arduino using this ICSP.

Arduino as ISP ATMega328

Vcc/5V Vcc

GND GND

MOSI/D11 D11

MISO/D12 D12

SCK/D13 D13

D10 Reset

RESET

Pins 3, 28 and 5 in ICSP

Power

Pins 4, 17, 27, 28, 30 and 2 & 6 in ICSP

22
3.3 Features 
 1.8-5.5V operating range
 Up to 20MHz
 Part: ATMEGA328P-AU
 32kB Flash program memory
 1kB EEPROM
 2kB Internal SRAM
 2 8-bit Timer/Counters
 16-bit Timer/Counter
 RTC with separate oscillator
 Master/Slave SPI interface
 2-wire (I2C) interface
 Watchdog timer
 23 IO lines
 Data retention: 20 years at 85C/ 100 years at 25C
 Digital I/O Pins are 14 (out of which 6 provide PWM output)
 Analog Input Pins are 6.
 DC Current per I/O is 40 mA
 DC Current for 3.3V Pin is 50mA
3.4 Arduino with ATmega328
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz
ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. It
contains everything needed to support the microcontroller; simply connect it to a computer with
a USB cable or power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to versionR2) programmed as
a USB-to-serial converter.
 Pin out: Added SDA and SCL pins that are near to the AREF pin and two other new pins
placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage
provided from the board. In future, shields will be compatible with both the board that

23
uses the AVR, which operates with 5V and with the Arduino. Due that operates with
3.3V. The second one is a not connected pin that is reserved for future purposes.
 Stronger RESET circuit.
 Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0.
The Uno and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is
the latest in a series of USB Arduino boards, and the reference model for the Arduino platform;
for a comparison with previous versions, see the index of Arduino boards.

Arduino Characteristics
Power
The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically. External (non-USB) power can come either
from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a
2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in
the Gnd and Vin pin headers of the POWER connector. The board can operate on an external
supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than
five volts and the board may be unstable. If using more than 12V, the voltage regulator may
overheat and damage the board. The recommended range is 7 to 12 volts.
The power pins are as follows:
 VIN: The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can
supply voltage through this pin, or, if supplying voltage via the power jack, access it
through this pin.
 5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V),
or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses
the regulator, and can damage your board. We don't advise it.
 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50
mA.
 GND. Ground pins.

24
 IOREF. This pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin voltage
and select the appropriate power source or enable voltage translators on the outputs for
working with the 5V or 3.3V.
Memory:
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Serial Communication:
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the
board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The '16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .inf file is required. The Arduino software
includes a serial monitor which allows simple textual data to be sent to and from the Arduino
board. The RX and TX LEDs on the board will flash when data is being transmitted via the
USB-to-serial chip and USB connection to the computer (but not for serial communication on
pins 0 and 1).
A Software Serial library allows for serial communication on any of the Uno's digital
pins. The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus. For SPI communication, use the SPI
library.

4.0 FIRE SENSOR

Flame detector is a sensor designed to detect and respond to the presence of a flame or fire,


allowing flame detection. Responses to a detected flame depend on the installation, but can
include sounding an alarm, deactivating a fuel line (such as a propane or a natural gas line), and
activating a fire suppression system. When used in applications such as industrial furnaces, their
role is to provide confirmation that the furnace is properly; in these cases they take no direct
action beyond notifying the operator or control system. A flame detector can often respond faster

25
and more accurately than a smoke or heat detector due to the mechanisms it uses to detect the
flame.

Description
The Fire sensor is used to detect fire flames . The module makes use of Fire sensor and
comparator to detect fire up to a range of 1 meters.

Feature

 Allows your robot to detect flames from upto 1 M away


 Typical Maximum Range :1 m .
 Calibration preset for range adjustment.
 Indicator LED with 3 pin easy interface connector.
 Input Voltage +5VDC

Fig 7.1 Fire sensor diagram

Fire Sensor circuit


This fire sensor circuit exploits the temperature sensing property of an ordinary signal diode IN
34 to detect heat from fire. At the moment it senses heat, a loud alarm simulating that of Fire
brigade will be produced. The circuit is too sensitive and can detect a rise in temperature of 10
degree or more in its vicinity. Ordinary signal diodes like IN 34 and OA 71 exhibits this property
and the internal resistance of these devices will decrease when temperature rises.

The fire sensor circuit is too sensitive and can detect a rise in temperature of 10 degree or more
in its vicinity. Ordinary signal diodes like IN 34 and OA 71 exhibits this property and the

26
internal resistance of these devices will decrease when temperature rises. In the reverse biased
mode, this effect will be more significant. Typically the diode can generate around 600 milli
volts at 5 degree centigrade. For each degree rise in temperature; the diode generates 2 mV
output voltage. That is at 5 degree it is 10 mV and when the temperature rises to 50 degree, the
diode will give 100 milli volts. This voltage is used to trigger the remaining circuit. Transistor T1
is a temperature controlled switch and its base voltage depends on the voltage from the diode and
from VR and R1. Normally T1 conducts (due to the voltage set by VR) and LED glows. This
indicates normal temperature.

When T1 conducts, base pf T2 will be grounded and it remains off to inhibit the Alarm
generator. IC UM 3561 is used in the circuit to give a Fire force siren. This ROM IC has an
internal oscillator and can generate different tones based on its pin connections. Here pin 6 is
shorted with the Vcc pin 5 to get a fire force siren. When the temperature near the diode
increases above 50 degree, it conducts and ground the base of T1. This makes T1 off and T2 on.
Alarm generator then gets current from the emitter of T2 which is regulated by ZD to 3.1 volt
and buffered by C1.Resistor R4 ( 220K) determines the frequency of oscillation and the value
220K is a must for correct tone. To set the fire sensor circuit, keep a lighted candle near the
diode and wait for 1 minute. Slowly adjust VR till the alarm sounds. Remove the heat .After one

27
minute, alarm will turns off. VR can be used for further adjustments for particular temperature

levels.

Fig 7.2 Fire Sensor Circuit Diagram

5.0 LCD MODULE

To display interactive messages we are using LCD Module. We examine an intelligent


LCD display of two lines,16 characters per line that is interfaced to the controllers. The protocol
(handshaking) for the display is as shown. Whereas D0 to D7th bit is the Data lines, RS, RW and
EN pins are the control pins and remaining pins are +5V, -5V and GND to provide supply.
Where RS is the Register Select, RW is the Read Write and EN is the Enable pin.

The display contains two internal byte-wide registers, one for commands (RS=0) and the
second for characters to be displayed (RS=1). It also contains a user-programmed RAM area (the
character RAM) that can be programmed to generate any desired character that can be formed

28
using a dot matrix. To distinguish between these two data areas, the hex command byte 80 will
be used to signify that the display RAM address 00h will be chosen.Port1 is used to furnish the
command or data type, and ports 3.2 to3.4 furnish register select and read/write levels.

The display takes varying amounts of time to accomplish the functions as listed. LCD bit 7 is
monitored for logic high (busy) to ensure the display is overwritten.

Liquid Crystal Display also called as LCD is very helpful in providing user interface as well as
for debugging purpose. The most common type of LCD controller is HITACHI 44780 which
provides a simple interface between the controller & an LCD. These LCD's are very simple to
interface with the controller as well as are cost effective.

Fig 5.1 2x16 Line Alphanumeric LCD Display

The most commonly used ALPHANUMERIC displays are 1x16 (Single Line & 16 characters),
2x16 (Double Line & 16 character per line) & 4x20 (four lines & Twenty characters per line). 
The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The number on data
lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3 control
lines i.e. total 11 lines are required. And if operated in 4-bit mode then 4 data lines + 3 control
lines i.e. 7 lines are required. How do we decide which mode to use? It’s simple if you have
sufficient data lines you can go for 8 bit mode & if there is a time constrain i.e. display should be
faster then we have to use 8-bit mode because basically 4-bit mode takes twice as more time as
compared to 8-bit mode.
 Pin  Symbol Function
 1  Vss  Ground
 2  Vdd  Supply Voltage
 3  Vo  Contrast Setting
 4  RS  Register Select
 5  R/W  Read/Write Select
 6  En  Chip Enable Signal
 7-14  DB0-DB7  Data Lines
 15  A/Vee  Gnd for the backlight
 16  K  Vcc for backlight
When RS is low (0), the data is to be treated as a command. When RS is high (1), the data being
sent is considered as text data which should be displayed on the screen.
29
When R/W is low (0), the information on the data bus is being written to the LCD. When RW is
high (1), the program is effectively reading from the LCD. Most of the times there is no need to
read from the LCD so this line can directly be connected to Gnd thus saving one controller line.
The ENABLE pin is used to latch the data present on the data pins. A HIGH - LOW signal is
required to latch the data. The LCD interprets and executes our command at the instant the EN
line is brought low. If you never bring EN low, your instruction will never be executed.

COMMANDS USED IN LCD

Basic 16x 2 Characters LCD - Black on Green 5V:

30
Description:

This is a basic 16 character by 2 line display. Black text on Green background. Utilizes
the extremely common HD44780 parallel interface chipset. Interface code is freely available. We

will need ~11 general I/O pins to


interface to this LCD screen. Includes LED backlight.

5.1 Pin description:

The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line
LCDs which have only 1 controller and support at most of 80 characters, whereas LCDs
supporting more than 80 characters make use of 2 HD44780 controllers.

31
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections). Pin description is shown in the table
below.

32
Fig 5.2: Character LCD type HD44780 Pin diagram

Pin description:

Pin No. Name Description


Pin no. 1 VSS Power supply (GND)
Pin no. 2 VCC Power supply (+5V)
Pin no. 3 VEE Contrast adjust
0 = Instruction input
Pin no. 4 RS
1 = Data input
0 = Write to LCD module
Pin no. 5 R/W
1 = Read from LCD module
Pin no. 6 EN Enable signal
Pin no. 7 D0 Data bus line 0 (LSB)
Pin no. 8 D1 Data bus line 1
Pin no. 9 D2 Data bus line 2
Pin no. 10 D3 Data bus line 3
Pin no. 11 D4 Data bus line 4
Pin no. 12 D5 Data bus line 5
33
Pin no. 13 D6 Data bus line 6
Pin no. 14 D7 Data bus line 7 (MSB)

Table 1: Character LCD pins with 1 Controller

Pin No. Name Description


Pin no. 1 D7 Data bus line 7 (MSB)
Pin no. 2 D6 Data bus line 6
Pin no. 3 D5 Data bus line 5
Pin no. 4 D4 Data bus line 4
Pin no. 5 D3 Data bus line 3
Pin no. 6 D2 Data bus line 2
Pin no. 7 D1 Data bus line 1
Pin no. 8 D0 Data bus line 0 (LSB)
Pin no. 9 EN1 Enable signal for row 0 and 1 (1stcontroller)
0 = Write to LCD module
Pin no. 10 R/W
1 = Read from LCD module
0 = Instruction input
Pin no. 11 RS
1 = Data input
Pin no. 12 VEE Contrast adjust
Pin no. 13 VSS Power supply (GND)
Pin no. 14 VCC Power supply (+5V)
Pin no. 15 EN2 Enable signal for row 2 and 3 (2ndcontroller)
Pin no. 16 NC Not Connected

Table 2: Character LCD pins with 2 Controller

LCD Background:

Frequently, an 8051 program must interact with the outside world using input and
output devices that communicate directly with a human being. One of the most common devices
attached to an 8051 is an LCD display. Some of the most common LCDs connected to the 8051
are 16x2 and 20x2 displays. This means 16 characters per line by 2 lines and 20 characters per
34
line by 2 lines, respectively.Fortunately, a very popular standard exists which allows us to
communicate with the vast majority of LCDs regardless of their manufacturer. The standard is
referred to as HD44780U, which refers to the controller chip which receives data from an
external source (in this case, the 8051) and communicates directly with the LCD.

44780 Background:

The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the data
bus. The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus.
If a 4-bit data bus is used the LCD will require a total of 7 data lines (3 control lines plus the 4
lines for the data bus). If an 8-bit data bus is used the LCD will require a total of 11 data lines (3
control lines plus the 8 lines for the data bus).

The three control lines are referred to as EN, RS, and RW.

The EN line is called "Enable." This control line is used to tell the LCD that we are sending it
data. To send data to the LCD, our program should make sure this line is low (0) and then set the
other two control lines and/or put data on the data bus. When the other lines are completely
ready, bring EN high (1) and wait for the minimum amount of time required by the LCD
datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.

The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as
a command or special instruction (such as clear screen, position cursor, etc.). When RS is high
(1), the data being sent is text data which should be displayed on the screen. For example, to
display the letter "T" on the screen we would set RS high.

The RW line is the "Read/Write" control line. When RW is low (0), the information on the
data bus is being written to the LCD. When RW is high (1), the program is effectively querying
(or reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are
write commands--so RW will almost always be low.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation
selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2,
DB3, DB4, DB5, DB6, and DB7.
35
Characters x 2 Lines LCD-Interfacing Example - 16

Description:

This is the first interfacing example for the Parallel Port. We will start with something
simple. This example doesn't use the Bi-directional feature found on newer ports, thus it should
work with most, if no all Parallel Ports.

It however doesn't show the use of the Status Port as an input. A 16 Character x 2 Line
LCD Module to the Parallel Port. These LCD Modules are very common these days, and are
quite simple to work with, as all the logic required running them is on board.

Fig 5.3 Interfacing Circuit Of LCD

Circuit Description:

Above is the quite simple schematic. The LCD panel's Enable and Register Select is
connected to the Control Port. The Control Port is an open collector / open drain output. While
most Parallel Ports have internal pull-up resistors, there is a few which don't. Therefore by
incorporating the two 10K external pull up resistors, the circuit is more portable for a wider
range of computers, some of which may have no internal pull up resistors.

36
We make no effort to place the Data bus into reverse direction. Therefore we hard wire
the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on the data
lines. As a result we cannot read back the LCD's internal Busy Flag which tells us if the LCD has
accepted and finished processing the last instruction. This problem is overcome by inserting
known delays into our program.

The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here. As
with all the examples, I've left the power supply out. We can use a bench power supply set to 5v
or use an onboard +5 regulator. Remember a few de-coupling capacitors, especially if we have
trouble with the circuit working properly.

An example hardware configuration:

As we've mentioned, the LCD requires either 8 or 11 I/O lines to communicate with. For
the sake of this tutorial, we are going to use an 8-bit data bus--so we'll be using 11 of the 8051's
I/O pins to interface with the LCD.

Let's draw a sample pseudo-schematic of how the LCD will be connected to the 8051.

As we can see, we've established a 1-to-1 relation between a pin on the 8051 and a line on
the 44780 LCD. Thus as we write our assembly program to access the LCD, we are going to
equate constants to the 8051 ports so that we can refer to the lines by their 44780 name as
opposed to P0.1, P0.2, etc. Let's go ahead and write our initial equates:

37
DB0 EQU P1.0
DB1 EQU P1.1
DB2 EQU P1.2
DB3 EQU P1.3
DB4 EQU P1.4
DB5 EQU P1.5
DB6 EQU P1.6
DB7 EQU P1.7
EN EQU P3.7
RS EQU P3.6
RW EQU P3.5
DATA EQU P1

Having established the above equates, we may now refer to our I/O lines by their 44780
name. For example, to set the RW line high (1), we can execute the following instruction:

SETB RW

Handling the EN control line:

As we mentioned above, the EN line is used to tell the LCD that we are ready for it to
execute an instruction that we've prepared on the data bus and on the other control lines. Note
that the EN line must be raised/ lowered before/after each instruction sent to the LCD regardless
of whether that instruction is read or write text or instruction. In short, we must always
manipulate EN when communicating with the LCD. EN is the LCD's way of knowing that we
are talking to it. If we don't raise/lower EN, the LCD doesn't know we're talking to it on the other
lines.

Thus, before we interact in any way with the LCD we will always bring the EN line low
with the following instruction:
38
CLR EN: And once we've finished setting up our instruction with the other control lines and
data bus lines, we'll always bring this line high:

SETB EN

The line must be left high for the amount of time required by the LCD as specified in its
datasheet. This is normally on the order of about 250 nanoseconds, but checks the datasheet. In
the case of a typical 8051 running at 12 MHz, an instruction requires 1.08 microseconds to
execute so the EN line can be brought low the very next instruction. However, faster
microcontrollers (such as the DS89C420 which executes an instruction in 90 nanoseconds given
an 11.0592 MHz crystal) will require a number of NOPs to create a delay while EN is held high.
The number of NOPs that must be inserted depends on the microcontroller we are using and the
crystal we have selected.

The instruction is executed by the LCD at the moment the EN line is brought low with a
final CLR EN instruction.

Checking the busy status of the LCD:

As previously mentioned, it takes a certain amount of time for each instruction to be


executed by the LCD. The delay varies depending on the frequency of the crystal attached to the
oscillator input of the 44780 as well as the instruction which is being executed.

While it is possible to write code that waits for a specific amount of time to allow the LCD
to execute instructions, this method of "waiting" is not very flexible. If the crystal frequency is
changed, the software will need to be modified. Additionally, if the LCD itself is changed for
another LCD which, although 44780 compatible, requires more time to perform its operations,
the program will not work until it is properly modified.

A more robust method of programming is to use the "Get LCD Status" command to determine
whether the LCD is still busy executing the last instruction received.

The "Get LCD Status" command will return to us two tidbits of information; the
information that is useful to us right now is found in DB7. In summary, when we issue the "Get

39
LCD Status" command the LCD will immediately raise DB7 if it's still busy executing a
command or lower DB7 to indicate that the LCD is no longer occupied. Thus our program can
query the LCD until DB7 goes low, indicating the LCD is no longer busy. At that point we are
free to continue and send the next command.

Since we will use this code every time we send an instruction to the LCD, it is useful to
make it a subroutine. Let's write the code:

WAIT_LCD:

CLR EN ;Start LCD command


CLR RS ;It's a command
SETB RW ;It's a read command
MOV DATA, #0FFh ;Set all pins to FF initially
SETB EN ;Clock out command to LCD
MOV A,DATA ;Read the return value
JB ACC.7,WAIT_LCD ;If bit 7 high, LCD still busy
CLR EN ;Finish the command
CLR RW ;Turn off RW for future commands
RET

Thus, our standard practice will be to send an instruction to the LCD and then call our
WAIT_LCD routine to wait until the instruction is completely executed by the LCD. This will
assure that our program gives the LCD the time it needs to execute instructions and also makes
our program compatible with any LCD, regardless of how fast or slow it is.

The last byte we need to send is used to configure additional operational parameters of
the LCD. We must send the value 06h.

CLR RS
MOV DATA, #06h
SETB EN
CLR EN
LCALL WAIT_LCD
40
So, in all, our initialization code is as follows:

INIT_LCD:

CLR RS
MOV DATA, #38h
SETB EN
CLR EN
LCALL WAIT_LCD
CLR RS
MOV DATA, #0Eh
SETB EN
CLR EN
LCALL WAIT_LCD
CLR RS
MOV DATA, #06h
SETB EN
CLR EN
LCALL WAIT_LCD
RET

Having executed this code the LCD will be fully initialized and ready for us to send
display data to it.

CLEARING THE DISPLAY:

When the LCD is first initialized, the screen should automatically be cleared by the
44780 controller. However, it's always a good idea to do things our self so that we can be
completely sure that the display is the way we want it. Thus, it's not a bad idea to clear the screen
as the very first operation after the LCD has been initialized.An LCD command exists to
accomplish this function. Not surprisingly, it is the command 01h. Since clearing the screen is a
function we very likely will wish to call more than once, it's a good idea to make it a subroutine.
41
CLEAR_LCD:

CLR RS
MOV DATA, #01h
SETB EN
CLR EN
LCALL WAIT_LCD
RET

How that we've written a "Clear Screen" routine, we may clear the LCD at any time by
simply executing an LCALL CLEAR_LCD.

6.0 RELAY:

A relay is an electrically operated switch. Many relays use an electromagnet to operate a


switching mechanism, but other operating principles are also used. Relays find applications
where it is necessary to control a circuit by a low-power signal, or where several circuits must be
controlled by one signal. The first relays were used in long distance telegraph circuits, repeating
the signal coming in from one circuit and re-transmitting it to another. Relays found extensive
use in telephone exchanges and early computers to perform logical operations. A type of relay
that can handle the high power required to directly drive an electric motor is called a contactor.
Solid-state relays control power circuits with no moving parts, instead using a semiconductor
device triggered by light to perform switching. Relays with calibrated operating characteristics
and sometimes multiple operating coils are used to protect electrical circuits from overload or
faults; in modern electric power systems these functions are performed by digital instruments
still called "protection relays".

6.1 Basic design and operation:

42
Fig 6.1 Simple electromechanical relay

A simple electromagnetic relay, such as the one taken from a car in the first picture, is an
adaptation of an electromagnet. It consists of a coil of wire surrounding a soft iron core, an iron
yoke, which provides a low reluctance path for magnetic flux, a movable iron armature, and a
set, or sets, of contacts; two in the relay pictured. The armature is hinged to the yoke and
mechanically linked to a moving contact or contacts. It is held in place by a spring so that when
the relay is de-energized there is an air gap in the magnetic circuit. In this condition, one of the
two sets of contacts in the relay pictured is closed, and the other set is open. Other relays may
have more or fewer sets of contacts depending on their function. The relay in the picture also has
a wire connecting the armature to the yoke. This ensures continuity of the circuit between the
moving contacts on the armature, and the circuit track on the printed circuit board (PCB) via the
yoke, which is soldered to the PCB.

When an electric current is passed through the coil, the resulting magnetic field attracts the
armature and the consequent movement of the movable contact or contacts either makes or
breaks a connection with a fixed contact. If the set of contacts was closed when the relay was
De-energized, then the movement opens the contacts and breaks the connection, and vice versa if
the contacts were open. When the current to the coil is switched off, the armature is returned by a
force, approximately half as strong as the magnetic force, to its relaxed position. Usually this
force is provided by a spring, but gravity is also used commonly in industrial motor starters.
Most relays are manufactured to operate quickly. In a low voltage application, this is to reduce
noise. In a high voltage or high current application, this is to reduce arcing.

43
If the coil is energized with DC, a diode is frequently installed across the coil, to dissipate the
energy from the collapsing magnetic field at deactivation, which would otherwise generate a
voltage spike dangerous to circuit components. Some automotive relays already include a diode
inside the relay case. Alternatively a contact protection network, consisting of a capacitor and
resistor in series, may absorb the surge. If the coil is designed to be energized with AC, a small
copper ring can be crimped to the end of the solenoid. This "shading ring" creates a small out-of-
phase current, which increases the minimum pull on the armature during the AC cycle.

By analogy with the functions of the original electromagnetic device, a solid-state relay is made
with a thyristor or other solid-state switching device. To achieve electrical isolation an opt
coupler can be used which is a light-emitting diode (LED) coupled with a photo transistor.

7.0 BUZZER

A buzzer or beeper is an audio signaling device, which may be mechanical, electromechanical, or


electronic. Typical uses of buzzers and beepers include alarms, timers and confirmation of user input such
as a mouse click or keystroke.

FEATURES
• The PB series are high-performance buzzers with a unimorph piezoelectric ceramic element and an
integral self-excitation oscillator circuit.
• They exhibit extremely low power consumption in comparison to electromagnetic units.
• They are constructed without switching contacts to ensure long life and no electrical noise.
• Compact, yet produces high acoustic output with minimal voltage.

Mechanical
A joy buzzer is an example of a purely mechanical buzzer.
44
Electromechanical
Early devices were based on an electromechanical system identical to an electric bell without the metal
gong. Similarly, a relay may be connected to interrupt its own actuating current, causing the contacts to
buzz. Often these units were anchored to a wall or ceiling to use it as a sounding board. The word
"buzzer" comes from the rasping noise that electromechanical buzzers made.

VOLTAGE BUZZER SOUND CONTROLS

When resistance is connected in series (as shown in illustrations (a) and (b)), abnormal oscillation may
occur when adjusting the sound volume. In this case, insert a capacitor in parallel to the voltage
oscillation board (as shown in illustration (c)). By doing so, abnormal oscillation can be prevented by
grounding one side. However, the voltage VB added to the voltage oscillation board must be within the
maximum input voltage range, and as capacitance of 3.3μF or greater should be connected.

Electronic

Fig 7.1 Pizeo electric sensor

A piezoelectric element may be driven by an oscillating electronic circuit or other audio signal
source. Sounds commonly used to indicate that a button has been pressed are a click, a ring or a
beep. Electronic buzzers find many applications in modern days.

45
Uses

 Annunciator panels
 Electronic metronomes
 Game shows
 Microwave ovens and other household appliances
 Sporting events such as basketball games

8.0 GSM MODEM

Definitions
The words, “Mobile Station” (MS) or “Mobile Equipment” (ME) are used for mobile terminals
Supporting GSM services.
A call from a GSM mobile station to the PSTN is called a “mobile originated call” (MOC) or
“Outgoing call”, and a call from a fixed network to a GSM mobile station is called a “mobile
Terminated call” (MTC) or “incoming call”

What is GSM?
GSM (Global System for Mobile communications) is an open, digital cellular technology used
for transmitting mobile voice and data services.
What does GSM offer?
GSM supports voice calls and data transfer speeds of up to 9.6 kbit/s, together with the
transmission of SMS (Short Message Service).
GSM operates in the 900MHz and 1.8GHz bands in Europe and the 1.9GHz and 850MHz bands
in the US. The 850MHz band is also used for GSM and 3G in Australia, Canada and many South
American countries. By having harmonised spectrum across most of the globe, GSM’s
international roaming capability allows users to access the same services when travelling abroad
as at home. This gives consumers seamless and same number connectivity in more than 218
countries.
46
Terrestrial GSM networks now cover more than 80% of the world’s population. GSM satellite
roaming has also extended service access to areas where terrestrial coverage is not available
HISTORY

In 1980’s the analog cellular telephone systems were growing rapidly all throughout
Europe, France and Germany. Each country defined its own protocols and frequencies to work
on. For example UK used the Total Access Communication System (TACS), USA used the
AMPS technology and Germany used the C-netz technology. None of these systems were
interoperable and also they were analog in nature.
In 1982 the Conference of European Posts and Telegraphs (CEPT) formed a study group
called the GROUPE SPECIAL MOBILE (GSM) The main area this focused on was to get the
cellular system working throughout the world, and ISDN compatibility with the ability to
incorporate any future enhancements. In 1989 the GSM transferred the work to the European
Telecommunications Standards Institute (ETSI.) the ETS defined all the standards used in GSM.

8.1 BASICS OF WORKING AND SPECIFICATIONS OF GSM

The GSM architecture is nothing but a network of computers. The system has to partition
available frequency and assign only that part of the frequency spectrum to any base transreceiver

Some of the technical specifications of GSM are listed below –

Multiple Access Method TDMA / FDMA

Uplink frequencies (MHz) 933-960 (basic GSM)

Downlink frequencies (MHz) 890-915 (basic GSM)

Duplexing FDD

Channel spacing, kHz 200

Modulation GMSK

Portable TX power, maximum / average (mW) 1000 / 125

Power control, handset and BSS Yes

Speech coding and rate (kbps) RPE-LTP / 13

47
Speech Channels per RF channel: 8

Channel rate (kbps) 270.833

Channel coding Rate 1/2 convolutional

Frame duration (ms) 4.615

GSM was originally defined for the 900 Mhz range but after some time even the 1800 Mhz range
was used for cellular technology. The 1800 MHz range has its architecture and specifications
almost same to that of the 900 Mhz GSM technology but building the Mobile exchanges is easier
and the high frequency Synergy effects add to the advantages of the 1800 Mhz range.

ARCITECTURE AND BUILDIGN BLOCKS –

GSM is mainly built on 3 building blocks. (Ref Fig. 2)

 GSM Radio Network – This is concerned with the signaling of the system. Hand-overs
occur in the radio network. Each BTS is allocated a set of frequency channels.
 GSM Mobile switching Network – This network is concerned with the storage of data
required for routing and service provision.
 GSM Operation and Maintenance – The task carried out by it include Administration and
commercial operation , Security management, Network configuration, operation,
performance management and maintenance tasks.

48
Fig.8.1 The basic blocks of the whole GSM system

Explanations of some of the abbreviations used –

Public Land Mobile Network(PLMN) The whole GSM system


Mobile System (MS) The actual cell phone that we use
Base Transceiver Station (BTS) Provides connectivity between network and
mobile station via the Air- interface

Controls the whole subsystem.


BaseStationController(BSC)
Transcoding Rate & Adaption Unit This is instrumental in compressing the Data that
is passed on to the network, is a part of the BSS.

(TRAU)
Mobile Services Switching Center The BSC is connected to the MSC. The MSC
routes the incoming and outgoing calls and
(MSC) assigns user cannels on the A- interface.
Home Location Register (HLR) This register stores data of large no of users. It is
like a database that manages data of all the users.
Every PLMN will have atleast one HLR.

Visitor Location Resigter (VLR) This contains part of data so that the HLR is not
overloaded with inquiries. If a subscriber moves
out of VLR area the HLR requests removal of
data related to that user from the VLR.

Equipment Identity Register (EIR) The IMEI no. is allocated by the manufacturer
and is stored on the network in the EIR. A stolen

49
phone can be made completely useless by the
network/s if the IMEI no is known.

SIGNALLING SCHEMES AND CIPHERING CODES USED –


GSM is digital but voice is inherently analog. So the analog signal has to be converted
and then transmitted. The coding scheme used by GSM is RPE-LTP (Rectangular pulse
Excitation – Long Term Prediction)

Fig.8.3Transmitter and Receiver for the signal


The voice signal is sampled at 8000 bits/sec and is quantized to get a 13 bit resolution
corresponding to a bit rate of 104 kbits/sec. This signal is given to a speech coder (codec) that
compresses this speech into a source-coded speech signal of 260 bit blocks at a bit rate of 13
kbit/sec. The codec achieves a compression ratio of 1:8. The coder also has a Voice activity
detector (VAD) and comfort noise synthesizer. The VAD decides whether the current speech
frame contains speech or pause, this is turn is used to decide whether to turn on or off the

50
transmitter under the control of the Discontinuous Transmission (DTX). This transmission takes
advantage of the fact that during a phone conversation both the parties rarely speak at the same
time. Thus the DTX helps in reducing the power consumption and prolonging battery life. The
missing speech frames are replaced by synthetic background noise generated by the comfort
noise synthesize in a Silence Descriptor (SID) frame. Suppose a loss off speech frame occurs due
to noisy transmission and it cannot be corrected by the channel coding protection mechanism
then the decoder flags such frames with a bad frame indicator (BFI) In such a case the speech
frame is discarded and using a technique called error concealment which calculates the next
frame based on the previous frame.
CIPHERING CODES

MS Authentication algorithm’s –
These algorithms are stored in the SIM and the operator can decide which one it
prefers using.
A3/8
The A3 generates the SRES response to the MSC’s random challenge, RAND which the
MSC has received from the HLR. The A3 algorithm gets the RAND from the MSC and the
secret key Ki from the SIM as input and generated a 32- bit output, the SRES response. The A8
has a 64 bit Kc output.
A5/1 (Over the Air Voice Privacy Algorithm)

The A5 algorithm is the stream cipher used to encrypt over the air transmissions. The
stream cipher is initialized for every frame sent with the session key Kc and the no. of frames
being decrypted / encrypted. The same Kc key is used throughout the call but different 22-bit
frame is used.

8.3 TWO MAIN INTERFACES

The two main interfaces are the AIR and the ABIS interface. The figure shows the
signaling between them.
AIR INTERFACE – signaling between MS and BTS
ABIS INTERFACE – signaling between BTS and BSC
51
Fig.8.3 Signaling between Air and Abis Interface
AIR INTERFACE
The air interface is like the physical layer in the model. The signaling schemes used in
the AIR interface are as follows –
 BROADCAST CONTROL CHANNE (BCCH)
o Broadcast Control Channel (BCCH)
This channel broadcasts a series of information elements to the MS, such as radio
channel configuration, synchronization information etc.
o FREQUENCY CORRECTION CHANNEL (FCCH)
This channel contains information about the correction in transmission frequency
broadcasted to MS.
o 0SYNCHRONIZATION CHANNEL (SCH)
It broadcasts data for the frame synchronization of a MS and information to
identify a BSC.
 COMMON CONTROL CHANNEL (BCH)
This is a point to multi-point signaling channel to deal with access management
functions. Consists of 3 channels –
o RANDOM ACCESS CHANNEL (RACH)
It is the Uplink portion, accessed from the mobile stations in a cell to ask for a
dedicated signaling channel for 1 transaction.
o ACCESS GRANT CHANNEL (AGCH)

It is the downlink portion used to assign a dedicated signaling channel.

52
o NOTIFICATION CHANNEL (NCH)
It is used to inform mobile stations about incoming calls and broadcast calls.
 DEDICATED CONTROL CHANNEL (DCCH)
It is a Bi-directional point to point signaling channel. Consists of 3 channels –
o STAND ALONE DEDICATED CONTROL CHANNEL (SDDCH) –
Used for signaling between the BSS and MS when there is no active connection
between them.
o SLOW ASSOCIATED CONTROL CHANNEL (SACCH) –
This channel had to continuously transfer data because it is considered as proof of
existence of a physical radio connection.
o FAST ASSOCIATED CONTROL CHANNEL (FACCH) –
This channel is used to make additional band-width available for signaling
Multi-Tech line settings
A serial link handler is set with the following default values (factory settings): autobaud, 8 bits
data, 1 stop bit, no parity, RTS/CTS flow control. Please use the +IPR, +IFC and +ICF
Commands to change these settings.
Commands always start with AT (which means ATtention) and finish with a <CR> character.
Information responses and result codes
Responses start and end with <CR><LF>, except for the ATV0 DCE response format) and the
ATQ1 (result code suppression) commands.
If command syntax is incorrect, an ERROR string is returned.
If command syntax is correct but with some incorrect parameters, the +CME ERROR:
<Err> or +CMS ERROR: <SmsErr> strings are returned with different error codes.
If the command line has been performed successfully, an OK string is returned.
In some cases, such as “AT+CPIN?” or (unsolicited) incoming events, the product does not
Return the OK string as a response.
Product Serial Number +CGSN
Description:
This command allows the user application to get the IMEI (International Mobile Equipment
Identity) of the product.
Syntax:
53
Command syntax: AT+CGSN

Repeat last command A/


Description:
This command repeats the previous command. Only the A/ command itself cannot be repeated.
Syntax:
Command syntax: A/

Signal Quality +CSQ

Description:

This command determines the received signal strength indication (<rssi>) and the channel bit
error
Rate (<ber>) with or without a SIM card inserted.
Syntax:
Command syntax: AT+CSQ

Defined values:
0: -113 dBm or less
1: -111 dBm
30: -109 to –53 dBm

54
31: -51dBm or greater
99: not known or not detectable
<ber>: 0…7: as RXQUAL values in the table GSM 05.08
99: not known or not detectable

New message indication +CNMI


Description:
This command selects the procedure for message reception from the network.
Syntax:
Command syntax: AT+CNMI=<mode>,<mt>,<bm>,<ds>,<bfr>

Read message +CMGR


Description:
This command allows the application to read stored messages. The messages are read from the
memory selected by +CPMS command.
Command syntax: AT+CMGR=<index>

55
List message +CMGL
Description:
This command allows the application to read stored messages, by indicating the type of the
Message to read. The messages are read from the memory selected by the +CPMS command.
Syntax: Command syntax: AT+CMGL=<stat>

Defined values:

<stat> possible values (status of messages in memory):

56
Send message +CMGS
Description:
The <address> field is the address of the terminal to which the message is sent. To send the
Message, simply type, <ctrl-Z> character (ASCII 26). The text can contain all existing
Characters except <ctrl-Z> and <ESC> (ASCII 27). This command can be aborted using the
<ESC> character when entering text. In PDU mode, only hexadecimal characters are used
(‘0’…’9’,’A’…’F’).
Syntax:
Command syntax in text mode:
AT+CMGS= <da> [ ,<toda> ] <CR>
text is entered <ctrl-Z / ESC >

The message reference, <mr>, which is returned to the application, is allocated by the product.
This number begins with 0 and is incremented by one for each outgoing message (successful
and failure cases); it is cyclic on one byte (0 follows 255).
Note: This number is not a storage number. Outgoing messages are not stored.
Delete message +CMGD

Description:
57
This command deletes one or several messages from preferred message storage (“BM” SMS
CB ‘RAM storage’, “SM” SMSPP storage ‘SIM storage’ or “SR” SMS Status-Report storage).
Syntax:
Command syntax: AT+CMGD=<Index> [,<DelFalg>]

Defines values

(1-20) when the preferred message storage is “BM”

Integer type values in the range of location numbers of SIM Message memory

When the preferred message storage is “SM” or “SR”.

<DelFlag>

0 Delete message at location <index>.

1 Delete All READ messages

2 Delete All READ and SENT messages

3 Delete All READ, SENT and UNSENT messages and Delete all messages.

58
Result

59
Conclusion
• Hence by this project we can Monitor the fault and power grids using GSM based mobile
by means of SMS.

• This project is detect the fault location.

• Fast operation.

60

You might also like