SlideShare a Scribd company logo
1 of 66
1
MESSAGE BASED HOME AUTOMATION & SECURITY
SYSTEM
By
Hassan Mahmood Polash
S.M. Istiaque Sekander
Md. Jahid Hassan
Srijohn Kumar Roy
Department of Electrical and Electronic Engineering
University of Information Technology & Sciences (UITS)
2
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
Home Automation & Security System is the residential extension of building automation. Home
automation system may include centralized control of lighting, HVAC (heating, ventilation and
air conditioning), appliances, security locks of gates and doors and other systems, to provide
improved convenience, comfort, energy efficiency and security. [1]
A home automation system may include simple automated door opener to complete automation
of home appliances. Usual home automation feature may include ambient light intensity control,
temperature and humidity monitor and control system etc. Home automation helps people to get
things done conveniently. For example, it helps to turn on the microwave oven from the office
laptop, remotely start vacuuming, etc. Home automation system can be extended to home
security monitoring system. A home security system may include intruder alarm system to
CCTV monitoring facilities. The basic aim of Home automation is to control or monitor signals
from different appliances.
Home automation is a growing trend. Automation systems can control important systems like
lighting and temperature controls as well as entertainment systems and even curtains. Though
costly, control systems can ease the lifestyle of a homeowner greatly. Depending upon which
sort of control system is purchased, the ease of the customer’s life can be exponentially
increased. Especially with central control systems, users can change the temperature and lighting
in their house with a flick of the finger. No longer is it necessary to worry about leaving the heat
running or burning out light bulbs that were mistakenly left on.
In this thesis we have presented simplicity in design, a standard compatible platform of home
automation & security system. Our designed system includes a GSM modem and a
microcontroller based monitoring and control device that allows monitoring from any distance,
over GSM network using short message service (SMS). Multiple sensors feed surrounding
environment information to the microcontroller like – temperature and humidity and also
monitors gas leakage or smoke and human presence. And microcontroller sends that information
via SMS to a cell phone number by using a GSM modem. Our designed system constantly
3
monitors the temperature and humidity and display on a LCD. If the temperature reaches 50ºC
the microcontroller turns off the main power supply of the house. We have selected 50ºC,
because it is very unusual temperature for human comfort and household temperature
considering our geographical position. Hence this lead to one assessment that some, flammable
object is on fire in smaller magnitude or some electrical home appliance is about to catch fire.
Since most of the modern electrical home appliance generates temperature between 20ºC to
35ºC.
1.2 BACKGROUND
Home automation is adopted for reasons of ease, security and energy efficiency. In modern
construction in most homes have been wired for electrical power, telephones, TV outlets (cable
or antenna), and a doorbell. Many household tasks were automated by the development of
specialized automated appliances. For instance, automatic washing machines were developed to
reduce the manual labor of cleaning clothes, and water heaters reduced the energy necessary for
bathing. If no one is supposed to be home and the alarm system is set, the Home Automation &
Security System could call the owner, or the neighbors, or an emergency number if an intruder is
detected. [1]
In simple installations, automation may be as straightforward as turning on/off the lights when a
person enters the room. In advanced installations, rooms can sense not only the presence of a
person inside but know who that person is and perhaps set appropriate lighting, temperature,
music levels or television channels, taking into account the day of the week, the time of day, and
other factors.
An example of remote monitoring in home automation could be triggered when a smoke detector
detects a fire or smoke condition, causing all lights in the house to blink to alert any occupants of
the house to the possible emergency. The system could also call the home owner on their mobile
phone to alert them, or call the fire department or alarm monitoring company.
1.3 IMPORTANCE OF THE WORK
Home automation systems that are available in market are very expensive. Moreover it also
includes high monthly service charge and installation cost. Also this system requires internet
connection to operate; hence the user also has to bear internet subscription fees.
As the demand of home automation system increases, so is the complexity of construction and
maintenance cost. Our goal for this project to develop a home automation system that is not only
simple in construction and low on maintenance cost, but also a standard compatible platform of
home automation & security system. To do so, we have used four sensors (temperature sensor,
humidity sensor, gas detector and PIR motion sensor) and interfaced with a microcontroller. We
4
have tried to provide access to the user, that information about the sensors instantly from a LCD
display as well as through SMS.
1.4 OBJECTIVE
 Our objective is to construct a cost effective home automation system.
 Also to make a safety monitoring system that provides security against fire damage and
intruder.
 And to develop an automation system that can control main power supply of a house.
 And to make a system which is easy to operate and low on maintenance cost.
1.5 APPLICATION
There is several application of our project:
 This project includes interfacing of temperature and humidity sensors. This concept can
be used for manufacturing and processing industries.
 It is also represent the use of several security features such as motion sensing ability
which can be used for monitoring house, office, restricted area etc. for human
trespassing.
 It also includes a gas leakage detector which can be used in deep sea drilling rig, oil
tanker ships for hazardous gas leakage and combustion gas detection.
 This project features usage of GSM modem and SMS; this can be extended over GSM
data service, like GPRS, EDGE, 3G internet for monitor and control wide range of
modern home appliance over any distance and even lower cost.
5
1.6 BLOCK DIAGRAM:
Figure 1 Block Diagram of Proposed System
6
EXTENSIVE
LITERATURE REVIEW
MODEL CONCEPT
SELECTION
PROCCESS
MODEL
DEVELOPMENT
TESTING
VERIFICATION
IMPLEMENTATION
1.6 METHODOLOGY
The purpose of the project is to develop an automation system based on PIC Microcontroller and
GSM modem. The sensors are connected to microcontroller. Microcontroller converts the analog
input into digital signal and analyzes, then takes actions to accordance. Our project’s systematic
flow chart and explanation of work are given below:
Figure 2 Methodology
7
1.6.1 EXTENSIVE LITERATURE REVIEW
In recent years there has been an exponential growth and advancement in computing technology.
There has also been use of these technologies even among non-technical users as they are no
longer limited to personal computers that occupy fixed desk space. Instead there has been an
increasing trend towards global computing that integrates seamlessly into peripheral environment
to assist ones day to day life.
Several standards have been proposed each day promising to solve standards issue. Home
automation is not different. At very basic level home automation is introduced as early as 19th
century with the introduction of water supply and energy distribution system. Science then
several solutions was proposed by the industry and academia; but the progress has been
relatively slow. Few system aims to solve issues such as ease of access and scalability, such as
Microchip’s X-10. In early 2000’s, there has been several academic research were published
regarding home automation, such as – in University of Utah, Utah, USA Kevin Brown, Don
DeLaMare and Brian Faires proposed an land phone based home automation and security
system, where a door, window, motion sensors are integrated to a MC9S12C32 microcontroller
(which serve as a slave microcontroller to collect and analyze data from sensors) and a
thermostat control unit and a land phone is integrated to another MC9S12C32 microcontroller
(which serve as a master microcontroller to control and dial a fixed number if required). A
MC9S12C32 is a powerful 16-bit microcontroller by Freescale Semiconductor Inc. It has 32KB
of program memory and 4KB RAM with 52 general purpose I/O pin, with a 16-channel ADC
module. In the project by Kevin Brown, Don DeLaMare and Brian Faires, they used two
MC9S12C32 microcontroller, one as master and another as slave, connected to each other over
I2C (inter-integrated circuit) communication protocol. The slave microcontroller is integrated
with three sensors (door, window and motion) to monitor the internal situation of a house. If any
of this sensor triggers then the slave microcontroller sends a signal to the master microcontroller.
The master microcontroller is integrated with a keypad and a land phone. If any of the sensor
were triggered then the microcontroller wait for 10 seconds for an authorized password entry
from the keypad; otherwise it dials 911(emergency number in USA) to call the police.
Our system includes one 8-bit PIC16F877A microcontroller by Microchip Inc. It has 8KB
program memory and 368 bytes RAM with 33 general purposes I/O pin. Since land phone are
rarely used in modern days hence we replaced land phone with cell phone. Integrating a cell
phone to a microcontroller is a complex process and requires an auxiliary circuit, so instead of a
cell phone we used a GSM module, which is special type circuit that mimics a cell phone. It can
be directly integrated to a microcontroller without the help of an auxiliary circuit. But our
system’s microcontroller has a limitation of low data bus (8-bit only), program memory and
RAM. Hence we had to develop a program that is low on line count compare to Kevin Brown,
Don DeLaMare and Brian Faires project. We also have to remove the keypad feature for this
reason. Our system incorporates four sensors (i.e. temperature, humidity, and motion and gas
sensor). Our systems microcontroller gathers information from the sensors and analyzes them if
any one of them is triggered over an alarming level, and then a SMS is send to a predefined cell
8
phone number. And if certain parameter is crossed over danger level then supply from the mains
is cut off.
Another research was published by Sunny Peter Gomasa under Massey University, Albany, New
Zealand, proposing a web service based home automation, where light, smoke and motion sensor
are integrated to a single board computer ALIX 3D2 and the computer is connected to a ADSL
modem. It also developed a website for the control and monitoring purpose using PHP web
development language. An ALIX 3D2 is single board computer by PC Engines Ltd. A single
board computer has distinctive advantage over microcontroller. Single board computer usually
includes a powerful microprocessor which performance is measured in several hundred MHz;
whereas the performance of a microcontroller processor is measured in MIPS (million
instructions per second). An ALIX 3D2 single board computer includes AMD Geode LX800
CPU with 500 MHz clock speed and 256 MB RAM. It also includes a LAN port and two USB
port. The LAN port can be used with ADSL modem for internet connection. The main purpose
of an ALIX 3D2 single board computer is to allow control different load via internet. The load
might be connected to one or more microcontroller powered control board. The drawback of
ALIX 3D2 is, beside need of internet it also require a dedicated small computer server and its
own custom website.
To avoid the complexity of using single board computer we developed our own microcontroller
powered controller board. And instead of internet, we have used SMS of monitoring. But since
our microcontroller is very low on ability compare to a single board computer, our system
operation is only limited to notification of certain parameter via SMS and termination of mains
power supply when needed. We also had to remove end-user control feature.
1.6.2 MODEL CONCEPT
During the system design, ease of construction, ease of use and cost effectiveness is given top
priority. We intend to develop a home automation and security system that is low on cost for
construction as well as minimum operating cost as possible. Our intention is to develop a system
that is user friendly and requires no user manual to operate. Thus our system is based on SMS.
Because SMS is the most versatile and easy communication method in mobile communication,
requires basic handsets that are able to send and receive SMS; and almost anybody can grasp the
concept of SMS. To develop a home automation and security system, the system requires
auxiliary sensing equipment. So we considered the most common concern of a home owner.
According to our findings a home owner mostly concerned about respectively, intruder or
trespasser, fire, temperature and humidity of the house. Hence we choose four sensors that are
related to these factors and they are – PIR based motion sensor, gas detector, temperature and
humidity sensor.
9
1.6.3 SELECTION PROCESS
At the beginning of the selection process, access to system status via SMS and internet are both
thoroughly revised and SMS is selected for the ease of construction and use. At the second phase
of the selection process, selection of microcontroller is considered. There are three ranges of
microcontroller are available and they are, Base Line, Mid-Range and High-End microcontroller.
In our project we needed ADC module (analog-to-digital converter), UART module and general
input-output option. But in a Base Line controller all these module are not available. Although
High-End controller provides this features but the devices are expensive. On the other hand Mid-
Range controller provides all of these modules in reasonable cost. Hence we selected Mid-Range
controller (PIC16F877A).In third phase of our selection process, we needed to select those
sensors which parameters are used in our daily life. Hence we select four types of sensors and
they are: Temperature, Humidity, Gas and Motion sensor. In the final phase of selection of
hardware, we had to decide which type of sensor is to be used. There are two types of sensor,
analog and digital. Digital sensor provides low percentage of error, but they are expensive and
cannot be easily found. Analog sensors require a time consuming calibration and they are error
prone. But they are low on cost. Hence we selected analog type sensors for our project.
1.6.4 MODEL DEVELOPMENT
After selecting appropriate hardware for the project, we developed a virtual system using Proteus
8.1 EDA (Electronic Design Automation). A Computer-aided design or CAD software helps to
remove any type design error before actual hardware are assembled. It also helps a designer to
keep track of how much a system draws power. After testing the virtual system we used EAGLE
(Easily Applicable Graphical Layout Editor) CAD to design the custom PCB for the project.
10
PLATFORMSELECTION
•Message Base,or,
•InternetBase.
MICROCNTROLLER
SELECTION
•Base Line (PIC10- 12 Series)
•Mid-Range(PIC16Series),or,
•High-End(PIC18-24 Series)
SENSORSELECTION
•Temperatur
•Humidity
•Gas
•Passive Infrared(PIRmotionsensor)
SENSORTYPE SELECTION
•Analog,or,
•Digital.
Figure 3 Selection Process
11
1.6.5 TESTING
This project is implemented with all the sensors along with LCD display, connected to the
microcontroller individually for testing and calibration on a BREADBOARD. The
microcontroller is then interfaced with a GSM modem and tested for sending SMS on the same
BREADBOARD. Whenever a sensor status was updated, the microcontroller updated the status
on the LCD display and if needed sends a status SMS to a predefined number successfully.
1.6.6 VARIFICATION
At first we connected all the devices. When power was supplied, a “Beep” sound from the buzzer
ensures that the system is on. We are able to observe the system status on a LCD display where
temperature, relative humidity, gas and motion sensor status are shown. We change the
temperature and humidity by heating up the sensor and change of status was displayed on the
LCD. Again we triggered both smoke and motion sensor separately and a SMS was sent for each
sensors status, in a cell phone in our hand.
1.6.7 IMPLMENTATION
After several testing and verification, the components are soldered on a custom etched PCB.
GSM modem is connected with project circuit board with jumper wires.
1.7 OUTLINE OF THE THESIS
This thesis is organized in such a way that it can be effectively helpful for any other to work with
any Message based home automation system. Towards this goal the project has divided in
several sections-
 In Chapter One, we have described the aspect of the project in practical life. Also we
tried to describe a short idea about what we are trying to implement.
 In Chapter Two, we have described the importance of microcontroller, its architecture,
and peripherals.
 In Chapter Three, we have described about sensors, working principle of sensors, its
types and construction.
 In Chapter Four, we have described about the basic network structure of GSM network
and SMS.
 In Chapter Five, we have described about the AT command, for interfacing a GSM
module with microcontroller.
 In Chapter Six, we tried to make an overall familiarization of all the hardware and
software to incorporate to implement these projects.
 In Chapter Seven, we have described the algorithm, designing procedure and
implementation of the project.
 In Chapter Eight, we have described the future aspect of the project, its application and
overall conclusion.
 In Appendix A, we provided the source code of the project.
