1.introduction - kumaraguruece.files.wordpress.com€¦ · 1 1.introduction: in the present...

39
1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In that gas cylinder tops the list. LPG is the commonly used fuel for cooking which includes the composition of propane or butane and a mixture of propane and butane. It is impossible to read a newspaper without mentioning gas accidents in a week. Kitchen is the least safe place in our home. The statistics of National Crime Records of Bureau show that 586 people in Tamil Nadu died due to cooking gas explosion and Tamil Nadu tops the list in southern states. It has been recorded about 735 deaths in Gujarat, 426 in Andhra Pradesh, 386 in Karnataka and 52 in Kerala. On an average 10 people in Tamil Nadu die every week due to gas accidents and 82% victims is mostly women. A recent statistics showed that 481women lost their lives in the cylinder blast in 2011. 1.1 MARKET ANALYSIS AND CAUSES FOR ACCIDENTS: It is important that the safe handling of LPG is understood and applied in the domestic and commercial/industrial situations .Liquefied petroleum gas is stored under pressure. The gas will leak from any joint connection, when it is not sealed properly. If the liquefied petroleum gas leak is a gas leak it may not be seen because LPG is colourless. When a liquid liquefied petroleum gas leak occurs, the gas release will be as a patch of ice around the area of the leak, or as a jet of white liquid. This white appearance is due to the cooling effect created by the rapid expansion the LPG liquid into a gas. The condensing atmospheric moisture makes them visible.

Upload: others

Post on 07-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

1

1.INTRODUCTION:

In the present scenario as population increases the consumption of basic

amenities also increases. In that gas cylinder tops the list. LPG is the commonly

used fuel for cooking which includes the composition of propane or butane and a

mixture of propane and butane. It is impossible to read a newspaper without

mentioning gas accidents in a week. Kitchen is the least safe place in our home.

The statistics of National Crime Records of Bureau show that 586 people in Tamil

Nadu died due to cooking gas explosion and Tamil Nadu tops the list in southern

states. It has been recorded about 735 deaths in Gujarat, 426 in Andhra Pradesh,

386 in Karnataka and 52 in Kerala. On an average 10 people in Tamil Nadu die

every week due to gas accidents and 82% victims is mostly women. A recent

statistics showed that 481women lost their lives in the cylinder blast in 2011.

1.1 MARKET ANALYSIS AND CAUSES FOR ACCIDENTS:

It is important that the safe handling of LPG is understood and applied in

the domestic and commercial/industrial situations .Liquefied petroleum gas is

stored under pressure. The gas will leak from any joint connection, when it is not

sealed properly. If the liquefied petroleum gas leak is a gas leak it may not be seen

because LPG is colourless. When a liquid liquefied petroleum gas leak occurs, the

gas release will be as a patch of ice around the area of the leak, or as a jet of white

liquid. This white appearance is due to the cooling effect created by the rapid

expansion the LPG liquid into a gas. The condensing atmospheric moisture makes

them visible.

Page 2: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

2

In concentrated amounts and in uncontrolled conditions, liquefied petroleum

gas has the potential to create a fire or an explosion. As per the various

investigation conducted it found the following common causes for the LPG related

accidents are

Overfilled/liquid full cylinders, which are highly dangerous.

Forgetting to switch off the regulator when not in use.

Leak of LPG from damaged rubber tube.

Incorrect way of fixing the regulator causing damage and leakage of LPG

Fig 1.1-Notifiable LPG Accidents 1993-2013-By equipment.

The most comprehensive database of incidents involving LPG cylinders used

indoors has been compiled by ESS. At the time of writing, this databaserecorded

503 separate incidents up until 4 January 2011. The records for each incident are

quite variable in terms of the details of the equipment, the operating parameters at

the time of the incident, the condition of the equipment, and the cause of the

incident. LPG accidents are graphically represented in fig 1.1 and fig 1.2

Page 3: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

3

The reasons for the spate of incidents can be grouped into four categories:

• 50% arise because of a leakage in the cylinder connection system

• 25% arise out of misuse by the consumer of the appliance and LPG system

• 5% arise because of cylinder overfills.

• 20% are of unknown origin.

And currently only gas detectors are used in gas manufacturing companies to

detect any leakage. So here is the first and new approach to step towards a safe

cooking.

TABLE NO:1

ABER analysed 178 incidents from the ESS database for the period 22/04/1992

until 13/06/1997 under 10 categories and reported as follows:

CAUSES INCIDENT %

Faulty regulator 16 9

Faulty adaptor 8 5

Over filled gas cylinder 9 5

Loose adaptor 2 1

Leaking cylinder 6 3

Heater too close 25 14

Heater tipped 1 1

Faulty break 48 27

No reason 48 27

Lack of maintenance 15 8

Total

178

100

Page 4: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

4

Fig: 1.2-LPG accidents 1993-2013-cooker/oven

Page 5: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

5

2.HARDWARE DESCRIPTION:

2.1 PROJECT DESCRIPTION:

The main aim of the project is to make cooking really safe. Humans are

prone to being careless and because of that it might result in an irreparable loss. As

said by elders, “Prevention is better than cure”, this project suggests a concept that,

“Precaution is way better than suffering”. In this fast world where everything

around us is happening so swift, the probability of accidents is also increasing to a

massive range. And the accidents due to gas are mainly because of carelessness.

Most of the time, we either keep something in the stove and forget about it or we

switch on the stove and forget to turn it off again and it becomes a real head-ache

when we leave the house as somebody has to run to the kitchen every time to

check if the gas is switched off properly. Hence we have come up with a one-step

solution to overcome this huge tension.

The proposed circuit makes use of a micro-controller (ARM LPC-2148) that

controls the gas sensor (MQ-2) ,a camera(Human Movement Detection), a stepper

motor and a buzzer.

Page 6: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

6

BLOCK DIAGRAM:

GAS LEAKAGE REGULATOR

HUMAN MOVEMENT MESSAGE ALERT

Fig:2.1-Block Diagram

This is the block diagram of the project that we intend to implement.Block diagram

is shown in fig 2.1.

The gas sensor used will detect gas leakage if any in the cylinder or in the

tube/regulator and send a warning signal to the microcontroller which in turn

alerts the stepper motor to switch off the regulator and make it really safe.

After cooking , if we forget to switch off the stove or forget that the stove is

kept on, the camera will sense that there is no human movement in that area.

So the microcontroller will prompt the timer to generate an alarm at the 5th

minute. Then the process will be repeated and the alarm will be set for the

10th minute as well along with a voice alert and the regulator will be turned

STEPPER MOTOR

ARM

CONTROLLER

GSM MODULE

BUZZER/VOICE ALERT

CAMERA

GAS SENSOR

Page 7: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

7

to the minimum (SIM) position through the steper motor and next time the

procedure gets repeated and if there is still no human movement at the 15th

minute, the stove will be automatically switched off with the help of the

stepper motor ans a message will be generated to the registered mobile

number via GSM module that is connected. (The 5th

minute alarm and the

15th minute shut off are all a prototype module which can be varied

according to the requirement of the user by just varying the time delay in the

program)

Any Indian cooking will not take more than 15 minutes of a dish being

left unattended. It will definitely require some saute‟ that has to be done during

cooking. In that case, 15 minutes will be the ideal time to switch off the stove in

case there is no human movement detected by the camera.

2.2 PROJECT EXECUTION PLAN:

This project requires basic prototyping of embedded system coding with the

help of arduino and a MATLAB coding to interface the ARM LPC -2148

controller with Camera. It can also be coded with the help of c wherein we have

used Energeon C programming software for our module. It aims in bringing

together the hardware and the software to achieve the necessity of making a fully

automated and safe cookware.

We take the proposal to the prototype by ,Using C language to code the

microcontroller that in turn controls the gas sensor, sound sensor and the distance

sensor. Other softwares like arduinos also easy to understand and as the world is

fast moving towards the advanced versions like Simulink coding with Model

Based Development, arduino is modern and brings innovation to action.

Page 8: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

8

The prototype is made into a final product by, Understanding the work of

each sensor and coding each and every sensor based on the specifications of the

microcontroller. Ultimately leading to the output as proposed in the project

proposal. We aim to make this cost effective by using the products and the

components that are not too expensive but at the same time meeting our

requirements of temperature sensitivity and consuming less power thus making the

system completely reliable at the same time affordable by the end users. This is the

reason why we have used ARM instead of PIC because ARM requires a less code

space and it supports more tools and has an advanced debugging features and

supports hugh speed operation at low cost.

2.3:COMPONENTS AND ITS USES:

TABLE 2:

Components Usage/Advantage

Camera To sense the movement of human

MQ-2 To detect the gas leakage

ARM LPC-2148 Performance for various real-time control

applications using programs

Stepper motor To switch off the stove

GSM Module To send message to the registered mobile number

Buzzer/Voice

Alert

To provide warning message to the human

regarding their absence in the kitchen

Page 9: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

9

2.4 ARM CONTROLLER:

Fig:2.2-ARM Controller

In this project the controller used is called “ARM LPC-2148 CONTROLLER

”.ARM controller is shown in fig 2.2. It is a 64 pin IC. This microcontroller has

two major advantages which includes its ultra low power consumption and its cost.

And some of its features are:

• 8 to 40 kB of on-chip static RAM and 32 to 512 kB of on-chip flash program

memory.128 bit wide interface/accelerator enables high speed 60 MHz operation.

Page 10: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

10

• In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader

software.Single flash sector or full chip erase in 400 ms and programming of 256

bytes in 1ms.

• EmbeddedICE RT and Embedded Trace interfaces offer real-time debugging

with theon-chip RealMonitor software and high speed tracing of instruction

execution.

• USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM.In

