You are on page 1of 59

PROJECT RERPORT ON

GSM BASED ALERT SYSTEM WITH


MOTOR CONTROL

CONTENTS

1. ABSTRACT

2. INTRODUCTION

3. DESCRIPTION AS PER THE DIAGRAMS

4. BLOCK & CIRCUIT DIAGRAMS

5. POWER SOURCE DESCRIPTION

6. DESCRIPTION ABOUT GAS LEAKAGE DETECTORS

7. BRIRF DESCRIPTION ABOUT GSM TECHNOLOGY

8. DESCRIPTION ABOUT MICROCONTROLLER

9. HARDWARE DETAILS

10. SOFTWARE DETAILS

11. CONCLUSIONS AND REFERENCES


GSM BASED ALERT SYSTEM WITH
MOTOR CONTROL

ABSTRACT

The system designed with gas leakage and fire detection sensors is
quite useful for the kitchens at domestic side and in the industries at
commercial side. A gas detector is a device, which detects the presence of
various gases within an area, usually as part of a system to warn about
gases, which might be harmful to humans. Gas detectors can be used to
detect combustible, toxic (poisonous) and CO2 gases. Here TGS 813 is
used as a gas sensor, the data sheets of this device are provided in
hardware details chapter.

TGS 813 is a general-purpose sensor, which has good sensitivity


characteristics to a wide range of gases. This device is designed to
operate at 5V-regulated supply. The most suitable application for the TGS
813 is the detection of methane, propane and butane, which makes it an
excellent sensor for gas leak detectors. This sensor output is used to
trigger the operational amplifier (op-amp); this device is configured as
voltage comparator. With the help of a reference voltage generated at one
input of comparator, sensor output is compared, whenever the sensor
detects any toxic gasses, it generates a potential, which is more than the
reference voltage and there by comparator output will become high. This
high signal is fed to the controller; on receipt of this high signal the
controller sends this information to the authorized person of the house
through GSM i.e., SMS to the number defined in the program.
In the same way for detecting the fire accident, fire sensing circuit is
designed using LDR (Light Dependent Resistor) and trigger circuit. The
LDR is a light sensor, which detects the light intensity when any fire
accident occurs. When fire is detected, the LDR gives a trigger to the
triggering circuit. Up on receiving this signal, the trigger circuit gives a logic
signal to the controller. Instantaneously the controller sends this
information to the fire station for rescue operation immediately. The trigger
circuit is designed using the 555 timer chip configured in monostable multi-
vibrator. Here also through the GSM technology the information is
transmitted to the fire station.

One more function performed in this project is the control of the


motor that may be water pumping of over head tank or the agricultural
application. By sending an SMS from any mobile phone to the GSM
module, the motor can be switched ON as well as can be switched OFF.
For demo purpose here a small DC motor is used to simulate the
agricultural motor. The motor is controlled by the micro controller through
the relay contact. The entire required power supply for the project work is
derived from the mains i.e., single phase supply.
CHAPTER 2

INTRODUCTION

Technological and Industrial development promote the living


standards and give us necessary tools and sciences to face emergencies
but it creates new hazardous situations such as chemical accidents. Due
to the vast use of chemicals, more chemical accidents with huge losses of
money and human damages are taking place. More than 300 major
chemical accidents have been registered in the European Chemical
Accident Center in the years 1985-97. AS Kalra, Henderson and Raines
described (1985) Bhopal methyl isocyanate accident in 1984, which killed
2000-5000 and tens of thousands, was the worst chemical accident in the
recent decades. The explosion of Ammonium Nitrate Train in Nishabor,
Iran, in the current year, which killed 300 and injured more than 500
people, was one of the latest tragedies in this regard. As Leal, Gustavo,
and Santiago (2004) mentioned the study of accidents caused by the
release of flammable liquids and gases particularly vapor cloud explosions,
has been increasingly done in the last decades.

Recent attacks by terrorists such as the destruction of the World


Trade Center in New York City, and the growing availability of chemical and
biological agents to militant organizations, is yielding significant efforts
toward increasing security among the technologically advanced countries.
Generally, there is a trend towards the use of microcontroller equipment in
the fire and gas detection area. Gas detectors are now being used in a
wide variety of applications for process and quality monitoring as well as
safety and environmental compliance. Because prevention helping gas
detectors are more reliable and less expensive than alternative solutions.
As witnessed by a wide array of toxic and combustible gas detection
systems outlined in recent publications, there are many manufacturers who
can offer appropriate instrumentation to protect people at risk of hazardous
chemicals in their atmosphere.

Gas monitoring could be an essential element of city safety systems


for the protection of people and properties on all types of societies and
production platforms. In this study a City Hazardous Gas Monitoring was
designed to detect the leak of toxic and combustible gases in the primary
stages. Gas leakage detector is an intelligent alert system to automatically
detect the hazardous gases increasing in the city atmosphere in selected
sites and warns the formerly determined authorities and residents by
automatic calling and activating field sounders respectively.

Modern homes are currently designed and constructed to be airtight


environments. Standard residential fuel-burning furnaces require a
sufficient supply of oxygen in order to achieve complete fuel combustion.
When there is incomplete combustion of heating fuels such as natural gas,
carbon monoxide gas is created. Carbon monoxide is a colorless,
odorless, tasteless, and invisible gas, which acts as a highly dangerous
cumulative toxicant. When carbon monoxide is inhaled into the human
body, it replaces oxygen molecules in the human body's hemoglobin. If a
person continues to inhale carbon monoxide, more and more oxygen
molecules are replaced, and eventually, the person experiences difficult
breathing, nausea, brain damage and even death.

An effective way to monitor the presence of carbon monoxide in a


residential home, is to place a carbon monoxide detector in a bedroom,
where residents spend substantial periods of time in the especially
vulnerable activity of sleeping. To Viewing discloses a portable multiple
warning device, which includes an alarm and a smoke or gas detector.
However, the gas detector only provides the user with a single type of
audible alarm to indicate dangerous levels of gases such as carbon
monoxide. This device does not advise the user of specific gas detection
information, or provide safety instructions appropriate to the concentration
of gas detected. The microcontroller-based system provides fast, accurate
and continuous monitoring of gases in extreme environments.

Protection of homes, offices, premises and facilities is extremely


important. The project work is directed to a method for alerting residents to
hazardous gas concentrations, comprising an alarm, a gas sensor, fire
sensor, GSM and 89C51 microcontroller. The gas sensor senses the
concentration of a specified hazardous gas and generates co-relatable
sensor signals. The controller is operatively coupled to the GSM and the
gas sensor, and sends an SMS automatically to the authorized person
mobile. The demonstration module is designed with TGS 813 Gas sensor
has high sensitivity to methane, propane, and butane, making it ideal for
natural gas and LPG monitoring and fire sensor for detecting the fire
accident and send the information to the fire station. The system uses the
microcontroller as the brain or center of operations.

These days GSM based project works are gaining popularity


because of unique facilities provided by the GSM network. The term GSM
stands for Global System for mobile communications and the network is
designed based on European standards. Many concepts from simple to
complex systems are designed based on this technology for various
applications, but here the system designed with GSM module is quite
unique and it is quite useful for domestic as well as commercial
applications to control the appliances and get the information of accidents.
CHAPTER 3

DESCRIPTION AS PER THE BLOCK DIAGRAM

The block diagram of the present project consists of the 89C51


microcontroller, Gas sensor, fire sensor, relay to operate the motor and
GSM modem for communication. The microcontroller plays major role in
receiving the data from the sensor and to take the required action. The gas
sensor is used to detect the presence of smoke. According to the received
data the microcontroller sends the information to the authorized person
mobile through the GSM in the form of an SMS. The smoke sensor detects
the gas leak and feed the signal to the controller and the controller sends
information to the authorized person. In this concept this project work is
taken up, which alerts the concern persons at remote place when there is
a gas leak or fire accident. An additional operation can also be performed
to switch ON and OFF the motor as well. The following is the description of
individual blocks.

GENERAL CHARACTERISTICS OF TGS 813 GAS SENSOR