12
CHAPTER 2
INTRODUCTIONTO MICROCONTROLLER
2.1 INTRODUCTION
The term microcomputer is used to describe a system that includes at minimum a
microprocessor, program memory, data memory, and an input-output (I/O) device. Some
microcomputer systems include additional components such as timers, counters, and
analog-to-digital converters. Thus, a microcomputer system can be anything from a large
computer having hard disks, floppy disks, and printers to a single-chip embedded
controller.
Here we are going to consider only the type of microcomputers that consist of a single
silicon chip. Such microcomputer systems are also called microcontrollers, and they are
used in many household goods such as microwave ovens, TV remote control units,
cookers, hi-fi equipment, CD players, personal computers, and refrigerators. Many
different microcontrollers are available on the market. Here we shall be looking at
programming and system design for the PIC (programmable interface controller) series of
microcontrollers manufactured by Microchip Technology Inc. [6]
2.2 MICROCONTROLLER SYSTEMS
A microcontroller is a single-chip computer. Micro suggests that the device is small, and
controller suggests that it is used in control applications. Another term for microcontroller is
embedded controller, since most of the microcontrollers are built into (or embedded in) the
devices they control. A microprocessor differs from a microcontroller in a number of ways.
The main distinction is that a microprocessor requires several other components for its
operation, such as program memory and data memory, input-output devices, and an external
clock circuit. A microcontroller, on the other hand, has all the support chips incorporated inside
its single chip. All microcontrollers operate on a set of instructions (or the user program) stored
in their memory. A microcontroller fetches the instructions from its program memory one by
one, decodes these instructions, and then carries out the required operations.
Figure 4 Microprocessor vs.Microcontroller
13
Microcontrollers have traditionally been programmed using the assembly language of the target
device. Although the assembly language is fast, it has several disadvantages. An assembly
program consists of mnemonics, which makes learning and maintaining a program written
using the assembly language difficult. Also, microcontrollers manufactured by different firms
have different assembly languages, so the user must learn a new language with every new
microcontroller he or she uses.
Microcontrollers can also be programmed using a high-level language, such as mikroC by
MikroElektronika Inc., CCS C by Custom Computer Services, Inc., Keil Compiler by Keil
Elektronik etc. High-level languages are much easier to learn than assembly languages. They
also facilitate the development of large and complex programs.
In theory, a single chip is sufficient to have a running microcontroller system. In practical
applications, however, additional components may be required so the microcomputer can
interface with its environment. With the advent of the PIC family of microcontrollers the
development time of an electronic project has been reduced to several hours.
Basically, a microcomputer executes a user program which is loaded in its program memory.
Under the control of this program, data is received from external devices (inputs), manipulated,
and then sent to external devices (outputs). For example, in a microcontroller-based oven
temperature control system the microcomputer reads the temperature using a temperature
sensor and then operates a heater or a fan to keep the temperature at the required value.
A microcontroller is a very powerful tool that allows a designer to create sophisticated input-
output data manipulation under program control. Microcontrollers are classified by the number
of bits they process. Microcontrollers with 8 bits are the most popular and are used in most
microcontroller-based applications. Microcontrollers with 16 and 32 bits are much more
powerful, but are usually more expensive and not required in most small or medium-size
general purpose applications that call for microcontrollers.
The simplest microcontroller architecture consists of a microprocessor, memory, and input-
output. The microprocessor consists of a central processing unit (CPU) and a control unit (CU).
The CPU is the brain of the microcontroller; this is where all the arithmetic and logic
operations are performed. The CU controls the internal operations of the microprocessor and
sends signals to other parts of the microcontroller to carry out the required instructions.
Memory, an important part of a microcontroller system, can be classified into two types:
program memory and data memory. Program memory stores the program written by the
programmer and is usually nonvolatile (i.e., data is not lost after the power is turned off). Data
memory stores the temporary data used in a program and is usually volatile (i.e., data is lost
after the power is turned off). [6]
There are basically six types of memories, summarized as follows:
14
2.2.1 RAM
RAM, random access memory, is a general purpose memory that usually stores the user data in
a program. RAM memory is volatile in the sense that it cannot retain data in the absence of
power (i.e., data is lost after the power is turned off). Most microcontrollers have some amount
of internal RAM, 256 bytes being a common amount, although some microcontrollers have
more, some less. The PIC18F452 microcontroller, for example, has 1536 bytes of RAM.
Memory can usually be extended by adding external memory chips. [6]
2.2.2 ROM
ROM, read only memory, usually holds program or fixed user data. ROM is nonvolatile. If
power is removed from ROM and then reapplied, the original data will still be there. ROM
memory is programmed during the manufacturing process, and the user cannot change its
contents. ROM memory is only useful if we have developed a program and wish to create
several thousand copies of it. [6]
2.2.4 PROM
PROM, programmable read only memory, is a type of ROM that can be programmed in the
field, often by the end user, using a device called a PROM programmer. Once a PROM has
been programmed, its contents cannot be changed. PROMs are usually used in low production
applications where only a few such memories are required. [6]
2.2.4 EPROM
EPROM, erasable programmable read only memory, is similar to ROM, but EPROM can be
programmed using a suitable programming device. An EPROM memory has a small clear-glass
window on top of the chip where the data can be erased under strong ultraviolet light. Once the
memory is programmed, the window can be covered with dark tape to prevent accidental
erasure of the data. An EPROM memory must be erased before it can be reprogrammed. Many
developmental versions of microcontrollers are manufactured with EPROM memories where
the user program can be stored. These memories are erased and reprogrammed until the user is
satisfied with the program. Some versions of EPROMs, known as OTP (one time
programmable), can be programmed using a suitable programmer device but cannot be erased.
OTP memories cost much less than EPROMs. OTP is useful after a project has been developed
completely and many copies of the program memory must be made. [6]
2.2.5 EEPROM
EEPROM, electrically erasable programmable read only memory, is a nonvolatile memory that
can be erased and reprogrammed using a suitable programming device. EEPROMs are used to
save configuration information, maximum and minimum values, identification data, etc. Some
microcontrollers have built-in EEPROM memories. For instance, the PIC18F452 contains a
256-byte EEPROM memory where each byte can be programmed and erased directly by
15
applications software. EEPROM memories are usually very slow. An EEPROM chip is much
costlier than an EPROM chip. [6]
2.2.6 FLASH EEPROM
Flash EEPROM, a version of EEPROM memory, has become popular in microcontroller
applications and is used to store the user program. Flash EEPROM is nonvolatile and usually
very fast. The data can be erased and then reprogrammed using a suitable programming device.
Some microcontrollers have only 1K flash EEPROM while others have 32K or more. The
PIC18F452 microcontroller has 32K bytes of flash memory. [6]
2. 3 MICROCONTROLLER ARCHITECHTURE
Two types of architectures are conventional in microcontrollers. Von Neumann architecture,
used by a large percentage of microcontrollers, places all memory space on the same bus;
instruction and data also use the same bus.
In Harvard architecture (used by PIC microcontrollers), code and data are on separate buses,
which allows them to be fetched simultaneously, resulting in an improved performance. [6]
2.3.1 RISC and CISC
RISC (reduced instruction set computer) and CISC (complex instruction computer) refer to the
instruction set of a microcontroller. In an 8-bit RISC microcontroller, data is 8 bits wide but the
instruction words are more than 8 bits wide (usually 12, 14, or 16 bits) and the instructions
occupy one word in the program memory. Thus the instructions are fetched and executed in one
cycle, which improves performance.
In a CISC microcontroller, both data and instructions are 8 bits wide. CISC microcontrollers
usually have over two hundred instructions. Data and code are on the same bus and cannot be
fetched simultaneously. [6]
Figure 6 Von Neumann Architecture
Figure 5 Harvard Architecture
16
2.4 MICROCONTROLLER FEATURES
Microcontrollers from different manufacturers have different architectures and different
capabilities. Some may suit a particular application while others may be totally unsuitable for the
same application. The hardware features common to most microcontrollers are described in this
section.
2.4.1 SUPPLY VOLTAGE
Most microcontrollers operate with the standard logic voltage of 5V. Some microcontrollers can
operate at as low as 2.7V, and some will tolerate 6V without any problem. The manufacturer’s
data sheet will have information about the allowed limits of the power supply voltage.
PIC18F452 microcontrollers can operate with a power supply of 2V to 6.5V. Usually, a voltage
regulator circuit is used to obtain the required power supply voltage when the device is operated
from a mains adapter or batteries. For example, a 5V regulator is required if the microcontroller
is operated from a 5V supply using a 9V battery. [6]
2.4.2 THE CLOCK
All microcontrollers require a clock (or an oscillator) to operate, usually provided by external
timing devices connected to the microcontroller. In most cases, these external timing devices are
a crystal plus two small capacitors. In some cases they are resonators or an external resistor-
capacitor pair. Some microcontrollers have built-in timing circuits and do not require external
timing components. If an application is not time- sensitive, external or internal (if available)
resistor-capacitor timing components are the best option for their simplicity and low cost. An
instruction is executed by fetching it from the memory and then decoding it. This usually takes
several clock cycles and is known as the instruction cycle. In PIC microcontrollers, an instruction
cycle takes four clock periods. Thus the microcontroller operates at a clock rate that is one-
quarter of the actual oscillator frequency. [6]
The performance of a CPU in a microcontroller is normally determined by the frequency of an
oscillator crystal. Typically a crystal oscillator produces a fixed sine wave—the frequency
reference signal. Electronic circuitry translates that into a square wave at the same frequency for
digital electronics applications. The clock distribution network inside the CPU carries that clock
signal to all the components that need it. With each clock pulse, the CPU executes one
instruction set. The higher the clock pulse the higher the execution rate. For example – if we use
a CPU with a 20 MHz clock frequency, then it will execute an instruction in 0.05 microseconds
(since 𝑇 =
1
𝑓
, hence 𝑇 =
1
20×106 or 0.05µs). But if the same CPU is given an 8 MHz clock
frequency, then it will execute the same instruction in 12.5 microseconds (𝑇 =
1
8×106 or 12.5µs).
Usually most CPU in microcontroller’s complete one instruction with each clock pulse, but some
device requires up to 4 clock pulses to complete one instruction set, such as – PIC
microcontroller we used in our project requires 4 clock pulses to complete one instruction set.
17
But increased clock frequency will increase heat produce by the CPU in microcontroller, which
in turns increases the body temperature of the microcontroller, leading to failure of the device.
According to manufacturer datasheet increase of 1MHz clock frequency will increase 5°C
operating body temperature of the microcontroller per hour. Maximum operating temperature of
a PIC16F877A is 125°C. Using the following equation a safe operating temperature for the
microcontroller can be derived.
TB= TA+FOSC×5°C±2°C
Here, TB = total body temperature of the microcontroller
TA = ambient/room temperature
FOSC = oscillating frequency
Example: if the room temperature is 30C and 20MHz clock frequency, then according to stated
equation the body temperature of the microcontroller will be,
TB= 30+20×5°C±2°C
Or, TB= 30+100±2°C
Or, TB= 130±2°C
This exceeds the maximum operating temperature of the microcontroller. Again if the room
temperature is 30C and 8MHz clock frequency, then according to stated equation the body
temperature of the microcontroller will be,
TB= 30+8×5°C±2°C
Or, TB= 30+40±2°C
Or, TB= 70±2°C
And this is within the maximum operating range of the microcontroller. Hence, we used an
8MHz clock frequency, instead of 20MHz clock frequency. [10]
2.4.3 TIMERS
Timers are important parts of any microcontroller. A timer is basically a counter which is driven
from either an external clock pulse or the microcontroller’s internal oscillator. A timer can be 8
bits or 16 bits wide. Data can be loaded into a timer under program control, and the timer can be
stopped or started by program control. Most timers can be configured to generate an interrupt
when they reach a certain count (usually when they overflow). The user program can use an
interrupt to carry out accurate timing-related operations inside the microcontroller.
Microcontrollers in the PIC16F series have at least two timers. For example, the PIC16F877A
microcontroller has two built-in timers. Some microcontrollers offer capture and compare
facilities, where a timer value can be read when an external event occurs, or the timer value can
18
be compared to a preset value, and an interrupt is generated when this value is reached. Most
PIC16F microcontrollers have at least two capture and compare modules. [6]
2.4.4 WATCHDOG
Most microcontrollers have at least one watchdog facility. The watchdog is basically a timer that
is refreshed by the user program. Whenever the program fails to refresh the watchdog, a reset
occurs. The watchdog timer is used to detect a system problem, such as the program being in an
endless loop. This safety feature prevents runaway software and stops the microcontroller from
executing meaningless and unwanted code. Watchdog facilities are commonly used in real-time
systems where the successful termination of one or more activities must be checked regularly. [4]
2.4.5 RESET INPUT
A reset input is used to reset a microcontroller externally. Resetting puts the microcontroller into
a known state such that the program execution starts from address0 of the program memory. An
external reset action is usually achieved by connecting a push-button switch to the reset input.
When the switch is pressed, the microcontroller is reset. [6]
2.4.6 INTERRUPTS
Interrupts are an important concept in microcontrollers. An interrupt causes the microcontroller
to respond to external and internal (e.g., a timer) events very quickly. When an interrupt occurs,
the microcontroller leaves its normal flow of program execution and jumps to a special part of
the program known as the interrupt service routine (ISR). The program code inside the ISR is
executed, and upon return from the ISR the program resumes its normal flow of execution. The
ISR starts from a fixed address of the program memory sometimes known as the interrupt vector
address. Some microcontrollers with multi-interrupt features have just one interrupt vector
address, while others have unique interrupt vector addresses, one for each interrupt source.
Interrupts can be nested such that a new interrupt can suspend the execution of another interrupt.
Another important feature of multi-interrupt capability is that different interrupt sources can be
assigned different levels of priority. For example, the PIC18F series of microcontrollers has both
low-priority and high- priority interrupts levels. [6]
2.4.7 BROWN-OUT DETECTOR
Brown-out detectors, which are common in many microcontrollers, reset the microcontroller if
the supply voltage falls below a nominal value. These safety features can be employed to prevent
unpredictable operation at low voltages, especially to protect the contents of EEPROM-type
memories. [6]
19
2.4.8 ANALOG-TO-DIGITAL CONVERTER
An analog-to-digital converter (A/D) is used to convert an analog signal, such as voltage, to
digital form so a microcontroller can read and process it. Some microcontrollers have built-in
A/D converters. External A/D converter can also be connected to any type of microcontroller.
A/D converters are usually 8 to 10 bits, having 256 to 1024 quantization levels. Most PIC
microcontrollers with A/D features have multiplexed A/D converters which provide more than
one analog input channel. For example, the PIC18F452 microcontroller has 10-bit 8-channel A/D
converters. The A/D conversion process must be started by the user program and may take
several hundred microseconds to complete. A/D converters usually generate interrupts when a
conversion is complete so the user program can read the converted data quickly. A/D converters
are especially useful in control and monitoring applications, since most sensors (e.g., temperature
sensors, pressure sensors, force sensors, etc.) produce analog output voltages. [6]
2.4.9 SERIAL INPUT-OUTPUT
Serial communication (also called RS232 communication) enables a microcontroller to be
connected to another microcontroller or to a PC using a serial cable. Some microcontrollers have
built-in hardware called USART (universal synchronous- asynchronous receiver-transmitter) to
implement a serial communication interface. The user program can usually select the baud rate
and data format. If no serial input-output hardware is provided, it is easy to develop software to
implement serial data communication using any I/O pin of a microcontroller. The PIC18F series
of microcontrollers has built-in USART modules. Some microcontrollers (e.g., the PIC18F
series) incorporate SPI (serial peripheral interface) or I2C (integrated interconnect) hardware bus
interfaces. These enable a microcontroller to interface with other compatible devices easily. [6]
2.4.10 EEPROM DATA MEMORY
EEPROM-type data memory is also very common in many microcontrollers. The advantage of
an EEPROM memory is that the programmer can store nonvolatile data there and change this
data whenever required. For example, in a temperature monitoring application, the maximum
and minimum temperature readings can be stored in an EEPROM memory. If the power supply
is removed for any reason, the values of the latest readings are available in the EEPROM
memory. The PIC18F452 microcontroller has 256 bytes of EEPROM memory. Other members
of the PIC18F family have more EEPROM memory (e.g., the PIC18F6680 has 1024 bytes). The
mikroC language provides special instructions for reading and writing to the EEPROM memory
of a PIC microcontroller. [6]
2.4.11 LCD DRIVERS
LCD drivers enable a microcontroller to be connected to an external LCD display directly. These
drivers are not common since most of the functions they provide can be implemented in
software. For example, the PIC18F6490 microcontroller has a built-in LCD driver module. [6]
20
2.4.12 ANALOG COMPARATOR
Analog comparators are used where two analog voltages need to be compared. Although these
circuits are implemented in most high-end PIC microcontrollers, they are not common in other
microcontrollers. The PIC18F series of microcontrollers has built-in analog comparator modules.
[6]
2.4.13 REAL-TIME CLOCK
A real-time clock enables a microcontroller to receive absolute date and time information
continuously. Built-in real-time clocks are not common in most microcontrollers, since the same
function can easily be implemented by either a dedicated real-time clock chip or a program
written for this purpose. [6]
2.4.14 SLEEP MODE
Some microcontrollers (e.g., PICs) offer built-in sleep modes, where executing this instruction
stops the internal oscillator and reduces power consumption to an extremely low level. The sleep
mode’s main purpose is to conserve battery power when the microcontroller is not doing
anything useful. The microcontroller is usually woken up from sleep mode by an external reset
or a watchdog time-out. [6]
2.4.15 POWER-ON RESET
Some microcontrollers (e.g., PICs) have built-in power-on reset circuits which keep the
microcontroller in the reset state until all the internal circuitry has been initialized. This feature is
very useful, as it starts the microcontroller from a known state on power-up. An external reset
can also be provided, where the microcontroller is reset when an external button is pressed. [6]
2.5 PIC16F877A MICROCONTROLLER
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 – 20 MHz 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 other 28-pin or 40/44-pin
PIC16CXXX and PIC16FXXX microcontrollers
21
Peripheral Features:
 Timer0: 8-bit timer/counter with 8-bit prescaler
 Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via
external crystal/clock
 Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
 Two Capture, Compare, PWM modules
 Capture is 16-bit, max. resolution is 12.5 ns
 Compare is 16-bit, max. resolution is 200 ns
 PWM max. resolution is 10-bit
 Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C™
(Master/Slave)
 Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit
address detection
 Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls (40/44-pin
only)
 Brown-out detection circuitry for
 Brown-out Reset (BOR)
 10-bit, up to 8-channel Analog-to-Digital
 Converter (A/D)
Device
Program Memory
Data SRAM
(Bytes)
EEPROM
(Bytes) I/O
10-bit
A/D
(ch)
CCP
(PWM)
MSSP
USART
Timers
8/16-
bit
Comparators
Bytes
# Single
Word
Instructions
SPI
Master
I2
C
PIC16F877A 14.3K 8192 368 256 33 8 2 Yes Yes Yes 2/1 2
2.6 WHY SELECT PIC16F877A?
PIC16F877A has a operating range at DC 20MHz clock frequency. It has 386 bytes RAM and
vast 8192 single word instruction or 14.3Kbytes program memory. It also provides an ADC and
USART module. It also provides CCP, SPI, I2C Comparator and Timers module.
To implement our design we needed an ADC module to read sensors analog data and analyze.
To send SMS using a GSM Modem, we need an UART module to communicate with module.
That’s why we selected PIC16F877A microcontroller.
22
2.7 USED PIN IN OUR PROJECT
 PIN01 – it is Master Reset pin, it also used for power on reset feature where
microcontroller program cycle is reset and start from the beginning.
 PIN 02 – 0 5 – are part of the ADC module of the microcontroller, can be used as both
analog and digital input, and digital output.
 PIN 13 – 14 – used for receiving an external clock frequency using a crystal oscillator.
 PIN 11 – 32 – used for power supply to microcontroller, usually +5v.
 PIN 12 – 31 – used for grounding end to complete the circuit.
 PIN 25 – is connected to UART module of microcontroller, performs the transition of
data.
 PIN 26 – is connected to UART module of microcontroller, performs the receiving of
data.
23
CHAPTER 3
SENSOR
3.1 INTRODUCTION
A sensor is a device that measures a physical quantity and converts it into a signal which can be
read by an observer or by an (today mostly electronic) instrument. A sensor is a device, which
responds to an input quantity by generating a functionally related output usually in the form of an
electrical or optical signal. A sensor's sensitivity indicates how much the sensor's output changes
when the measured quantity changes.
A good sensor obeys the following rules:
 Is sensitive to the measured property only
 Is insensitive to any other property likely to be encountered in its application
 Does not influence the measured property