addition, the LPC2146/8 provides 8 kB of on-chip RAM accessible to USB by

DMA.

• One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total

of 6/14analog inputs, with conversion times as low as 2.44 us per channel.

• Single 10-bit D/A converter provides variable analog output.

• Two 32-bit timers/external event counters (with four capture and four

comparechannels each), PWM unit (six outputs) and watchdog.

• Low power real-time clock with independent power and dedicated 32 kHz clock

input.

• Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus(400

kbit/s), SPI and SSP with buffering and variable data length capabilities.

• Vectored interrupt controller with configurable priorities and vector addresses.

• Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.

• Up to nine edge or level sensitive external interrupt pins available.

Page 11: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

11

• On-chip integrated oscillator operates with an external crystal in range from 1

MHz to30 MHz and with an external oscillator up to 50 MHz.

• Power saving modes include Idle and Power-down.

• Individual enable/disable of peripheral functions as well as peripheral clock

scaling foradditional power optimization.

• Processor wake-up from Power-down mode via external interrupt, USB, Brown-

OutDetect (BOD) or Real-Time Clock (RTC).

• Single power supply chip with Power-On Reset (POR) and BOD circuits:

– CPU operating voltage range of 3.0 V to 3.6 V (3.3 V ± 10 %) with 5 V tolerant

I/Opads.

ADVANTAGES OF ARM OVER OTHER PROCESSORS:

ARM has far better tools support then Microchip MIPS.

The PIC32 needs more code space then the ARM target (upto 35% more).

The ARM has far better debug features. The ARM debug printf (to an output

console) works very fast compared to the PIC32. For a large project with a

lot of console logging in debug build, PIC32 is not workable.

ARM offers a disict advantage over Intel X86, in power consumption and

efficiency. ARM is used in most of the applications that are portable.

Depending on the applications, X86 and ARM processors are used.

Page 12: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

12

ARM gives tough competition over X86 processors. Now new windows 8

which is out, supports ARM. If laptops are replaced by ARM processors,it

will consume low power and will also have better battery life.

When compared to 8051, AVR and PIC, it has a vast community, has high

speed operation, much lower in cost and power consumption and operates

with RISC Instruction set.

2.5 ARCHITECTURAL OVERVIEW:

The ARM7 is a general purpose 32-bit microprocessor, which offers high

performance and very low power consumption. The ARM architecture is based on

Reduced Instruction Set Computer (RISC) principles, and the instruction set and

relateddecode mechanism are much simpler than those of

microprogrammedComplexInstruction Set Computers (CISC). This simplicity

results in a high instruction throughputand impressive real-time interrupt response

from a small and cost-effective processorcore.

Pipeline techniques are employed so that all parts of the processing and memory

systemscan operate continuously. Typically, while one instruction is being

executed, its successoris being decoded, and a third instruction is being fetched

from memory.The ARM7TDMI-S processor also employs a unique architectural

strategy known asThumb, which makes it ideally suited to high-volume

applications with memoryrestrictions, or applications where code density is an

issue.The key idea behind Thumb is that of a super-reduced instruction set.

Essentially, theARM7TDMI-S processor has two instruction sets:

• The standard 32-bit ARM set.

• A 16-bit Thumb set.

Page 13: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

13

The Thumb set‟s 16-bit instruction length allows it to approach twice the

density of standard ARM code while retaining most of the ARM‟s performance

advantage over atraditional 16-bit processor using 16-bit registers. This is possible

because Thumb codeoperates on the same 32-bit register set as ARM code.

Thumb code is able to provide up to 65 % of the code size of ARM, and

160 % of theperformance of an equivalent ARM processor connected to a 16-bit

memory system.The particular flash implementation in the LPC2141/42/44/46/48

allows for full speedexecution also in ARM mode. It is recommended to program

performance critical andshort code sections (such as interrupt service routines and

DSP algorithms) in ARMmode. The impact on the overall code size will be

minimal but the speed can be increased by 30% over Thumb mode.

Fast general purpose parallel I/O (GPIO):

Device pins that are not connected to a specific peripheral function are

controlled by the GPIO registers. Pins may be dynamically configured as inputs or

outputs. Separate registers allow setting or clearing any number of outputs

simultaneously. The value of the output register may be read back, as well as the

current state of the port pins. LPC2141/42/44/46/48 introduce accelerated GPIO

functions over prior LPC2000 devices:

• GPIO registers are relocated to the ARM local bus for the fastest possible I/O

timing.

• Mask registers allow treating sets of port bits as a group, leaving other bits

unchanged.

• All GPIO registers are byte addressable.

• Entire port value can be written in one instruction.

Page 14: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

14

Features:

• Bit-level set and clear registers allow a single instruction set or clear of any

number of

bits in one port.

• Direction control of individual bits.

• Separate control of output set and clear.

• All I/O default to inputs after reset.

10-bit ADC:

The LPC2141/42 contain one and the LPC2144/46/48 contain two analog to

