You are on page 1of 37


Chapter 3

3.1 Microcontroller

Figure 3.1.1 AT89S52 Microcontroller with Driver Circuit . When we have to learn about a new computer we have to familiarize about the machine capability we are using, and we can do it by studying the internal hardware design (devices Architecture), and also to know about the size, number and the Size of the registers. A microcontroller is a single chip that contains the Processor (the CPU), non-volatile memory for the program (ROM or flash), volatile memory for input and output (RAM), a clock and an I/O control unit. Also called a "computer on a chip," billions of microcontroller



units (MCUs) are embedded each year in a myriad of products from toys to appliances to automobiles. For example, a single vehicle can use 70 or more microcontrollers.

3.1.1 Advantages of Microcontroller
Microcontrollers are widely used in today’s control systems for the following reasons: • Design and Simulation – Because you are programming with software, detailed simulations may be performed in advance to assure correctness of code and system performance. • Flexibility – Ability to reprogram using Flash, EEPROM or EPROM allows straightforward changes in the control law used. • High Integration – Most microcontrollers are essentially single chip computers with onchip processing, memory, and I/O. Some contain peripherals for serial communication and reading analog signals (with an analog-to-digital converter or ADC). This differentiates a microcontroller from a microprocessor. Microprocessors require that this functionality be provided by added components. • Cost – Cost savings come from several locations. Development costs are greatly decreased because of the design/flexibility advantages mentioned previously. Because so many components are included on one IC, board area and component savings are often evident as well. • Easy to Use – Just program and go! While in the past, programming has often involved tedious assembly code, today C compilers are available for most microcontrollers. Microcontrollers often only require a single 5V supply as well which makes them easier to power and use.

3.1.2 AT89s52 Microcontroller
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s highdensity nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller, which provides a highly flexible and costeffective solution to many, embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a Six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the



AT89S52 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 Powerdown mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt. Features of AT89s52
• Compatible with MCS®-51 Products • 8K Bytes of In-System Programmable (ISP) Flash Memory – Endurance: 10,000 Write/Erase Cycles • 4.0V to 5.5V Operating Range • Fully Static Operation: 0 Hz to 33 MHz • Three-level Program Memory Lock • 256 x 8-bit Internal RAM • 32 Programmable I/O Lines • Three 16-bit Timer/Counters • Eight Interrupt Sources • Full Duplex UART Serial Channel • Low-power Idle and Power-down Modes • Interrupt Recovery from Power-down Mode • Watchdog Timer • Dual Data Pointer • Power-off Flag • Fast Programming Time • Flexible ISP Programming (Byte and Page Mode) • Green (Pb/Halide-free) Packaging Option


2 Block diagram Figure 3.1.2 Block Diagram Of AT89S52 4 .2.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3.1.

2.3 Pin diagram A T 8 9 S 5 2 Figure 3.3 Pin Diagram For AT89S52 5 .1.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3.1.