TGS 813 is a general purpose Sensor that has good sensitivity


characteristics to a wide range of gases. This device is designed to
operate with a stabilized 5V heater supply and a circuit voltage depends up
the design. The most suitable application for the TGS 813 is the detection
of methane, propane and butane, which makes it an excellent Sensor for
domestic gas, leak detectors.

The initial stabilization time of the TGS 8813 is very short and the
relative and elapsed characteristics are very good over a long period of
Operation. TGS 813 has a very low sensitivity to 'noise-gases, which
considerably reduces the Problem of nuisance alarming. The TGS 8813 is
most practically employed in a circuit design, which maintains circuit
voltages at fixed value of 5V. This voltage rating is very practical when
determining design specifications because of the wide range of available
components. This makes the use of the TGS 813 an especially economical
way to design low-cost, highly reliable gas detection circuits.

Because of its especially high sensitivity to methane, propane and


butane, the TGS 813 is very practical for Town Gas and LPG monitoring.
With the added features of a short-initial stabilization period and highly
reliable elapsed characteristics, the TGS 813 represents a new generation
of gas Sensors from Figaro. These sensors are molded with Resin.

STRUCTURAL SPECIFICATIONS:

The TGS 813 is a sintered bulk semiconductor composed mainly of


tio-dioxide. The semiconductor material and electrodes are deposited on
a ceramic tubular former. The heater coil is located inside the ceramic
former. This coil, made of 60-micron diameter wire, has a resistance of 30
ohms. The lead wires from the Sensor electrodes are a gold alloy of 80-
micron diameter. The heater and lead wires are spot welded to the Sensor
pins, which are arranged to fit a 6-pin miniature tube socket. The Sensor
base and cover are made of nylon. The deformation temperature for this
material is in excess of 240C. The upper and lower openings in the
Sensor case are covered with a flameproof double layer of 100-mesh
stainless steel gauze. Independent tests confirm that this mesh will prevent
a spark produced inside the flameproof cover from igniting an explosive.

BASIC MEASURING CIRCUIT WITH TGS SENSOR:


The following is the basic test circuit

The Variation in resistance of the TGS sensors measured indirectly


as a Change in voltage appearing across the load resistor RL. In fresh air
the current passing through the Sensor and RL in series is steady, but
when a combustible gas such as propane, methane etc. comes in contact
with the Sensor surface, the Sensor resistance decreases in accordance
with the gas concentration present. The voltage Change across RL is the
same when VC and VH are supplied from AC or DC sources. One can feel
that this circuit is most suitable for evaluating the TGS 813 performance
because of the ease in measuring the output signal.

TEMPERATURE AND HUMIDITY

The sensitivity characteristics of the TGS 813 Sensor are altered by


changes in atmospheric temperature and humidity. The detection principle
of the TGS is based on Chemical adsorption and desertion of gases on the
Sensor surface. Because these reactions are temperature dependent and
water vapor tan be considered a gas, the effects of temperature and
humidity changes cannot be eliminated from the Sensor. These effects tan
however be reduced by circuit design.

TIME FOR INITIAL STABILIZATION

A TGS Sensor, which has been stored de-energized for a long


period, takes some time to reach its normal operating condition following
switch on. From the moment of switch on the sensor's conductivity first
rises rapidly and then falls towards its final stable value. The time taken to
stabilize is a function of the sensor's storage time and atmosphere. In
general, the longer the storage time, the longer the initial action time. In the
case of Sensor type 8813, the initial action time reaches its maximum
value after about 20 days storage. In normal applications the initial action
time will be less than 2 minutes. It is important to note that if the Sensor is
placed in the air containing gas immediately after the "Initial Action", then
the Rs value will appear according to the characteristics described in the
next section.

TIME DEPENDENCY CHARACTERISTICS

When the Sensor is energized after a long storage period it takes


approximately 1-10 days for the Sensor to reach a stable resistance level.
Please note, that the actual transitional time necessary to reach stability is
dependent on the amount of time the Sensor has been stored and the
atmospheric conditions under which it has been stored. Regarding the
above characteristics of the Sensor, it is strongly recommend that to wait
until the Sensor has reached a stable output level before we calibrate.

SENSOR LIFE

The life of the sensors decreases slowly in the form of fluctuations in


sensitivity with time based over a 9-year period using some of the TGS
Sensors originally produced. Current TGS Sensors have been
considerably improved since then but retain the same time dependency
characteristics as the early models. On long term Operation, the
performance of the device will be decreased gradually, but is specifically
related to TGS 813 Performance. It should be noted that since the TGS
813 is a relatively new product, the graph covers only a three-year period
of testing. In both cases these measurements were made in natural air
rather than in a temperature/humidity controlled environment. The cyclic
Change in sensitivity corresponds to the seasonal changes in Japan with
the peak sensitivity occurring in July. Although the data related to 813
Performance covers only a three-year period, we have found based on our
extensive laboratory testing and past experience with millions of Sensors,
that the TGS Sensors have a long-term effectiveness for at least 8-10
years.
.
PRACTICAL DETECTOR CIRCUIT USING THE 813 SENSOR

As it was mentioned above the TGS 813 is suitable for use in the
detection of a wide range of gases such as natural gas, L.P.G. and town
gas. When we design a circuit employing the TGS 813 we must consider
both the type and concentration of gas we wish to detect. Because of its
sensitivity characteristics, the action of the Sensor will vary according to
the type and concentration of gas it is detecting. Furthermore, the proper
alarm Point for the detector should be determined after considering the
following factors,
a. Where the Sensor is to be installed
b. Purpose of detector (gas leak, automatic fan control, air monitoring, etc.)
c. Operation of detector (Sound, light, fan control, valve control, etc.)
d. Type of gas being detected or monitored.

OP-AMP DESCRIPTION

The operational amplifier is arguably the most useful single device in


analog electronic circuitry. With only a handful of external components, it
can be made to perform a wide variety of analog signal processing tasks. It
is also quite affordable, most general-purpose amplifiers selling for under a
dollar apiece. Modern designs have been engineered with durability in
mind as well: several "op-amps" are manufactured that can sustain direct
short-circuits on their outputs without damage.

One key to the usefulness of these little circuits is in the engineering


principle of feedback, particularly negative feedback, which constitutes the
foundation of almost all automatic control processes. The principles
presented here in operational amplifier circuits, therefore, extend well
beyond the immediate scope of electronics. It is well worth the electronics
student's time to learn these principles and learn them well.

LM324 QUAD OPERATIONAL AMPLIFIER

This device consists of 14 pins. It consists of four independent, high


gain, internally frequency compensated operational amplifiers which were
designed specifically to operate from a single power supply over a wide
range of voltages. Operation from split power supplies is also possible and
the low power supply current drain is independent of the magnitude of the
power supply voltage. pplication areas include transducer amplifiers, dc
gain blocks and all the conventional operation amplifier circuits, which now
can be more easily implemented in single power supply systems. For
example, the lm324 series can be directly operated off of the standard +5v
power supply voltage, which is used in digital systems and will easily
provide the required interface electronics without requiring the additional
+15v power supplies.
The below is the figure of LM 324 quad operational device showing
the function of each pin

Description

The LM124 series consists of four independent, high gain, internally


frequency compensated operational amplifiers which were designed
specifically to operate from a single power supply over a wide range of
voltages. Operation from split power supplies is also possible and the low
power supply current drain is independent of the magnitude of the power
supply voltage.
Application areas include transducer amplifiers, DC gain blocks and
all the conventional op amp circuits, which now can be more easily
implemented in single power supply systems. For example, the LM124
series can be directly operated off of the standard +5V power supply
voltage, which is used in digital systems and will easily provide the
required interface electronics without requiring the additional 15V power
supplies.

The LM324 contains four independent high gain operational


amplifiers with internal frequency compensation. The four op-amps operate
over a wide voltage range from a single Power supply. Also use a split
power supply. The device has low power supply current drain, regardless
of the power supply voltage. The low power drain also makes the LM324 a
good choice for battery operation. The LM324 series are low-cost, quad
operational amplifiers with true differential inputs. They have several
distinct advantages over standard operational amplifier types in single
supply applications.