digital converters. These converters are single 10-bit successive approximation

analog to digital converters. While ADC0 has six channels, ADC1 has eight

channels. Therefore, total number of available ADC inputs for LPC2141/42 is 6

and for LPC2144/46/48 is 14.

Features:

• 10 bit successive approximation analog to digital converter.

• Measurement range of 0 V to VREF (2.0 V ≤ VREF ≤ VDDA).

• Each converter capable of performing more than 400,000 10-bit samples per

second.

• Every analog input has a dedicated result register to reduce interrupt overhead.

• Burst conversion mode for single or multiple inputs.

• Optional conversion on transition on input pin or timer match signal.

• Global Start command for both converters (LPC2142/44/46/48 only).

Page 15: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

15

10-bit DAC:

The DAC enables the LPC2141/42/44/46/48 to generate a variable analog

output. The maximum DAC output voltage is the VREF voltage.

Features:

• 10-bit DAC.

• Buffered output.

• Power-down mode available.

• Selectable speed versus power.

Real-time clock:

The RTC is designed to provide a set of counters to measure time when

normal or idleoperating mode is selected. The RTC has been designed to use little

power, making itsuitable for battery powered systems where the CPU is not

running continuously (Idlemode).

Features:

• Measures the passage of time to maintain a calendar and clock.

• Ultra-low power design to support battery powered systems.

• Provides Seconds, Minutes, Hours, Day of Month, Month, Year, Day of Week,

and Dayof Year.

• Can use either the RTC dedicated 32 kHz oscillator input or clock derived from

theexternal crystal/oscillator input at XTAL1. Programmable reference clock

dividerallows fine adjustment of the RTC.

• Dedicated power supply pin can be connected to a battery or the main 3.3 V.

Page 16: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

16

General purpose timers/external event counters:

The Timer/Counter is designed to count cycles of the peripheral clock

(PCLK) or anexternally supplied clock and optionally generate interrupts or

perform other actions atspecified timer values, based on four match registers. It

also includes four capture inputsto trap the timer value when an input signal

transitions, optionally generating an interrupt.Multiple pins can be selected to

perform a single capture or match function, providing anapplication with „or‟ and

„and‟, as well as „broadcast‟ functions among them.The LPC2141/42/44/46/48 can

count external events on one of the capture inputs if theminimum external pulse is

equal or longer than a period of the PCLK. In this configuration,unused capture

lines can be selected as regular timer capture inputs, or used as externalinterrupts.

Features :

• A 32-bit timer/counter with a programmable 32-bit prescaler.

• External event counter or timer operation.

• Four 32-bit capture channels per timer/counter that can take a snapshot of the

timervalue when an input signal transitions. A capture event may also optionally

generatean interrupt.

• Four 32-bit match registers that allow:

– Continuous operation with optional interrupt generation on match.

– Stop timer on match with optional interrupt generation.

– Reset timer on match with optional interrupt generation.

• Four external outputs per timer/counter corresponding to match registers, with the

following capabilities:

– Set LOW on match.

– Set HIGH on match.

– Toggle on match.

Page 17: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

17

– Do nothing on match.

UARTs:

The LPC2141/42/44/46/48 each contain two UARTs. In addition to standard

transmit and receive data lines, the LPC2144/46/48 UART1 also provides a full

modem control handshake interface. Compared to previous LPC2000

microcontrollers, UARTs in LPC2141/42/44/46/48 introduce a fractional baud rate

generator for both UARTs, enabling these microcontrollers to achieve standard

baudrates such as 115200 with any crystal frequency above 2 MHz.

In addition, auto-CTS/RTS flow-control functions are fully implemented in

hardware (UART1 in LPC2144/46/48 only).

Features:

• 16 byte Receive and Transmit FIFOs.

• Register locations conform to „550 industry standard.

• Receiver FIFO trigger points at 1, 4, 8, and 14 bytes

• Built-in fractional baud rate generator covering wide range of baud rates without

a need for external crystals of particular values.

• Transmission FIFO control enables implementation of software (XON/XOFF)

flow control on both UARTs.

• LPC2144/46/48 UART1 equipped with standard modem interface signals. This

module also provides full support for hardware flow control (auto-CTS/RTS).

EXTERNAL INTERRUPT INPUTS:

The LPC2141/42/44/46/48 include up to nine edge or level sensitive External

Interrupt Inputs as selectable pin functions. When the pins are combined, external

Page 18: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

18

events can be processed as four independent interrupt signals. The External

Interrupt Inputs can optionally be used to wake-up the processor from Power-down

mode. Additionally capture input pins can also be used as external interrupts

without the option to wake the device up from Power-down mode.

MEMORY MAPPING CONTROL:

The Memory Mapping Control alters the mapping of the interrupt vectors that

appear beginning at address 0x0000 0000. Vectors may be mapped to the bottom

of the on-chip flash memory, or to the on-chip static RAM. This allows code

running in different memory spaces to have control of the interrupts.

Power control :