Ideal sensors are designed to be linear or linear to some simple mathematical function of the
measurement, typically logarithmic. The output of such a sensor is an analog signal and linearly
proportional to the value or simple function of the measured property. The sensitivity is then
defined as the ratio between output signal and measured property. [1]
3.2 TEMPERATURE SENSOR
A temperature is a numerical measure of hot and cold. Its measurement is by detection of heat
radiation, particle velocity, kinetic energy, or most commonly, by the bulk behavior of a
thermometric material. It may be calibrated in any of various temperature scales, Celsius,
Fahrenheit, Kelvin, etc. [3]
3.2.1 TEMPERATURE AND ITS MEASUREMENT
Simply speaking, temperature is the degree of hotness of the body which is a measure of the heat
content in the body. The problem to quantify the heat content of the body on a scale did not arise
until the invention of the Steam Engine. The curiosity of scientists to understand the behavior of
Figure 7 Temperature Sensor
24
water at different levels of heat contents gave rise to a formal and better laid out study. One of
the first references for ‘temperature’ dates back to 1760, when Joseph Black declared that
applying the same heat to different materials resulted in different temperatures. Years of rigorous
scientific study led to many theories ranging from the simple ‘Caloric’ concept, which treated
heat as a material substance which is exchanged among materials, to Carnot’s description of heat
as a form of energy (which laid the foundation of the first law of thermodynamics). However,
none of them satisfactorily explained the concept of temperature. It was Maxwell’s theory which
offered good reasoning into it. He defined temperature of a body as is its thermal property which
provides information about the energy content of the system. It is the measure of the average
kinetic energy (energy by virtue of motion) of the molecules of the substance and signifies a heat
potential due to which heat flows from higher temperature to lower temperature.
The word ‘temperature’ itself is said to be derived of the Latin word ‘tempera’ meaning
‘moderate or soften’. Moving along Maxwell’s line of thought, the velocity of molecules should
be the basis of selecting the value of temperature, with absolute heatlessness being a state where
the molecules are totally static. But, this measurement is not possible practically, and hence,
other manifestations of the effect of heat are utilized to measure temperature, for example, the
geometric expansion of materials. [3]
3.2.2 TYPES OF TEMPERATURE SENSORS
Temperature can be classified into following classes:
The classes of temperature sensors based on their mechanical property:
Contact Temperature Sensing: The sensor is brought into physical contact with the object to
be monitored. This method can be used with solids, liquids and gases. The sensors used for
measurement can vary from capillary bulb thermometers and bi-metal sensors to sensors that use
varying voltage signals or resistance values. [3]
Expansion Thermometers: These sensors use Bi-metallic strips which have different expansion
rates at a particular temperature. Thus, this difference of expansion can be translated into
temperature change using a mechanical pointer. Though not very accurate, these devices offer
the advantage of being portable. Low cost applications like time compensators in mechanical
clocks, thermostats where a higher temperature may open the contact as in heating control or
may close it like in refrigerators make use of bimetallic strips to open and close mechanical
switches which in turn control electrical switches like circuit breakers. [3]
Filled System Thermometers: These devices are filled with some substitute which expands or
contracts due to temperature change. They may be filled with mercury. However, as it is
considered to be an environmental hazard, organic liquid types may be used instead. These do
not require any electric power to operate and are stable even after repeated use. However, they
do not provide any kind of reading storage solution and also cannot make point measurements.
These find use in medical industry to measure body temperatures. [3]
25
The classes of temperature sensors based on their electrical property:
Voltage signal based sensors: Thermocouples are the main sensors of this category. The
underlying principle is the Seebeck effect. When two different metals or alloys are placed
together so as to form two junctions, a voltage is induced across the junctions when there is a
difference of temperatures between the junctions. These sensors are capable of detecting very
high temperatures (as high as 1700o), have a very simplistic design which makes them quite
robust to shock and vibration and can have almost immediate response to temperature changes.
They however provide localized temperature readings and need a cold junction compensation to
maintain the temperature gradient. Also, they are highly non-linear devices when compared to
other sensors and require extremely good algorithms on the part of the conditioning electronics
and processors to compensate for the non-linearity. Thermocouples find application in extremely
high temperature sensing applications, chemical reaction monitoring, metal cutting, gas
chromatography, sensing temperatures inside internal combustion engines etc. owing to their
wide temperature range and ruggedness; however, if high accuracy and linearity are desired,
other temperature sensors must be used. Simple implementation ideas can be like the one in the
following: [3]
Resistance value based sensors: The resistance of metals and semiconductors offered to the
flow of current through them changes with temperature. This change can be monitored and
mapped to various temperature values on a scale. Further, on increasing the temperature, the
value of resistance may increase or decrease. Substances with a positive temperature coefficient
like most metals undergo a positive change of resistance with increasing temperature, while
resistance of most semiconductors decreases with increasing temperature owing to their negative
temperature coefficients. Based on the temperature coefficients, the Resistance Temperature
Detectors (RTD) can be further divided into two types: [3]
Figure 8 Circuit Diagram of Voltage Signal based Sensor
26
Resistance Wire: Mainly built with materials with positive resistance coefficient materials like
platinum, RTDs are resistive elements which exhibit predictable change in resistance with
temperature. The change of Resistance with temperature is given by the relation:
Here, Rt and Ro are the resistance of the material at temperatures t and to ºC; and α is the Average
temperature Coefficient. These devices may be in the forms of Thin Film Resistors or Wire-
wounded Resistors. They offer a very wide linear range of temperature measurement (-200 to
650oC) and are very stable with minimal drift even with repeated operation year after year. The
signal output is quite large as compared to thermocouples, and can use ordinary copper wires for
extension. Also, these can be spread over a large area. Such sensors may be mounted on one arm
of a balanced Wheatstone bridge circuit as shown in the figure below and the entire circuit be
used to calculate and also control actuators for maintenance of temperature using feedback. They
provide the desired linear range of operation where thermocouples fall short. RTDs find use in
applications like cold junction compensation, calibration purposes, in a wheat stone bridge
circuit and process control. The linearity simplifies the implementation of signal conditioning
circuitry and makes RTDs suitable for high precision applications. RTDs measure absolute
temperature in contrast with the thermocouples, and hence, might not be suitable for maintaining
uniform temperature throughout the surface like the thermocouples are used. [3]
Thermistor: Semiconductors offer a variety of phenomenon and form the very basis of
electronics. Both Positive (PTC) and Negative Temperature Coefficient (NTC) semiconductors
are present and sensors based on them are differentiated as cold-wire PTC-Thermistor and hot-
wire NTC-Thermistor. For PTC-Thermistor, Ferro electricity is the predominant phenomenon
causing the positive coefficient in a short range of temperature. The short temperature range of
operation for these materials makes them suitable for use as temperature limiting switches. They
have been used successfully in CRT monitors as timers in degaussing coils. They can be used as
replacements for fuses in the form of current limiting devices. If the current increases, more heat
is generated which heats up the Thermistor. This increases the resistance which reduces the
current and voltage available to the device thus protecting it from increased currents. For NTC-
Thermistor, the relation between resistance and temperature is negative and exponential which is
very repeatable. In the range of use, this exponential curve can be seen as a fairly linear plot and
Figure 9 RTD Circuit Diagram
27
can even provide more sensitivity than RTDs which makes them more attractive in terms of
accuracy in measurements.
Owing to their low costs, they find ample use in automotive and consumer products industries
like coolant and oil temperature monitors, incubator temperature maintenance, low temperature
thermometers, modern digital thermostats, battery pack temperature monitors etc. A more recent
application where NTC Thermistor have been used is 3D printing, where Thermistor are used to
maintain a constant temperature at the hot end of 3D printers for the proper melting of plastic
filaments. [3]
Integrated Silicon Temperature Sensors: Besides all these classifications, integrated circuits
have been designed to provide ease of use while measuring temperatures in the desired scale. For
example, the LM35 IC from Texas Instruments is a precision temperature sensor IC that offers
reading directly on the Celsius scale and LM34 is another one offering readings on the
Fahrenheit scale. These ICs provide Voltage readings which are directly proportional to a certain
multiplier of temperature and hence can be directly read off a multimeter, or fed directly into an
ADC for further processing. They provide easy integration and interfacing with other elements of
the circuit. Many semiconductor companies like Analog Devices, Microchip, Smartek, ZMD and
ST Microelectronics are into temperature sensors design and even provide signal processing
circuitry and digital I/O interfaces for microcontrollers. These temperature sensors find
widespread use in consumer products like personal computers, office electronics equipment,
cellular phones, HVACs and battery management solutions.
Apart from these major principles of temperature measurement, other methods have also been
developed. Some of them are, oscillating quartz temperature sensors, thermal noise
thermometers, fiber optic thermometers and temperature measurement systems. [3]
3.2.3 SELECTION CRITERIA OF TEMPERATURE SENSORS
None of the temperature sensing devices are versatile enough to be used everywhere. If the
thermocouples are known for their wide temperature range of operation, RTDs are unrivalled in
the linearity range and Thermistor is very accurate while the silicon sensors are easy to integrate
Figure 10 LM35 IC Temperature Sensor
28
in circuits. The use of a particular temperature sensor in some applications is governed by a
number of parameters, the most important being temperature itself. The temperature range for
the application, the rate at which the temperature may change, etc. help decide the type of design.
For example, for sensors with high operating temperatures, special connection leads would be
needed, while for sensors which have to deal with temperature shocks, wire-wound type of
construction is preferred.
The stability and accuracy of the sensor at the prescribed operating conditions is another major
factor to weigh while choosing design. Sensitivity of the device to measure small changes and
how prone it is to self heating, determines the reliability of the device and its performance. The
response time of the sensor is often governed by the size of the sensor. For example, the small
dimensions of a film type resistor based sensor result in minimal associated heat capacity and
hence, short response times (0.1 s in water and 3 to 6s in air). In the same application area, wire
type resistor would respond in 0.2 to 0.5s in water and 4 to 25s in air. To aid you in choosing the
right temperature sensor for your application, a comparison table of the 4 popular sensors is
drawn below for easy reference: [3]
Table 1 Comparison among Different Types of Temperature Sensor
Type Thermocouple RTD Thermistor Integrated Silicon
Temperature
Range
-270 - 1800°C -250 - 900°C -100 - 450°C -55 - 150°C
Accuracy ±0.5°C ±0.01°C ±0.1°C ±1°C
Linearity
(Minimum order of
polynomial, lesser
the better)
4th order
polynomial
2nd order
polynomial
3rd order polynomial Linearization not
required. Within ±1°C
Sensitivity ? 10µV/°C 0.00385 ?/?/°C
(Pt)
Several ?/ ?/°C -2mV/°C
Ruggedness Larger the gauge
of wire, more is
the ruggedness
Quite susceptible
to breakage due
to vibration
Hermetic
Thermistor housed
in glass,not affected
by shock or
vibration
As rugged as an IC in
plastic package like a
DIP.
Responsiveness
(test conditions)
Tres<1s 1s<Tres<10s 1s<Tres<5s 4s<Tres<60s
External Excitation
Required
None Current Source Voltage Source Supply Voltage
Output Voltage Resistance Resistance Digital/Current/Voltage
29
Apart from these considerations, the choice of contact or non-contact sensors is subject to
various other environmental conditions. While contact sensors may provide economical
measurements and are quite accurate, the need physical contact, which may lead to
contamination, wear and tear and heat sinking which alters the temperature to be measured. On
the other hand, non-contact sensing offers faster response and monitoring from a remote
location, but cannot measure gas temperatures and has ambient temperature restrictions which
may affect the readings. [3]
3.2.4 SENSOR WE USED & HOW DOES IT WORKS
For our project we have used a NTC Thermistor type temperature sensor. A NTC Thermistor is
typically a semiconductor, made from oxides of cobalt, copper, nickel, iron or titanium, pressed
into a small bead, disk or wafer. Varying the combinations of metal oxides and temperature to
which they are heated allows a range of temperature characteristics to be produced. NTC
Thermistor initially has a high resistance, which limits the current that can flow. However, power
is dissipated as heat, which raises the body heat of the Thermistor. This lowers the resistance of
the Thermistor and increases the current flow, which, in turn, increases the power dissipated.
This cycle continues until thermal equilibrium is reached.
3.3 HUMIDITY SENSOR
Humidity is the presence of water in air. The amount of water vapor in air can affect human
comfort as well as many manufacturing processes in industries. The presence of water vapor also
influences various physical, chemical, and biological processes. Humidity measurement in
industries is critical because it may affect the business cost of the product and the health and
safety of the personnel. Hence, humidity sensing is very important, especially in the control
systems for industrial processes and human comfort. [3]
Controlling or monitoring humidity is of paramount importance in many industrial & domestic
applications. In semiconductor industry, humidity or moisture levels needs to be properly
controlled & monitored during wafer processing. In medical applications, humidity control is
required for respiratory equipments, sterilizers, incubators, pharmaceutical processing, and
Figure 11 Humidity Sensor
30
biological products. Humidity control is also necessary in chemical gas purification, dryers,
ovens, film desiccation, paper and textile production, and food processing. In agriculture,
measurement of humidity is important for plantation protection (dew prevention), soil moisture
monitoring, etc. For domestic applications, humidity control is required for living environment in
buildings, cooking control for microwave ovens, etc. In all such applications and many others,
humidity sensors are employed to provide an indication of the moisture levels in the
environment. [3]
3.3.1 RELEVANT MOISTURE TERMS
To mention moisture levels, variety of terminologies are used. The study of water vapor
concentration in air as a function of temperature and pressure falls under the area of
psychometrics. Psychometrics deals with the thermodynamic properties of moist gases while the
term “humidity” simply refers to the presence of water vapor in air or other carrier gas. Humidity
measurement determines the amount of water vapor present in a gas that can be a mixture, such
as air, or a pure gas, such as nitrogen or argon. [3]
Various terms used to indicate moisture levels are tabulated in the table below:
Table 2 Measuring Terms of Humidity
S.N Term Definition Unit
1 Absolute Humidity
(Vapor Concentration)
Ratio of mass (vapor) to volume. grams/m3
2 Mixing Ratio OR
Mass Ratio
Ratio of mass(vapor) to mass(dry gas) grams/m3
3 Relative Humidity Ratio of mass (vapor) to mass (saturated vapor) OR ratio of actual
vapor pressure to saturation vapor pressure.
%
4 Specific Humidity Ratio of mass (vapor) to total mass. %
5 Dew Point Temperature(above 0°C) at which the water vapor in a gas condenses
to liquid water)
°C
6 Frost Point Temperature(below 0°C) at which the water vapor in a gas condenses
to ice
7 Volume Ratio Ratio of partial pressure(vapor) to partial pressure (dry gas) % by
volume
8 PPM by Volume Ratio of volume(vapor) X 106 to volume(dry gas)
PPMV
9 PPM by Weight PPMV X PPMW
Most commonly used units for humidity measurement are Relative Humidity (RH), Dew/Frost
point (D/F PT) and Parts per Million (PPM). RH is a function of temperature, and thus it is a
relative measurement. Dew/Frost point is a function of the pressure of the gas but is independent
of temperature and is therefore defined as absolute humidity measurement. PPM is also an
absolute measurement. Dew points and frost points are often used when the dryness of the gas is
important. Dew point is also used as an indicator of water vapor in high temperature processes,
such as industrial drying. Mixing ratios, volume percent, and specific humidity are usually used
31
when water vapor is either an impurity or a defined component of a process gas mixture used in
manufacturing. Correlation among RH, Dew/Frost point and PPMv is shown below: [3]
3.3.2 HUMIDITY SENSING – CLASSIFICATION & PRINCIPLES
According to the measurement units, humidity sensors are divided into two types: Relative
Humidity (RH) sensors and Absolute Humidity (moisture) sensors. Most humidity sensors are
relative humidity sensors and use different sensing principles. [3]
A table showing important parameters of different types of humidity sensors is given below:
Table 3 Comparison of Different Types Of Humidity Sensor
Active Material Thermo-set
Polymer
Thermoplastic
Polymer
Thermoplastic
Polymer
Bulk
Thermoplastic
Bulk
AlO3
Lithium
Chloride
Film
Substrate Ceramic or
Silicon
Ceramic or
silicon
Polyester or
Polymer film
N/A N/A Ceramic
Sensed Parameter Capacitance Capacitance Capacitance Resistance Resistance Conductivity
Measured
Parameter
%RH %RH %RH %RH %RH %RH
RH Change 0% to 100% 0% to 100% 0% to 100% 20% to 100% 2% to
90%
15% to
<100%
RH Accuracy ±1% to
±5%
±3% to ±5% ±3% to ±5% ±3% to ±10% ±1% to
±5%
±5%
Interchangeability ±2% to
±10% RH
±3% to
±20% RH
±3% to
±20% RH
±5% to
±25% RH
poor ±3% to
±10% RH
Hysteresis <1% to 3%
RH
2% to 5% RH 2% to 5% RH 3% to 6% RH <2% RH very poor
Linearity ±1% RH ±1% RH ±2% RH poor poor Very poor
Rise time 15 s to 60 s 15 s to 90 s 15 s to 90 s 2 min to 5 min 3 min to 5
min
3 min to 5
min
Temperature
Range
-40 °C to
185 °C
-30 °C to
190 °C
-25°C to
100 °C
10 °C to
40 °C
-10 °C to
75 °C
-
Figure 12 Correlation of Measuring Scale of Humidity
32
3.3.3 SENSING PRINCIPLE
Humidity measurement can be done using dry and wet bulb hygrometers, dew point
hygrometers, and electronic hygrometers. There has been a surge in the demand of electronic
hygrometers, often called humidity sensors. Electronic type hygrometers or humidity sensors can
be broadly divided into two categories: one employs capacitive sensing principle, while other
uses resistive effects. [3]
3.3.3.1 SENSORS BASED ON CAPACITIVE EFFECT
Humidity sensors relying on this principle consists of a hygroscopic dielectric material
sandwiched between a pair of electrodes forming a small capacitor. Most capacitive sensors use
a plastic or polymer as the dielectric material, with a typical dielectric constant ranging from 2 to
15. In absence of moisture, the dielectric constant of the hygroscopic dielectric material and the
sensor geometry determine the value of capacitance. At normal room temperature, the dielectric
constant of water vapor has a value of about 80, a value much larger than the constant of the
sensor dielectric material. Therefore, absorption of water vapor by the sensor results in an
increase in sensor capacitance. At equilibrium conditions, the amount of moisture present in a
hygroscopic material depends on both the ambient temperature and the ambient water vapor
pressure.
This is true also for the hygroscopic dielectric material used on the sensor. By definition, relative
humidity is a function of both the ambient temperature and water vapor pressure. Therefore there
is a relationship between relative humidity, the amount of moisture present in the sensor, and
sensor capacitance. This relationship governs the operation of a capacitive humidity instrument.
Basic structure of capacitive type humidity sensor is shown below: [3]
Figure 13 Types of Humidity Sensor
Figure 14 Capacitive Type Humidity Sensor
33
On Alumina substrate, lower electrode is formed using gold, platinum or other material. A
polymer layer such as PVA is deposited on the electrode. This layers senses humidity. On top of
this polymer film, gold layer is deposited which acts as top electrode. The top electrode also
allows water vapor to pass through it, into the sensing layer. The vapors enter or leave the
hygroscopic sensing layer until the vapor content is in equilibrium with the ambient air or gas.
Thus capacitive type sensor is basically a capacitor with humidity sensitive polymer film as the
dielectric. [3]
3.3.3.2 SENSORS BASED ON RESISTIVE EFFECT
Resistive type humidity sensors pick up changes in the resistance value of the sensor element in
response to the change in the humidity. Basic structure of resistive type humidity sensor from
TDK is shown below:
Thick film conductor of precious metals like gold, ruthenium oxide is printed and culminated in
the shape of the comb to form an electrode. Then a polymeric film is applied on the electrode;
the film acts as a humidity sensing film due to the existence of movable ions. Change in
impedance occurs due to the change in the number of movable ions. [3]
3.3.4 SENSOR WE USED & HOW DOES IT WORKS
To monitor humidity we have used a capacitive humidity sensor. A capacitive humidity sensor
gauges the humidity of the air relatively using a capacitor-based system. The sensor is made out
of a film usually made of either glass or ceramics. The insulator material which absorbs the
water is made out of a polymer which takes in and releases water based on the relative humidity
of the given area. This changes the level of charge in the capacitor of the on board electrical
circuit. Capacitive humidity or electronic hygrometers, in general, control the temperature of a
surface based on electronic feedback and measure the resulting condensation. The hygrometer
reads the air temperature and adjusts the surface temperature of a sensor until condensation
forms and can be measured. Capacitive hygrometers measure condensation by running an
alternating current between two plates to test capacitance, which is the ability of something to
hold an electrical charge. As the presence of water increases, the ability to hold a charge also
increases.
Figure 15 Resistive Type Humidity Sensor
34
3.4 GAS DETECTOR
A gas detector is a device which detects the presence of various gases within an area, often as
part of a safety system. This type of equipment is used to detect a gas leak and interface with a
control system so a process can be automatically shut down.
Gas detectors can be classified according to the operation mechanism (semiconductors,
electrochemical, ultrasonic etc.). [3]
3.4.1 ELECTROCHEMICAL GAS DETECTOR
Electrochemical gas detectors work by allowing gases to diffuse through a porous membrane to
an electrode where it is either chemically oxidized or reduced. The amount of current produced is
determined by how much of the gas is oxidized at the electrode, indicating the concentration of
the gas. Manufactures can customize electrochemical gas detectors by changing the porous
barrier to allow for the detection of a certain gas concentration range. Also, since the diffusion
barrier is a physical/mechanical barrier, the detector tended to be more stable and reliable over
the sensor's duration and thus required less maintenance than other early detector technologies.
However, the sensors themselves are subject to corrosive elements or chemical contamination,
and may last only 1–2 years before a replacement is required. Electrochemical gas detectors are
used in a wide variety of environments such as refineries, gas turbines, chemical plants,
underground gas storage facilities, and more. [1]
3.4.2 SEMICONDUCTOR GAS DETECTOR
Semiconductor sensors detect gases by a chemical reaction that takes place when the gas comes
in direct contact with the sensor. Tin dioxide (TiO2) is the most common material used in
semiconductor sensors, and the electrical resistance in the sensor is decreased when it comes in
contact with the monitored gas. The resistance of the Tin dioxide (TiO2) is typically around 50
kΩ in air but can drop to around 3.5 kΩ in the presence of 1% methane. This change in
resistance is used to calculate the gas concentration. Semiconductor sensors are commonly used
to detect hydrogen, oxygen, alcohol vapor, and harmful gases such as Carbon Monoxide. One of
the most common uses for semiconductor sensors is in carbon monoxide sensors. They are also
Figure 16 Capacitive Humidity Sensor
35
used in Breathalyzers. Because the sensor must come in contact with the gas in order to detect it,
semiconductor sensors work over a smaller distance than infrared point or ultrasonic detectors. [1]
3.4.3 ULTRASONIC GAS DETECTOR
Ultrasonic gas detectors use acoustic sensors to detect changes in the background noise of its
environment. Since most high-pressure gas leaks generate sound in the ultrasonic range of
25 KHz to 10 MHz, the sensors are able to easily distinguish these frequencies from background
acoustic noise which occurs in the audible range of 20 Hz to 20 KHz. The ultrasonic gas leak
detector then produces an alarm when there is an ultrasonic deviation from the normal condition
of background noise. Despite the fact that ultrasonic gas leak detectors cannot measure gas
concentration, the device is still able to determine the leak rate of an escaping gas because the
ultrasonic sound level depends on the gas pressure and size of the leak. Ultrasonic gas detectors
are mainly used for remote sensing in outdoor environments where weather conditions can easily
dissipate escaping gas before allowing it to reach gas leak detectors that require contact with the
gas in order to detect it and sound an alarm. These detectors are commonly found on offshore
and onshore oil/gas platforms, gas compressor and metering stations, gas turbine power plants,
and other facilities that house a lot of outdoor pipeline.
Gas detectors can be used to detect combustible, flammable and toxic gases, and oxygen
depletion. This type of device is used widely in industry and can be found in a variety of
locations such as on oil rigs, to monitor manufacture processes and emerging technologies such
as photovoltaic. [1]
3.4.4 SENSOR WE USED & HOW DOES IT WORKS
For this project we have used a semiconductor gas detector. When a gas interacts with this
sensor, it is first ionized into its constituents and is then adsorbed by the sensing element. This
absorption creates a potential difference on the element.
The gas detecting module consists of a steel exoskeleton under which a sensing element is
housed. This detecting element is subjected to current through connecting leads. This current is
known as heating current through it; the gases coming close to the sensing element get ionized
and are absorbed by the sensing element. This changes the resistance of the sensing element
which alters the value of the current going out of it.
Figure 17 MQ - 9 Gas Detector
36
Figure 17 shows externals of a standard gas sensor module: A Steel Mesh, Copper Clamping
Ring and Connecting Leads. The top part is a stainless steel mesh which takes care of the
following:
 Filtering out the suspended particles so that only gaseous elements are able to pass to insides
of the sensor.
 Protecting the insides of the sensor.
 Exhibits an anti explosion network that keeps the sensor module intact at high temperatures
and gas pressures.
In order to manage above listed functions efficiently, the steel mesh is made into two layers. The
mesh is bound to rest of the body via a copper plated clamping ring.
The connecting leads of the sensor are thick so that sensor can be connected firmly to the circuit
and sufficient amount of heat gets conducted to the inside part. They are casted from copper and
have tin plating over them. Four of the six leads are for signal fetching while two are used to
provide sufficient heat to the sensing element.
The pins are placed on a Bakelite base which is a good insulator and provides firm gripping to
the connecting leads of the sensor.
Figure 18 External structure of MQ-9 Gas Detector
Figure 19 Steel Mesh of MQ-9 Gas Detector
37
The top of the gas sensor is removed off to see the internals parts of the sensor: Sensing Element
and Connection Wiring. The hexapod structure is constituted by the sensing element and six
connecting legs that extend beyond the Bakelite base.
Figure 20 shows the hollow sensing element which is made up from Aluminum Oxide based
ceramic and has a coating of Tin Oxide. Using a ceramic substrate increases the heating
efficiency and Tin Oxide, being sensitive towards adsorbing desired gas’ components (in this
case methane and its products) suffices as sensing coating.
The leads responsible for heating the sensing element are connected through Nickel-Chromium,
well known conductive alloy. Leads responsible for output signals are connected using Platinum
wires which convey small changes in the current that passes through the sensing element. The
Platinum wires are connected to the body of the sensing element while Nickel-Chromium wires
pass through its hollow structure.
Figure 20 Internal Parts of the Sensor
Figure 21 MQ-9 Internal Element
Figure 22 Main Sensing Element
38
Figure 21 shows the ceramic with Tin Dioxide on the top coating that has good adsorbing
property. Any gas to be monitored has specific temperature at which it ionizes. The task of the
sensor is to work at the desired temperature so that gas molecules get ionized. Through Nickel-
chromium wire, the ceramic region of the sensing element is subjected to heating current. The
heat is radiated by the element in the nearby region where gases interact with it and get ionized.
Once, ionized, they are absorbed by the tin dioxide. Adsorbed molecules change the resistance of
the tin dioxide layer. This changes the current flowing through the sensing element and is
conveyed through the output leads to the unit that controls the working of the gas sensor. [3]
3.5 PIR SENSOR
Infrared sensors can be classified as Active Infrared Sensors and Passive Infrared Sensors. Both
of them use the same infrared rays and same underlying physics. However, the only difference
between the two is that, active infrared sensors employ infrared source (an active element) in
addition to infrared detector. [3]
Active infrared sensors operate by transmitting energy from either a light emitting diode (LED)
or a laser diode. An LED is used for a non-imaging active IR detector, and a laser diode is used
for an imaging active IR detector. In both types of these, the LED or laser diode illuminates the
target, and the reflected energy is focused onto a detector consisting of a pixel or an array of
pixels. Photoelectric cells, Photodiode or phototransistors are generally used as detectors.
Contrary to Active Infrared sensors, Passive Infrared sensors do not contain any source of
infrared radiation, they simply detect IR radiations. They totally rely on the three governing laws
explained earlier.
A passive infrared system detects energy emitted by objects in the field of view and may use
signal-processing algorithms to extract the desired information. It does not emit any energy of its
own for the purposes of detection.
Humans at normal body temperature radiate quite strongly in the infrared region at a wavelength
around 10 µm. Passive infrared sensors convert the infrared signal to current or voltage.
Accordingly, they are used to detect presence, occupancy, and count. Primarily used for intrusion
detection, passive infrared sensor as used as a special purpose radiometer which detects the heat
emitted by the body of an intruder. It offers high probability of detection within a defined area
even without responding to anything else. Its presence is hard to detect which is not the case with
active infrared sensors, ultrasonic detectors and the like. Passive Infra-Red Sensors were
originally being used for military and scientific applications. Nowadays they can be seen in a
wide range of commercial products for automatic light control, safety, cost-savings, etc. Almost
any region where people occasionally walk or move through and need not be continuously lit,
could be benefitted from the installation of a PIR sensor. Some examples are hallways, foyers,
paths, driveways, garden areas and car parking’s. [3]
39
3.5.1 PASSIVE INFRARED DETECTORS: CLASSIFICATION
Passive Infrared detectors primarily are of two types: Thermal & Quantum. In the PIR sensors
used for human/pets detection for automatic lighting systems, intrusion detection, etc. thermal
type- Pyroelectric based PIR sensors are used. Types of PIR detectors are explained below: [3]
3.5.2.1 THERMAL PIRs
Thermal type has no wavelength dependence. They use the infrared energy as heat and their
photosensitivity is independent of wavelength. Thermal detectors don’t require cooling but have
disadvantages that response time is slow & detection time is low. [3]
Types of Thermal type PIR detectors are:
THERMOCOUPLE-THERMOPILE
Thermocouple uses Seebeck effect, one of the thermoelectric effects and is a detector that
converts temperature into an electrical signal. The junction of dissimilar metals generates a
voltage potential, which is directly proportional to the temperature. This junction can be made
into multiple junctions to improve sensitivity. Such a configuration is called a thermopile. Thus,
a thermopile is nothing but a junction of thermocouples connected in series.
The active or ‘Hot’ junctions are blackened to efficiently absorb radiation. The reference or
‘Cold’ junctions are maintained at the ambient temperature of the detector. The absorption of
radiation by the blackened area causes a rise in temperature in the ‘hot’ junctions as compared to
the ‘cold’ junctions of the thermopile. This difference in temperature between the active junction
and a reference junction kept at a fixed temperature produces an electric potential which is
directly proportional to the differential temperature created.
Figure 23 Working Principle of Thermocouple-Thermopile PIR Sensor
Figure 24 Thermocouple-Thermopile PIR Sensor
40
These detectors has a relatively slow response time, but offers the advantages of DC stability,
requiring no bias, and responding to all wavelengths. [3]
BOLOMETER
A bolometer is a simple thermal or total power detector. A bolometer changes resistance when
incident infrared radiation interacts with the detector. Therefore, sensing material used for
bolometer should have very high temperature coefficient of resistance; superconductor is an ideal
candidate for sensing temperature in a bolometer. Typically, thermally sensitive semiconductor
is made of a sintered metal oxide material. It has a high temperature coefficient of resistance.
It consists of two main elements: a sensitive thermometer and a high cross section absorber. The
absorber is connected by a weak thermal link to a heat sink (at temperature T0). Incoming energy
falls upon the absorber. Incoming energy is converted to heat in the absorber. Temperature of the
absorber changes depending upon the changes in the power of incoming energy. Bolometer
works by measuring this change in temperature. [3]
PYROELECTRIC DETECTOR
Pyroelectric detectors use PZT having pyroelectic effect, a high resistor and a low noise FET,
hermetically sealed in a package. Pyroelectric materials are crystals, such as lithium tantalate,
which exhibit spontaneous polarization, or a concentrated electric charge that is temperature
dependent.PZT is spontaneously polarized in dark state. As infrared radiation strikes the detector
surface, the change in temperature causes a current to flow. This results in change of polarization
state which is reflected in terms of voltage change at the output.
Figure 25 Working Principle of Bolometer
Figure 26 Pyroelectric Detector
41
This detector exhibits good sensitivity and good response to a wide range of wavelengths, and
does not require cooling of the detector.
While thermopiles are proportional to incident radiations, pyroelectric detectors are proportional
to rate of change of incident radiation. Thus, pyroelectric detectors are AC coupled devices.
Also, pyroelectric detectors have very high impedance and hence require a buffer. [3]
3.5.2.2 QUANTUM TYPE PIRs
Quantum type offer higher detection performance and a faster response speed although their
photosensitivity is wavelength dependant. Quantum type detectors require cooling for accurate
measurements (except for those in near IR region). [3]
PHOTOCONDUCTIVE
Photoconductive type of IR detectors makes use of photoconductive effect. This effect causes
change in resistance when IR radiation falls upon detecting elements. [3]
Examples are PbS, PbSe, MCT (HgCdTe)
Band gap of PbS, PbSe have negative temperature coefficient and hence their spectral response
characteristics shift to long wavelength region when cooled. However, band gap of HgCdTe
depends upon the composition and therefore, spectral response characteristics can be tailored to
suit the requirements.
PHOTOVOLTAIC
Photoconductive type of IR detectors makes use of photovoltaic effect. Incident IR light cause
increase in voltage output of these detectors. [3]
Examples are InGaAs PIN photodiodes, InAs, InSb
EXTRINSIC TYPE
Various types of detectors like Ge: Au, Ge:Hg, Ge:Cu, Ge:Zn, Si:Ga, Si:As and are used
depending upon the required application- spectral response, D*(Photosensitivity per unit area of
the detector), etc. [3]
3.5.2 SENSOR WE USED & HOW DOES IT WORKS
Figure 27 PIR Sensor Circuit
42
For this project we have used a pyroelectric type passive infrared (PIR) based motion sensor. A
PIR sensor is made of ceramic material that generates surface charge when exposed to infrared
radiations. As the amount of radiation increases, the surface charge generated increases. A FET
is used to buffer this signal. As the sensor is sensitive to a wide range of radiations, a filter is
used which limits the infrared rays falling on the sensor to 8µm-14µm range. Thus the output of
an IR sensor is a function of infrared radiation. But since the output is affected by vibration,
radio interference, sunlight, etc. as well, dual sensing elements are used. Both sensors are
connected out of phase such that any excitation common to both gets cancelled out.
The field of view of these sensors is the area or zone which it sees or where changes in the infra-
red radiation can be sensed or detected. Typically, to enhance the range and field of view, the
field of view is divided into number of zones (both vertically as well as horizontally) with the
help of Fresnel Lens; a Fresnel lens is a Plano convex lens that is collapsed on itself to form a
flat lens which retains its optical properties, but is thinner and has lesser absorption losses.
Fresnel lens focuses the infra-red radiation emitted by an infrared source onto the PIR detector.
After the light falls upon the PIR sensor, an electrical signal corresponding to the varying amount
of infra red radiations is generated.
All PIR sensors detect changes in infra-red radiation; infrared radiations in the form of heat
emitted by the bodies including human beings, vehicles, etc. Bigger is the body more is the infra-
red radiation and it becomes easier for the PIR sensor to detect them.
In most of the applications, passive infrared sensors look for the change in the environment. The
sensors are sensitive to changes in infrared energy rather than absolute levels. The sensor first
sets up equilibrium with the background conditions. If the state equilibrium is disturbed due to
some intrusion or by some other mechanism, it perceives it as a change. This change is
fundamental to the operation of PIR sensors.
Figure 28 Fresnel Lance
43
By dividing the region into a number of zones, numbers of separated zones are created. A person
while walking through the area will appear in one zone, then disappear and then reappear in the
next zone and so on. By doing so, he modulates the reference equilibrium conditions; the process
is referred to as chopping. The signal produced is proportional to the temperature difference
between the intruder and the background.
When a person enters into a particular zone, infra-red level in that zone increases. The increase in
the infra-red energy level is detected. The dual elements are excited one after another; resultant
output is a positive signal followed by negative signal. In this way, movement of a person is the
field of view of the sensor can be detected. However, if the person moves within a zone, it is not
possible to detect the changes. [3]
Figure 29 Operation of a PIR Sensor
44
CHAPTER 4
GSM NETWORK& SMS
4.1 INTRODUCTION
GSM (Global System for Mobile Communications, originally Groupe Spécial Mobile), is a
standard developed by the European Telecommunications Standards Institute (ETSI) to describe
protocols for second generation (2G) digital cellular networks used by mobile phones. It is the
defacto global standard for mobile communications with over 90% market share, and is available
in over 219 countries and territories.
The GSM standard was developed as a replacement for first generation (1G) analog cellular
networks, and originally described a digital, circuit-switched network optimized for full duplex
voice telephony. This was expanded over time to include data communications, first by circuit-
switched transport, then packet data transport via GPRS (General Packet Radio Services) and
EDGE (Enhanced Data rates for GSM Evolution or EGPRS). [1]
4.2 GSM NETWORK
The heart of the GSM network includes the following systems to operate wireless services:
 Base station subsystem,
 GSM carrier frequencies,
 Subscriber identity module.