General Description

The LM124 series consists of four independent, high gains;


internally frequency compensated operational amplifiers, which were
designed specifically to operate from a single power supply over a wide
range of voltages. Operation from split power supplies is also possible and
the low power supply current drain is independent of the magnitude of the
power supply voltage.

Application areas include transducer amplifiers, DC gain blocks and


all the conventional op amp circuits, which now can be more easily
implemented in single power supply systems. For example, the LM124
series can be directly operated off of the standard a5V power supply
voltage, which is used in digital systems and will easily provide the
required interface electronics without requiring the additional g15V power
supplies.
Unique Characteristics

In the linear mode the input common-mode voltage range includes


ground and the output voltage can also swing to ground, even
though operated from only a single power supply voltage
The unity gain cross frequency is temperature compensated
The input bias current is also temperature compensated

Advantages

Eliminates need for dual supplies


Four internally compensated op amps in a single package
Allows directly sensing near GND and VOUT also goes to GND
Compatible with all forms of logic
Power drain suitable for battery operation

Features

Internally frequency compensated for unity gain


Large DC voltage gain 100 dB
Wide bandwidth (unity gain) 1 MHz (temperature compensated)
Wide power supply range: Single supply 3V to 32V or dual supplies
1.5V to 16V
Very low supply current drain (700 A)-essentially independent of
supply voltage
Low input biasing current 45 nA (temperature compensated)
Low input offset voltage 2 mV and offset current: 5 nA
Input common-mode voltage range includes ground
Differential input voltage range equal to the power supply voltage
Large output voltage swing 0V to V+ - 1.5V

Representative circuit diagram of LM324:

Circuit Description:

The LM324 series is made using four internally compensated, two


stage operational amplifiers. The first stage of each consists of differential
input devices Q20 and Q18 with input buffer transistors Q21 and Q17 and
the differential to single ended converter Q3 and Q4. The first stage
performs not only the first stage gain function but also performs the level
shifting and Tran conductance reduction functions. By reducing the Tran
conductance, a smaller compensation capacitor (only 5.0 pF) can be
employed, thus saving chip area. The Tran conductance reduction is
accomplished by splitting the collectors of Q20 and Q18. Another feature of
this input stage is that the input common mode range can include the
negative supply or ground, in single supply operation, without saturating
either the input devices or the differential to single ended converter. The
second stage consists of a standard current source load amplifier stage.

Microcontroller Unit

The AT89C51 is a low-voltage, high-performance CMOS 8-bit


microcomputer with 4K bytes of Flash programmable and erasable read-
only memory (PEROM). The device is manufactured using Atmels high-
density nonvolatile memory technology and is compatible with the industry-
standard MCS-51 instruction set. By combining a versatile 8-bit CPU with
Flash on a monolithic chip, the AT89C51 is a powerful microcomputer,
which provides a highly flexible and cost-effective solution to many
embedded control applications. The AT89C51 provides the following
standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two
16-bit timer/counters, a five vector two-level interrupt architecture, a full
duplex serial port, a precision analog comparator, on-chip oscillator and
clock circuitry. In addition, the AT89C51 is designed with static logic for
operation down to zero frequency and supports two software selectable
power saving modes. The Idle Mode stops the CPU while allowing the
RAM, timer/counters, serial port and interrupt system to continue
functioning. The power-down mode saves the RAM contents but freezes
the oscillator disabling all other chip functions until the next hardware
reset.
A Micro controller consists of a powerful CPU tightly coupled with
memory, various I/O interfaces such as serial port, parallel port timer or
counter, interrupt controller, data acquisition interfaces-Analog to Digital
converter, Digital to Analog converter, integrated on0 to a single silicon
chip. If a system is developed with a microprocessor, the designer has to
go for external memory such as RAM, ROM, EPROM and peripherals. But
controller is provided all these facilities on a single chip. Development of a
Micro controller reduces PCB size and cost of design.

One of the major differences between a Microprocessor and a Micro


controller is that a controller often deals with bits not bytes as in the real
world application.
Intel has introduced a family of Micro controllers called the MCS-51.

GAS SENSOR

Gas sensor is used to detect any leakage of hazardous gases and


smoke such that an alarm can be initiated to avoid any damages in
the industries. These sensors are also used in many applications like
corporate and in any office work areas these are linked to fire alarms
and buzzers through the micro-controller.

Smoke Detectors

There are two main types of smoke detectors: ionization detectors


and photoelectric detectors. A smoke alarm uses one or both methods,
sometimes plus a heat detector, to warn of a fire.

Ionization Detectors

Ionization detectors have an ionization chamber and a source of


ionizing radiation. The source of ionizing radiation is a minute quantity of
americium-241 (perhaps 1/5000th of a gram), which is a source of alpha
particles (helium nuclei). The ionization chamber consists of two plates
separated by about a centimeter. The battery applies a voltage to the
plates, charging one plate positive and the other plate negative. Alpha
particles constantly released by the americium knock electrons off of the
atoms in the air, ionizing the oxygen and nitrogen atoms in the chamber.
The positively charged oxygen and nitrogen atoms are attracted to the
negative plate and the electrons are attracted to the positive plate,
generating a small, continuous electric current. When smoke enters the
ionization chamber, the smoke particles attach to the ions and neutralize
them, so they do not reach the plate. The drop in current between the
plates triggers the alarm.

LOW FREQUENCY GENERATOR

The main function of this circuit is to generate the tone frequency


that is to be transmitted along with the carrier frequency. The circuit is
designed to vary the frequency; there by different tone frequencies can be
produced at receiver. As described in previous chapter, the timer IC used
to generate square pulses is configured in Astable mode of operation. In
this configuration, the timing capacitor C charges and discharges
continuously. Based on the charging time and discharging time, the pulse
rate is depended. The description is as followed.

The 555 timer IC was first introduced around 1971 by the Signetics
Corporation as the SE555/NE555 and was called "The IC Time Machine"
and was also the very first and only commercial timer IC available. It
provided circuit designers with a relatively cheap, stable, and user-friendly
integrated circuit for both monostable and astable applications. Since this
device was first made commercially available, a countless of novel and
unique circuits have been developed and presented in several trade,
professional, and hobby publications.

Although these days the CMOS version of this IC, like the Motorola
MC1455, is mostly used, the regular type is still available; however there
have been many improvements and variations in the circuitry. But all types
are pin-for-pin plug compatible. This timer uses a maze of transistors,
diodes and resistors and for this complex reason a more simplified (but
accurate) block diagram is used to explain the internal organizations of the
555.

The equivalent circuit, in block diagram, providing the functions of


control, triggering, level sensing or comparison, discharge, and power
output. Some of the more attractive features of the 555 timer are: Supply
voltage between 4.5 and 18 volt, supply current 3 to 6 mA, and a Rise/Fall
time of 100 n Seconds. It can also withstand quite a bit of abuse. The
Threshold current determine the maximum value of Ra + Rb. For 15-volt
operation the maximum total resistance for R (Ra +Rb) is 20 Mega ohms.
Inside the 555 timer, at fig. 3, are the equivalent of over 20
transistors, 15 resistors, and 2 diodes, depending of the manufacturer.

All IC timers rely upon an external capacitor to determine the off-on


time intervals of the output pulses. It takes a finite period of time for a
capacitor (C) to charge or discharge through a resistor (R). Those times
are clearly defined and can be calculated given the values of resistance
and capacitance.

The basic RC charging circuit is shown in fig. 4. Assume that the


capacitor is initially discharged. When the switch is closed, the capacitor
begins to charge through the resistor. The voltage across the capacitor
rises from zero up to the value of the applied DC voltage. The charge
curve for the circuit is shown in
fig. 6. The time that it takes for
the capacitor to charge to
63.7% of the applied voltage is
known as the time constant (t).
That time can be calculated
with the simple expression:

t=RXC

Assume a resistor value of 1


M and a capacitor value of
1uF. The time constant in that
case is:

t = 1,000,000 X 0.000001 = 1 second

Assume further that the applied voltage is 6 volts. That means that it
will take one time constant for the voltage across the capacitor to reach
63.2% of the applied voltage. Therefore, the capacitor charges to
approximately 3.8 volts in one second.

As described above, in the siren circuit both ICs are configured in


astable mode of operation, the following is the description.

Astable operation: in astable multivibrator, both the trigger and threshold


inputs (pins 2 and 6) to the two comparators are connected together and to
the external capacitor. The capacitor charges toward the supply voltage
through the two resistors, R1 and R2. The discharge pin (7) connected to
the internal transistor is connected to the junction of those two resistors.

When power is first applied to the circuit, the capacitor will be


uncharged; therefore, both the trigger and threshold inputs will be near
zero volts. The lower comparator sets the control flip-flop causing the
output to switch high. That also turns off transistor T1. That allows the
capacitor to begin charging through R1 and R2. As soon as the charge on
the capacitor reaches 2/3 of the supply voltage, the upper comparator will
trigger causing the flip-flop to reset. That causes the output to switch low.
Transistor T1 also conducts. The effect of T1 conducting causes resistor
R2 to be connected across the external capacitor. Resistor R2 is effectively
connected to ground through internal transistor T1. The result of that is that
the capacitor now begins to discharge through R2.

As soon as the voltage across the capacitor reaches 1/3 of the


supply voltage, the lower comparator is triggered. That again causes the
control flip-flop to set and the output to go high. Transistor T1 cuts off and
again the capacitor begins to charge. That cycle continues to repeat with
the capacitor alternately charging and discharging, as the comparators
cause the flip-flop to be repeatedly set and reset. The resulting output is a
continuous stream of rectangular pulses. The frequency of operation of the
astable circuit is dependent upon the values of R1, R2, and C. The
frequency can be calculated with the formula:

f = 1/(.693 x C x (R1 + 2 x R2))

The Frequency f is in Hz, R1 and R2 are in ohms, and C is in farads.


The time duration between pulses is known as the 'period', and usually
designated with at. The pulse is on for t1 seconds, then off for t2 seconds.
The total period (t) is t1 + t2.

That time interval is related to the frequency by the familiar relationship:

f = 1/t or t = 1/f

The time intervals for the on and off portions of the output depend
upon the values of R1 and R2. The ratio of the time duration when the
output pulse is high to the total period is known as the duty-cycle. The
duty-cycle can be calculated with the formula:

D = t1/t = (R1 + R2) / (R1 + 2R2)

t1 and t2 times can be calculated with the formulas below:

t1 = .693(R1+R2)C t2 = .693 x R2 x C

Relay Unit

The relays driver circuit consists of switching transistors and relays.


Relay is an electromagnetic switch. It has one common point and one
normally open (N/O) and one normally close (N/C) contact. This block has
the potential to drive the various controlled devices. The relay is connected
with a +12V power supply. The O/P from port 3 of the microcontroller is
connected to the base of the transistor BC547. The emitter of the transistor
is grounded. When the base of the transistor goes high its O/P goes high,
switching the relay. IN4007 diode is provided to prevent the back EMF of
the circuit. Output signal from AT 89C2051 is given to the base of the
transistor, which we are further energizing the particular relay because of
this appropriate device is selected and it do its allotted function. Detail
description is provided in the further chapters.

GSM modem (900/1800 MHz)

Semens GSM/GPRS Smart Modem is a multi-functional, ready to use,


rugged unit that can be embedded or plugged into any application. The Smart
Modem can be controlled and customized to various levels by using the
standard AT commands. The modem is fully type-approved, it can speed up the
operational time with full range of Voice, Data, Fax and Short Messages (Point
to Point and Cell Broadcast), the modem also supports for data transfer. GSM
is one of the latest mobile technologies using smart MODEM, which can easily
interfaced to embedded Microcontrollers. Now everything is going to be
automated using this technology, using this technology we can monitor the
particular machine parameters. Using GSM and GPS now we can identify the
people, vehicles etc in any where of the world.
CHAPTER 5

POWER SOURCE DESCRIPTION

The power Supply is a Primary requirement for the project work.


Before designing a power supply, first we must calculate how much current
is required to drive entire circuit including LCD & control unit. As per the
calculations based on the assumption, it is estimated that the entire circuit
power consumption of data transmitting module will not exceed more then
350 milliamps. Here two separate power supply units are constructed for
data transmitter & data receiver. The data receiving module consumes less
power when compared with data transmitting module, because this module
is having lot of electronic hardware. As specified above, it is clear that any
module will not consume more then 350 milliamps, therefore a higher
rating transformer of 750 milliamps at secondary is to be selected for the
safe side.

Since the required DC power supply for the total circuitry to be


derived from the single phase mains, a step down transformer with center
tapped secondary of 12V-0-12V transformer is considered for the purpose.
The secondary is rectified with two diodes to convert the AC in to DC, for
this purpose higher rating diodes of 2N4007 are selected; these diodes
can with stand up to 400V at 1 Amp current. Now a large capacitor of
1,000 micro-farads is connected across the DC source for eliminating the
AC ripple, there by smooth DC is availed from the power supply unit.

The DC voltage derived from the supply is un-regulated, initially


around 18V DC is available at no load, when load is connected, and the
voltage may fall down by 13V. The main draw back of this un-regulated
supply is, it varies according to the line voltage, for buzzer & relay it
doesnt effect voltage fluctuations, because these devices are designed to
operate from 10V to 15V DC, where as for control circuit & other electronic
devices like LCD & ADC, a stable supply of +5V is essential, therefore with
the help of a positive voltage regulator, a constant voltage source of +5V is
derived. For this purpose 7805 3Pin Voltage regulator is used so that,
though the mains supply varies from 170V to 250V, the output DC level
remains constant. The 7805 used in this project work can deliver a
maximum current of 800 Milli-amps, this device is having thermal shut-
down facility internally such that whenever the device body temperature
rises more then 70 degree centigrade, automatically output become zero
and protects the regulator burning due to the over temperature. A suitable
Aluminum heat sink coupled to the regulator body is essential when
maximum current is drawn. As stated above, the consumption is less, here
heat sink is not required.

Rectification is a process of rendering an alternating current or


voltage into an unidirectional one. The component used for rectification is
called Rectifier. A rectifier permits current to flow only during the positive
half cycles of the applied AC voltage by eliminating the negative half cycles
or alternations of the applied AC voltage. Thus pulsating DC is obtained. To
obtain smooth DC power, additional filter circuits are required.

A diode can be used as rectifier. There are various types of diodes.


But, semiconductor diodes are very popularly used as rectifiers. A
semiconductor diode is a solid state device consisting of two elements is
being an electron emitter or cathode, the other an electron collector or
anode. Since electrons in a semiconductor diode can flow in one direction
only-form emitter to collector- the diode provides the unilateral conduction
necessary for rectification.
The rectified Output is filtered for smoothening the DC, for this
purpose suitable capacitor is to be selected depending up on the current
rating, generally for 1Amp rating power supply 1000 Micro-farad capacitor
is used in the filter circuit, hear the supply rating is more, so that heavy
capacitor is used. The filter capacitors are usually connected in parallel
with the rectifier output and the load. The AC can pass through a capacitor
but DC cannot, the ripples are thus limited and the output becomes
smoothed. When the voltage across the capacitor plates tends to rise, it
stores up energy back into voltage and current. Thus the fluctuation in the
output voltage is reduced considerable.

The circuit diagram of this power supply is shown in main diagram,


and the data sheets of voltage regulator are provided in hardware details
chapter.

The following is the circuit diagram of Power supply.


CHAPTER 6

DESCRIPTION ABOUT GAS LEAKAGE DETECTORS

Gas leak detection

Gas leak detection is the process of identifying potentially hazardous


gas leaks by means of various sensors. These sensors usually employ an
audible alarm to alert people when a dangerous gas has been detected.
Common sensors used today include Infrared Point Sensors, Ultrasonic
Sensors, Electrochemical Sensors, and Semiconductor Sensors. These
sensors are used for a wide range of applications, and can be found in
industrial plants, refineries, wastewater treatment facilities, vehicles, and
around the home.