The LPC2141/42/44/46/48 supports two reduced power modes: Idle mode and

Power-down mode. In Idle mode, execution of instructions is suspended until

either a reset or interrupt occurs. Peripheral functions continue operation during

Idle mode and may generate interrupts to cause the processor to resume execution.

Idle mode eliminates power used by the processor itself, memory systems and

related controllers, and internal buses. In Power-down mode, the oscillator is shut

down and the chip receives no internal clocks. The processor state and registers,

peripheral registers, and internal SRAM values are preserved throughout Power-

down mode and the logic levels of chip output pins remain static. The Power-down

mode can be terminated and normal operation resumed by either a reset or certain

specific interrupts that are able to function without clocks. Since all dynamic

operation of the chip is suspended, Power-down mode reduces chip power

consumption to nearly zero. Selecting an external 32 kHz clock instead of the

Page 19: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

19

PCLK as a clock-source for the on-chip RTC will enable the microcontroller to

have the RTC active during Power-down mode. Power-down current is increased

with RTC active. However, it is significantly lower than in Idle mode.

A Power Control for Peripherals feature allows individual peripherals to be turned

off if they are not needed in the application, resulting in additional power savings

during active and idle mode.

Emulation and debugging:

The LPC2141/42/44/46/48 support emulation and debugging via a JTAG

serial port. A trace port allows tracing program execution. Debugging and trace

functions are multiplexed only with GPIOs on Port 1. This means that all

communication, timer and interface peripherals residing on Port 0 are available

during the development and debugging phase as they are when the application is

run in the embedded system itself.

EmbeddedICE:

Standard ARM EmbeddedICE logic provides on-chip debug support. The

debugging of the target system requires a host computer running the debugger

software and an EmbeddedICE protocol convertor. EmbeddedICE protocol

convertor converts the remote debug protocol commands to the JTAG data needed

to access the ARM core. The ARM core has a Debug Communication Channel

(DCC) function built-in. The DCC allows a program running on the target to

communicate with the host debugger or another separate host without stopping the

program flow or even entering the debug state. The DCC is accessed as a

coprocessor 14 by the program running on the ARM7TDMI-S

Page 20: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

20

core. The DCC allows the JTAG port to be used for sending and receiving data

without affecting the normal program flow. The DCC data and control registers are

mapped in to addresses in the EmbeddedICE logic.

Embedded trace:

Since the LPC2141/42/44/46/48 have significant amounts of on-chip

memory, it is not possible to determine how the processor core is operating simply

by observing the external pins. The Embedded Trace Macrocell (ETM) provides

real-time trace capability for deeply embedded processor cores. It outputs

information about processor execution to the trace port.The ETM is connected

directly to the ARM core and not to the main AMBA system bus. It compresses the

trace information and exports it through a narrow trace port. An external trace port

analyzer must capture the trace information under software debugger control.

Instruction trace (or PC trace) shows the flow of execution of the processor and

provides a list of all the instructions that were executed. Instruction trace is

significantly compressed by only broadcasting branch addresses as well as a set of

status signals that indicate the pipeline status on a cycle by cycle basis. Trace

information generation can be controlled by selecting the trigger resource. Trigger

resources include address comparators, counters and sequencers. Since trace

information is compressed the software debugger requires a static image of the

code being executed. Self-modifying code can not be traced because of this

restriction.

Real Monitor:

Real Monitor is a configurable software module, developed by ARM Inc.,

which enables real-time debug. It is a lightweight debug monitor that runs in the

Page 21: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

21

background while users debug their foreground application. It communicates with

the host using the DCC, which is present in the EmbeddedICE logic. The LPC2148

contain a specific configuration of RealMonitor software programmed into the on-

chip flash memory.

2.6 PIN DESCRIPTION:

There are two ports in ARM LPC -2148 controller Port 0 and Port 1. Among

the 64 pins only 48 pins can be used.Port 0 has 32 pins and port 2 has 16 pins.

Remaining 16 pins are used for power supply and for crystal oscillators. The pin

diagram of ARM controller is shown in fig 2.3.

Pin 1 is used to provide voice alert and is a general purpose input/output pin.

Pin 17(Port0.31/LED CONNECT Output Pin),Pin 18 (Power supply),Pin

19(P0.0/TXD0/PWM1) and Pin 44(P1.21/PIPESTAT0)are used for LCD

display.

Pins 20 is a port1.31 pin and is also a general purpose input/output pin and is

connected to the buzzer.

Pin 32(P1.24/TRACECLK) is connected to the gas sensor.

Pin 33(P0.8/TXD1/PWM4/AD1.1), Pin 34(P0.9/RXD1/PWM6/EINT3) is

used by GSM module.

Pin44(P1.21/PIPESTAT0),Pin45(P0.15/RI1/EINT2/AD1.5),Pin

46(P0.16/EINT0/MAT0.2/CAP0.2),Pin 47(P0.17/CAP1.2/SCK1/MAT1.2)