4.2.1 BASE STATION SUBSYSTEM
GSM is a cellular network, which means that cell phones connect to it by searching for cells in
the immediate vicinity. There are five different cell sizes in a GSM network—macro, micro,
pico, femto, and umbrella cells. The coverage area of each cell varies according to the
implementation environment. Macro cells can be regarded as cells where the base station antenna
is installed on a mast or a building above average rooftop level. Micro cells are cells whose
antenna height is under average rooftop level; they are typically used in urban areas. Picocells
are small cells whose coverage diameter is a few dozen meters; they are mainly used indoors.
Femtocells are cells designed for use in residential or small business environments and connect
to the service provider’s network via a broadband internet connection. Umbrella cells are used to
cover shadowed regions of smaller cells and fill in gaps in coverage between those cells.
Cell horizontal radius varies depending on antenna height, antenna gain, and propagation
conditions from a couple of hundred meters to several tens of kilometers. The longest distance
the GSM specification supports in practical use is 35 kilometers (22 mi). There are also several
45
implementations of the concept of an extended cell, where the cell radius could be double or
even more, depending on the antenna system, the type of terrain, and the timing advance.
Indoor coverage is also supported by GSM and may be achieved by using an indoor Picocells
base station, or an indoor repeater with distributed indoor antennas fed through power splitters,
to deliver the radio signals from an antenna outdoors to the separate indoor distributed antenna
system. These are typically deployed when significant call capacity is needed indoors, like in
shopping centers or airports. However, this is not a prerequisite, since indoor coverage is also
provided by in-building penetration of the radio signals from any nearby cell. [1]
4.2.2 GSM CARRIER FREQUENCIES
GSM networks operate in a number of different carrier frequency ranges (separated into GSM
frequency ranges for 2G and UMTS frequency bands for 3G), with most 2G GSM networks
operating in the 900 MHz or 1800 MHz bands. Where these bands were already allocated, the
850 MHz and 1900 MHz bands were used instead (for example in Canada and the United
States). In rare cases the 400 and 450 MHz frequency bands are assigned in some countries
because they were previously used for first-generation systems.
Most 3G networks in Europe operate in the 2100 MHz frequency band. Regardless of the
frequency selected by an operator, it is divided into timeslots for individual phones. This allows
eight full-rate or sixteen half-rate speech channels per radio frequency. These eight radio
timeslots (or burst periods) are grouped into a TDMA frame. Half-rate channels use alternate
frames in the same timeslot. The channel data rate for all 8 channels is 270.833 Kbit/s, and the
frame duration is 4.615 ms.
The transmission power in the handset is limited to a maximum of 2 watts in GSM 850/900 and
1 watt in GSM 1800/1900. [1]
4.2.4 SUBSCRIBER IDENTITY MODULE (SIM)
One of the key features of GSM is the Subscriber Identity Module, commonly known as a SIM
card. The SIM is a detachable smart card containing the user's subscription information and
phone book. This allows the user to retain his or her information after switching handsets.
Alternatively, the user can also change operators while retaining the handset simply by changing
the SIM. Some operators will block this by allowing the phone to use only a single SIM, or only
a SIM issued by them; this practice is known as SIM locking. [1]
4.3 SMS (SHORT MESSAGE SERVICE)
Short message service is a mechanism of delivery of short messages over the mobile networks. It
is a store and forward way of transmitting messages to and from mobiles. The message (text
only) from the sending mobile is stored in a central short message center (SMC) which then
46
forwards it to the destination mobile. This means that in the case that the recipient is not
available; the short message is stored and can be sent later. Each short message can be no longer
than 160 characters. These characters can be text (alphanumeric) or binary Non-Text Short
messages. An interesting feature of SMS is return receipts. This means that the sender, if wishes,
can get a small message notifying if the short message was delivered to the intended recipient.
Since SMS used signaling channel as opposed to dedicated channels, these messages can be
sent/received simultaneously with the voice/data/fax service over a GSM network. SMS supports
national and international roaming. This means that we can send short messages to any other
GSM mobile user around the world. With the PCS networks based on all the three technologies,
GSM, CDMA and TDMA supporting SMS, SMS is more or less a universal mobile data service.
[4]
4.3.1 HOW DOES SMS WORK?
The figure below shows a typical organization of network elements in a GSM network
supporting SMS.
Figure 30 GSM network supporting SMS
The SMC (Short Message Center) is the entity which does the job of store and forward of
messages to and from the mobile station. The SME (Short Message Entity) which can be located
in the fixed network or a mobile station receives and sends short messages.
The SMS GW MSC (SMS gateway MSC) is a gateway MSC (Mobile Switching Center) that can
also receive short messages. The gateway MSC is a mobile network’s point of contact with other
networks. On receiving the short message from the short message center, GMSC uses the SS7
network to interrogate the current position of the mobile station form the HLR, the home location
register.
HLR (Home Location Register) is the main database in a mobile network. It holds information of
the subscription profile of the mobile and also about the routing information for the subscriber,
47
Sensor
Input
MCU
Converts
input into
string data
to form
SMS
MCU
Send
destination
number to
GSM
modem
MCU
Transmit
SMS to
GSM
modem
GSM
MODEM
GSM
network:
SMS
Gatway
Destination
Number
i.e. the area (covered by a MSC) where the mobile is currently situated. The GMSC is thus able
to pass on the message to the correct MSC.
MSC (Mobile Switching Center) is the entity in a GSM network which does the job of switching
connections between mobile stations or between mobile stations and the fixed network.
A VLR (Visitor Location Register) corresponds to each MSC and contains temporary information
about the mobile, information like mobile identification and the cell (or a group of cells) where
the mobile is currently situated. Using information from the VLR, the MSC is able to switch the
information (short message) to the corresponding BSS (Base Station System, BSC + BTSs),
which transmits the short message to the mobile. The BSS consists of transceivers, which send
and receive information over the air interface, to and from the mobile station. This information is
passed over the signaling channels so the mobile can receive messages even if a voice or data
call is going on. [4]
4.4 HOW WE IMPLEMENTED GSM NETWORK IN OUR PROJECT
GSM (Global System for Mobile Communication) is the most popular mobile communication
system around the world dominating over 90% of the total mobile communication market. GSM
service provider offers various types of services, which includes three main services and they are
voice call, short message service (SMS) and internet. GSM services can be gained by using a
mobile phone and GSM modem.
For our project we have used SMS as our remote monitoring feature for a user. In below we have
described the steps how we implemented the GSM network, in our project:
 In our project, the microcontroller collects and analyzes the information from the sensors.
 Then the microcontroller converts that information into a string of data to form a SMS.
 Next the microcontroller sends a destination number to the GSM modem, to set
destination for the SMS.
 Then the microcontroller transmits the SMS to the GSM modem.
 By using the GSM network’s SMS gateway, GSM modem sends the SMS to the
destination.
Figure 31 Block diagram of implementation of GSM network in the project.
48
CHAPTER 5
AT COMMAND
5.1 GSM MODEMS
A GSM modem is a wireless MODEM that works with a GSM wireless network. A wireless
modem behaves like a dial-up modem. The main difference between them is that a dial-up
modem sends and receives data through a fixed telephone line while a wireless modem sends and
receives data through radio waves. There are several types of modems out there. Some shown
below: [5]
5.2 What is AT Command?
AT commands are instructions used to control a modem. AT is the abbreviation of “ATtention”.
Every command line starts with "AT" or "at" and the command is terminated by a Carriage
Return ("Enter" key in keyboard). That's why modem commands are called AT commands. [5]
The general syntax of AT commands is straightforward. The syntax rules are provided below.
Syntax rule 1
All command lines must start with "AT" and end with a Carriage Return character. In a
terminal program like HyperTerminal of Microsoft Windows, we can press the Enter key on the
keyboard to output a carriage return character. The ASCII value of CR is 0x0D (Decimal13) and
string value is "r".[5]
Syntax rule 2
A string is enclosed between double quotes. [5]
Example: To read all SMS messages from message storage in SMS text mode (at this time we do
not need to know what SMS text mode is. More information will be provided later in this SMS
tutorial), we need to assign the string "ALL" to the AT command, like this:
Figure 34 WAVECOM
GSM MODEM
Figure 33 SIM900 GSM
Module
Figure 32 Telit G862 GSM
Module
49
AT+CMGL="ALL"
Syntax rule 3
Information responses and result codes always start and end with a Carriage Return character
and a Line Feed character (ASCII = 0x0A; Decimal = 10; string = 'n'). [5]
Example: After sending the command line "AT+CGMI " to the mobile device, the mobile device
should return a response similar to this:
LF CR Nokia LF CR
LF CR OK LF CR
The first line is the information response of the AT command and the second line is the final
result code. The final result code "OK" marks the end of the response. It indicates no more data
will be sent from the mobile device to the PC.
When a terminal program such as HyperTerminal of Microsoft Windows sees a carriage return
character, it moves the cursor to the beginning of the current line. When it sees a linefeed
character, it moves the cursor to the same position on the next line.
Case Sensitivity of AT Commands
In the SMS specification, all AT commands are in uppercase letters. However, many
GSM/GPRS modems and mobile phones allow us to type AT commands in either uppercase or
lowercase letters. For example, on Nokia 6021, AT commands are case-insensitive and the
following two command lines are equivalent:
AT+CMGL at+cmgl
The ETSI GSM 07.07 (3GPP TS 27.007) specifies AT commands. The AT command list can be
found in their website. However, as this project’s application limited to SMS, only the SMS
related AT commands were explained below. [5]
1) ATE0 – Turn off echo
This command is used to determine whether or not the modem echoes characters received by
microcontroller. For example if we send the following command: "AT", then modem will simply
reply: "OK". But if echo is turn on then it will reply: [5]
LF CR AT LF CR
LF CR OK LF CR
It will reply first what he receive and then the response. By default Echo is ON. It should be off
for less
traffic.
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system
Message based home automation  &amp; security system

More Related Content

What's hot

Environmental monitoring26
Environmental monitoring26Environmental monitoring26
Environmental monitoring26praveenenbd
 
Investigation of Internet of Things
Investigation of Internet of ThingsInvestigation of Internet of Things
Investigation of Internet of ThingsMadhavi Jayarathne
 
Development of Personal Weather Report for Home Security
Development of Personal Weather Report for Home SecurityDevelopment of Personal Weather Report for Home Security
Development of Personal Weather Report for Home SecurityIOSRJVSP
 
IRJET- Design and Implementation in Laboratory using Siemens PLC S7-200
IRJET- Design and Implementation in Laboratory using Siemens PLC S7-200IRJET- Design and Implementation in Laboratory using Siemens PLC S7-200
IRJET- Design and Implementation in Laboratory using Siemens PLC S7-200IRJET Journal
 
Hardware and logic implementation of multiple alarm system for gsm bts rooms
Hardware and logic implementation of multiple alarm system for gsm bts roomsHardware and logic implementation of multiple alarm system for gsm bts rooms
Hardware and logic implementation of multiple alarm system for gsm bts roomsZac Darcy
 
Wsp smart building e
Wsp smart building eWsp smart building e
Wsp smart building eJac van Megen
 
ANDROID APPLICATION DEVELOPMENT FOR ENVIRONMENT MONITORING USING SMART PHONES
ANDROID APPLICATION DEVELOPMENT FOR ENVIRONMENT MONITORING USING SMART PHONESANDROID APPLICATION DEVELOPMENT FOR ENVIRONMENT MONITORING USING SMART PHONES
ANDROID APPLICATION DEVELOPMENT FOR ENVIRONMENT MONITORING USING SMART PHONESijmnct
 
IRJET- Pollution Monitoring and Controlling System using Internet of Thin...
IRJET-  	  Pollution Monitoring and Controlling System using Internet of Thin...IRJET-  	  Pollution Monitoring and Controlling System using Internet of Thin...
IRJET- Pollution Monitoring and Controlling System using Internet of Thin...IRJET Journal
 
IRJET- Design and Implementation of Integrated Smart Home System (ISHS)
IRJET- Design and Implementation of Integrated Smart Home System (ISHS)IRJET- Design and Implementation of Integrated Smart Home System (ISHS)
IRJET- Design and Implementation of Integrated Smart Home System (ISHS)IRJET Journal
 
Internet of Things Technology for Fire Monitoring System
Internet of Things Technology  for Fire Monitoring SystemInternet of Things Technology  for Fire Monitoring System
Internet of Things Technology for Fire Monitoring SystemIRJET Journal
 
IRJET - IoT based Smart City and Air Quality Monitor
IRJET -  	  IoT based Smart City and Air Quality MonitorIRJET -  	  IoT based Smart City and Air Quality Monitor
IRJET - IoT based Smart City and Air Quality MonitorIRJET Journal
 
11669987_Technical_Research_Paper_EGP
11669987_Technical_Research_Paper_EGP11669987_Technical_Research_Paper_EGP
11669987_Technical_Research_Paper_EGPJay Patel
 
Home Automation Products and Suppliers in UAE
Home Automation Products and Suppliers in UAEHome Automation Products and Suppliers in UAE
Home Automation Products and Suppliers in UAEBeatriz john
 
IRJET- Smart Security System in Homes using Simple Internet of Things Ena...
IRJET-  	  Smart Security System in Homes using Simple Internet of Things Ena...IRJET-  	  Smart Security System in Homes using Simple Internet of Things Ena...
IRJET- Smart Security System in Homes using Simple Internet of Things Ena...IRJET Journal
 
MOX Living Technology Home Automation System
MOX Living Technology Home Automation SystemMOX Living Technology Home Automation System
MOX Living Technology Home Automation Systemmoxreview
 
Temperature control solutions
Temperature control solutionsTemperature control solutions
Temperature control solutionsMobiloitte
 

What's hot (20)

Home Automation
Home AutomationHome Automation
Home Automation
 
Environmental monitoring26
Environmental monitoring26Environmental monitoring26
Environmental monitoring26
 
Investigation of Internet of Things
Investigation of Internet of ThingsInvestigation of Internet of Things
Investigation of Internet of Things
 
Development of Personal Weather Report for Home Security
Development of Personal Weather Report for Home SecurityDevelopment of Personal Weather Report for Home Security
Development of Personal Weather Report for Home Security
 
Smart home with home automation
Smart home with home automationSmart home with home automation
Smart home with home automation
 
IRJET- Design and Implementation in Laboratory using Siemens PLC S7-200
IRJET- Design and Implementation in Laboratory using Siemens PLC S7-200IRJET- Design and Implementation in Laboratory using Siemens PLC S7-200
IRJET- Design and Implementation in Laboratory using Siemens PLC S7-200
 
Hardware and logic implementation of multiple alarm system for gsm bts rooms
Hardware and logic implementation of multiple alarm system for gsm bts roomsHardware and logic implementation of multiple alarm system for gsm bts rooms
Hardware and logic implementation of multiple alarm system for gsm bts rooms
 
Wsp smart building e
Wsp smart building eWsp smart building e
Wsp smart building e
 
ANDROID APPLICATION DEVELOPMENT FOR ENVIRONMENT MONITORING USING SMART PHONES
ANDROID APPLICATION DEVELOPMENT FOR ENVIRONMENT MONITORING USING SMART PHONESANDROID APPLICATION DEVELOPMENT FOR ENVIRONMENT MONITORING USING SMART PHONES
ANDROID APPLICATION DEVELOPMENT FOR ENVIRONMENT MONITORING USING SMART PHONES
 
Bms for security systems
Bms for security systemsBms for security systems
Bms for security systems
 
IRJET- Pollution Monitoring and Controlling System using Internet of Thin...
IRJET-  	  Pollution Monitoring and Controlling System using Internet of Thin...IRJET-  	  Pollution Monitoring and Controlling System using Internet of Thin...
IRJET- Pollution Monitoring and Controlling System using Internet of Thin...
 
IRJET- Design and Implementation of Integrated Smart Home System (ISHS)
IRJET- Design and Implementation of Integrated Smart Home System (ISHS)IRJET- Design and Implementation of Integrated Smart Home System (ISHS)
IRJET- Design and Implementation of Integrated Smart Home System (ISHS)
 
Internet of Things Technology for Fire Monitoring System
Internet of Things Technology  for Fire Monitoring SystemInternet of Things Technology  for Fire Monitoring System
Internet of Things Technology for Fire Monitoring System
 
Smart control v3
Smart control v3Smart control v3
Smart control v3
 
IRJET - IoT based Smart City and Air Quality Monitor
IRJET -  	  IoT based Smart City and Air Quality MonitorIRJET -  	  IoT based Smart City and Air Quality Monitor
IRJET - IoT based Smart City and Air Quality Monitor
 