respectively. P1.6 P1. as shown in the following table.2.In addition.clock out T2EX(Timer/counter2 capture trigger direction control) MOSI(used for in-system programming) MISO(used for in-system programming) SCK(used for in-system programming) Port 1 also receives the low-order address bytes during Flash programming and verification.Port 0 also receives the code bytes during Flash programming and outputs the code bytes during Program verification.7 AlterNet function T2(external count input to timer/counter2).0 and P1.Port1 pins that are externally being pulled low will source current because of the internal pull-ups. As an output port.1 can be configured to be the timer/counter 2 external count input (P1.1. External pull-ups are required during program verification. When 1s are written to port 0 pins. In this mode.3. As inputs. Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. 6 . they are pulled high by the internal Pull-ups and can be used as inputs.1/T2EX). P0 has internal pull-ups.0/T2) and the timer/counter 2 trigger input (P1. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory.5 P1. the pins can be used as high-impedance inputs.1 Pin Description VCC GND Supply Voltage Ground Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. When 1s are written to Port 1 pins. Port pin P1.1 P1. each pin can sink eight TTL inputs. The Port 1 output buffers can Sink/source four TTL inputs.0 P1.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3.

Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR).METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. When 1s are written to Port 2 pins. Port 2 emits the contents of the P2 Special Function Register. Port 3 also serves the functions of various special features of the AT89S52. Port pin P3. Port 3 receives some control signals for Flash programming and verification. The Port 2 output buffers can Sink/source four TTL inputs. When 1s are written to Port 3 pins. they are pulled high by the internal pull-ups and can be used as inputs.6 P3. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI).4 P3. Port3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. Port 2 pins that are externally being pulled low will source current because of the internal pull-ups.0 P3. As inputs.3 P3. In this application. As inputs.7 Alternate function RXD(serial input port) TXD(serial output port) INTO (external interrupt 0) INT1 (external interrupt 1) T0 (timer 0 external input) T01(timer 01external input) WR(external data memory write storable) RD(external data memory read storable) 7 . as shown in the following table. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. Port 3 pins that are externally being pulled Low will source current because of the pull-ups. The Port 3 output buffers can Sink/source four TTL inputs. they are pulled high by the internal pull-up sand can be used as inputs.1 P3.5 P3.2 P3. Port 2 uses strong internal pullups when emitting 1s.

ALE operation can be disabled by setting bit 0 of SFR location 8EH. however. If desired. EA/VPP External Access Enable: EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. however. ALE is active only during a MOVX or MOVC instruction. PSEN is activated twice each machine cycle. With the bit set. EA should be strapped to Vcc for internal program executions. This pin drives high for 98 oscillator periods after the Watchdog times out. the pin is weakly pulled high. In normal operation. Otherwise. the RESET HIGH out feature is enabled. Note. that one ALE pulse is skipped during each access to external data memory. This pin is also the program pulse input (PROG) during Flash programming. EA will be internally latched on reset. ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. that if lock bit 1 is programmed. Note. 8 . except that two PSEN activations are skipped during each access to external data memory. PSEN Program Store Enable (PSEN) is the read strobe to external program memory. A high on this pin for two machine cycles while the oscillator is running resets the device. In the default state of bit DISRTO. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. When the AT89S52 is executing code from external program memory.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 RST Reset input. ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes.

respectively. since the input to the internal clocking Circuitry is through a divide-by-two flip-flop. as shown in Figure 3.4 C1.5.1.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 This pin also receives the 12-volt programming enable voltage (Vpp) during Flash programming.1. Figure 3. XTAL1 and XTAL2 are the input and output. XTAL2 Output from the inverting oscillator amplifier. XTAL2 Should be left unconnected while XTAL1 is driven. Either a quartz crystal or Ceramic resonator may be used. To drive the device from an external clock source. as shown in Figure 3. C2 = 30 pF ± 10 pF for Crystals = 40 pF ± 10 pF for Ceramic Resonators Figure 3.4. of an inverting amplifier that can be Configured for use as an on-chip oscillator.1. External Clock Drive Configuration 9 .5 There are no requirements on the duty cycle of the external clock signal. but minimum and maximum voltage high and low Time specifications must be observed. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.1.

Watchdog Timer (One-time Enabled with Reset-out) The WDT is intended as a recovery method in situations where the CPU may be subjected to software upsets. rather than P2 (whose address is 0A0H). program fetches to addresses 0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to external memory. When WDT over-flows. the following direct addressing instruction accesses the SFR at location 0A0H (which is P2). Data Memory . where R0 contains 0A0H. all program fetches are directed to external memory. The upper 128 bytes occupy a parallel address space to the Special Function Registers.If the EA pin is connected to GND. To enable the WDT.1. it will drive an output RESET HIGH pulse at the RST pin. MOV 0A0H. it will increment every machine cycle while the oscillator is running. the following indirect addressing instruction. On the AT89S52. When the WDT is enabled. For example. The WDT timeout period is dependent on the external clock frequency. #data Note that stack operations are examples of indirect addressing. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. if EA is connected to VCC.4 Memory Organization MCS-51 devices have a separate address space for Program and Data Memory. so the upper 128 bytes of data RAM are available as stack space. accesses the data byte at address 0A0H. the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. Program Memory . The WDT is defaulted to disable from exiting reset. #data Instructions that use indirect addressing access the upper 128 bytes of RAM. For example. Up to 64K bytes each of external Program and Data Memory can be addressed.2. When an instruction accesses an internal location above address 7FH. 10 . a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H). Instructions which use direct addressing access the SFR space.The AT89S52 implements 256 bytes of on-chip RAM. There is no way to disable the WDT except through reset (either hardware reset or WDT overflow reset).METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3. The WDT consists of a 14-bit counter and the Watchdog Timer Reset (WDTRST) SFR. MOV @R0.