History

Electrochemical Detectors

Electrochemical gas detectors work by allowing gases to diffuse


through a porous membrane to an electrode where it is either oxidized or
reduced. The amount of current produced is determined by how much of
the gas is oxidized at the electrode. The sensor is then able to determine
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 tends to be more stable and
reliable over the sensor's duration and thus requires less maintenance
than other types of detectors. However, the sensors themselves are
subject to corrosive elements 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.

Infrared Point Detectors

Infrared point sensors (IR) use radiation passing through a volume


of gas to detect leaks. Energy from the radiation is absorbed as it passes
through the gas at certain wavelengths. The range of wavelengths that is
absorbed depends on the properties of the specific gas. Carbon monoxide
absorbs wavelengths of about 4.2-4.5 m, for example. This is
approximately a factor of 10 larger than the wavelength of visible light,
which ranges from .39 m to .75 m for most people. The energy in this
wavelength is compared to a wavelength outside of the absorption range;
the difference in energy between these two wavelengths is proportional to
the concentration of gas present. This type of sensor is advantageous
because it does not have to be placed in the gas itself in order to detect it.
Infrared point sensors can be used to detect hydrocarbons, compounds
composed of hydrogen and carbon atoms, and other infrared active gases
such as water vapor and calcium fluoride. IR sensors are commonly found
in wastewater treatment facilities, refineries, gas turbines, chemical plants,
and other facilities where flammable gases are present and the possibility
of an explosion exists. Engine emissions are another area where IR
sensors are being researched for use. The sensor would be able to detect
high levels of carbon dioxide in the vehicles exhaust, and even be
integrated with the vehicles electronic systems to notify drivers.

Semiconductor Detectors

Semiconductor sensors detect gases by a chemical reaction that


takes place when the gas comes in contact with the sensor. Tin dioxide 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 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, and harmful gases such as carbon monoxide. One of the most
common uses for semiconductor sensors is in carbon monoxide sensors.
They are also used in breathalyzers. Because the sensor must come in
contact with the gas in order to detect it, semiconductor sensors work in a
smaller range than infrared point or ultrasonic detectors.

Ultrasonic Detectors

Ultrasonic gas detectors use acoustic sensors to detect changes in


the background noise of its environment. Since most gas leaks occur in the
ultrasonic range of 25 kHz to 10 MHz, the sensors are able to easily
distinguish these frequencies from background 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 dont measure gas concentration, the device is still able to
determine the leak rate of an escaping gas. By measuring its ultrasonic
sound level, the detector is able to determine the leak rate, which depends
on the gas pressure and size of the leak. The bigger the leak, the larger its
ultrasonic sound level will be. Ultrasonic gas detectors are mainly used for
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.

Holographic Detectors

Holographic gas Sensor use light reflection to detect changes in a


polymer film matrix containing a hologram. Since holograms reflect light at
certain wavelengths a change in their composition can generate a colorful
reflection indicative of the presence of a gas molecule. Holographic sensor
require however illumination sources such as white light or lasers and an
observer or CCD detector.

Household Safety

There are many different sensors that can be purchased to detect


hazardous gases around the house. Carbon monoxide is a very dangerous
gas that robs the lungs of oxygen, killing hundreds of people worldwide
each year. It is an odorless, colorless gas, making it impossible for humans
to detect it. Carbon monoxide detectors can be purchased for around $20-
60. Handheld flammable gas detectors can be used to trace leaks from
natural gas lines, propane tanks, butane tanks, or any other combustible
gas. These sensors can be purchased for $35-100.
CHAPTER - 7

DETAILED DESCRIPTION OF GSM

Introduction:

GSM (Global System for Mobile Communications) is a digital cellular


communications system. It was developed in order to create a common
European mobile telephone standard but it has been rapidly accepted
worldwide. GSM is designed to provide a comprehensive range of services and
features to the users not available on analogue cellular networks and in many
cases very much in advance of the old public switched telephone network
(PSTN). In addition to digital transmission, GSM incorporates many advanced
services and features like worldwide roaming in other GSM networks.

History of GSM and cellular mobile Radio:

The idea of cell-based mobile radio systems appeared at Bell


Laboratories (in USA) in the early 1970s. However, mobile cellular systems
were not introduced for commercial use until the 1980s. During the early 1980s,
analog cellular telephone systems experienced a very rapid growth in Europe,
particularly in Scandinavia and the United Kingdom, but also in France and
Germany. Each country developed its own system, which was incompatible with
everyone else's in equipment and operation. But in the beginnings of cellular
systems, each country developed its own system, which was an undesirable
situation for the following reasons:

The equipment was limited to operate only within the boundaries of each
country, which in a unified Europe were increasingly unimportant.
The market for mobile equipment was limited, so economies of scale,
and the subsequent savings, could not be realized.

In order to overcome these problems, the Conference of European Posts


and Telecommunications (CEPT) formed, in 1982, the Group Special Mobile
(GSM) in order to develop a pan-European mobile cellular radio system (the
GSM acronym became later the acronym for Global System for Mobile
communications). The standardized system had to meet certain criterias:

Good subjective speech quality

Support for international roaming

Ability to support handheld terminals

Support for range of new services and facilities

Spectral efficiency

Low mobile and base stations costs

Compatibility with other systems such as Integrated Services Digital


Network (ISDN)

In 1989 the responsibility for the GSM specifications passed from the
CEPT to the European Telecommunications Standards Institute (ETSI). The
commercial use of GSM started around mid-1991. By the beginning of 1994,
there were 1.3 million subscribers worldwide. By the beginning of 1995, there
were 60 countries with operational or planned GSM networks in Europe, the
Middle East, the Far East, Australia, Africa, and South America, with a total of
over 5.4 million subscribers. As of the end of 1997, GSM service was available
in more than 100 countries and has become the de facto standard in Europe
and Asia. Presently, GSM networks are operational or planned in over 80
countries around the world.

Technical details

GSM is a cellular network, which means that mobile phones connect to it


by searching for cells in the immediate vicinity. GSM networks operate in a
number of different frequency ranges (separated into GSM frequency ranges
for 2G and UMTS frequency bands for 3G). Most 2G GSM networks operate in
the 900 MHz or 1800 MHz bands. Some countries in the Americas (including
Canada and the United States) use the 850 MHz and 1900 MHz bands
because the 900 and 1800 MHz frequency bands were already allocated. Most
3G GSM networks in Europe operate in the 2100 MHz frequency band

The rarer 400 and 450 MHz frequency bands are assigned in some
countries where these frequencies were previously used for first-generation
systems.

GSM-900 uses 890915 MHz to send information from the mobile station
to the base station (uplink) and 935960 MHz for the other direction (downlink),
providing 124 RF channels (channel numbers 1 to 124) spaced at 200 kHz.
Duplex spacing of 45 MHz is used. In some countries the GSM-900 band has
been extended to cover a larger frequency range. This 'extended GSM', E-
GSM, uses 880915 MHz (uplink) and 925960 MHz (downlink), adding 50
channels (channel numbers 975 to 1023 and 0) to the original GSM-900 band.
Time division multiplexing is used to allow eight full-rate or sixteen half-rate
speech channels per radio frequency channel. There are eight radio timeslots
(giving eight burst periods) grouped into what is called 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 GSM850/900 and 1 watt in GSM1800/1900.

GSM has used a variety of voice codes to squeeze 3.1 kHz audio into
between 5.6 and 13 kbit/s. Originally, two codes, named after the types of data
channel they were allocated, were used, called Half Rate (5.6 kbit/s) and Full
Rate (13 kbit/s). These used a system based upon linear predictive coding
(LPC). In addition to being efficient with bitrates, these codes also made it
easier to identify more important parts of the audio, allowing the air interface
layer to prioritize and better protect these parts of the signal.