are used for Stepper motor control.

Page 22: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

22

Fig: 2.3-Pin diagram

2.7 CIRCUIT DESCRIPTION:

ARM LPC-2148 microcontroller has an inbuilt power supply module which

provides an output of 3.3V.The circuit diagram is shown in fig 2.4.This is given as

the input to the microcontroller when the module is on. The gas sensor is

connected to the pin 32 of the microcontroller. And this in connected in digital

mode so that it provides either a “LOW” or “HIGH” output. Whenever a “high”

pulse is transmitted microcontroller triggers the stepper motor to turn off the

Page 23: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

23

regulator. And the real time image is captured through tha camera and the human

presenced is detected through it and is given as the input to the UART 1 in the

ARM controller. When there is no human movement detected fot the first five

minutes the buzzer will be provoked through the microcontroller and in the next

5th

minute if the human is not present then a voice alert will be generated along

with that the positionof the burner will be turned to the minimum position(“SIM”)

and in the next 5th

minutes if the human is still not present in the vicinity of the

camera then the GSM module will generate a message to the registered mobile

number and the stove will be turned off immediately via the stepper motor.

Fig:2.4-Circuit diagram

Page 24: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

24

2.8 INTERFACES:

The various interfaces used are gas sensor,Gsm module, a driver circuit to

boost the steppor motor, camera and a buzzer.The software used to interface are

MATLAB,Keil and hyper terminal.

2.9 GAS SENSOR (MQ-2):

Gas sensor used here is MQ-2 and its detection range is from 200 ppm-

10000ppm. Fig 2.6 shows the gas sensor.The recommended threshold value for the

gas sensor is 1000ppm. This sensor is sensitive to propane and butane which are

the major constituents of LPG. It is very less sensitive to smoke and alcohol. Gas

sensor consists of a tin oxide layer which is less conductive. Whenever the gas in

atmosphere rises above the threshold value it falls on the tin oxide layer and

indicates it conductivity. And this in turn indicates the gas leakage. This intimates

the microprocessor to switch off the regulator via a servo motor.

Character Configuration:

Good sensitivity to Combustible gas in wide range

High sensitivity to LPG, Propane and Hydrogen

Long life and low cost

Simple drive circuit

Page 25: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

25

TABLE 3:TECHNICAL DATA:

Model No. MQ-2

Sensor Type Semiconductor

Standard Encapsulation Bakelite (Black Bakelite)

Detection Gas Combustible gas and smoke

Concentration 300-10000ppm

( Combustible gas)

Loop Voltage Vc ≤24V DC

Heater Voltage VH 5.0V±0.2V ACorDC

Heater consumption PH ≤900Mw

Load Resistance RL Adjustable

Heater Resistance RH 31Ω±3Ω(Room Tem.)

Sensing Resistance Rs 2KΩ-20KΩ(in 2000ppm C3H8 )

Sensitivity S Rs(in air)/Rs(1000ppmisobutane)≥5

Slope Α ≤0.6(R5000ppm/R3000ppm CH4)

Tem. Humidity 20℃±2℃;65%±5%RH

Standard test circuit Vc:5.0V±0.1V;

VH: 5.0V±0.1V

Preheat time Over 48 hours

Page 26: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

26

SENSITIVITY CHARACTERISTICS:

Fig: 2.5-Sensitivity characteristics.

Following conditions must be prohibited:

Exposed to organic silicon steam

Organic silicon steam cause sensors invalid, sensors must be avoid exposing to

silicon bond,

fixature, silicon latex, putty or plastic contain silicon environment

High Corrosive gas

If the sensors exposed to high concentration corrosive gas (such as H2Sz,

SOX,Cl2,HCl etc), it willnot only result in corrosion of sensors structure, also

it cause sincere sensitivity attenuation.

Alkali, Alkali metals salt, halogen pollution

Page 27: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

27

The sensors performance will be changed badly if sensors be sprayed polluted by

alkali metals salt

especially brine, or be exposed to halogen such as fluorin.

Touch water

Sensitivity of the sensors will be reduced when spattered or dipped in water.

Freezing

Do avoid icing on sensor‟surface, otherwise sensor would lose sensitivity.

Applied voltage higher

Applied voltage on sensor should not be higher than stipulated value, otherwise it

cause down-line or

heater damaged, and bring on sensors‟ sensitivity characteristic changed badly.

Fig 2.6-MQ-2 Gas Sensor

Page 28: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

28

2.10 CAMERA:

The real time images are captured by the camera to detect the presence of

human in thekitchen.Fig 2.7 shows a real time web camera. The first 5 frames are

taken as the reference frame and that image is stored and then by starting the

camera it will start to capture the images.The coding is done such that the in a time

interal of 1 ms every frame is taken and subtracted with the reference frame.That is

vector subtraction is performed between the two frames.If there is any variations or

difference occurs between the two frames then it is an indication that the human is