Program Counter and Data Pointer The program counter is a 16.bit data type. B.5 Registers In the CPU. R4.1. or an address pointing to the data to be fetched. any data larger than 8 bits has to be broken into 8-bit chunks before it is processed. R3. R1. it can access 11 . registers are used to store information temporarily.1.6 8 bit and 16 bit register examples. The most commonly used registers of the 8051 are A(accumulator). R5. With an 8. R6. Since the PC is 16 bit wide. All the above registers are 8-bit registers except DPTR and the program counter.bit register and it points to the address of the next instruction to be executed. R2. That information could be a byte of data to be processed. R7. DPTR (data pointer) and PC (program counter). As the CPU fetches op-code from the program ROM.2. Figure 3. R0. In the 8051 there is only one data type: 8 bits. the program counter is incremented to point to the next instruction.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3. The accumulator A is used for all arithmetic and logic instructions.

P (parity). Four of the flags are conditional flags. The two unused bits are user definable flags. These four are CY (carry). not all the members of the 8051 have the entire 64K bytes of on-chip ROM installed. DPTR.7 PSW. a total of 64K bytes of code. only 6 bits of it are used by the microcontroller. It can also be set to 1 or 0 directly by an instruction such as ―SETB C‖ and ―CLR C‖ where ―SETB C‖ stands for set bit carry and ―CLR C‖ for clear carry. It is also referred as the flag register.1 PSW.0 CY (The Carry Flag) This flag is set whenever there is a carry out from the d7 bit. meaning they indicate some conditions that resulted after an instruction was executed. which are used to furnish memory addresses for internal and external data access.5 Carry flag Auxiliary carry flag Available to the user for general purpose Register bank selector bit 1 Register bank selector bit 0 Overflow flag User definable bit Parity flag RS1 PSW. DPTR does not have a single internal address. Although the PSW register is 8-bit wide. The program status word (PSW) register is an 8-bit register. The flag register in the 8051 is called the program status word (PSW) register. This flag bit is affected after an 8-bit addition or subtraction. and OV (overflow). The bits of the PSW register are shown below: CY AC -- PSW.2 PSW.6 PSW.6 RS0 PSW. DPH and DPL. The DPTR register is made up of two 8-bit registers. Flag bits and the PSW Register Like any other microprocessor. the 8051 have a flag register to indicate arithmetic conditions such as the carry bit.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 program addresses 0000 to FFFFH.3 OV F0 P PSW. The DPTR is under the control of program instructions and can be specified by its name. However. DPH and DPL are assigned an address each. AC (auxiliary carry). 12 .

In general the carry flags is used to detect errors in unsigned arithmetic operations. If the register A contains an odd number of 1s. This flag is used by instructions that perform BCD arithmetic. Therefore. then P=1. Special function register A map of the on-chip memory area called the Special Function Register (SFR) space is listed in following table 13 . this bit is set: otherwise cleared. P (The Parity Flag) The parity flag reflects the number of 1s in the accumulator register only. P=0 if Ahas an even number of 1s. OV (The Overflow Flag) This flag is set whenever the result of a signed number operation is too large.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 AC (The Auxiliary Carry Flag) If there is carry from D3 to D4 during an ADD or SUB operation. causing the high order bit to overflow into the sign bit.


METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3.6 and P3.7. the address. and the next cycle may begin.0 is pulled high again when programming is done to indicate READY. Signature Bytes: The signature bytes are read by the same procedure as a nor-mal verification of locations 000H. Input the desired memory location on the address lines. Data Polling: The AT89S52 features Data Polling to indicate the end of a byte write cycle.0 is pulled low after ALE goes high during programming to indicate BUSY. 100H.1. (000H) = 1EH indicates manufactured by Atmel (100H) = 52H indicates AT89S52 (200H) = 06H Chip Erase: In the parallel programming mode.6 Programming the Flash – Parallel Mode The AT89S52 is shipped with the on-chip Flash memory array ready to be programmed. The values returned are as follows. a chip erase operation is initiated by 15 . In the serial programming mode. 5. The bytewrite cycle is self-timed and typically takes no more than 50 μs. To program the AT89S52. During a write cycle. changing the address and data for the entire array or until the end of the object file is reached. The status of the individual lock bits can be verified directly by reading them back. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. 4. Data Polling may begin any time after a write cycle has been initiated. P3. Programming Algorithm: Before programming the AT89S52. an attempted read of the last byte written will result in the complement of the written data on P0.7 must be pulled to a logic low. a chip erase operation is initiated by using the proper combination of control signals and by pulsing ALE/PROG low for a duration of 200 ns . and control signals should be set up according to the ―Flash Programming Modes‖ . Once the write cycle has been completed. Repeat steps 1 through 5. except that P3. 3. Input the appropriate data byte on the data lines. data. Raise EA/VPP to 12V. the programmed code data can be read back via the address and data lines for verification. true data is valid on all outputs. 2.2.500 ns. The AT89S52 code memory array is programmed byte-by-byte. Program Verify: If lock bits LB1 and LB2 have not been programmed. take the following steps: 1. and 200H. P3. The programming interface needs a high-voltage (12-volt) program enable signal and is compatible with conventional third-party Flash or EPROM programmers. Activate the correct combination of control signals. Ready/Busy: The progress of byte programming can also be monitored by the RDY/BSY output signal.

During chip erase. chip erase is self-timed and takes about 500 ms. the Programming Enable instruction needs to be executed first before other operations can be executed. The maximum serial clock (SCK) frequency should be less than 1/16 of the crystal frequency. Figure 3.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 issuing the Chip Erase instruction. In this mode. Power-up sequence: a. The Chip Erase operation turns the content of every memory location in the Code array into FFH. The serial interface consists of pins SCK.1. Either an external system clock can be supplied at pin XTAL1 or a crystal needs to be connected across pins XTAL1 and XTAL2. the maximum SCK frequency is 2 MHz Serial Programming Algorithm To program and verify the AT89S52 in the serial programming mode. a serial read from any address location will return 00H at the data output. After RST is set high. MOSI (input) and MISO (output). a Chip Erase operation is required.7 Flash Programming and Verification Waveforms – Parallel Mode Programming the Flash – Serial Mode The Code memory array can be programmed using the serial ISP interface while RST is pulled to VCC. With a 33 MHz oscillator clock. Before a reprogramming sequence can occur. the following sequence is recommended: 1. Apply power between VCC and GND 16 .

Enable serial programming by sending the Programming Enable serial instruction to pin MOSI/P1. 2. 3. 3. 2.1. Set XTAL1 to ―L‖ (if a crystal is not used). Any memory location can be verified by using the Read instruction which returns the content at the selected address at serial output MISO/P1. The frequency of the shift clock supplied at pin SCK/P1. The write cycle is self-timed and typically takes less than 0. In this mode.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 pins. b. Power-off sequence (if needed): 1.5 ms at 5V. RST can be set low to commence normal device operation. The Code array is programmed one byte at a time in either the Byte or Page mode. apply a 3 MHz to 33 MHz clock to XTAL1 pin and wait for at least 10 milliseconds. If a crystal is not connected across pins XTAL1 and XTAL2.7 needs to be less than the CPU clock at XTAL1 divided by 16. Data Polling: The Data Polling feature is also available in the serial mode. Set RST pin to ―H‖. Turn VCC power off. Figure 3. 4. At the end of a programming session.8 Serial Programming Waveforms 17 .5. Set RST to ―L‖. 5. during a write cycle an attempted read of the last byte written will result in the complement of the MSB of the serial output byte on MISO.6.

METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3.1 Max-232 IC 3. Each driver converts TTL/COMS Levels into TIA/EIA-232-E levels. Figure 3. MAX232 is purposed for application in high-performance information processing systems and control devices of wide application. Each receiver converts TIA/EIA-232-E levels into 5V TTL/CMOS levels.1µA at ТA= 25 °С  Output current: 24mA  Latching current not less than 450mA at ТA= 25°С  The transmitter outputs and receiver inputs are protected to ±15kV Air ESD 18 .2.2 Max-232 Level converter MAX232 is compatible with RS-232 standard. The MAX232 is characterized for operation from -40°C to +85°C for all packages.1 FEATURES  Input voltage levels are compatible with standard СMOS levels  Output voltage levels are compatible with EIA/TIA-232-E levels  Single Supply voltage: 5V  Low input current: 0.2. and consists of dual transceiver.

2.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3.2 Interfacing of MAX-232 IC 19 .2 PIN DISCRIPTION 3.3 MAX-232 Interfaced With MCU   MAX232 (+5V -> +-12V converter) Serial port male 9 pin connector (SER) Figure 3.2.2.

20 .3 Motor Driver Circuit L293D is a dual H-Bridge motor driver.5V to 36V. The name "H Bridge" is derived from the actual shape of the switching circuit which controls the motion of the motor. output diodes are included within the IC. two DC motors can be interfaced which can be controlled in both clockwise and counter clockwise directions and its direction of motion can also be fixed. Moreover for the protection of the circuit from back EMF. It is also known as "Full Bridge" By using two motors the robot can be moved in any direction. which has made L293D a best choice for DC motor driver.2A per channel. The output supply (VCC2) has a wide range from 4.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 Absolute maximum ratting 3. L293D has output current of 600mA and peak output current of 1. So with one IC. The four I/O’s can be used to connect up to four DC motors. This Steering mechanism of the robot is called differential drive.

2 block diagram of lm293 21 .Pin diagram Figure 3.3.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 Figure 3.1 .3.

4 DTMF Decoder The MT-8870 is a DTMF Receiver that integrates both band split filter and decoder functions into a single 18-pin DIP or SOIC package.579545 MHz color burst crystal. clock generator. Figure 3.4. a timing resistor. Minimal external components required includes a low-cost 3. Its decoder uses digital counting techniques to detect and decode all 16 DTMF tone pairs into a 4-bit code. External component count is minimized by provision of an on-chip differential input amplifier.1 Pin configuration of MT-8870 Its filter section uses switched capacitor technology for both the high and low group filters and for dial tone rejection. and a timing capacitor. The MT-8870 offers low power consumption (35 mW max) and precise data handling. The filter section is used for separation of the low-group and high group tones and 22 . It is manufactured using CMOS process technology.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3. and latched tri-state interface bus.

as shown in Table 1.1: DTMF Keypad. the bandwidths of which corresponds to the low and high group frequencies. Limiting is performed by high-gain comparators which are provided with hysteresis to prevent detection of unwanted low-level signals. FREQUENCY 1209 HZ 1336 HZ 2 5 8 0 1477 HZ 3 6 9 # 1633 HZ A B C D 697 Hz 770 Hz 852 Hz 941 Hz 1 4 7 * 23 . Following the filter section is a decoder employing digital counting techniques to determine the frequencies of the incoming tones and to verify that they correspond tothe standard DTMF frequencies. The filter section also incorporates notches at 350 and 440 Hz for exceptional dial tone rejection. *. #) on the telephone. DTMF Tone The DTMF technique outputs distinct representation of 16 common alphanumeric characters (0-9. Each filter output is followed by a single order switched capacitor filter section which smoothes the signals prior to limiting. The lowest frequency used is 697Hz and the highest frequency used is 1633Hz. Table 3. The outputs of the comparators provide full rail logic swings at the frequencies of the incoming DTMF signals.4.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 it is achieved by applying the DTMF signal to the inputs of two sixth order switched capacitor band pass filters. A-D.