GSM was further enhanced in 1997[12] with the Enhanced Full Rate (EFR)
codec, a 12.2 kbit/s codec that uses a full rate channel. Finally, with the
development of UMTS, EFR was refactored into a variable-rate codec called
AMR-Narrowband, which is high quality and robust against interference when
used on full rate channels, and less robust but still relatively high quality when
used in good radio conditions on half-rate channels.

There are five different cell sizes in a GSM networkmacro, 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 roof
top level. Micro cells are cells whose antenna height is under average roof top
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 providers 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
kilometres. The longest distance the GSM specification supports in practical
use is 35 kilometres (22 mi). There are also several 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 picocell 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 a lot of call capacity is needed indoors, for example 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
nearby cells.

The modulation used in GSM is Gaussian minimum-shift keying (GMSK),


a kind of continuous-phase frequency shift keying. In GMSK, the signal to be
modulated onto the carrier is first smoothed with a Gaussian low-pass filter prior
to being fed to a frequency modulator, which greatly reduces the interference to
neighboring channels (adjacent channel interference).

Architecture of the GSM Network:

The GSM mobile telephony service is based on a series of contiguous


radio cells which provide complete coverage of the service area and allow the
subscriber operation anywhere within it. Prior to this cellular concept,
radiophones were limited to just the one transmitter covering the whole service
area. Cellular telephony differs from the radiophone service because instead of
one large transmitter, many small ones are used to cover the same area. The
basic problem is to handle the situation where a person using the phone in one
cell moves out of range of that cell. In the radiophone service there was no
solution and the call was lost, which is why the service area was so large. In
cellular telephony, handing the call over to the next cell solves the problem.
This process is totally automatic and requires no special intervention by the
user, but it is a complex technical function requiring significant processing
power to achieve a quick reaction.

The functional architecture of a GSM system can be broadly divided into


the Mobile Station, the Base Station Subsystem, and the Network Subsystem.
Each subsystem is comprised of functional entities that communicate through
the various interfaces using specified protocols. The subscriber carries the
mobile station; the base station subsystem controls the radio link with the
Mobile Station. The network subsystem, which is the main part of which is the
Mobile services Switching Center, performs the switching of calls between the
mobile and other fixed or mobile network users, as well as management of
mobile services, such as authentication.

Mobile Station:

The Mobile Station (MS) represents the only equipment the GSM user
ever sees from the whole system. It actually consists of two distinct entities.
The actual hardware is the Mobile Equipment (ME), which is anonymous and
consists of the physical equipment, such as the radio transceiver, display and
digital signal processors. The subscriber information is stored in the Subscriber
Identity Module (SIM), implemented as a Smart Card. The mobile equipment is
uniquely identified by the International Mobile Equipment Identity (IMEI). The
SIM card contains the International Mobile Subscriber Identity (IMSI), identifying
the subscriber, a secret key for authentication, and other user information. The
IMEI and the IMSI are independent, thereby providing personal mobility.
Thus the SIM provides personal mobility, so that the user can have
access to all subscribed services irrespective of both the location of the terminal
and the use of a specific terminal. By inserting the SIM card into another GSM
cellular phone, the user is able to receive calls at that phone, make calls from
that phone, or receive other subscribed services. The SIM card may be
protected against unauthorized use by a password or personal identity number.

The ME provides generic radio and processing functions to access the


network through the radio interface as well as an interface to the user
(microphone loudspeaker, display and keyboard) together with an interface to
some other terminal equipment (fax machine, PC).

The SIM contain all the subscriber-related information stored on the


user's side of the radio interface.

The MS is operational only when a valid SIM is placed in a ME.

Base Station Subsystem:

The Base Station Subsystem is composed of two parts, the Base


Transceiver Station (BTS) and the Base Station Controller (BSC). The BTS
houses the radio transceivers that define a cell and transmits and receives
signals on the cells' allocated frequencies with the mobile station.

A BSC operates with a group of BTSs and manages the radio resources
for one or more of them. The BSC is the connection between the MS and the
Network Subsystem. It manages the radio channel (setup, tear down, frequency
hopping, etc.) as well as handovers and the transmission power levels and
frequency translations of the voice channel used over the radio link to the
standard channel used by the Public Switched Telephone Network or ISDN.

Network Subsystem:
The central component of the Network Subsystem is the Mobile services
Switching Center (MSC). It acts like a normal switching node of the normal
telephones of the land lines and in addition provides all the functionality needed
to handle a mobile subscriber, including registration, authentication, location
updating and inter-MSC handovers. These services are provided in conjunction
with several functional entities, which together form the Network Subsystem.
The MSC provides the connection to the public fixed network (PSTN or ISDN)
and is the interface between the GSM and the PSTN networks for both
telephony and data.

Thus the MSC is primarily responsible for:

Traffic management

Call set-up

Call Routing to a roaming subscriber

Termination

Charging and accounting information


Applications of GSM Modem

GSM is worlds most famous Mobile platform. Mobile phones with SIM
cards use GSM technology to help you communicate with your family, friends
and business associates. GSM systems have following advantages over basic
landline telephony systems:

1. Mobility
2. Easy availability
3. High uptime

GSM technology is being mostly used for talking to family, friends and
business colleagues. We use communication feature of Telephone landlines for
Internet, e-mail, data connectivity, remote monitoring, computer-to-computer
communication, and security systems. In the same way we can use GSM
technology and benefit from its advantages.

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.

A GSM modem can be an external device or a PC Card / PCMCIA Card.


Typically, an external GSM modem is connected to a computer through a serial
cable or a USB cable. A GSM modem in the form of a PC Card / PCMCIA Card
is designed for use with a laptop computer. It should be inserted into one of the
PC Card / PCMCIA Card slots of a laptop computer.

Like a GSM mobile phone, a GSM modem requires a SIM card from a
wireless carrier in order to operate.

As mentioned in earlier sections of this SMS tutorial, computers use AT


commands to control modems. Both GSM modems and dial-up modems
support a common set of standard AT commands. We can use a GSM modem
just like a dial-up modem. In addition to the standard AT commands, GSM
modems support an extended set of AT commands. These extended AT
commands are defined in the GSM standards. With the extended AT
commands, we can do things like:

Reading, writing and deleting SMS messages.

Sending SMS messages.

Monitoring the signal strength.

Monitoring the charging status and charge level of the battery.

Reading, writing and searching phone book entries.

The number of SMS messages that can be processed by a GSM modem


per minute is very low -- only about six to ten SMS messages per minute.
GSM FEATURES

One of the remarkable features is the Subscriber Identity Module (SIM).


SIM being memory device stores information such as the subscribers
identification number, list of countries and networks where the subscriber is
entitled to service, privacy keys etc. A SIM consists of four-digit personal
identification number to activate service from any GSM phone. SIMs is
available as smart cards that may be inserted into GSM phone or plug-in
modules, which are portable and removable.

The second feature is on-the-air privacy that the GSM system provides.
The privacy is maintained by encryption of the digital data according to a
specific secret cryptographic key that is known only to the cellular carrier and
the key is changed with time.

GSM INTERFACES

The different interfaces used in GSM listed as follows:

1. GSM radio air interface: This is the interface between MS and BTSs.
2. Abis interface: The one connecting the BTS to a BSC is known as Abis
interface. This is responsible for carrying traffic and maintenance data.
3. A interface: This is the interface between a BSC and a MSC.

GSM CHANNELS:
There are two types of GSM logical channels:
Traffic Channels: These channels carry digitally encoded user speech or
data.
Control Channels: Signaling and synchronizing commands between BS and
MS are transmitted through these channels.
GSM SERVICES:
The GSM services in different spheres are listed as follows:
1. Data services include computer to computer communication and packet
switched traffic.
2. Telephone services which include fax services. Videotex and teletex are
also supported by GSM.
3. Mobile originated traffic and standard mobile telephony are included in
teleservices supported by GSM.
4. Different other services include:
call diversion caller line identification
call wait SMS services
CHAPTER 8
DESCRIPTION ABOUT MICORCONTROLLER

The micro-controller is a chip, which has a computer processor with