present.This is called image processing.If there is no human for 5 minutes (i.e. The

result of vactor subtraction is zero for five minutes) the the buzzer will be involed

to provide alarm. And if this situation prevails for the next 5 minutes then a voice

alert will be generated and also the burner will be turned to the minimum

position.And again if the human is not present for the next five minutes then the

stove will be turned off completely by generating a message to the registered

mobile number through the GSM module.

Fig:2.7-Camera

Page 29: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

29

2.11 GSM MODULE:

Fig: 2.8-GSM module

A GSM module is used to send SMS, make and receive calls, and do other

GSM operations by controlling it through simple AT commands from micro

controllers and computers. It uses the highly popular SIM300 module for all its

operations. It comes with a standard RS232 interface which can be used to easily

interface the modem to micro controllers and computers.Fig 2.8 shows the GSM

module.

The modem consists of all the required external circuitry required to start

experimenting with the SIM300 module like the power regulation, external

antenna, SIM Holder, etc. GSM300 usually operates at a baudrate of 9600, with 1

stopbits, No parity, No Hardware control and 8 databits.

Page 30: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

30

TABLE4:AT COMMANDS:

Command Description

AT It is the Prefix of every command sent to the modem. It is also

used to test the condition of the modem.

AT+CSMINS? Command to check if the Modem has a sim inserted in it. It

checks if the sim Is inserted.

AT+CMGF=1 Command to set the communication to TextMode. By default

the communication is in the PDU mode.

AT+CMGR=1

Command to read an SMS at the index one.Generally the index

depends upon the how many number of SMS that a sim can

store. SIM Memory is the only memory available when GSM

Modem is used and hence the number of SMS's stored depends

on the SIM. It is usually 20. Any message received is arranged

in the order of arrival at specific indices.

FEATURES:

Uses the extremely popular SIM300 GSM module

Provides the industry standard serial RS232 interface for easy connection to

computers and other devices

Provides serial TTL interface for easy and direct interface to

microcontrollers

Power, RING and Network LEDs for easy debugging

Onboard 3V Lithium Battery holder with appropriate circuitry for providing

backup for the modules‟ internal RTC

Page 31: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

31

Can be used for GSM based Voice communications, Data/Fax, SMS,GPRS

and TCP/IP stack

Can be controlled through standard AT commands

Comes with an onboard wire antenna for better reception.

Board provides an option for adding an external antenna through an SMA

connector

The SIM300 allows an adjustable serial baud rate from 1200 to 115200 bps

(9600 default)

Modem a low power consumption of 0.25 A during normal operations and

around 1 A during transmission