4. Table 3. will generate a dual tone consisting of 770 Hz for the low group and 1336 Hz for the high group.2: Digits vs.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 The DTMF keypad is arranged such that each row will have its own unique tone frequency and also each column will have its own unique tone frequency. tone output frequency (serial mode) Digit D4 D3 D2 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 D1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 1 1 0 0 1 1 1 D0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 Tone Output Frequency (Hz) 697 + 1209 697+ 1336 697+ 1477 770 + 1209 770+ 1336 770+ 1477 852+ 1209 852+ 1336 852 +1477 941 +1336 941 +1209 941 +1477 697 +1633 770 +1633 852 +1633 941+1633 697 770 852 941 1209 1336 1477 1633 — 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 1 9 0 1 0 0 1 * 0 1 # 0 1 A 0 1 B 0 1 C 0 1 D 0 0 — 1 0 — 1 0 — 1 0 — 1 0 — 1 0 — 1 0 — 1 0 — 1 0 DTMF 1 1 OFF *Notes: The codes not listed in Table 3. By pressing a key. input data vs.1 are not used D4 is MSB 24 . for example 5. Above is a representation of the typical DTMF keypad and the associated row/column frequencies.4.

organic solvents. Ion assisted deposition (IAD) process offers several advantages for gas sensor fabrication. The response time is the amount of time required from the initial contact with the 25 . including reactive deposition for gas-sensitive metal. In this work.1 Basic Gas Sensor Gas sensor has recently attracted much attention due to increasing demand of environmental monitoring and other gas detecting applications. hydrogen. sulfur dioxide. the distance. Among different types of gas sensor. Common gases measured by gas sensors include ammonia.oxide material optimization and improved thin film adhesion for better device reliability. Important measurement specifications to consider when looking for gas sensors include the response time. nitrogen oxides. thin film gas sensor has been much of interest because of microelectronic batch. silane. bromine. carbon monoxide. carbon dioxide.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 3. hydrogen sulfide. aerosols. halocarbons or refrigerants. chlorine dioxide. and the flow rate. ozone. phosphine. nitric oxide. germane. and ability to form multilayer device structures. reproducibility. dust.5 Gas sensor 3.5. arsine.5.1 Introduction Figure 3. nitrogen dioxide.fabricated compatibility. The gas sensor then provides output to a gas instrument to display the measurements. The sensors were tested with reducing gases. thin film based gas sensing circuit is designed for immediate applications of CO detection for environmental monitoring. chlorine. The metal oxide layer was deposited on alumina or glass substrates. and water vapor. Diborane. hydrocarbons. in the temperature range between 200oC and 350 oC and the electrical change in gas sensor is detected. hydrogen fluoride. hydrogen chloride. mercury vapor. oxygen. fluorine. hydrogen selenide. hydrogen cyanide. Gas sensors interact with a gas to initiate the measurement of its concentration.

The relationship between % LEL and % by volume differs from gas to gas. Consumption may also be called respiration given in units of ml/L/hr.2 Gas Sensor Circuit 26 . percent volume. Trace gas sensors given in units of concentration: ppm. A signature or spectra measurement is a spectral signature of the gases present. consumption. The flow rate is the necessary flow rate of air or gas across the gas sensor to produce signal. the output is often a chromatogram. The lower explosive limit (LEL) or lower flammable limit (LFL) of a combustible gas is defined as the smallest amount of the gas that will support a self-propagating flame when mixed with air (or oxygen) and ignited. analog currents and switch or relays. the amount of gas present is specified in terms of % LEL: 0% LEL being a combustible gas-free atmosphere and 100% LEL being an atmosphere in which the gas is at its lower flammable limit. Distance is the maximum distance from the leak or gas source that the sensor can detect gases.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 gas to the sensors processing of the signal. pulse signals.5. Density measurements are given in units of density: mg/m^3. In gas-detection systems. percent volume is typically only used for mixtures of liquids. Operating parameters to consider for gas sensors include operating temperature and operating humidity. and signature or spectra. Percent by volume is simply the volume of the solute divided by the sum of the volumes of the other components multiplied by 100%. Common outputs from gas sensors include analog voltage. trace. Also called volume percent or percent by volume. Figure 3. Gas sensors can output a measurement of the gases detected in a number of ways. density. Leakage is given as a flow rate like ml/min. leakage. These include percent LEL.

