You are on page 1of 9

Experiment No 6

Aim:- To study the Microcontroller Based Instrumentation System.

Apparatus :- Microcontroller PIC18F4520, MQ-5, Temperature Sensor, 16X2 LCD Display,


Buzzer , Power supply.

Objectives

The objective of the experiment is to develop and test a small, portable gas detector that could
detect LPG and some other gases. The gas detector shall be able to display and warn the
owner by alarm when gas is detected.
To detect the temperature if that exceeded beyond critical value.
One of the main objectives of project is safety of people and other things. This gas leakage
system can be used at various places.

Introduction

The red cylinder you see in your kitchen contains the natural gas thats used for cooking
called Liquefied Petroleum gas (LPG). Sometimes, due to an accident or if the valve is not
closed properly, the gas from it may leak.
Your gas supplier mixes odorless natural gas in the form of LPG with strong smelling pungent
gases to help you detect a leak very easily. A gas like hydrogen sulphide which smells like
rotten eggs is added to natural gas. With that strong pungent smell, you can easily know if
there is a leak. The same principle works for gases that come in pipes.
And if in case the temperature of the working environment get exceeded beyond the critical
value then (In our case it is 50oC)
Block Diagram

Power

Supply

Temperature

Sensor

PIC 18F4520
Display

Gas Detector

Sensor

Block diagram of LPG gas leakage system & Temperature Sensor


Circuit Diagram :-

Circuit diagram of system.


Working Principle
In LPG gas sensors the sensing material is a metal oxide, most typically SnO2. The oxygen
gets adsorbed on the crystal surface with a negative charge when the metal oxide crystal such as SnO2
is heated at a particular temperature in air. The donor electrons on the crystal surface are then
transferred to the adsorbed oxygen which results in leaving positive charges in the space charge layer.
Thus the surface potential serves as a potential barrier against the electron flow.
The electric current flows in the sensor through the combination parts (grain boundary) of
SnO2 micro crystals. Adsorbed oxygen forms a potential barrier at the grain boundaries which
prevents carriers to move freely. The electrical resistance of the sensor is recognized by this potential
barrier. The surface density of the negatively charged oxygen decreases in the presence of deoxidizing
gas which reduces the barrier height in the grain boundary. This reduced barrier height decreases the
sensor resistance.
The working principal of whole system is that whenever the LPG gas gets leak then that
leaked gas is detected by the LPG gas sensor and then the that data which is sensed by the sensor is
goes to the controller and according to the input the controller decides that whether the valves of the
cylinder should have to on or off, and according to the controller turns on the buzzer and displays
warning message on lcd.
MICROCONTROLLER

Definition
An embedded microcontroller is a chip which has a computer processor with all its support
functions (clock & reset), memory (both program and data), and I/O (including bus interface) built
into the device. These built in functions minimize the need for external circuits and devices to be
designed in the final application.

PIC18

In 2000, Microchip introduced the PIC18 architecture. Unlike the 17 series, it has proven to
be very popular, with a large number of device variants presently in manufacture. In contrast to
earlier devices, which were more often than not programmed in assembly, C has become the
predominant development language.

The 18 series inherits most of the features and instructions of the 17 series, while adding a number
of important new features:

call stack is 21 bits wide and much deeper (31 levels deep).
the call stack may be read and written (TOSU:TOSH:TOSL registers).
conditional branch instructions.
indexed addressing mode (PLUSW).
extending the FSR registers to 12 bits, allowing them to linearly address the entire data address
space.
the addition of another FSR register (bringing the number up to 3).

The RAM space is 12 bits, addressed using a 4-bit bank selects register and an 8-bit offset in
each instruction. An additional "access" bit in each instruction selects between bank 0 (a=0) and the
bank selected by the BSR (a=1).

A 1-level stack is also available for the STATUS, WREG and BSR registers. They are saved on
every interrupt, and may be restored on return. If interrupts are disabled, they may also be used on
subroutine call/return by setting the s bit (appending ", FAST" to the instruction).

The auto increment/decrement feature was improved by removing the control bits and
adding four new indirect registers per FSR. Depending on which indirect file register is being
accessed it is possible to post decrement, post increment, or preincrement FSR; or form the effective
address by adding W to FSR.
In more advanced PIC18 devices, an "extended mode" is available which makes the
addressing even more favorable to compiled code:

a new offset addressing mode; some addresses which were relative to the access bank are now
interpreted relative to the FSR2 register.
the addition of several new instructions, notable for manipulating the FSR registers.

These changes were primarily aimed at improving the efficiency of a data stack
implementation. If FSR2 is used either as the stack pointer or frame pointer, stack items may be
easily indexedallowing more efficient re-entrant code. Microchip's MPLAB C18 C compiler chooses
to use FSR2 as a frame pointer.

Pin Diagram

Fig. Pin Diagram Of PIC18F4520


TEMPERATURE SENSOR LM35

Overview

The LM35-series devices are precision integrated-circuit temperature sensors, with an


output voltage linearly proportional to the Centigrade temperature. The LM35 device has an
advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to
subtract a large constant voltage from the output to obtain convenient Centigrade scaling. The LM35
device does not require any external calibration or trimming to provide typical accuracies of C
at room temperature and C over a full 55C to 150C temperature range. Lower cost is
assured by trimming and calibration at the wafer level.
The low output impedance, linear output, and precise inherent calibration of the LM35
device makes interfacing to readout or control circuitry especially easy. The device is used with
single power supplies, or with plus and minus supplies. As the LM35 device draws only 60 A from
the supply, it has very low self-heating of less than 0.1C in still air. The LM35 device is rated to
operate over a 55C to 150C temperature range, while the LM35C device is rated for a 40C to
110C range (10 with improved accuracy). The temperature-sensing element is comprised of a
delta-V BE architecture. The temperature-sensing element is then buffered by an amplifier and
provided to the VOUT pin.

5.3.2 Pin Diagram:

Fig 5.3.1 Pin Diagram of LM35


GAS DETECTOR SENSOR MQ5

MQ 5 is the gas detector sensor which can able to sense the CNG gas, LPG gas , town gas as
well as smoke. But it is highly sensitive to the gases and less sensitive to the smoke.
Structure and configuration of MQ-5 gas sensor is shown as Fig. 1 sensor composed by
micro Al2O3ceramic tube,Tin Dioxide(SnO2) sensitive layer, measuring electrode and heater are
fixed into a crust made by plastic and stainless steel net. The heater provides necessary work
conditions for work of sensitive components. The enveloped MQ-5 have 6 pin ,4 of them are used to
fetch signals, and other 2 are used for providing heating current.

Pin Diagram

Fig. Pin Diagram of Gas Sensor


Specifications Of Components:-

SPECIFICATION OF PIC

1. They use Harvard architecture and high performance RISC processors.


2. The register file/data memory can be addressed directly and indirectly. All the SFRs including
the PC are mapped in data memory.
3. It consists of instruction set of 35 instructions. Most of the instruction are completed in the
single cycle.
4. The PIC microcontroller has built-in power on reset.
5. There are three timers. They are characterized the input, control output and provide internal
timing for program execution.
6. It can control up to 12 independent interrupt sources.
7. It also supports analog to digital conversion function.
8. There is built in serial peripheral interface.
9. It allows serial programming.
10. It consumes low power.

SPECIFICATION OF TEMPERATURE SENSOR (LM35)

1. Calibrated Directly in Celsius (Centigrade)


2. Linear + 10-mV/C Scale Factor
3. 0.5C Ensured Accuracy (at 25C)
4. Rated for Full 55C to 150C Range
5. Suitable for remote applications.
6. Low-Cost Due to Wafer-Level Trimming
7. Operates from 4V to 30V.
8. Less than 60-A Current Drain
9. Low Self-Heating, 0.08C in Still Air
10. Non-Linearity only C Typical
11. Low-Impedance Output, 0.1 for 1-mA Load
SPECIFICATION OF GAS SENSOR (MQ5)

1. High sensitivity to LPG, natural gas , town gas.


2. Small sensitivity to alcohol, smoke.
3. Fast response.
4. Stable and long life.
5. Simple drive circuit.

STANDARD WORK CONDITION


`
Symbol Parameter Name Technical Condition Remark
Vc Circuit Voltage 5V0.1 AC or DC
Vh Heating Voltage 5V0.1 AC or DC
PL Load Resistance 20 K
RH Heater Resistance 3110% Room Temp.
PH Heating Consumption Less than 800mW

Table. Standard Work Condition of MQ5.

Conclusion:-

You might also like