all its support functions, memory (both program storage and RAM), and I/O
built in to the device. These built in functions minimize the need for
external circuits and devices to be designed in the final applications. Most
micro-controllers do not require a substantial amount of time to learn how
to efficiently program them, although many of them have quirks, which you
will have to under stand before you attempt to develop your first
application.

Along with micro-controllers getting faster, smaller and more power


efficient they are also getting more and more features. Often, the first
version of micro-controller will just have memory and simple digital I/O, but
as the device family matures, more and more part numbers with varying
features will be available. With all the 8051 manufacturers products taken
into account, there are over two hundred different 8051 part numbers,
each with different features and capabilities. For most applications, we
will be able to find a device within the family that meets our specifications
with a minimum of external devices, or an external but which will make
attaching external devices easier, both in terms of wiring and
programming.

For many micro-controllers, programmers can be built very cheaply,


or even built in to the final application circuit eliminating the need for a
separate circuit. Also simplifying this requirement is the availability of
micro-controllers with SRAM and EEPROM for control store, which will
allow program development without having to remove the micro-controller
from the application circuit.

Different types of Micro-controllers;

Creating applications for micro-controllers is completely different


than any other development job in computing and electronic. In most other
applications, we probably have a number of sub systems and interfaces
already available for our use. This is not the case with a Micro-controller,
where we are responsible

a) Power distribution

b) System clocking

c) Interface design and wiring

d) Systems programming

e) Application programming

f) Device programming

These work items might seem obvious, but having to do them all is
really quite profound in modern computing system development. In no
other aspect of electronics are all these requirements found. The process
is also made more enjoyable by learning how to work with the features
built into the devices that are designed to simplify the task of directly
connecting to other devices. Often, very useful applications can be
created using a micro-controller and a few passive components.

Embedded micro-controllers
When all the hardware required to run the application is provided on
the chip, it is referred to as an embedded micro-controller. All that is
typically required to operate the device is power, reset, and a clock. Digital
I/O pins are provided to allow interfacing with external devices. This
complete hardware on a chip is extremely useful for some applications.
Embedded micro-controllers are now replacing some very common
devices like 555 timers because they are actually cheaper to use in
applications and they are much more precise and easier to control

Micro-controller memory types

Memory is probably not something we normally think about when we


create applications for a personal computer. In a micro-controller,
understanding how much memory we have and how its architect is critical,
especially when we are planning on how to implement the application
code. In a micro-controller, memory for different purposes is typically
segregated and arranged to allow the device to execute most efficiently.

Control storage

In a PC, when we execute an application, we read the application


from disk and store it into an allocated section of memory. In a micro-
controller, this is not possible because there is no disk to read from. The
application that is stored in non-volatile memory is always the only
software the micro-controller will execute. Having the program always
available in memory makes the writing of its some what different than PC
or work station applications.

Control store is known by a number of different names including


program memory and firmware (as well as some permutations of the
various names). The name really is not important. What is important is
under standing that this memory space is the maximum size of the
application that can be loaded in to the micro-controller and that the
application also includes all the low-level code and device interfaces
necessary to execute an application.

CHIP TECHNOLOGIES

Microcontrollers, like all other electronic products, are growing


smaller, running faster, requiring less power, and are cheaper. This is
primarily due to improvements in the manufacturing process and
technologies used (and not the adoption of different computer
architectures). Virtually all microcontrollers built today use CMOS
(complementary metal oxide semiconductor) logic technology to provide
the computing functions and electronic interfaces. CMOS is a push-pull
technology in which a PMOS and NMOS transistor are paired together.
The following is the circuit diagram of push-pull configuration

When the input signal is low, the PMOS transistor will be conducting
and the NMOS transistor will be off. This means that the switch (or
transistor) at Vcc will be ON, providing Vcc at the signal out. If a high
voltage is input to the gate, then the PMOS transistor will be turned off and
the NMOS transistor will be turned on, pulling the output line to ground.
During a state transition, a very small amount of current will flow through
the transistors. As the frequency of operation increases, current will flow
more often in a given period of time (put another way, the charge
transferred per unit time, which is defined as current, will increase). This
increased current flow will result in increased power consumption by the
device. Therefore, a CMOS device should be driven at the slowest
possible speed, to minimize power consumption.

An important point with all logic families understands the switching


point of the input signal. For CMOS devices, this is typically 1.4Volts to
one half of Vcc. However, it can be at different levels for different devices.
Before using any device, it is important to understand what the input
threshold level is. CMOS can interface directly with most positive logic
technologies, although we must be careful of low voltage logic, to make
sure that a high can be differentiated from a low in all circumstances.

ATMEL 89C51 PROGRAMMING

Programming the Atmel AT89Cx051 series of 8051 microcontrollers


uses somewhat of a different algorithm than what is used for the standard
40-pin devices. The AT89C51 algorithm is actually quite simple to
implement. This programmer hardware can also be used to program AVR
20-pin microcontrollers. The programming can be described as erasing the
control store and then presenting bytes to the microcontroller and latching
it in. After the byte is latched in, the programmer waits for the byte to be
saved into control store before reading it back and incrementing the
AT89Cx051s program counter to receive the next byte.

To begin the programming cycle, the AT 89C51 is powered up with


the Reset and XTAL1 pins held low. Then, +5V is applied to Reset and the
PROG pin. At this point, the program counter inside the AT89C51 is reset
to zero. After power up, the first thing we should do is a chip erase, to
prepare the control store for the next program (all the control store bytes
are loaded with 0FFh). This is accomplished by setting high and to low
(this will be characterized as HLLL to show how the control signals are set)
and pulsing PROG low for at least 10 msec. With the chip erased, the
control store can be programmed. Note that Reset is cycled between +5V
and +12V for writes and reads. This means that the Reset driver has to
be a circuit that can output 0V, 5V, and 12V to the Reset Pin.

The lock bits are used to limit access to the application in control
store of a programmed part. If lock bit 1 is programmed, then the flash
control store cannot be updated until it is erased again. If bit 2 is
programmed, the verify fuction (read back) will return invalid data (this is
copy protection for the chip , there is no encryption array in the AT89Cx51)
again until the control store on the chip is erased. For obvious reasons,
these two bits should not be programmed until the application
programming is complete.

Often in application programming, there will be gaps in the code,


which means there are areas that are not programmed. The AT89Cx51s
program counter can be incremented (by pulsing XTAL1) to skip over these
areas. To carry this out, the programmers control software will have to
keep track of the current value of the program counter as it works through
programming the device.

AT89Cx051 Programmer Circuit

For many other devices (including the PIC Micro and even the
68HCxx), there are actually quite a few simple circuits available for simply
programming the Microcontroller. While not attempting to fill the gap, a
perfect programmer circuit can be design and it can be used for all the
AT89Cx51 applications. One nice feature of the programmer is its ability to
be used in-circuit, it can be wired into a prototype circuit and have the
AT89Cx051 run without having to pull the chip in an out of the programmer
as circuits are being developed. Another feature is that this circuit could
be used for programming 20-pin Atmel AVR micro-controllers in parallel
mode.
The circuit itself is pretty simple and can be blocked out, with the
programmer connected to an IBM compatible PC via the parallel port.
Power is supplied by an adaptor with at least 16V peak-to-peak. The
power circuit provides switched +5 and +12V for the 8051s Vcc and Reset
(0 V, +5 V or +12 V). The power circuit is controlled by the programmer
control block. If Reset is being driven by something other than 0 V, the
programmer drivers are active. With this circuit, it is found that, when
going from +12V to +5V on Reset, 30 msec was needed. If we end up
writing our own software for this circuit, we may have to make sure that we
have a long enough delay before attempting to read back what was
written. Going from 0 V to +5V or +12V (or from +5V to +12V) took less
than a msec.

The programmer control block is used to control the power applied