So by using op-amp as comparator we detect weather gas is present or not.5. CIRCUIT DIAGRAM Figure 3. and how to connect to circuit is shown above.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 Gas sensor has 6 pin as shown below. for example at no Gas it produces 1.4 Circuit Diagram Of A Gas Sensor With Driver Circuit 27 . There is no polarity in gas sensors because these consist of heating coil Working: Gas sensor output voltage changes as it detect gas.2 Volt and when it detects Gas its voltage output changes to 3 volt.

The instrument is used to check the atmosphere of sewers. Stable and long life Simple drive circuit APPLICATIONS OF GAS SENSORS They are used in gas leakage detecting equipments in family and Industry. Fast response .METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 FEATURES      High sensitivity to LPG. smoke. are suitable for detecting of LPG. town gas Small sensitivity to alcohol. town gas.especially water and telecoms Chemical and petrochemical . but the consequences of a gas escape could be catastrophic. They have 3 or even 4 sensors included in the package. tanks and other vessels prior to entry for maintenance purposes. (i) Gas Leak Protection: .for entry into vessels Cabling contractors • Piling contractors • Tunnelling contractors • Civil engineers 28 . natural gas . natural gas.These are areas of industry where the possibility of flammable gas build-up is small. These instruments invariably are 'multi-gas'. avoid the noise of alcohol and cooking fumes and cigarette smoke. Large volumes of these instruments are purchased by: • • • Public utilities . These tend to be industries which by their nature have large volumes of gases piped around the works: • • • Engineering companies Metal working plants Research laboratories (ii) Confined Space Entry The most prominent application for portable gas detection instruments.

1 20K 31Ω ±10 % 800mw less than Technical condition -10℃-50℃ -20℃-70℃ less than 95%Rh 21%(standard condition)Oxygen concentration can affect sensitivity Remar ACks OR DC ACOR DC Room Tem Remar ks minimum over 2% value is 3. Typical industrial sectors here are: • • • Chemical and petrochemical industries Oil/gas exploration Mining Note: Use cigarette Lighter for getting LPG gas SPECIFICATIONS A. but there are areas where single gas monitors ('explosimeters') are used. 1 5V±0. Standard work condition Symbol Parameter name Vc Circuit voltage Heating voltage V H Load resistance P L Heater resistance R H P Heating consumption H B.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 • Landfill operators (iii) Hazardous Area: Working Areas of industry where the build-up of flammable gas or vapour is an ever present danger. These instruments are very often the same multi-gas instruments used for confined space entry. Environment condition Symbol Parameter name Tao Using Tem Tas Storage Tem RH Related humidity Oxygen concentration O2 Technical condition 5V±0.5 INDUCTIVE PROXIMITY SENSOR 29 .

The oscillator generates a fluctuating magnetic field the shape of a doughnut around the winding of the coil that locates in the device’s sensing face. oscillator. When a metal object moves into the inductive proximity sensor’s field of detection. so energy in the field is lost.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 Inductive proximity sensors operate under the electrical principle of inductance. detection circuit and output circuit. The coil. which by definition has a magnetic component. Inductance is the phenomenon where a fluctuating current. If a target nears the field will it induce eddy current. This type of sensor consists of four stages. a sensor manufacturer twists wire into a tight coil and runs a current through it. These currents consume power because of resistance. and the signal amplitude decreases. induces an electromotive force (emf) in a target object. The detector examines field magnitude to determine when it has decreased enough to switch. The sensor’s detection circuit monitors the oscillator’s strength and triggers an output from the output circuitry when the oscillator becomes reduced to a sufficient level. Eddy circuits build up in the metallic object. An inductive sensor is able to detect the presence of some metallic materials. An inductive proximity sensor has four components. To amplify a device’s inductance effect. The inductive proximity sensor work by setting up a high frequency field. 30 . magnetically push back. and finally reduce the Inductive sensor’s own oscillation field.