11669987_Technical_Research_Paper_EGP
11669987_Technical_Research_Paper_EGP11669987_Technical_Research_Paper_EGP
11669987_Technical_Research_Paper_EGP
 
Home Automation Products and Suppliers in UAE
Home Automation Products and Suppliers in UAEHome Automation Products and Suppliers in UAE
Home Automation Products and Suppliers in UAE
 
IRJET- Smart Security System in Homes using Simple Internet of Things Ena...
IRJET-  	  Smart Security System in Homes using Simple Internet of Things Ena...IRJET-  	  Smart Security System in Homes using Simple Internet of Things Ena...
IRJET- Smart Security System in Homes using Simple Internet of Things Ena...
 
MOX Living Technology Home Automation System
MOX Living Technology Home Automation SystemMOX Living Technology Home Automation System
MOX Living Technology Home Automation System
 
Temperature control solutions
Temperature control solutionsTemperature control solutions
Temperature control solutions
 

Similar to Message based home automation &amp; security system

IoT Based Home Automation System_revised_27_06_2021.pptx
IoT Based Home Automation System_revised_27_06_2021.pptxIoT Based Home Automation System_revised_27_06_2021.pptx
IoT Based Home Automation System_revised_27_06_2021.pptxCUInnovationTeam
 
Development of wireless and intelligent home automation system
Development of wireless and intelligent home automation systemDevelopment of wireless and intelligent home automation system
Development of wireless and intelligent home automation systemTELKOMNIKA JOURNAL
 
A Short Review on the Perspective of Home Automation Technology
A Short Review on the Perspective of Home Automation TechnologyA Short Review on the Perspective of Home Automation Technology
A Short Review on the Perspective of Home Automation TechnologyIRJET Journal
 
Cell phone based automation systems
Cell phone based automation systemsCell phone based automation systems
Cell phone based automation systemsManpreet Chandhok
 
IRJET- Experimental Investigation on Properties of High Volume Fly Ash High S...
IRJET- Experimental Investigation on Properties of High Volume Fly Ash High S...IRJET- Experimental Investigation on Properties of High Volume Fly Ash High S...
IRJET- Experimental Investigation on Properties of High Volume Fly Ash High S...IRJET Journal
 