to the device being programmed as well as to its Reset (as noted in the
previous paragraph) and the programming mode of AT89Cx51. A 74LS374
is used with data being latched in from the PCs parallel port. The output of
the 374 is always enabled, but all the lines going to the AT89Cx51 (with
the exception of the power and Reset, which are independently controlled)
pass through a 74LS244, which allows the AT89Cx51 to be pulled from the
circuit without turning off the power to the programmer. The 244 is also
used to pass the RDY/_BSY signal back to the PC to allow the
programmer to poll the RDY/_BSY to determine when the programming
operation has finished.
The Data, which allows a programming byte to be passed to the
Microcontroller or read from it. It could have eliminated this pin and had
the same functionality by simply using the bi-directional features of the
PCs parallel port. However, to ensure that the AT89Cx51 would run in-
circuit, we wanted to make sure that we could disable the connection to the
PC, to make sure the cable wouldnt affect the operation of the application
and, more importantly, make sure that invalid voltages or signals in the
application circuit would not damage the PC.

The PC should have a parallel port capable of bi-directional I/O, and


we used a switch-box dual male DB-25 connector cable. This cable is
used for connecting a PCs parallel port to a printer sharing switch box. On
two of the Db-25 connectors, each pin is directly connected (i.e., pin 1 is
connected to Pin 1, pin 2 to pin 2, and so on), which makes wiring to the
application easier.

The final circuit probably looks pretty complex; however, by following


the nets, we can find that its actually quite simple and easy to understand.
What might be surprising is the component reference numbers (they dont
go in any order in the schematic). They are not in any kind of logical order
because we developed this raw card.

ASSEMBLY LANGUAGE

When we look at the different types of programming languages, we


have to understand the pay menow, pay me later rule that exists with
programming costs. Assembly language programming is generally the
cheapest way to get into microcontroller programming, but it is the most
difficult to learn, requires the most effort, and is the least portable to other
platforms.
Conversely, using a high-level language (such as BASIC or C) can
make it much easier for a beginner to program a Microcontroller, but it is
the most costly option. Code written for a high-level language is, by
definition, portable to other platforms. Where the pay me now, pay me
later rule comes into effect is if we are developing 8051 applications
professionally. Spending time on assembly language programming is
probably costing you money over doing it in a high-level language.

For learning the 8051 or any other Microcontroller or computer


processor, assembly language is, as per the author opinion, the best way
of doing it. Before going to an experiment, we will get a good feeling for
how the 8051 processes instructions and how it works. Assembly language
programming is the process of writing code that uses assembler
statement, which are the actual instructions the 8051s processor executes
(the smallest unit of granularity).

Along with assembler statement, directives are added to the source


file to control the operation of the assembly process. Macros and
conditional assembly statements are types of directives that can help you
develop code unique to our application. Macros are labels that are
replaced with code; theyre similar to subroutines, except the subroutine
code is copied directly into the source before the assembly operation.
Conditional assembly statements are if/else/end if statements that
execute during assembly and, depending on the conditions, not allow
certain sections of code to be assembled.

A completed assembly language source file is assembled into a


listing file (showing how the assembly program converted the source into
bits for the processor) and an object, or hex, file, which are the actual bits
and bytes to be burned into the 8051. Assembly language programming is
the lowest form of: human-readable source code-processing possible.
Interpreters and compilers take high-level language statements and
convert them directly into processor instructions without the programmer
being involved.

Now, if we are well heeled and dont want to do the drudgery of


assembly language programming, we could buy a compiler, but we will
never use the full potential of the 8051. Knowing and being proficient in
assembly language programming will allow us to enhance our high-level
language applications by allowing us to add code that will reduce the
number of cycles required to execute, reduce the number of bytes required
for the program, or enhance the operation of the application.
CHAPTER 10

HARDWARE DETAILES

The ICs and other important components used in this project work,
procured from the Hyderabad Electronics Market. The details or data
sheets of the ICs are down loaded from the Internet. The following are
the web sites that can be browsed for collecting the data sheets.

1. www. Texas Instruments.com


2. www. National semiconductors.com
3. www. Fairchild semiconductors.com

The following are the ICs and other important components used in
this project work

(1) 89C51 Microcontroller Chip


(2) TGS 813 Gas Sensor
(3) 555 Timer IC
(4) GSM Modem
(5) Voltage Regulator
(6) BC 547 NPN Transistor

The required PCBS (Printed Circuit boards) for the project work
fabricated by COSMIC CIRCUITS, Kushaiguda Industrial Estate,
Hyderabad. Kushaiguda Industrial Estate is very famous for fabricating the
Industrial grade PCBs.
CHAPTER 11

SOFTWARE DESCRIPTION

In our project we used software that is Keil micro vision for the
simulation of the program.

Keil Software

Keil development tools for the 8051 Microcontroller Architecture


support every level of software developer from the professional
applications engineer to the student just learning about embedded
software.

The industry-standard Keil C Compilers, Macro Assemblers,


Debuggers, Real-time Kernels, Single-board Computers, and Emulators
support all 8051 derivatives and help you get your projects completed on
schedule.

Simulation

The Vision Simulator allows you to debug programs using only your
PC using simulation drivers provided by Keil and various third-party
developers. A good simulation environment, like Vision, does much more
than simply simulate the instruction set of a microcontroller it simulates
your entire target system including interrupts, startup code, on-chip
peripherals, external signals, and I/O.

Use of software for execution of microcontroller programs


Keil development tools for the MC architecture support every level of
software developer from the professional applications engineer to the
student just learning about embedded software development.

The industry-standard Keil-C compilers, macro assemblers,


debuggers, real, time Kernels, Single-board computers and emulators
support all microcontroller derivatives and help you to get more projects
completed on schedule. The Keil software development tools are designed
to solve the complex Problems facing embedded software developers.
Those are listed below.

Problems faced by embedded software developers

When starting a new project, simply select the microcontroller


you the device database and the vision IDE sets all compiler,
assembler, linker, and memory options for you.
The Keil Vision debugger accurately simulates on-chip
peripherals (PC, CAN, UART, SPI, Interrupts, I/O ports, A/D
converter, D/A converter and PWM modules)of your aver
device.
Simulation helps you understand h/w configurations and
avoids time wasted on setup problems. Additionally, with
simulation, you can write and test applications before target
h/w is available.
When you are ready to begin testing your s/w application with
target h/w, use the MON51, MON390, MONADI, or flash
MON51 target monitors, the ISD51 In-System Debugger, or
the ULINK USB-JTAG adapter to download and test program
code on your target system.
CHAPTER 12

CONCLUSIONS AND REFERENCES

CONCLUSIONS

The project work is successfully designed, tested and a demo unit is


fabricated. However, the limitation is being made in this project work is to
monitor the important parameter, such as gas and fire only which in most
of the fire accidents occurs. Apart from this parameter various other
parameters, such as temperature etc; can also be incorporated in this
project work due to which the fire accidents can be avoided.

In addition to this exhaust fan and fire extinguisher can also be


incorporated in this project work as future extension. With the GSM
technology the information can be transmitted to anywhere in the world
and the motor can also be controlled as well from anywhere on the globe.
But only thing that is to be checked is the network of that particular mobile
phone.

The control circuit used in this project work can be utilized for the
real applications with minimum modifications.
REFERENCES:
The following are the references made during the development of
this project work.

Text Books:
1.Linear Integrated Circuits By: D. Roy Choudhury, Shail Jain
2.Digital Electronics. By JOSEPH J.CARR
3.Fundamental of Radio Communication: By A.SHEINGOLD
4.Basic Radio and Television: By S.P.SHARMA
5.Digital and Analog Communication System By: K. sam Shanmugam
6.Relays and their applications - By: M.C.SHARMA
7.Op-Amps Hand Book - By: MALVIND
8.The concepts and Features of Micro-controllers - By: Raj Kamal
9.The 8051 Micro-controller Architecture, programming & Applications -
By: Kenneth J. Ayala
10. Programming and Customizing the 8051 Micro-controller - By: Myke
Predko
11.Electronic Circuit guide book Sensors By JOSEPH J.CARR

Catalogs:
(1) TEXAS - LINEAR ICs manual
(2) SIGNETICS - DIGITAL ICs manual

Journals:
(1) Electronic Design
(2) Electronics for you
(3) Electronics Text.
(4) Practical Electronics

You might also like