Demodulator stage As the current flows back and forth between the capacitor and the coil.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 1 2 3 4 Oscillator Stage Demodulator Stage Trigger Stage Output Stage Oscillator stage The oscillator consist of capacitor that stores energy in its electrical field and an inductor that stores energy in magnetic field. a sine 31 .

Advantages of inductive detection 1 No physical contact with the object to be detected. which is amplified and fed to the demodulator stage. Output stage The primary function of the output stage is to provide a sensor output signal that is sufficient enough for the load to which it is connected. two of the output terminals are used for the power supply connections for the sensor.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 wave is produced. thus avoiding wear and enabling fragile or freshly painted objects to be detected. Also. A primary function of this trigger is to produce two different voltages that transition from one to the other very rapidly. 32 . Trigger stage The DC voltage from the demodulator is fed into the scmitt trigger.

In May 1987. The GSM standard is intended to address these problems. A summary of GSM milestones is given in table below: 33 . fully encapsulated in resin). This presented many problems directly related to compatibility. various systems have been developed without the benefit of standardized specifications. a digital system was adopted for GSM.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 2 High operating rates. 3 Fast response. 6 Solid state technology : no moving parts.metal case(cylindrical).wired cable. Give Applications Give Rating. The next task was to decide between a narrow or broadband solution. From 1982 to 1985 discussions were held to decide between building an analog or digital system. 4 Excellent resistance to industrial environments (robust products. GSMThroughout the evolution of cellular telecommunications. After multiple field tests.tightening torque 3.6 GLOBAL SYSTEM FOR MOBILE COMMUNICATION (GSM)DEFINITIONGlobal System for Mobile Communication (GSM) is a globally accepted standard 1982 to create a common European mobile telephone standard that would formulate specifications for a pan-European mobile cellular radio system operating at 900 MHz. therefore service life of sensor independent of the number of operating cycles.led. especially with the development of digital radio technology. the narrowband time division multiple access (TDMA) solution was chosen.

SIM300 provides GPRS multi-slot class 10/class 8 (optional) capability and support the GPRS coding schemes CS-1. SIM 300 is a Tri-band GSM/GPRS engine that works on frequencies EGSM 900 MHz.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 YEAR 1982 1986 1987 1988 1989 1990 1991 1992 1993 1995 MILESTONES GSM formed Field test TDMA chosen as access method Memorandum of understanding signed Validation of GSM system Pre-operation system Commercial system start-up Coverage of larger cities/airports Coverage of main roads Coverage of rural areas Fig. CS-3 and CS-4. 34 . DCS 1800 MHz and PCS 1900 MHz.GSM system architecture with essential components. SIM300PRODUCT CONCEPTDesigned for global market. CS-2.

The antenna connector is MURATA MM9329-2700. The physical interface to the mobile application is made through a 60 pins board-to-board connector. SIM300 can fit almost all the space requirement in our application.5mA in SLEEP mode. 35 . such as smart phones.METAL DETECTION AND GAS LEAK FINDING ROBOT 2013 With a tiny configuration of 40mm x 33mm x 2.    The keypad and SPI LCD interface will give you the flexibility to develop customized applications.PDA phone and other mobile device. This can be easily configured by AT commands.85mm. Two audio channels include two microphones inputs and two speaker outputs. SIM300 provide RF antenna interface with two alternatives: antenna connector and antenna pad. And customer’s antenna can be soldered to the antenna pad. Two serial ports can help us easily develop our applications. which provides all hardware interfaces between the module and customer’s boards except the RF antenna interface. the current consumption to as low as 2. The SIM300 is designed with power saving technique.