IRJET- Design and Implementation of a Smart Home(Smoke, Fire, Gas and Motion ...
IRJET- Design and Implementation of a Smart Home(Smoke, Fire, Gas and Motion ...IRJET- Design and Implementation of a Smart Home(Smoke, Fire, Gas and Motion ...
IRJET- Design and Implementation of a Smart Home(Smoke, Fire, Gas and Motion ...IRJET Journal
 
GSM Based Home Appliances Monitoring System for Handicapped People
GSM Based Home Appliances Monitoring System for Handicapped PeopleGSM Based Home Appliances Monitoring System for Handicapped People
GSM Based Home Appliances Monitoring System for Handicapped Peoplepaperpublications3
 
Communication Methods to build Smart Home Monitoring System: A Survey
Communication Methods to build Smart Home Monitoring System: A SurveyCommunication Methods to build Smart Home Monitoring System: A Survey
Communication Methods to build Smart Home Monitoring System: A Surveydbpublications
 
Communication Methods to build Smart Home Monitoring System: A Survey
Communication Methods to build Smart Home Monitoring System: A SurveyCommunication Methods to build Smart Home Monitoring System: A Survey
Communication Methods to build Smart Home Monitoring System: A Surveydbpublications
 
Presentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUPresentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUSouvik Kundu
 
HOME AUTOMATION WITH SPY ROBOT AND SECURITY SYSTEM
HOME AUTOMATION WITH SPY ROBOT AND SECURITY SYSTEMHOME AUTOMATION WITH SPY ROBOT AND SECURITY SYSTEM
HOME AUTOMATION WITH SPY ROBOT AND SECURITY SYSTEMpaperpublications3
 
14983184 industrial-security-system-using-auto-dialer
14983184 industrial-security-system-using-auto-dialer14983184 industrial-security-system-using-auto-dialer
14983184 industrial-security-system-using-auto-dialera_subramaniyam
 
Home automation proposal
Home automation proposalHome automation proposal
Home automation proposalHazratBilal82
 
smart-home-automation-and-security-system-using-gsm-and-arm7-IJERTCONV5IS1800...
smart-home-automation-and-security-system-using-gsm-and-arm7-IJERTCONV5IS1800...smart-home-automation-and-security-system-using-gsm-and-arm7-IJERTCONV5IS1800...
smart-home-automation-and-security-system-using-gsm-and-arm7-IJERTCONV5IS1800...Mehraj U Din
 
Energy Management with Disaster Intimation and Control using IoT
Energy Management with Disaster Intimation and Control using IoTEnergy Management with Disaster Intimation and Control using IoT
Energy Management with Disaster Intimation and Control using IoTIJEACS
 
Home automation using blynk app with fan direction control and displaying sta...
Home automation using blynk app with fan direction control and displaying sta...Home automation using blynk app with fan direction control and displaying sta...
Home automation using blynk app with fan direction control and displaying sta...Diwash Kapil Chettri
 

Similar to Message based home automation &amp; security system (20)

68-71.pdf
68-71.pdf68-71.pdf
68-71.pdf
 
MAJOR_PROJECT
MAJOR_PROJECTMAJOR_PROJECT
MAJOR_PROJECT
 
IoT Based Home Automation System_revised_27_06_2021.pptx
IoT Based Home Automation System_revised_27_06_2021.pptxIoT Based Home Automation System_revised_27_06_2021.pptx
IoT Based Home Automation System_revised_27_06_2021.pptx
 
Development of wireless and intelligent home automation system
Development of wireless and intelligent home automation systemDevelopment of wireless and intelligent home automation system
Development of wireless and intelligent home automation system
 
A Short Review on the Perspective of Home Automation Technology
A Short Review on the Perspective of Home Automation TechnologyA Short Review on the Perspective of Home Automation Technology
A Short Review on the Perspective of Home Automation Technology
 
Cell phone based automation systems
Cell phone based automation systemsCell phone based automation systems
Cell phone based automation systems
 
IRJET- Experimental Investigation on Properties of High Volume Fly Ash High S...
IRJET- Experimental Investigation on Properties of High Volume Fly Ash High S...IRJET- Experimental Investigation on Properties of High Volume Fly Ash High S...
IRJET- Experimental Investigation on Properties of High Volume Fly Ash High S...
 
IRJET- Design and Implementation of a Smart Home(Smoke, Fire, Gas and Motion ...
IRJET- Design and Implementation of a Smart Home(Smoke, Fire, Gas and Motion ...IRJET- Design and Implementation of a Smart Home(Smoke, Fire, Gas and Motion ...
IRJET- Design and Implementation of a Smart Home(Smoke, Fire, Gas and Motion ...
 
GSM Based Home Appliances Monitoring System for Handicapped People
GSM Based Home Appliances Monitoring System for Handicapped PeopleGSM Based Home Appliances Monitoring System for Handicapped People
GSM Based Home Appliances Monitoring System for Handicapped People
 
Project ppt
Project   pptProject   ppt
Project ppt
 
Communication Methods to build Smart Home Monitoring System: A Survey
Communication Methods to build Smart Home Monitoring System: A SurveyCommunication Methods to build Smart Home Monitoring System: A Survey
Communication Methods to build Smart Home Monitoring System: A Survey
 
Communication Methods to build Smart Home Monitoring System: A Survey
Communication Methods to build Smart Home Monitoring System: A SurveyCommunication Methods to build Smart Home Monitoring System: A Survey
Communication Methods to build Smart Home Monitoring System: A Survey
 
Presentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUPresentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCU
 
HOME AUTOMATION WITH SPY ROBOT AND SECURITY SYSTEM
HOME AUTOMATION WITH SPY ROBOT AND SECURITY SYSTEMHOME AUTOMATION WITH SPY ROBOT AND SECURITY SYSTEM
HOME AUTOMATION WITH SPY ROBOT AND SECURITY SYSTEM
 
14983184 industrial-security-system-using-auto-dialer
14983184 industrial-security-system-using-auto-dialer14983184 industrial-security-system-using-auto-dialer
14983184 industrial-security-system-using-auto-dialer
 
Home automation proposal
Home automation proposalHome automation proposal
Home automation proposal
 
Home Automation System
Home Automation SystemHome Automation System
Home Automation System
 
smart-home-automation-and-security-system-using-gsm-and-arm7-IJERTCONV5IS1800...
smart-home-automation-and-security-system-using-gsm-and-arm7-IJERTCONV5IS1800...smart-home-automation-and-security-system-using-gsm-and-arm7-IJERTCONV5IS1800...
smart-home-automation-and-security-system-using-gsm-and-arm7-IJERTCONV5IS1800...
 
Energy Management with Disaster Intimation and Control using IoT
Energy Management with Disaster Intimation and Control using IoTEnergy Management with Disaster Intimation and Control using IoT
Energy Management with Disaster Intimation and Control using IoT
 
Home automation using blynk app with fan direction control and displaying sta...
Home automation using blynk app with fan direction control and displaying sta...Home automation using blynk app with fan direction control and displaying sta...
Home automation using blynk app with fan direction control and displaying sta...
 

Recently uploaded

ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 

Message based home automation &amp; security system

  • 1. 1 MESSAGE BASED HOME AUTOMATION & SECURITY SYSTEM By Hassan Mahmood Polash S.M. Istiaque Sekander Md. Jahid Hassan Srijohn Kumar Roy Department of Electrical and Electronic Engineering University of Information Technology & Sciences (UITS)
  • 2. 2 CHAPTER 1 INTRODUCTION 1.1 INTRODUCTION Home Automation & Security System is the residential extension of building automation. Home automation system may include centralized control of lighting, HVAC (heating, ventilation and air conditioning), appliances, security locks of gates and doors and other systems, to provide improved convenience, comfort, energy efficiency and security. [1] A home automation system may include simple automated door opener to complete automation of home appliances. Usual home automation feature may include ambient light intensity control, temperature and humidity monitor and control system etc. Home automation helps people to get things done conveniently. For example, it helps to turn on the microwave oven from the office laptop, remotely start vacuuming, etc. Home automation system can be extended to home security monitoring system. A home security system may include intruder alarm system to CCTV monitoring facilities. The basic aim of Home automation is to control or monitor signals from different appliances. Home automation is a growing trend. Automation systems can control important systems like lighting and temperature controls as well as entertainment systems and even curtains. Though costly, control systems can ease the lifestyle of a homeowner greatly. Depending upon which sort of control system is purchased, the ease of the customer’s life can be exponentially increased. Especially with central control systems, users can change the temperature and lighting in their house with a flick of the finger. No longer is it necessary to worry about leaving the heat running or burning out light bulbs that were mistakenly left on. In this thesis we have presented simplicity in design, a standard compatible platform of home automation & security system. Our designed system includes a GSM modem and a microcontroller based monitoring and control device that allows monitoring from any distance, over GSM network using short message service (SMS). Multiple sensors feed surrounding environment information to the microcontroller like – temperature and humidity and also monitors gas leakage or smoke and human presence. And microcontroller sends that information via SMS to a cell phone number by using a GSM modem. Our designed system constantly
  • 3. 3 monitors the temperature and humidity and display on a LCD. If the temperature reaches 50ºC the microcontroller turns off the main power supply of the house. We have selected 50ºC, because it is very unusual temperature for human comfort and household temperature considering our geographical position. Hence this lead to one assessment that some, flammable object is on fire in smaller magnitude or some electrical home appliance is about to catch fire. Since most of the modern electrical home appliance generates temperature between 20ºC to 35ºC. 1.2 BACKGROUND Home automation is adopted for reasons of ease, security and energy efficiency. In modern construction in most homes have been wired for electrical power, telephones, TV outlets (cable or antenna), and a doorbell. Many household tasks were automated by the development of specialized automated appliances. For instance, automatic washing machines were developed to reduce the manual labor of cleaning clothes, and water heaters reduced the energy necessary for bathing. If no one is supposed to be home and the alarm system is set, the Home Automation & Security System could call the owner, or the neighbors, or an emergency number if an intruder is detected. [1] In simple installations, automation may be as straightforward as turning on/off the lights when a person enters the room. In advanced installations, rooms can sense not only the presence of a person inside but know who that person is and perhaps set appropriate lighting, temperature, music levels or television channels, taking into account the day of the week, the time of day, and other factors. An example of remote monitoring in home automation could be triggered when a smoke detector detects a fire or smoke condition, causing all lights in the house to blink to alert any occupants of the house to the possible emergency. The system could also call the home owner on their mobile phone to alert them, or call the fire department or alarm monitoring company. 1.3 IMPORTANCE OF THE WORK Home automation systems that are available in market are very expensive. Moreover it also includes high monthly service charge and installation cost. Also this system requires internet connection to operate; hence the user also has to bear internet subscription fees. As the demand of home automation system increases, so is the complexity of construction and maintenance cost. Our goal for this project to develop a home automation system that is not only simple in construction and low on maintenance cost, but also a standard compatible platform of home automation & security system. To do so, we have used four sensors (temperature sensor, humidity sensor, gas detector and PIR motion sensor) and interfaced with a microcontroller. We
  • 4. 4 have tried to provide access to the user, that information about the sensors instantly from a LCD display as well as through SMS. 1.4 OBJECTIVE  Our objective is to construct a cost effective home automation system.  Also to make a safety monitoring system that provides security against fire damage and intruder.  And to develop an automation system that can control main power supply of a house.  And to make a system which is easy to operate and low on maintenance cost. 1.5 APPLICATION There is several application of our project:  This project includes interfacing of temperature and humidity sensors. This concept can be used for manufacturing and processing industries.  It is also represent the use of several security features such as motion sensing ability which can be used for monitoring house, office, restricted area etc. for human trespassing.  It also includes a gas leakage detector which can be used in deep sea drilling rig, oil tanker ships for hazardous gas leakage and combustion gas detection.  This project features usage of GSM modem and SMS; this can be extended over GSM data service, like GPRS, EDGE, 3G internet for monitor and control wide range of modern home appliance over any distance and even lower cost.
  • 5. 5 1.6 BLOCK DIAGRAM: Figure 1 Block Diagram of Proposed System
  • 6. 6 EXTENSIVE LITERATURE REVIEW MODEL CONCEPT SELECTION PROCCESS MODEL DEVELOPMENT TESTING VERIFICATION IMPLEMENTATION 1.6 METHODOLOGY The purpose of the project is to develop an automation system based on PIC Microcontroller and GSM modem. The sensors are connected to microcontroller. Microcontroller converts the analog input into digital signal and analyzes, then takes actions to accordance. Our project’s systematic flow chart and explanation of work are given below: Figure 2 Methodology
  • 7. 7 1.6.1 EXTENSIVE LITERATURE REVIEW In recent years there has been an exponential growth and advancement in computing technology. There has also been use of these technologies even among non-technical users as they are no longer limited to personal computers that occupy fixed desk space. Instead there has been an increasing trend towards global computing that integrates seamlessly into peripheral environment to assist ones day to day life. Several standards have been proposed each day promising to solve standards issue. Home automation is not different. At very basic level home automation is introduced as early as 19th century with the introduction of water supply and energy distribution system. Science then several solutions was proposed by the industry and academia; but the progress has been relatively slow. Few system aims to solve issues such as ease of access and scalability, such as Microchip’s X-10. In early 2000’s, there has been several academic research were published regarding home automation, such as – in University of Utah, Utah, USA Kevin Brown, Don DeLaMare and Brian Faires proposed an land phone based home automation and security system, where a door, window, motion sensors are integrated to a MC9S12C32 microcontroller (which serve as a slave microcontroller to collect and analyze data from sensors) and a thermostat control unit and a land phone is integrated to another MC9S12C32 microcontroller (which serve as a master microcontroller to control and dial a fixed number if required). A MC9S12C32 is a powerful 16-bit microcontroller by Freescale Semiconductor Inc. It has 32KB of program memory and 4KB RAM with 52 general purpose I/O pin, with a 16-channel ADC module. In the project by Kevin Brown, Don DeLaMare and Brian Faires, they used two MC9S12C32 microcontroller, one as master and another as slave, connected to each other over I2C (inter-integrated circuit) communication protocol. The slave microcontroller is integrated with three sensors (door, window and motion) to monitor the internal situation of a house. If any of this sensor triggers then the slave microcontroller sends a signal to the master microcontroller. The master microcontroller is integrated with a keypad and a land phone. If any of the sensor were triggered then the microcontroller wait for 10 seconds for an authorized password entry from the keypad; otherwise it dials 911(emergency number in USA) to call the police. Our system includes one 8-bit PIC16F877A microcontroller by Microchip Inc. It has 8KB program memory and 368 bytes RAM with 33 general purposes I/O pin. Since land phone are rarely used in modern days hence we replaced land phone with cell phone. Integrating a cell phone to a microcontroller is a complex process and requires an auxiliary circuit, so instead of a cell phone we used a GSM module, which is special type circuit that mimics a cell phone. It can be directly integrated to a microcontroller without the help of an auxiliary circuit. But our system’s microcontroller has a limitation of low data bus (8-bit only), program memory and RAM. Hence we had to develop a program that is low on line count compare to Kevin Brown, Don DeLaMare and Brian Faires project. We also have to remove the keypad feature for this reason. Our system incorporates four sensors (i.e. temperature, humidity, and motion and gas sensor). Our systems microcontroller gathers information from the sensors and analyzes them if any one of them is triggered over an alarming level, and then a SMS is send to a predefined cell
  • 8. 8 phone number. And if certain parameter is crossed over danger level then supply from the mains is cut off. Another research was published by Sunny Peter Gomasa under Massey University, Albany, New Zealand, proposing a web service based home automation, where light, smoke and motion sensor are integrated to a single board computer ALIX 3D2 and the computer is connected to a ADSL modem. It also developed a website for the control and monitoring purpose using PHP web development language. An ALIX 3D2 is single board computer by PC Engines Ltd. A single board computer has distinctive advantage over microcontroller. Single board computer usually includes a powerful microprocessor which performance is measured in several hundred MHz; whereas the performance of a microcontroller processor is measured in MIPS (million instructions per second). An ALIX 3D2 single board computer includes AMD Geode LX800 CPU with 500 MHz clock speed and 256 MB RAM. It also includes a LAN port and two USB port. The LAN port can be used with ADSL modem for internet connection. The main purpose of an ALIX 3D2 single board computer is to allow control different load via internet. The load might be connected to one or more microcontroller powered control board. The drawback of ALIX 3D2 is, beside need of internet it also require a dedicated small computer server and its own custom website. To avoid the complexity of using single board computer we developed our own microcontroller powered controller board. And instead of internet, we have used SMS of monitoring. But since our microcontroller is very low on ability compare to a single board computer, our system operation is only limited to notification of certain parameter via SMS and termination of mains power supply when needed. We also had to remove end-user control feature. 1.6.2 MODEL CONCEPT During the system design, ease of construction, ease of use and cost effectiveness is given top priority. We intend to develop a home automation and security system that is low on cost for construction as well as minimum operating cost as possible. Our intention is to develop a system that is user friendly and requires no user manual to operate. Thus our system is based on SMS. Because SMS is the most versatile and easy communication method in mobile communication, requires basic handsets that are able to send and receive SMS; and almost anybody can grasp the concept of SMS. To develop a home automation and security system, the system requires auxiliary sensing equipment. So we considered the most common concern of a home owner. According to our findings a home owner mostly concerned about respectively, intruder or trespasser, fire, temperature and humidity of the house. Hence we choose four sensors that are related to these factors and they are – PIR based motion sensor, gas detector, temperature and humidity sensor.
  • 9. 9 1.6.3 SELECTION PROCESS At the beginning of the selection process, access to system status via SMS and internet are both thoroughly revised and SMS is selected for the ease of construction and use. At the second phase of the selection process, selection of microcontroller is considered. There are three ranges of microcontroller are available and they are, Base Line, Mid-Range and High-End microcontroller. In our project we needed ADC module (analog-to-digital converter), UART module and general input-output option. But in a Base Line controller all these module are not available. Although High-End controller provides this features but the devices are expensive. On the other hand Mid- Range controller provides all of these modules in reasonable cost. Hence we selected Mid-Range controller (PIC16F877A).In third phase of our selection process, we needed to select those sensors which parameters are used in our daily life. Hence we select four types of sensors and they are: Temperature, Humidity, Gas and Motion sensor. In the final phase of selection of hardware, we had to decide which type of sensor is to be used. There are two types of sensor, analog and digital. Digital sensor provides low percentage of error, but they are expensive and cannot be easily found. Analog sensors require a time consuming calibration and they are error prone. But they are low on cost. Hence we selected analog type sensors for our project. 1.6.4 MODEL DEVELOPMENT After selecting appropriate hardware for the project, we developed a virtual system using Proteus 8.1 EDA (Electronic Design Automation). A Computer-aided design or CAD software helps to remove any type design error before actual hardware are assembled. It also helps a designer to keep track of how much a system draws power. After testing the virtual system we used EAGLE (Easily Applicable Graphical Layout Editor) CAD to design the custom PCB for the project.
  • 10. 10 PLATFORMSELECTION •Message Base,or, •InternetBase. MICROCNTROLLER SELECTION •Base Line (PIC10- 12 Series) •Mid-Range(PIC16Series),or, •High-End(PIC18-24 Series) SENSORSELECTION •Temperatur •Humidity •Gas •Passive Infrared(PIRmotionsensor) SENSORTYPE SELECTION •Analog,or, •Digital. Figure 3 Selection Process
  • 11. 11 1.6.5 TESTING This project is implemented with all the sensors along with LCD display, connected to the microcontroller individually for testing and calibration on a BREADBOARD. The microcontroller is then interfaced with a GSM modem and tested for sending SMS on the same BREADBOARD. Whenever a sensor status was updated, the microcontroller updated the status on the LCD display and if needed sends a status SMS to a predefined number successfully. 1.6.6 VARIFICATION At first we connected all the devices. When power was supplied, a “Beep” sound from the buzzer ensures that the system is on. We are able to observe the system status on a LCD display where temperature, relative humidity, gas and motion sensor status are shown. We change the temperature and humidity by heating up the sensor and change of status was displayed on the LCD. Again we triggered both smoke and motion sensor separately and a SMS was sent for each sensors status, in a cell phone in our hand. 1.6.7 IMPLMENTATION After several testing and verification, the components are soldered on a custom etched PCB. GSM modem is connected with project circuit board with jumper wires. 1.7 OUTLINE OF THE THESIS This thesis is organized in such a way that it can be effectively helpful for any other to work with any Message based home automation system. Towards this goal the project has divided in several sections-  In Chapter One, we have described the aspect of the project in practical life. Also we tried to describe a short idea about what we are trying to implement.  In Chapter Two, we have described the importance of microcontroller, its architecture, and peripherals.  In Chapter Three, we have described about sensors, working principle of sensors, its types and construction.  In Chapter Four, we have described about the basic network structure of GSM network and SMS.  In Chapter Five, we have described about the AT command, for interfacing a GSM module with microcontroller.  In Chapter Six, we tried to make an overall familiarization of all the hardware and software to incorporate to implement these projects.  In Chapter Seven, we have described the algorithm, designing procedure and implementation of the project.  In Chapter Eight, we have described the future aspect of the project, its application and overall conclusion.  In Appendix A, we provided the source code of the project.
  • 12. 12 CHAPTER 2 INTRODUCTIONTO MICROCONTROLLER 2.1 INTRODUCTION The term microcomputer is used to describe a system that includes at minimum a microprocessor, program memory, data memory, and an input-output (I/O) device. Some microcomputer systems include additional components such as timers, counters, and analog-to-digital converters. Thus, a microcomputer system can be anything from a large computer having hard disks, floppy disks, and printers to a single-chip embedded controller. Here we are going to consider only the type of microcomputers that consist of a single silicon chip. Such microcomputer systems are also called microcontrollers, and they are used in many household goods such as microwave ovens, TV remote control units, cookers, hi-fi equipment, CD players, personal computers, and refrigerators. Many different microcontrollers are available on the market. Here we shall be looking at programming and system design for the PIC (programmable interface controller) series of microcontrollers manufactured by Microchip Technology Inc. [6] 2.2 MICROCONTROLLER SYSTEMS A microcontroller is a single-chip computer. Micro suggests that the device is small, and controller suggests that it is used in control applications. Another term for microcontroller is embedded controller, since most of the microcontrollers are built into (or embedded in) the devices they control. A microprocessor differs from a microcontroller in a number of ways. The main distinction is that a microprocessor requires several other components for its operation, such as program memory and data memory, input-output devices, and an external clock circuit. A microcontroller, on the other hand, has all the support chips incorporated inside its single chip. All microcontrollers operate on a set of instructions (or the user program) stored in their memory. A microcontroller fetches the instructions from its program memory one by one, decodes these instructions, and then carries out the required operations. Figure 4 Microprocessor vs.Microcontroller
  • 13. 13 Microcontrollers have traditionally been programmed using the assembly language of the target device. Although the assembly language is fast, it has several disadvantages. An assembly program consists of mnemonics, which makes learning and maintaining a program written using the assembly language difficult. Also, microcontrollers manufactured by different firms have different assembly languages, so the user must learn a new language with every new microcontroller he or she uses. Microcontrollers can also be programmed using a high-level language, such as mikroC by MikroElektronika Inc., CCS C by Custom Computer Services, Inc., Keil Compiler by Keil Elektronik etc. High-level languages are much easier to learn than assembly languages. They also facilitate the development of large and complex programs. In theory, a single chip is sufficient to have a running microcontroller system. In practical applications, however, additional components may be required so the microcomputer can interface with its environment. With the advent of the PIC family of microcontrollers the development time of an electronic project has been reduced to several hours. Basically, a microcomputer executes a user program which is loaded in its program memory. Under the control of this program, data is received from external devices (inputs), manipulated, and then sent to external devices (outputs). For example, in a microcontroller-based oven temperature control system the microcomputer reads the temperature using a temperature sensor and then operates a heater or a fan to keep the temperature at the required value. A microcontroller is a very powerful tool that allows a designer to create sophisticated input- output data manipulation under program control. Microcontrollers are classified by the number of bits they process. Microcontrollers with 8 bits are the most popular and are used in most microcontroller-based applications. Microcontrollers with 16 and 32 bits are much more powerful, but are usually more expensive and not required in most small or medium-size general purpose applications that call for microcontrollers. The simplest microcontroller architecture consists of a microprocessor, memory, and input- output. The microprocessor consists of a central processing unit (CPU) and a control unit (CU). The CPU is the brain of the microcontroller; this is where all the arithmetic and logic operations are performed. The CU controls the internal operations of the microprocessor and sends signals to other parts of the microcontroller to carry out the required instructions. Memory, an important part of a microcontroller system, can be classified into two types: program memory and data memory. Program memory stores the program written by the programmer and is usually nonvolatile (i.e., data is not lost after the power is turned off). Data memory stores the temporary data used in a program and is usually volatile (i.e., data is lost after the power is turned off). [6] There are basically six types of memories, summarized as follows:
  • 14. 14 2.2.1 RAM RAM, random access memory, is a general purpose memory that usually stores the user data in a program. RAM memory is volatile in the sense that it cannot retain data in the absence of power (i.e., data is lost after the power is turned off). Most microcontrollers have some amount of internal RAM, 256 bytes being a common amount, although some microcontrollers have more, some less. The PIC18F452 microcontroller, for example, has 1536 bytes of RAM. Memory can usually be extended by adding external memory chips. [6] 2.2.2 ROM ROM, read only memory, usually holds program or fixed user data. ROM is nonvolatile. If power is removed from ROM and then reapplied, the original data will still be there. ROM memory is programmed during the manufacturing process, and the user cannot change its contents. ROM memory is only useful if we have developed a program and wish to create several thousand copies of it. [6] 2.2.4 PROM PROM, programmable read only memory, is a type of ROM that can be programmed in the field, often by the end user, using a device called a PROM programmer. Once a PROM has been programmed, its contents cannot be changed. PROMs are usually used in low production applications where only a few such memories are required. [6] 2.2.4 EPROM EPROM, erasable programmable read only memory, is similar to ROM, but EPROM can be programmed using a suitable programming device. An EPROM memory has a small clear-glass window on top of the chip where the data can be erased under strong ultraviolet light. Once the memory is programmed, the window can be covered with dark tape to prevent accidental erasure of the data. An EPROM memory must be erased before it can be reprogrammed. Many developmental versions of microcontrollers are manufactured with EPROM memories where the user program can be stored. These memories are erased and reprogrammed until the user is satisfied with the program. Some versions of EPROMs, known as OTP (one time programmable), can be programmed using a suitable programmer device but cannot be erased. OTP memories cost much less than EPROMs. OTP is useful after a project has been developed completely and many copies of the program memory must be made. [6] 2.2.5 EEPROM EEPROM, electrically erasable programmable read only memory, is a nonvolatile memory that can be erased and reprogrammed using a suitable programming device. EEPROMs are used to save configuration information, maximum and minimum values, identification data, etc. Some microcontrollers have built-in EEPROM memories. For instance, the PIC18F452 contains a 256-byte EEPROM memory where each byte can be programmed and erased directly by
  • 15. 15 applications software. EEPROM memories are usually very slow. An EEPROM chip is much costlier than an EPROM chip. [6] 2.2.6 FLASH EEPROM Flash EEPROM, a version of EEPROM memory, has become popular in microcontroller applications and is used to store the user program. Flash EEPROM is nonvolatile and usually very fast. The data can be erased and then reprogrammed using a suitable programming device. Some microcontrollers have only 1K flash EEPROM while others have 32K or more. The PIC18F452 microcontroller has 32K bytes of flash memory. [6] 2. 3 MICROCONTROLLER ARCHITECHTURE Two types of architectures are conventional in microcontrollers. Von Neumann architecture, used by a large percentage of microcontrollers, places all memory space on the same bus; instruction and data also use the same bus. In Harvard architecture (used by PIC microcontrollers), code and data are on separate buses, which allows them to be fetched simultaneously, resulting in an improved performance. [6] 2.3.1 RISC and CISC RISC (reduced instruction set computer) and CISC (complex instruction computer) refer to the instruction set of a microcontroller. In an 8-bit RISC microcontroller, data is 8 bits wide but the instruction words are more than 8 bits wide (usually 12, 14, or 16 bits) and the instructions occupy one word in the program memory. Thus the instructions are fetched and executed in one cycle, which improves performance. In a CISC microcontroller, both data and instructions are 8 bits wide. CISC microcontrollers usually have over two hundred instructions. Data and code are on the same bus and cannot be fetched simultaneously. [6] Figure 6 Von Neumann Architecture Figure 5 Harvard Architecture
  • 16. 16 2.4 MICROCONTROLLER FEATURES Microcontrollers from different manufacturers have different architectures and different capabilities. Some may suit a particular application while others may be totally unsuitable for the same application. The hardware features common to most microcontrollers are described in this section. 2.4.1 SUPPLY VOLTAGE Most microcontrollers operate with the standard logic voltage of 5V. Some microcontrollers can operate at as low as 2.7V, and some will tolerate 6V without any problem. The manufacturer’s data sheet will have information about the allowed limits of the power supply voltage. PIC18F452 microcontrollers can operate with a power supply of 2V to 6.5V. Usually, a voltage regulator circuit is used to obtain the required power supply voltage when the device is operated from a mains adapter or batteries. For example, a 5V regulator is required if the microcontroller is operated from a 5V supply using a 9V battery. [6] 2.4.2 THE CLOCK All microcontrollers require a clock (or an oscillator) to operate, usually provided by external timing devices connected to the microcontroller. In most cases, these external timing devices are a crystal plus two small capacitors. In some cases they are resonators or an external resistor- capacitor pair. Some microcontrollers have built-in timing circuits and do not require external timing components. If an application is not time- sensitive, external or internal (if available) resistor-capacitor timing components are the best option for their simplicity and low cost. An instruction is executed by fetching it from the memory and then decoding it. This usually takes several clock cycles and is known as the instruction cycle. In PIC microcontrollers, an instruction cycle takes four clock periods. Thus the microcontroller operates at a clock rate that is one- quarter of the actual oscillator frequency. [6] The performance of a CPU in a microcontroller is normally determined by the frequency of an oscillator crystal. Typically a crystal oscillator produces a fixed sine wave—the frequency reference signal. Electronic circuitry translates that into a square wave at the same frequency for digital electronics applications. The clock distribution network inside the CPU carries that clock signal to all the components that need it. With each clock pulse, the CPU executes one instruction set. The higher the clock pulse the higher the execution rate. For example – if we use a CPU with a 20 MHz clock frequency, then it will execute an instruction in 0.05 microseconds (since 𝑇 = 1 𝑓 , hence 𝑇 = 1 20×106 or 0.05µs). But if the same CPU is given an 8 MHz clock frequency, then it will execute the same instruction in 12.5 microseconds (𝑇 = 1 8×106 or 12.5µs). Usually most CPU in microcontroller’s complete one instruction with each clock pulse, but some device requires up to 4 clock pulses to complete one instruction set, such as – PIC microcontroller we used in our project requires 4 clock pulses to complete one instruction set.
  • 17. 17 But increased clock frequency will increase heat produce by the CPU in microcontroller, which in turns increases the body temperature of the microcontroller, leading to failure of the device. According to manufacturer datasheet increase of 1MHz clock frequency will increase 5°C operating body temperature of the microcontroller per hour. Maximum operating temperature of a PIC16F877A is 125°C. Using the following equation a safe operating temperature for the microcontroller can be derived. TB= TA+FOSC×5°C±2°C Here, TB = total body temperature of the microcontroller TA = ambient/room temperature FOSC = oscillating frequency Example: if the room temperature is 30C and 20MHz clock frequency, then according to stated equation the body temperature of the microcontroller will be, TB= 30+20×5°C±2°C Or, TB= 30+100±2°C Or, TB= 130±2°C This exceeds the maximum operating temperature of the microcontroller. Again if the room temperature is 30C and 8MHz clock frequency, then according to stated equation the body temperature of the microcontroller will be, TB= 30+8×5°C±2°C Or, TB= 30+40±2°C Or, TB= 70±2°C And this is within the maximum operating range of the microcontroller. Hence, we used an 8MHz clock frequency, instead of 20MHz clock frequency. [10] 2.4.3 TIMERS Timers are important parts of any microcontroller. A timer is basically a counter which is driven from either an external clock pulse or the microcontroller’s internal oscillator. A timer can be 8 bits or 16 bits wide. Data can be loaded into a timer under program control, and the timer can be stopped or started by program control. Most timers can be configured to generate an interrupt when they reach a certain count (usually when they overflow). The user program can use an interrupt to carry out accurate timing-related operations inside the microcontroller. Microcontrollers in the PIC16F series have at least two timers. For example, the PIC16F877A microcontroller has two built-in timers. Some microcontrollers offer capture and compare facilities, where a timer value can be read when an external event occurs, or the timer value can
  • 18. 18 be compared to a preset value, and an interrupt is generated when this value is reached. Most PIC16F microcontrollers have at least two capture and compare modules. [6] 2.4.4 WATCHDOG Most microcontrollers have at least one watchdog facility. The watchdog is basically a timer that is refreshed by the user program. Whenever the program fails to refresh the watchdog, a reset occurs. The watchdog timer is used to detect a system problem, such as the program being in an endless loop. This safety feature prevents runaway software and stops the microcontroller from executing meaningless and unwanted code. Watchdog facilities are commonly used in real-time systems where the successful termination of one or more activities must be checked regularly. [4] 2.4.5 RESET INPUT A reset input is used to reset a microcontroller externally. Resetting puts the microcontroller into a known state such that the program execution starts from address0 of the program memory. An external reset action is usually achieved by connecting a push-button switch to the reset input. When the switch is pressed, the microcontroller is reset. [6] 2.4.6 INTERRUPTS Interrupts are an important concept in microcontrollers. An interrupt causes the microcontroller to respond to external and internal (e.g., a timer) events very quickly. When an interrupt occurs, the microcontroller leaves its normal flow of program execution and jumps to a special part of the program known as the interrupt service routine (ISR). The program code inside the ISR is executed, and upon return from the ISR the program resumes its normal flow of execution. The ISR starts from a fixed address of the program memory sometimes known as the interrupt vector address. Some microcontrollers with multi-interrupt features have just one interrupt vector address, while others have unique interrupt vector addresses, one for each interrupt source. Interrupts can be nested such that a new interrupt can suspend the execution of another interrupt. Another important feature of multi-interrupt capability is that different interrupt sources can be assigned different levels of priority. For example, the PIC18F series of microcontrollers has both low-priority and high- priority interrupts levels. [6] 2.4.7 BROWN-OUT DETECTOR Brown-out detectors, which are common in many microcontrollers, reset the microcontroller if the supply voltage falls below a nominal value. These safety features can be employed to prevent unpredictable operation at low voltages, especially to protect the contents of EEPROM-type memories. [6]
  • 19. 19 2.4.8 ANALOG-TO-DIGITAL CONVERTER An analog-to-digital converter (A/D) is used to convert an analog signal, such as voltage, to digital form so a microcontroller can read and process it. Some microcontrollers have built-in A/D converters. External A/D converter can also be connected to any type of microcontroller. A/D converters are usually 8 to 10 bits, having 256 to 1024 quantization levels. Most PIC microcontrollers with A/D features have multiplexed A/D converters which provide more than one analog input channel. For example, the PIC18F452 microcontroller has 10-bit 8-channel A/D converters. The A/D conversion process must be started by the user program and may take several hundred microseconds to complete. A/D converters usually generate interrupts when a conversion is complete so the user program can read the converted data quickly. A/D converters are especially useful in control and monitoring applications, since most sensors (e.g., temperature sensors, pressure sensors, force sensors, etc.) produce analog output voltages. [6] 2.4.9 SERIAL INPUT-OUTPUT Serial communication (also called RS232 communication) enables a microcontroller to be connected to another microcontroller or to a PC using a serial cable. Some microcontrollers have built-in hardware called USART (universal synchronous- asynchronous receiver-transmitter) to implement a serial communication interface. The user program can usually select the baud rate and data format. If no serial input-output hardware is provided, it is easy to develop software to implement serial data communication using any I/O pin of a microcontroller. The PIC18F series of microcontrollers has built-in USART modules. Some microcontrollers (e.g., the PIC18F series) incorporate SPI (serial peripheral interface) or I2C (integrated interconnect) hardware bus interfaces. These enable a microcontroller to interface with other compatible devices easily. [6] 2.4.10 EEPROM DATA MEMORY EEPROM-type data memory is also very common in many microcontrollers. The advantage of an EEPROM memory is that the programmer can store nonvolatile data there and change this data whenever required. For example, in a temperature monitoring application, the maximum and minimum temperature readings can be stored in an EEPROM memory. If the power supply is removed for any reason, the values of the latest readings are available in the EEPROM memory. The PIC18F452 microcontroller has 256 bytes of EEPROM memory. Other members of the PIC18F family have more EEPROM memory (e.g., the PIC18F6680 has 1024 bytes). The mikroC language provides special instructions for reading and writing to the EEPROM memory of a PIC microcontroller. [6] 2.4.11 LCD DRIVERS LCD drivers enable a microcontroller to be connected to an external LCD display directly. These drivers are not common since most of the functions they provide can be implemented in software. For example, the PIC18F6490 microcontroller has a built-in LCD driver module. [6]
  • 20. 20 2.4.12 ANALOG COMPARATOR Analog comparators are used where two analog voltages need to be compared. Although these circuits are implemented in most high-end PIC microcontrollers, they are not common in other microcontrollers. The PIC18F series of microcontrollers has built-in analog comparator modules. [6] 2.4.13 REAL-TIME CLOCK A real-time clock enables a microcontroller to receive absolute date and time information continuously. Built-in real-time clocks are not common in most microcontrollers, since the same function can easily be implemented by either a dedicated real-time clock chip or a program written for this purpose. [6] 2.4.14 SLEEP MODE Some microcontrollers (e.g., PICs) offer built-in sleep modes, where executing this instruction stops the internal oscillator and reduces power consumption to an extremely low level. The sleep mode’s main purpose is to conserve battery power when the microcontroller is not doing anything useful. The microcontroller is usually woken up from sleep mode by an external reset or a watchdog time-out. [6] 2.4.15 POWER-ON RESET Some microcontrollers (e.g., PICs) have built-in power-on reset circuits which keep the microcontroller in the reset state until all the internal circuitry has been initialized. This feature is very useful, as it starts the microcontroller from a known state on power-up. An external reset can also be provided, where the microcontroller is reset when an external button is pressed. [6] 2.5 PIC16F877A MICROCONTROLLER 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 – 20 MHz 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 other 28-pin or 40/44-pin PIC16CXXX and PIC16FXXX microcontrollers
  • 21. 21 Peripheral Features:  Timer0: 8-bit timer/counter with 8-bit prescaler  Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via external crystal/clock  Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler  Two Capture, Compare, PWM modules  Capture is 16-bit, max. resolution is 12.5 ns  Compare is 16-bit, max. resolution is 200 ns  PWM max. resolution is 10-bit  Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C™ (Master/Slave)  Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address detection  Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls (40/44-pin only)  Brown-out detection circuitry for  Brown-out Reset (BOR)  10-bit, up to 8-channel Analog-to-Digital  Converter (A/D) Device Program Memory Data SRAM (Bytes) EEPROM (Bytes) I/O 10-bit A/D (ch) CCP (PWM) MSSP USART Timers 8/16- bit Comparators Bytes # Single Word Instructions SPI Master I2 C PIC16F877A 14.3K 8192 368 256 33 8 2 Yes Yes Yes 2/1 2 2.6 WHY SELECT PIC16F877A? PIC16F877A has a operating range at DC 20MHz clock frequency. It has 386 bytes RAM and vast 8192 single word instruction or 14.3Kbytes program memory. It also provides an ADC and USART module. It also provides CCP, SPI, I2C Comparator and Timers module. To implement our design we needed an ADC module to read sensors analog data and analyze. To send SMS using a GSM Modem, we need an UART module to communicate with module. That’s why we selected PIC16F877A microcontroller.
  • 22. 22 2.7 USED PIN IN OUR PROJECT  PIN01 – it is Master Reset pin, it also used for power on reset feature where microcontroller program cycle is reset and start from the beginning.  PIN 02 – 0 5 – are part of the ADC module of the microcontroller, can be used as both analog and digital input, and digital output.  PIN 13 – 14 – used for receiving an external clock frequency using a crystal oscillator.  PIN 11 – 32 – used for power supply to microcontroller, usually +5v.  PIN 12 – 31 – used for grounding end to complete the circuit.  PIN 25 – is connected to UART module of microcontroller, performs the transition of data.  PIN 26 – is connected to UART module of microcontroller, performs the receiving of data.
  • 23. 23 CHAPTER 3 SENSOR 3.1 INTRODUCTION A sensor is a device that measures a physical quantity and converts it into a signal which can be read by an observer or by an (today mostly electronic) instrument. A sensor is a device, which responds to an input quantity by generating a functionally related output usually in the form of an electrical or optical signal. A sensor's sensitivity indicates how much the sensor's output changes when the measured quantity changes. A good sensor obeys the following rules:  Is sensitive to the measured property only  Is insensitive to any other property likely to be encountered in its application  Does not influence the measured property Ideal sensors are designed to be linear or linear to some simple mathematical function of the measurement, typically logarithmic. The output of such a sensor is an analog signal and linearly proportional to the value or simple function of the measured property. The sensitivity is then defined as the ratio between output signal and measured property. [1] 3.2 TEMPERATURE SENSOR A temperature is a numerical measure of hot and cold. Its measurement is by detection of heat radiation, particle velocity, kinetic energy, or most commonly, by the bulk behavior of a thermometric material. It may be calibrated in any of various temperature scales, Celsius, Fahrenheit, Kelvin, etc. [3] 3.2.1 TEMPERATURE AND ITS MEASUREMENT Simply speaking, temperature is the degree of hotness of the body which is a measure of the heat content in the body. The problem to quantify the heat content of the body on a scale did not arise until the invention of the Steam Engine. The curiosity of scientists to understand the behavior of Figure 7 Temperature Sensor
  • 24. 24 water at different levels of heat contents gave rise to a formal and better laid out study. One of the first references for ‘temperature’ dates back to 1760, when Joseph Black declared that applying the same heat to different materials resulted in different temperatures. Years of rigorous scientific study led to many theories ranging from the simple ‘Caloric’ concept, which treated heat as a material substance which is exchanged among materials, to Carnot’s description of heat as a form of energy (which laid the foundation of the first law of thermodynamics). However, none of them satisfactorily explained the concept of temperature. It was Maxwell’s theory which offered good reasoning into it. He defined temperature of a body as is its thermal property which provides information about the energy content of the system. It is the measure of the average kinetic energy (energy by virtue of motion) of the molecules of the substance and signifies a heat potential due to which heat flows from higher temperature to lower temperature. The word ‘temperature’ itself is said to be derived of the Latin word ‘tempera’ meaning ‘moderate or soften’. Moving along Maxwell’s line of thought, the velocity of molecules should be the basis of selecting the value of temperature, with absolute heatlessness being a state where the molecules are totally static. But, this measurement is not possible practically, and hence, other manifestations of the effect of heat are utilized to measure temperature, for example, the geometric expansion of materials. [3] 3.2.2 TYPES OF TEMPERATURE SENSORS Temperature can be classified into following classes: The classes of temperature sensors based on their mechanical property: Contact Temperature Sensing: The sensor is brought into physical contact with the object to be monitored. This method can be used with solids, liquids and gases. The sensors used for measurement can vary from capillary bulb thermometers and bi-metal sensors to sensors that use varying voltage signals or resistance values. [3] Expansion Thermometers: These sensors use Bi-metallic strips which have different expansion rates at a particular temperature. Thus, this difference of expansion can be translated into temperature change using a mechanical pointer. Though not very accurate, these devices offer the advantage of being portable. Low cost applications like time compensators in mechanical clocks, thermostats where a higher temperature may open the contact as in heating control or may close it like in refrigerators make use of bimetallic strips to open and close mechanical switches which in turn control electrical switches like circuit breakers. [3] Filled System Thermometers: These devices are filled with some substitute which expands or contracts due to temperature change. They may be filled with mercury. However, as it is considered to be an environmental hazard, organic liquid types may be used instead. These do not require any electric power to operate and are stable even after repeated use. However, they do not provide any kind of reading storage solution and also cannot make point measurements. These find use in medical industry to measure body temperatures. [3]
  • 25. 25 The classes of temperature sensors based on their electrical property: Voltage signal based sensors: Thermocouples are the main sensors of this category. The underlying principle is the Seebeck effect. When two different metals or alloys are placed together so as to form two junctions, a voltage is induced across the junctions when there is a difference of temperatures between the junctions. These sensors are capable of detecting very high temperatures (as high as 1700o), have a very simplistic design which makes them quite robust to shock and vibration and can have almost immediate response to temperature changes. They however provide localized temperature readings and need a cold junction compensation to maintain the temperature gradient. Also, they are highly non-linear devices when compared to other sensors and require extremely good algorithms on the part of the conditioning electronics and processors to compensate for the non-linearity. Thermocouples find application in extremely high temperature sensing applications, chemical reaction monitoring, metal cutting, gas chromatography, sensing temperatures inside internal combustion engines etc. owing to their wide temperature range and ruggedness; however, if high accuracy and linearity are desired, other temperature sensors must be used. Simple implementation ideas can be like the one in the following: [3] Resistance value based sensors: The resistance of metals and semiconductors offered to the flow of current through them changes with temperature. This change can be monitored and mapped to various temperature values on a scale. Further, on increasing the temperature, the value of resistance may increase or decrease. Substances with a positive temperature coefficient like most metals undergo a positive change of resistance with increasing temperature, while resistance of most semiconductors decreases with increasing temperature owing to their negative temperature coefficients. Based on the temperature coefficients, the Resistance Temperature Detectors (RTD) can be further divided into two types: [3] Figure 8 Circuit Diagram of Voltage Signal based Sensor
  • 26. 26 Resistance Wire: Mainly built with materials with positive resistance coefficient materials like platinum, RTDs are resistive elements which exhibit predictable change in resistance with temperature. The change of Resistance with temperature is given by the relation: Here, Rt and Ro are the resistance of the material at temperatures t and to ºC; and α is the Average temperature Coefficient. These devices may be in the forms of Thin Film Resistors or Wire- wounded Resistors. They offer a very wide linear range of temperature measurement (-200 to 650oC) and are very stable with minimal drift even with repeated operation year after year. The signal output is quite large as compared to thermocouples, and can use ordinary copper wires for extension. Also, these can be spread over a large area. Such sensors may be mounted on one arm of a balanced Wheatstone bridge circuit as shown in the figure below and the entire circuit be used to calculate and also control actuators for maintenance of temperature using feedback. They provide the desired linear range of operation where thermocouples fall short. RTDs find use in applications like cold junction compensation, calibration purposes, in a wheat stone bridge circuit and process control. The linearity simplifies the implementation of signal conditioning circuitry and makes RTDs suitable for high precision applications. RTDs measure absolute temperature in contrast with the thermocouples, and hence, might not be suitable for maintaining uniform temperature throughout the surface like the thermocouples are used. [3] Thermistor: Semiconductors offer a variety of phenomenon and form the very basis of electronics. Both Positive (PTC) and Negative Temperature Coefficient (NTC) semiconductors are present and sensors based on them are differentiated as cold-wire PTC-Thermistor and hot- wire NTC-Thermistor. For PTC-Thermistor, Ferro electricity is the predominant phenomenon causing the positive coefficient in a short range of temperature. The short temperature range of operation for these materials makes them suitable for use as temperature limiting switches. They have been used successfully in CRT monitors as timers in degaussing coils. They can be used as replacements for fuses in the form of current limiting devices. If the current increases, more heat is generated which heats up the Thermistor. This increases the resistance which reduces the current and voltage available to the device thus protecting it from increased currents. For NTC- Thermistor, the relation between resistance and temperature is negative and exponential which is very repeatable. In the range of use, this exponential curve can be seen as a fairly linear plot and Figure 9 RTD Circuit Diagram
  • 27. 27 can even provide more sensitivity than RTDs which makes them more attractive in terms of accuracy in measurements. Owing to their low costs, they find ample use in automotive and consumer products industries like coolant and oil temperature monitors, incubator temperature maintenance, low temperature thermometers, modern digital thermostats, battery pack temperature monitors etc. A more recent application where NTC Thermistor have been used is 3D printing, where Thermistor are used to maintain a constant temperature at the hot end of 3D printers for the proper melting of plastic filaments. [3] Integrated Silicon Temperature Sensors: Besides all these classifications, integrated circuits have been designed to provide ease of use while measuring temperatures in the desired scale. For example, the LM35 IC from Texas Instruments is a precision temperature sensor IC that offers reading directly on the Celsius scale and LM34 is another one offering readings on the Fahrenheit scale. These ICs provide Voltage readings which are directly proportional to a certain multiplier of temperature and hence can be directly read off a multimeter, or fed directly into an ADC for further processing. They provide easy integration and interfacing with other elements of the circuit. Many semiconductor companies like Analog Devices, Microchip, Smartek, ZMD and ST Microelectronics are into temperature sensors design and even provide signal processing circuitry and digital I/O interfaces for microcontrollers. These temperature sensors find widespread use in consumer products like personal computers, office electronics equipment, cellular phones, HVACs and battery management solutions. Apart from these major principles of temperature measurement, other methods have also been developed. Some of them are, oscillating quartz temperature sensors, thermal noise thermometers, fiber optic thermometers and temperature measurement systems. [3] 3.2.3 SELECTION CRITERIA OF TEMPERATURE SENSORS None of the temperature sensing devices are versatile enough to be used everywhere. If the thermocouples are known for their wide temperature range of operation, RTDs are unrivalled in the linearity range and Thermistor is very accurate while the silicon sensors are easy to integrate Figure 10 LM35 IC Temperature Sensor
  • 28. 28 in circuits. The use of a particular temperature sensor in some applications is governed by a number of parameters, the most important being temperature itself. The temperature range for the application, the rate at which the temperature may change, etc. help decide the type of design. For example, for sensors with high operating temperatures, special connection leads would be needed, while for sensors which have to deal with temperature shocks, wire-wound type of construction is preferred. The stability and accuracy of the sensor at the prescribed operating conditions is another major factor to weigh while choosing design. Sensitivity of the device to measure small changes and how prone it is to self heating, determines the reliability of the device and its performance. The response time of the sensor is often governed by the size of the sensor. For example, the small dimensions of a film type resistor based sensor result in minimal associated heat capacity and hence, short response times (0.1 s in water and 3 to 6s in air). In the same application area, wire type resistor would respond in 0.2 to 0.5s in water and 4 to 25s in air. To aid you in choosing the right temperature sensor for your application, a comparison table of the 4 popular sensors is drawn below for easy reference: [3] Table 1 Comparison among Different Types of Temperature Sensor Type Thermocouple RTD Thermistor Integrated Silicon Temperature Range -270 - 1800°C -250 - 900°C -100 - 450°C -55 - 150°C Accuracy ±0.5°C ±0.01°C ±0.1°C ±1°C Linearity (Minimum order of polynomial, lesser the better) 4th order polynomial 2nd order polynomial 3rd order polynomial Linearization not required. Within ±1°C Sensitivity ? 10µV/°C 0.00385 ?/?/°C (Pt) Several ?/ ?/°C -2mV/°C Ruggedness Larger the gauge of wire, more is the ruggedness Quite susceptible to breakage due to vibration Hermetic Thermistor housed in glass,not affected by shock or vibration As rugged as an IC in plastic package like a DIP. Responsiveness (test conditions) Tres<1s 1s<Tres<10s 1s<Tres<5s 4s<Tres<60s External Excitation Required None Current Source Voltage Source Supply Voltage Output Voltage Resistance Resistance Digital/Current/Voltage
  • 29. 29 Apart from these considerations, the choice of contact or non-contact sensors is subject to various other environmental conditions. While contact sensors may provide economical measurements and are quite accurate, the need physical contact, which may lead to contamination, wear and tear and heat sinking which alters the temperature to be measured. On the other hand, non-contact sensing offers faster response and monitoring from a remote location, but cannot measure gas temperatures and has ambient temperature restrictions which may affect the readings. [3] 3.2.4 SENSOR WE USED & HOW DOES IT WORKS For our project we have used a NTC Thermistor type temperature sensor. A NTC Thermistor is typically a semiconductor, made from oxides of cobalt, copper, nickel, iron or titanium, pressed into a small bead, disk or wafer. Varying the combinations of metal oxides and temperature to which they are heated allows a range of temperature characteristics to be produced. NTC Thermistor initially has a high resistance, which limits the current that can flow. However, power is dissipated as heat, which raises the body heat of the Thermistor. This lowers the resistance of the Thermistor and increases the current flow, which, in turn, increases the power dissipated. This cycle continues until thermal equilibrium is reached. 3.3 HUMIDITY SENSOR Humidity is the presence of water in air. The amount of water vapor in air can affect human comfort as well as many manufacturing processes in industries. The presence of water vapor also influences various physical, chemical, and biological processes. Humidity measurement in industries is critical because it may affect the business cost of the product and the health and safety of the personnel. Hence, humidity sensing is very important, especially in the control systems for industrial processes and human comfort. [3] Controlling or monitoring humidity is of paramount importance in many industrial & domestic applications. In semiconductor industry, humidity or moisture levels needs to be properly controlled & monitored during wafer processing. In medical applications, humidity control is required for respiratory equipments, sterilizers, incubators, pharmaceutical processing, and Figure 11 Humidity Sensor
  • 30. 30 biological products. Humidity control is also necessary in chemical gas purification, dryers, ovens, film desiccation, paper and textile production, and food processing. In agriculture, measurement of humidity is important for plantation protection (dew prevention), soil moisture monitoring, etc. For domestic applications, humidity control is required for living environment in buildings, cooking control for microwave ovens, etc. In all such applications and many others, humidity sensors are employed to provide an indication of the moisture levels in the environment. [3] 3.3.1 RELEVANT MOISTURE TERMS To mention moisture levels, variety of terminologies are used. The study of water vapor concentration in air as a function of temperature and pressure falls under the area of psychometrics. Psychometrics deals with the thermodynamic properties of moist gases while the term “humidity” simply refers to the presence of water vapor in air or other carrier gas. Humidity measurement determines the amount of water vapor present in a gas that can be a mixture, such as air, or a pure gas, such as nitrogen or argon. [3] Various terms used to indicate moisture levels are tabulated in the table below: Table 2 Measuring Terms of Humidity S.N Term Definition Unit 1 Absolute Humidity (Vapor Concentration) Ratio of mass (vapor) to volume. grams/m3 2 Mixing Ratio OR Mass Ratio Ratio of mass(vapor) to mass(dry gas) grams/m3 3 Relative Humidity Ratio of mass (vapor) to mass (saturated vapor) OR ratio of actual vapor pressure to saturation vapor pressure. % 4 Specific Humidity Ratio of mass (vapor) to total mass. % 5 Dew Point Temperature(above 0°C) at which the water vapor in a gas condenses to liquid water) °C 6 Frost Point Temperature(below 0°C) at which the water vapor in a gas condenses to ice 7 Volume Ratio Ratio of partial pressure(vapor) to partial pressure (dry gas) % by volume 8 PPM by Volume Ratio of volume(vapor) X 106 to volume(dry gas) PPMV 9 PPM by Weight PPMV X PPMW Most commonly used units for humidity measurement are Relative Humidity (RH), Dew/Frost point (D/F PT) and Parts per Million (PPM). RH is a function of temperature, and thus it is a relative measurement. Dew/Frost point is a function of the pressure of the gas but is independent of temperature and is therefore defined as absolute humidity measurement. PPM is also an absolute measurement. Dew points and frost points are often used when the dryness of the gas is important. Dew point is also used as an indicator of water vapor in high temperature processes, such as industrial drying. Mixing ratios, volume percent, and specific humidity are usually used
  • 31. 31 when water vapor is either an impurity or a defined component of a process gas mixture used in manufacturing. Correlation among RH, Dew/Frost point and PPMv is shown below: [3] 3.3.2 HUMIDITY SENSING – CLASSIFICATION & PRINCIPLES According to the measurement units, humidity sensors are divided into two types: Relative Humidity (RH) sensors and Absolute Humidity (moisture) sensors. Most humidity sensors are relative humidity sensors and use different sensing principles. [3] A table showing important parameters of different types of humidity sensors is given below: Table 3 Comparison of Different Types Of Humidity Sensor Active Material Thermo-set Polymer Thermoplastic Polymer Thermoplastic Polymer Bulk Thermoplastic Bulk AlO3 Lithium Chloride Film Substrate Ceramic or Silicon Ceramic or silicon Polyester or Polymer film N/A N/A Ceramic Sensed Parameter Capacitance Capacitance Capacitance Resistance Resistance Conductivity Measured Parameter %RH %RH %RH %RH %RH %RH RH Change 0% to 100% 0% to 100% 0% to 100% 20% to 100% 2% to 90% 15% to <100% RH Accuracy ±1% to ±5% ±3% to ±5% ±3% to ±5% ±3% to ±10% ±1% to ±5% ±5% Interchangeability ±2% to ±10% RH ±3% to ±20% RH ±3% to ±20% RH ±5% to ±25% RH poor ±3% to ±10% RH Hysteresis <1% to 3% RH 2% to 5% RH 2% to 5% RH 3% to 6% RH <2% RH very poor Linearity ±1% RH ±1% RH ±2% RH poor poor Very poor Rise time 15 s to 60 s 15 s to 90 s 15 s to 90 s 2 min to 5 min 3 min to 5 min 3 min to 5 min Temperature Range -40 °C to 185 °C -30 °C to 190 °C -25°C to 100 °C 10 °C to 40 °C -10 °C to 75 °C - Figure 12 Correlation of Measuring Scale of Humidity
  • 32. 32 3.3.3 SENSING PRINCIPLE Humidity measurement can be done using dry and wet bulb hygrometers, dew point hygrometers, and electronic hygrometers. There has been a surge in the demand of electronic hygrometers, often called humidity sensors. Electronic type hygrometers or humidity sensors can be broadly divided into two categories: one employs capacitive sensing principle, while other uses resistive effects. [3] 3.3.3.1 SENSORS BASED ON CAPACITIVE EFFECT Humidity sensors relying on this principle consists of a hygroscopic dielectric material sandwiched between a pair of electrodes forming a small capacitor. Most capacitive sensors use a plastic or polymer as the dielectric material, with a typical dielectric constant ranging from 2 to 15. In absence of moisture, the dielectric constant of the hygroscopic dielectric material and the sensor geometry determine the value of capacitance. At normal room temperature, the dielectric constant of water vapor has a value of about 80, a value much larger than the constant of the sensor dielectric material. Therefore, absorption of water vapor by the sensor results in an increase in sensor capacitance. At equilibrium conditions, the amount of moisture present in a hygroscopic material depends on both the ambient temperature and the ambient water vapor pressure. This is true also for the hygroscopic dielectric material used on the sensor. By definition, relative humidity is a function of both the ambient temperature and water vapor pressure. Therefore there is a relationship between relative humidity, the amount of moisture present in the sensor, and sensor capacitance. This relationship governs the operation of a capacitive humidity instrument. Basic structure of capacitive type humidity sensor is shown below: [3] Figure 13 Types of Humidity Sensor Figure 14 Capacitive Type Humidity Sensor
  • 33. 33 On Alumina substrate, lower electrode is formed using gold, platinum or other material. A polymer layer such as PVA is deposited on the electrode. This layers senses humidity. On top of this polymer film, gold layer is deposited which acts as top electrode. The top electrode also allows water vapor to pass through it, into the sensing layer. The vapors enter or leave the hygroscopic sensing layer until the vapor content is in equilibrium with the ambient air or gas. Thus capacitive type sensor is basically a capacitor with humidity sensitive polymer film as the dielectric. [3] 3.3.3.2 SENSORS BASED ON RESISTIVE EFFECT Resistive type humidity sensors pick up changes in the resistance value of the sensor element in response to the change in the humidity. Basic structure of resistive type humidity sensor from TDK is shown below: Thick film conductor of precious metals like gold, ruthenium oxide is printed and culminated in the shape of the comb to form an electrode. Then a polymeric film is applied on the electrode; the film acts as a humidity sensing film due to the existence of movable ions. Change in impedance occurs due to the change in the number of movable ions. [3] 3.3.4 SENSOR WE USED & HOW DOES IT WORKS To monitor humidity we have used a capacitive humidity sensor. A capacitive humidity sensor gauges the humidity of the air relatively using a capacitor-based system. The sensor is made out of a film usually made of either glass or ceramics. The insulator material which absorbs the water is made out of a polymer which takes in and releases water based on the relative humidity of the given area. This changes the level of charge in the capacitor of the on board electrical circuit. Capacitive humidity or electronic hygrometers, in general, control the temperature of a surface based on electronic feedback and measure the resulting condensation. The hygrometer reads the air temperature and adjusts the surface temperature of a sensor until condensation forms and can be measured. Capacitive hygrometers measure condensation by running an alternating current between two plates to test capacitance, which is the ability of something to hold an electrical charge. As the presence of water increases, the ability to hold a charge also increases. Figure 15 Resistive Type Humidity Sensor
  • 34. 34 3.4 GAS DETECTOR A gas detector is a device which detects the presence of various gases within an area, often as part of a safety system. This type of equipment is used to detect a gas leak and interface with a control system so a process can be automatically shut down. Gas detectors can be classified according to the operation mechanism (semiconductors, electrochemical, ultrasonic etc.). [3] 3.4.1 ELECTROCHEMICAL GAS DETECTOR Electrochemical gas detectors work by allowing gases to diffuse through a porous membrane to an electrode where it is either chemically oxidized or reduced. The amount of current produced is determined by how much of the gas is oxidized at the electrode, indicating the concentration of the gas. Manufactures can customize electrochemical gas detectors by changing the porous barrier to allow for the detection of a certain gas concentration range. Also, since the diffusion barrier is a physical/mechanical barrier, the detector tended to be more stable and reliable over the sensor's duration and thus required less maintenance than other early detector technologies. However, the sensors themselves are subject to corrosive elements or chemical contamination, and may last only 1–2 years before a replacement is required. Electrochemical gas detectors are used in a wide variety of environments such as refineries, gas turbines, chemical plants, underground gas storage facilities, and more. [1] 3.4.2 SEMICONDUCTOR GAS DETECTOR Semiconductor sensors detect gases by a chemical reaction that takes place when the gas comes in direct contact with the sensor. Tin dioxide (TiO2) is the most common material used in semiconductor sensors, and the electrical resistance in the sensor is decreased when it comes in contact with the monitored gas. The resistance of the Tin dioxide (TiO2) is typically around 50 kΩ in air but can drop to around 3.5 kΩ in the presence of 1% methane. This change in resistance is used to calculate the gas concentration. Semiconductor sensors are commonly used to detect hydrogen, oxygen, alcohol vapor, and harmful gases such as Carbon Monoxide. One of the most common uses for semiconductor sensors is in carbon monoxide sensors. They are also Figure 16 Capacitive Humidity Sensor
  • 35. 35 used in Breathalyzers. Because the sensor must come in contact with the gas in order to detect it, semiconductor sensors work over a smaller distance than infrared point or ultrasonic detectors. [1] 3.4.3 ULTRASONIC GAS DETECTOR Ultrasonic gas detectors use acoustic sensors to detect changes in the background noise of its environment. Since most high-pressure gas leaks generate sound in the ultrasonic range of 25 KHz to 10 MHz, the sensors are able to easily distinguish these frequencies from background acoustic noise which occurs in the audible range of 20 Hz to 20 KHz. The ultrasonic gas leak detector then produces an alarm when there is an ultrasonic deviation from the normal condition of background noise. Despite the fact that ultrasonic gas leak detectors cannot measure gas concentration, the device is still able to determine the leak rate of an escaping gas because the ultrasonic sound level depends on the gas pressure and size of the leak. Ultrasonic gas detectors are mainly used for remote sensing in outdoor environments where weather conditions can easily dissipate escaping gas before allowing it to reach gas leak detectors that require contact with the gas in order to detect it and sound an alarm. These detectors are commonly found on offshore and onshore oil/gas platforms, gas compressor and metering stations, gas turbine power plants, and other facilities that house a lot of outdoor pipeline. Gas detectors can be used to detect combustible, flammable and toxic gases, and oxygen depletion. This type of device is used widely in industry and can be found in a variety of locations such as on oil rigs, to monitor manufacture processes and emerging technologies such as photovoltaic. [1] 3.4.4 SENSOR WE USED & HOW DOES IT WORKS For this project we have used a semiconductor gas detector. When a gas interacts with this sensor, it is first ionized into its constituents and is then adsorbed by the sensing element. This absorption creates a potential difference on the element. The gas detecting module consists of a steel exoskeleton under which a sensing element is housed. This detecting element is subjected to current through connecting leads. This current is known as heating current through it; the gases coming close to the sensing element get ionized and are absorbed by the sensing element. This changes the resistance of the sensing element which alters the value of the current going out of it. Figure 17 MQ - 9 Gas Detector
  • 36. 36 Figure 17 shows externals of a standard gas sensor module: A Steel Mesh, Copper Clamping Ring and Connecting Leads. The top part is a stainless steel mesh which takes care of the following:  Filtering out the suspended particles so that only gaseous elements are able to pass to insides of the sensor.  Protecting the insides of the sensor.  Exhibits an anti explosion network that keeps the sensor module intact at high temperatures and gas pressures. In order to manage above listed functions efficiently, the steel mesh is made into two layers. The mesh is bound to rest of the body via a copper plated clamping ring. The connecting leads of the sensor are thick so that sensor can be connected firmly to the circuit and sufficient amount of heat gets conducted to the inside part. They are casted from copper and have tin plating over them. Four of the six leads are for signal fetching while two are used to provide sufficient heat to the sensing element. The pins are placed on a Bakelite base which is a good insulator and provides firm gripping to the connecting leads of the sensor. Figure 18 External structure of MQ-9 Gas Detector Figure 19 Steel Mesh of MQ-9 Gas Detector
  • 37. 37 The top of the gas sensor is removed off to see the internals parts of the sensor: Sensing Element and Connection Wiring. The hexapod structure is constituted by the sensing element and six connecting legs that extend beyond the Bakelite base. Figure 20 shows the hollow sensing element which is made up from Aluminum Oxide based ceramic and has a coating of Tin Oxide. Using a ceramic substrate increases the heating efficiency and Tin Oxide, being sensitive towards adsorbing desired gas’ components (in this case methane and its products) suffices as sensing coating. The leads responsible for heating the sensing element are connected through Nickel-Chromium, well known conductive alloy. Leads responsible for output signals are connected using Platinum wires which convey small changes in the current that passes through the sensing element. The Platinum wires are connected to the body of the sensing element while Nickel-Chromium wires pass through its hollow structure. Figure 20 Internal Parts of the Sensor Figure 21 MQ-9 Internal Element Figure 22 Main Sensing Element
  • 38. 38 Figure 21 shows the ceramic with Tin Dioxide on the top coating that has good adsorbing property. Any gas to be monitored has specific temperature at which it ionizes. The task of the sensor is to work at the desired temperature so that gas molecules get ionized. Through Nickel- chromium wire, the ceramic region of the sensing element is subjected to heating current. The heat is radiated by the element in the nearby region where gases interact with it and get ionized. Once, ionized, they are absorbed by the tin dioxide. Adsorbed molecules change the resistance of the tin dioxide layer. This changes the current flowing through the sensing element and is conveyed through the output leads to the unit that controls the working of the gas sensor. [3] 3.5 PIR SENSOR Infrared sensors can be classified as Active Infrared Sensors and Passive Infrared Sensors. Both of them use the same infrared rays and same underlying physics. However, the only difference between the two is that, active infrared sensors employ infrared source (an active element) in addition to infrared detector. [3] Active infrared sensors operate by transmitting energy from either a light emitting diode (LED) or a laser diode. An LED is used for a non-imaging active IR detector, and a laser diode is used for an imaging active IR detector. In both types of these, the LED or laser diode illuminates the target, and the reflected energy is focused onto a detector consisting of a pixel or an array of pixels. Photoelectric cells, Photodiode or phototransistors are generally used as detectors. Contrary to Active Infrared sensors, Passive Infrared sensors do not contain any source of infrared radiation, they simply detect IR radiations. They totally rely on the three governing laws explained earlier. A passive infrared system detects energy emitted by objects in the field of view and may use signal-processing algorithms to extract the desired information. It does not emit any energy of its own for the purposes of detection. Humans at normal body temperature radiate quite strongly in the infrared region at a wavelength around 10 µm. Passive infrared sensors convert the infrared signal to current or voltage. Accordingly, they are used to detect presence, occupancy, and count. Primarily used for intrusion detection, passive infrared sensor as used as a special purpose radiometer which detects the heat emitted by the body of an intruder. It offers high probability of detection within a defined area even without responding to anything else. Its presence is hard to detect which is not the case with active infrared sensors, ultrasonic detectors and the like. Passive Infra-Red Sensors were originally being used for military and scientific applications. Nowadays they can be seen in a wide range of commercial products for automatic light control, safety, cost-savings, etc. Almost any region where people occasionally walk or move through and need not be continuously lit, could be benefitted from the installation of a PIR sensor. Some examples are hallways, foyers, paths, driveways, garden areas and car parking’s. [3]
  • 39. 39 3.5.1 PASSIVE INFRARED DETECTORS: CLASSIFICATION Passive Infrared detectors primarily are of two types: Thermal & Quantum. In the PIR sensors used for human/pets detection for automatic lighting systems, intrusion detection, etc. thermal type- Pyroelectric based PIR sensors are used. Types of PIR detectors are explained below: [3] 3.5.2.1 THERMAL PIRs Thermal type has no wavelength dependence. They use the infrared energy as heat and their photosensitivity is independent of wavelength. Thermal detectors don’t require cooling but have disadvantages that response time is slow & detection time is low. [3] Types of Thermal type PIR detectors are: THERMOCOUPLE-THERMOPILE Thermocouple uses Seebeck effect, one of the thermoelectric effects and is a detector that converts temperature into an electrical signal. The junction of dissimilar metals generates a voltage potential, which is directly proportional to the temperature. This junction can be made into multiple junctions to improve sensitivity. Such a configuration is called a thermopile. Thus, a thermopile is nothing but a junction of thermocouples connected in series. The active or ‘Hot’ junctions are blackened to efficiently absorb radiation. The reference or ‘Cold’ junctions are maintained at the ambient temperature of the detector. The absorption of radiation by the blackened area causes a rise in temperature in the ‘hot’ junctions as compared to the ‘cold’ junctions of the thermopile. This difference in temperature between the active junction and a reference junction kept at a fixed temperature produces an electric potential which is directly proportional to the differential temperature created. Figure 23 Working Principle of Thermocouple-Thermopile PIR Sensor Figure 24 Thermocouple-Thermopile PIR Sensor
  • 40. 40 These detectors has a relatively slow response time, but offers the advantages of DC stability, requiring no bias, and responding to all wavelengths. [3] BOLOMETER A bolometer is a simple thermal or total power detector. A bolometer changes resistance when incident infrared radiation interacts with the detector. Therefore, sensing material used for bolometer should have very high temperature coefficient of resistance; superconductor is an ideal candidate for sensing temperature in a bolometer. Typically, thermally sensitive semiconductor is made of a sintered metal oxide material. It has a high temperature coefficient of resistance. It consists of two main elements: a sensitive thermometer and a high cross section absorber. The absorber is connected by a weak thermal link to a heat sink (at temperature T0). Incoming energy falls upon the absorber. Incoming energy is converted to heat in the absorber. Temperature of the absorber changes depending upon the changes in the power of incoming energy. Bolometer works by measuring this change in temperature. [3] PYROELECTRIC DETECTOR Pyroelectric detectors use PZT having pyroelectic effect, a high resistor and a low noise FET, hermetically sealed in a package. Pyroelectric materials are crystals, such as lithium tantalate, which exhibit spontaneous polarization, or a concentrated electric charge that is temperature dependent.PZT is spontaneously polarized in dark state. As infrared radiation strikes the detector surface, the change in temperature causes a current to flow. This results in change of polarization state which is reflected in terms of voltage change at the output. Figure 25 Working Principle of Bolometer Figure 26 Pyroelectric Detector
  • 41. 41 This detector exhibits good sensitivity and good response to a wide range of wavelengths, and does not require cooling of the detector. While thermopiles are proportional to incident radiations, pyroelectric detectors are proportional to rate of change of incident radiation. Thus, pyroelectric detectors are AC coupled devices. Also, pyroelectric detectors have very high impedance and hence require a buffer. [3] 3.5.2.2 QUANTUM TYPE PIRs Quantum type offer higher detection performance and a faster response speed although their photosensitivity is wavelength dependant. Quantum type detectors require cooling for accurate measurements (except for those in near IR region). [3] PHOTOCONDUCTIVE Photoconductive type of IR detectors makes use of photoconductive effect. This effect causes change in resistance when IR radiation falls upon detecting elements. [3] Examples are PbS, PbSe, MCT (HgCdTe) Band gap of PbS, PbSe have negative temperature coefficient and hence their spectral response characteristics shift to long wavelength region when cooled. However, band gap of HgCdTe depends upon the composition and therefore, spectral response characteristics can be tailored to suit the requirements. PHOTOVOLTAIC Photoconductive type of IR detectors makes use of photovoltaic effect. Incident IR light cause increase in voltage output of these detectors. [3] Examples are InGaAs PIN photodiodes, InAs, InSb EXTRINSIC TYPE Various types of detectors like Ge: Au, Ge:Hg, Ge:Cu, Ge:Zn, Si:Ga, Si:As and are used depending upon the required application- spectral response, D*(Photosensitivity per unit area of the detector), etc. [3] 3.5.2 SENSOR WE USED & HOW DOES IT WORKS Figure 27 PIR Sensor Circuit
  • 42. 42 For this project we have used a pyroelectric type passive infrared (PIR) based motion sensor. A PIR sensor is made of ceramic material that generates surface charge when exposed to infrared radiations. As the amount of radiation increases, the surface charge generated increases. A FET is used to buffer this signal. As the sensor is sensitive to a wide range of radiations, a filter is used which limits the infrared rays falling on the sensor to 8µm-14µm range. Thus the output of an IR sensor is a function of infrared radiation. But since the output is affected by vibration, radio interference, sunlight, etc. as well, dual sensing elements are used. Both sensors are connected out of phase such that any excitation common to both gets cancelled out. The field of view of these sensors is the area or zone which it sees or where changes in the infra- red radiation can be sensed or detected. Typically, to enhance the range and field of view, the field of view is divided into number of zones (both vertically as well as horizontally) with the help of Fresnel Lens; a Fresnel lens is a Plano convex lens that is collapsed on itself to form a flat lens which retains its optical properties, but is thinner and has lesser absorption losses. Fresnel lens focuses the infra-red radiation emitted by an infrared source onto the PIR detector. After the light falls upon the PIR sensor, an electrical signal corresponding to the varying amount of infra red radiations is generated. All PIR sensors detect changes in infra-red radiation; infrared radiations in the form of heat emitted by the bodies including human beings, vehicles, etc. Bigger is the body more is the infra- red radiation and it becomes easier for the PIR sensor to detect them. In most of the applications, passive infrared sensors look for the change in the environment. The sensors are sensitive to changes in infrared energy rather than absolute levels. The sensor first sets up equilibrium with the background conditions. If the state equilibrium is disturbed due to some intrusion or by some other mechanism, it perceives it as a change. This change is fundamental to the operation of PIR sensors. Figure 28 Fresnel Lance
  • 43. 43 By dividing the region into a number of zones, numbers of separated zones are created. A person while walking through the area will appear in one zone, then disappear and then reappear in the next zone and so on. By doing so, he modulates the reference equilibrium conditions; the process is referred to as chopping. The signal produced is proportional to the temperature difference between the intruder and the background. When a person enters into a particular zone, infra-red level in that zone increases. The increase in the infra-red energy level is detected. The dual elements are excited one after another; resultant output is a positive signal followed by negative signal. In this way, movement of a person is the field of view of the sensor can be detected. However, if the person moves within a zone, it is not possible to detect the changes. [3] Figure 29 Operation of a PIR Sensor
  • 44. 44 CHAPTER 4 GSM NETWORK& SMS 4.1 INTRODUCTION GSM (Global System for Mobile Communications, originally Groupe Spécial Mobile), is a standard developed by the European Telecommunications Standards Institute (ETSI) to describe protocols for second generation (2G) digital cellular networks used by mobile phones. It is the defacto global standard for mobile communications with over 90% market share, and is available in over 219 countries and territories. The GSM standard was developed as a replacement for first generation (1G) analog cellular networks, and originally described a digital, circuit-switched network optimized for full duplex voice telephony. This was expanded over time to include data communications, first by circuit- switched transport, then packet data transport via GPRS (General Packet Radio Services) and EDGE (Enhanced Data rates for GSM Evolution or EGPRS). [1] 4.2 GSM NETWORK The heart of the GSM network includes the following systems to operate wireless services:  Base station subsystem,  GSM carrier frequencies,  Subscriber identity module. 4.2.1 BASE STATION SUBSYSTEM GSM is a cellular network, which means that cell phones connect to it by searching for cells in the immediate vicinity. There are five different cell sizes in a GSM network—macro, micro, pico, femto, and umbrella cells. The coverage area of each cell varies according to the implementation environment. Macro cells can be regarded as cells where the base station antenna is installed on a mast or a building above average rooftop level. Micro cells are cells whose antenna height is under average rooftop level; they are typically used in urban areas. Picocells are small cells whose coverage diameter is a few dozen meters; they are mainly used indoors. Femtocells are cells designed for use in residential or small business environments and connect to the service provider’s network via a broadband internet connection. Umbrella cells are used to cover shadowed regions of smaller cells and fill in gaps in coverage between those cells. Cell horizontal radius varies depending on antenna height, antenna gain, and propagation conditions from a couple of hundred meters to several tens of kilometers. The longest distance the GSM specification supports in practical use is 35 kilometers (22 mi). There are also several
  • 45. 45 implementations of the concept of an extended cell, where the cell radius could be double or even more, depending on the antenna system, the type of terrain, and the timing advance. Indoor coverage is also supported by GSM and may be achieved by using an indoor Picocells base station, or an indoor repeater with distributed indoor antennas fed through power splitters, to deliver the radio signals from an antenna outdoors to the separate indoor distributed antenna system. These are typically deployed when significant call capacity is needed indoors, like in shopping centers or airports. However, this is not a prerequisite, since indoor coverage is also provided by in-building penetration of the radio signals from any nearby cell. [1] 4.2.2 GSM CARRIER FREQUENCIES GSM networks operate in a number of different carrier frequency ranges (separated into GSM frequency ranges for 2G and UMTS frequency bands for 3G), with most 2G GSM networks operating in the 900 MHz or 1800 MHz bands. Where these bands were already allocated, the 850 MHz and 1900 MHz bands were used instead (for example in Canada and the United States). In rare cases the 400 and 450 MHz frequency bands are assigned in some countries because they were previously used for first-generation systems. Most 3G networks in Europe operate in the 2100 MHz frequency band. Regardless of the frequency selected by an operator, it is divided into timeslots for individual phones. This allows eight full-rate or sixteen half-rate speech channels per radio frequency. These eight radio timeslots (or burst periods) are grouped into a TDMA frame. Half-rate channels use alternate frames in the same timeslot. The channel data rate for all 8 channels is 270.833 Kbit/s, and the frame duration is 4.615 ms. The transmission power in the handset is limited to a maximum of 2 watts in GSM 850/900 and 1 watt in GSM 1800/1900. [1] 4.2.4 SUBSCRIBER IDENTITY MODULE (SIM) One of the key features of GSM is the Subscriber Identity Module, commonly known as a SIM card. The SIM is a detachable smart card containing the user's subscription information and phone book. This allows the user to retain his or her information after switching handsets. Alternatively, the user can also change operators while retaining the handset simply by changing the SIM. Some operators will block this by allowing the phone to use only a single SIM, or only a SIM issued by them; this practice is known as SIM locking. [1] 4.3 SMS (SHORT MESSAGE SERVICE) Short message service is a mechanism of delivery of short messages over the mobile networks. It is a store and forward way of transmitting messages to and from mobiles. The message (text only) from the sending mobile is stored in a central short message center (SMC) which then
  • 46. 46 forwards it to the destination mobile. This means that in the case that the recipient is not available; the short message is stored and can be sent later. Each short message can be no longer than 160 characters. These characters can be text (alphanumeric) or binary Non-Text Short messages. An interesting feature of SMS is return receipts. This means that the sender, if wishes, can get a small message notifying if the short message was delivered to the intended recipient. Since SMS used signaling channel as opposed to dedicated channels, these messages can be sent/received simultaneously with the voice/data/fax service over a GSM network. SMS supports national and international roaming. This means that we can send short messages to any other GSM mobile user around the world. With the PCS networks based on all the three technologies, GSM, CDMA and TDMA supporting SMS, SMS is more or less a universal mobile data service. [4] 4.3.1 HOW DOES SMS WORK? The figure below shows a typical organization of network elements in a GSM network supporting SMS. Figure 30 GSM network supporting SMS The SMC (Short Message Center) is the entity which does the job of store and forward of messages to and from the mobile station. The SME (Short Message Entity) which can be located in the fixed network or a mobile station receives and sends short messages. The SMS GW MSC (SMS gateway MSC) is a gateway MSC (Mobile Switching Center) that can also receive short messages. The gateway MSC is a mobile network’s point of contact with other networks. On receiving the short message from the short message center, GMSC uses the SS7 network to interrogate the current position of the mobile station form the HLR, the home location register. HLR (Home Location Register) is the main database in a mobile network. It holds information of the subscription profile of the mobile and also about the routing information for the subscriber,
  • 47. 47 Sensor Input MCU Converts input into string data to form SMS MCU Send destination number to GSM modem MCU Transmit SMS to GSM modem GSM MODEM GSM network: SMS Gatway Destination Number i.e. the area (covered by a MSC) where the mobile is currently situated. The GMSC is thus able to pass on the message to the correct MSC. MSC (Mobile Switching Center) is the entity in a GSM network which does the job of switching connections between mobile stations or between mobile stations and the fixed network. A VLR (Visitor Location Register) corresponds to each MSC and contains temporary information about the mobile, information like mobile identification and the cell (or a group of cells) where the mobile is currently situated. Using information from the VLR, the MSC is able to switch the information (short message) to the corresponding BSS (Base Station System, BSC + BTSs), which transmits the short message to the mobile. The BSS consists of transceivers, which send and receive information over the air interface, to and from the mobile station. This information is passed over the signaling channels so the mobile can receive messages even if a voice or data call is going on. [4] 4.4 HOW WE IMPLEMENTED GSM NETWORK IN OUR PROJECT GSM (Global System for Mobile Communication) is the most popular mobile communication system around the world dominating over 90% of the total mobile communication market. GSM service provider offers various types of services, which includes three main services and they are voice call, short message service (SMS) and internet. GSM services can be gained by using a mobile phone and GSM modem. For our project we have used SMS as our remote monitoring feature for a user. In below we have described the steps how we implemented the GSM network, in our project:  In our project, the microcontroller collects and analyzes the information from the sensors.  Then the microcontroller converts that information into a string of data to form a SMS.  Next the microcontroller sends a destination number to the GSM modem, to set destination for the SMS.  Then the microcontroller transmits the SMS to the GSM modem.  By using the GSM network’s SMS gateway, GSM modem sends the SMS to the destination. Figure 31 Block diagram of implementation of GSM network in the project.
  • 48. 48 CHAPTER 5 AT COMMAND 5.1 GSM MODEMS A GSM modem is a wireless MODEM that works with a GSM wireless network. A wireless modem behaves like a dial-up modem. The main difference between them is that a dial-up modem sends and receives data through a fixed telephone line while a wireless modem sends and receives data through radio waves. There are several types of modems out there. Some shown below: [5] 5.2 What is AT Command? AT commands are instructions used to control a modem. AT is the abbreviation of “ATtention”. Every command line starts with "AT" or "at" and the command is terminated by a Carriage Return ("Enter" key in keyboard). That's why modem commands are called AT commands. [5] The general syntax of AT commands is straightforward. The syntax rules are provided below. Syntax rule 1 All command lines must start with "AT" and end with a Carriage Return character. In a terminal program like HyperTerminal of Microsoft Windows, we can press the Enter key on the keyboard to output a carriage return character. The ASCII value of CR is 0x0D (Decimal13) and string value is "r".[5] Syntax rule 2 A string is enclosed between double quotes. [5] Example: To read all SMS messages from message storage in SMS text mode (at this time we do not need to know what SMS text mode is. More information will be provided later in this SMS tutorial), we need to assign the string "ALL" to the AT command, like this: Figure 34 WAVECOM GSM MODEM Figure 33 SIM900 GSM Module Figure 32 Telit G862 GSM Module
  • 49. 49 AT+CMGL="ALL" Syntax rule 3 Information responses and result codes always start and end with a Carriage Return character and a Line Feed character (ASCII = 0x0A; Decimal = 10; string = 'n'). [5] Example: After sending the command line "AT+CGMI " to the mobile device, the mobile device should return a response similar to this: LF CR Nokia LF CR LF CR OK LF CR The first line is the information response of the AT command and the second line is the final result code. The final result code "OK" marks the end of the response. It indicates no more data will be sent from the mobile device to the PC. When a terminal program such as HyperTerminal of Microsoft Windows sees a carriage return character, it moves the cursor to the beginning of the current line. When it sees a linefeed character, it moves the cursor to the same position on the next line. Case Sensitivity of AT Commands In the SMS specification, all AT commands are in uppercase letters. However, many GSM/GPRS modems and mobile phones allow us to type AT commands in either uppercase or lowercase letters. For example, on Nokia 6021, AT commands are case-insensitive and the following two command lines are equivalent: AT+CMGL at+cmgl The ETSI GSM 07.07 (3GPP TS 27.007) specifies AT commands. The AT command list can be found in their website. However, as this project’s application limited to SMS, only the SMS related AT commands were explained below. [5] 1) ATE0 – Turn off echo This command is used to determine whether or not the modem echoes characters received by microcontroller. For example if we send the following command: "AT", then modem will simply reply: "OK". But if echo is turn on then it will reply: [5] LF CR AT LF CR LF CR OK LF CR It will reply first what he receive and then the response. By default Echo is ON. It should be off for less traffic.