Operating Voltage: 7 – 15V AC or DC (board has onboard rectifier.

RF Functionalities

The RF part of this module converts RF signals to baseband for receiver chain

and translatesbase band signals into RF frequency spectrum.

The operating frequencies are:

Rx (EGSM 850): 869 to 894MHz

Tx (EGSM 850): 824 to 849MHz

Rx (EGSM 900): 925 to 960MHz

Tx (EGSM 900): 880 to 915MHz

Rx (DCS 1800): 1805 to 1880MHz

Tx (DCS 1800): 1710 to 1785MHz

Page 32: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

32

Rx (PCS 1900): 1930 to 1990MHz

Tx (PCS 1900): 1850 to 1910MHz

Baseband Functionalities :

The baseband part of SM5210 is composed of a SPREADTRUM‟s SC6600D

chip. This chipsetis using 0.18μm mixed signal CMOS technology which allows

massive integration as well aslow power consumption. SC6600D provides single-

chip solution to wireless Quad-bandtelephone handsets and data modems

confirming to the EGSM 900, GSM 850, DCS 1800 andPCS 1900

Memory Functionalities

The memory used in this module is a combination of 32 Megabit (2M x 16-

Bit) CMOS 3.0VVolt-only, simultaneous operation flash memory and 4 Megabit

(256K x 16-Bit) static RAM.

Page 33: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

33

3.SOFTWARE DESCRIPTION:

3.1 EMBEDDED C:

Most of the electronic devices such as digital cameras mobile phones washing

machines etc. has some kind of processors in it and are called the embedded

systems. The hardware components form the body of the embedded system

whereas the embedded software coded in the processor forms the brain of the

system.It is the embedded software which primarily governs the functioning of

embedded systems. Initially assembly level languages are used to code the

processors. As assembly language programs are specific to a processor, assembly

language didn‟t offer portability across systems. To overcome this disadvantage,

several high level languages, including C, came up. Some other languages like

PLM, Modula-2, Pascal, etc. also came but couldn‟t find wide acceptance.

Amongst those, C got wide acceptance for not only embedded systems, but also for

desktop applications. Due to the wide acceptance of C in the embedded systems,

various kinds of support tools like compilers & cross-compilers, ICE, etc. came up

and all this facilitated development of embedded systems using C.

3.2 DIFFERENCE BETWEEN C AND EMBEDDED C:

Normal C does not provide any feature to address a bit value. Minimum of 1

byte can be addressed. Using embedded c it is possible even to access a

single bit value.

C is a widely used general purpose high level programming language

mainly intended for system programming. Embedded C is an extension to C

programming language that provides support for developing efficient

programs for embedded devices.

Page 34: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

34

C is for desktop computers, embedded C usually is for

microcontroller based applications.

C use the resources of desktop computers (memory, OS, etc)

Embedded C use only limited resources available in chip

(limited RAM, ROM, ports, etc).

C has a free-format program source code, in a desktop computer while

embedded C has different format based on embedded processor (micro-

controllers/microprocessors).

C has normal optimization, in programming while embedded C high level

optimization in programming.

Embedded C includes extra features over C, such as fixed point types,

multiple memory areas, and I/O register mapping.

C programming must have required operating system while embedded C

may or may not be required operating system.

C language uses the desktop OS memory while embedded C uses

the controllers inbuilt or any externally attached memory.

Compilers for C typically generate OS dependent executable. i.e. it allows

the users to run program from OS terminal directly while, embedded C

requires compilers to create files, and downloaded to the processor,

(microcontrollers/microprocessors) where it needs to run.

C programming run in console, i.e. the output can be seen in the OS

(desktop) while, embedded C run in real time constraints.

In C programming it is easy to input program data, when running while,

embedded C have pre-defined data that have been given while programming.

Embedded c code generates a .hex file while a convention c

code generates a compatible .exe file.

Page 35: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

35

Example of C program is, OS based software, simple logic program, etc.

example of embedded C is TV, DVD, washing machine, etc.

3.3 ADVANTAGES:

Embedded compilers give access to all resources which is not provided in

compilers for desktop computer applications.

C is easier to use for making more complex programs.

C syntax is a lot easier to learn than Assembler syntax.

C requires very little runtime support in and of itself, so the overhead is

much lower.

Compared to other high level languages, C offers more flexibility because C

is relatively small, structured language; it supports low-level bit-wise data

manipulation.

It is small and simpler to learn, understand, program and debug.

Compared to assembly language, C code written is more reliable and

scalable, more portable between different platform.

C compilers are available for almost all embedded devices in use today.

Unlike assembly, C has advantage of processor-independence and is not

specific to any particular microprocessor/microcontroller or any system.

This makes it convenient for a user to develop programs that can run on

most of the systems.

As C combines functionality of assembly language and features of high level

languages, C is treated as a „middle-level computer language‟ or „high level

assembly language‟.

It is fairly efficient.

Page 36: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

36

It supports access to I/O and provides ease of management of large

embedded projects.

Java is also used in many embedded systems but Java programs require the

Java Virtual Machine (JVM), which consumes a lot of resources. Hence it is

not used for smaller embedded devices.

3.4 SIGNIFICANCE OF THE PROJECT:

Using ARM LPC-2148 controller and a combination of a gas sensor , a

camera , a steppor motor , a GSM module , a buzzer and a voice module for our

implementation, this project achieves in avoiding gas accidents that takes place in

the kitchen due to negligence of people at home during and post cooking.

3.5 ENHANCEMENTS OF THE PROJECT:

The further enhancement that can be made is interfacing the camera and video

with the television, so when the gas is left untuned and if the person is seated in the

hall watching television, then he should be able to receive a message alert stating

the status of the kitchen, so that he could immediately turn off the stove.

Page 37: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

37

4.WORKING MODEL:

The working model of the project along with all its components is shown in

fig 4.1.

Fig 4.1- Working model

Page 38: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

38

5.CONCLUSION:

“Short as life is, we make it still shorter by being careless.” So this project

“One step solution for a safe cooking” which enables an average person to cook

leisurely and safely, which would otherwise be practically impossible as we are

moving towards the trend of, “Making life simpler and automatic”. Thereby we

have come up with a fascinating idea that, with the help of just a few interfaces

and a basic micro-controller to control the entire interface, it is feasible to save

thousands of lives from careless mistake.

Page 39: 1.INTRODUCTION - kumaraguruece.files.wordpress.com€¦ · 1 1.INTRODUCTION: In the present scenario as population increases the consumption of basic amenities also increases. In

39

REFERENCES:

1. Report of inquiry into the use of LPG cylinder in indoor situations”(INQ

03014) to ERMA New Zealand.

2. Indian Academy of forensic med,31(I)Fatal LPG blast accidents”- A case

report.

3. Design and Development of Kitchen Gas Leakage Detection and Automatic

Gas Shut off System” in the Journal of Emerging Trends in Engineering and

Applied Sciences (JETEAS) 5(3): 222-228 © Scholar link Research Institute

Journals, 2014(ISSN:2141-7016)

4. Automatic LPG leakage detection and hazard prevention for home

security”International journal of advanced computer

technology.(ISSN:2320-0790).

5. Sakr, Sharif. "ARM co-founder John Biggs". Engadget. Retrieved 23

December 2011.