Vous êtes sur la page 1sur 59

1

An adaptive hands free technique for mobile communication system

CHAPTER 1: INTRODUCTION
Now-a-days, using Mobile phones while driving motor vehicles have became common. As a result of which the drivers are getting distracted resulting in many accidents. From the previous statistics its been confirmed that about 70 percent of the accidents on the roads are due to the use of mobile phones while walking and driving. But in some situations some of the people feel it responsible using the mobile while driving. Mainly used systems to avoid the calls in traffic while driving till date are call-diverting, voice mail converting, flight mode, etc. So, lets go on for a new technique by which we can intimate the calling-subscriber by a voice message that we are in driving directly when we get the call. Only in the case of emergency, there is an option whether to send a voice message or answer the call. If the call is answered the speed of car the driver gets reduced. Here we are going to use a prototype in which there are two sections: 1. Dash Board section which is fixed in the car to control the speed of the car using a relay while driving. 2. Mobile section where the speaker, buzzer and an LCD display are present to imitate to the driver from whom the call is received. Buzzer blows when the call comes for the second time. Speaker is used to hear the recorded message stored in the memory of the micro controller.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

2
An adaptive hands free technique for mobile communication system

1.1 BLOCK DIAGRAM


Block diagram consists of two major parts: 1. Dash Board section

2. Mobile section DASH-BOARD SECTION

RELAY

ENGINE

TRANSMITTER (27 MHz)

8051 MCU

ENCODER

RECIEVER (433.34 MHz)

POWER - SUPPLY

Fig1: Dash-Board Section

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

3
An adaptive hands free technique for mobile communication system

MOBILE SECTION

POWER - SUPPLY RECIEVER (27 MHz)

TRANSMITTER (433.34 MHz)

GSM MODEM

DECODER

PIC MCU

MAX232

POWER - SUPPLY

Call INDICATOR (BUZZER, SPEAKER)

Fig2: Mobile Section

POWER SUPPLY SECTION

Power supply 230V AC

TRANSFORMER (230-9V AC)

RECTIFIER (9V DC)

VOLTAGE REGULATOR

5V DC

FILTER

Fig3: Power Supply

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

4
An adaptive hands free technique for mobile communication system

1.2 EXISTING SYSTEM


The methods so far used for avoiding the calls are: Muting the call The process in which the cell phone is switched on to silent mode is called Call Muting. In this mode call is received but the ring is not heard. Call diverting The process in which the call is diverted to a particular number as assigned by the person is called call diverting. Voice mail conversion In voice mail process the call gets lifted but the tone is not heard. Flight mode There is no signal for the phone. So, there is no connectivity.

1.3 PROPOSED SYSTEM


In this technique we have two options. They are:

Auto answering of call, provides the information of the driver in the form of voice
message.

Only emergency calls are allowed to access. 1.4 ADVANTAGES OF PROPOSED SYSTEM
Requires low cost for building this system. As the circuitry is very small it can be easily carried anywhere. The output of the system is accurate. Consumes less power. It is portable in nature.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

5
An adaptive hands free technique for mobile communication system

1.5 BLOCK DIAGRAM EXPLANATION


The block diagram as shown above consists of two sections. Dash-board section and Mobile section.

Mobile Section: The mobile section mainly consists of GSM modem, MAX232, PIC Micro Controller, Call Indicator and RF- transmitter and receiver. This section is present with the driver. After getting the confirmation from the dash board section that the mobile got switched in to driving mode this section comes in to picture. When the call comes to the mobile section for the first time, the GSM modem receives the call. An indication is sent to the micro controller with the help of RS-232 cable. PIC controller has an in built ADC which converts frequency signal in to bits stream and is feed to the call indictor. LCD present displays the mobile number from which call is received. The speaker in the call indicator shutters a message that the called subscriber is in driving. When the call is received from the same number with in no time for the second time the same procedure continues till the call indicator. But the buzzer will indicate that the call is emergency one. There will be a switch providing an option to accept or reject the call. If the call is rejected then same voice message is heard through the speaker. If the call is accepted then a signal is send to the dash board section. In the dash board section with the help of the relay the car speed is reduced. If the call comes from a second subscriber in between the two calls from the first subscriber again a voice message is sent to the first subscriber

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

6
An adaptive hands free technique for mobile communication system

Dash-Board Section: When the car gets started, an indication is sent to the micro controller (8051) through the relay. The micro controller with the help of RF Transmitter sends an indication to the mobile section the car has started and the mobile got switched in to driving mode. The Dash Board Section waits for the confirmation from the mobile section that the call is accepted. The signal is in the form of RF signal which is decoded and is feed to the micro controller. The controller with the help of the relay reduces the speed of the stepper motor present in the car. As a result the car speed gets reduced. When the call is terminated again a signal is send from the dash board section to the mobile section that the car is started and the mobile got switched to driving mode. Power Supply: There are two types of power supplies used here: 1. An adapter is used for connecting the GSM modem. The output of that adapter is 9V dc. 2. For both micro controllers we are giving 5V DC. Designing: Now the aim is to design the power supply section which converts 230V AC in to 5V DC. Since 230V AC is too high to reduce it to directly 5V DC, therefore we need a step-down transformer that reduces the line voltage to certain voltage that will help us to convert it in to a 5V DC. The output of the transformer is 9V AC; it feed to rectifier that converts AC to pulsating DC.Here we are using Bridge rectifier, because half wave rectifier has we less in efficiency. Even though the efficiency of full wave and bridge rectifier are the same, since there is no requirement for any negative voltage for our application, we gone with bridge rectifier.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

7
An adaptive hands free technique for mobile communication system

1.6 SCHEMATIC DIAGRAM AND DESCRIPTION


The schematic diagram here consists of mainly two parts: 1. Dash Board Section. 2. Mobile Section.

1.6.1 DASH-BOARD SECTION

Fig 4: Dash Board Section

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

8
An adaptive hands free technique for mobile communication system

1.6.2 MOBILE SECTION

Fig 5: Mobile Section

1.7 SCHEMATIC DIAGRAM EXPLANATION


Mobile Section: When the Engine gets started the micro controller indicates by pin16. Micro controller in the dash board section is interfaced with the pin10 of the decoder through pin27 of the controller. Pin14of decoder is interfaced with data port of RF transmitter. The RF receiver of the mobile section receives it and feeds the information to pin19 of encoder. The pin16 of encoder in mobile

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

9
An adaptive hands free technique for mobile communication system

section is interfaced with the pin38 of micro controller. Then successfully the information is received that the car is started and the mobile got switched to driving mode. Now actually mobile section comes in to picture. When we get the call for the very first time it is received by the GSM modem. The GSM modem is interfaced with the serial communication port RS-232 to the micro controller. Pin2 and pin3 of the serial port is interfaced with pin8 and pin7 of the MAX232 ports. Pin9 and pin10 of the MAX232 is interfaced with pin26 and pin25 of the PIC micro controller.pins13 and 14 are given to the crystal oscillator. PIC has an inbuilt ADC which converts the analog signal to digital. The PIC controller interfaces pin19 to pin30 with pin14 to pin7 of the LCD. Pin40 is interfaced with the Buzzer. Pin39 is interfaced with the voice module. Pin23 is interfaced with the pin10 of the decoder. The pin14 of the decoder is feed to the data pin. Dash-Board section: When the Engine of the car gets started it intimates to the mobile section that mobile is switched on to driving mode. Engine is feed to pin16. When the required signal is received by the RF Receiver, it is then feed to encoder through pin17. Pin10 to pin14 of encoder are interfaced with pin21 to pin25 of the micro controller. Pin28 of controller is interfaced with relay which is again interfaced with the stepper motor.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

10
An adaptive hands free technique for mobile communication system

CHAPTER 2: WORKING
The operation first starts in the dash board section. When the car gets started Engine of it provides the power supply to the micro controller (8051) and makes it on. The micro controller with the help of a decoder converts the bits stream in to continuous signal and feeds to the RF-Transmitter (27MHz). In the RF-Transmitter the frequency modulation takes place. The resultant signal of RF-Transmitter is transmitted from the dash board section to the mobile section. The RF-Receiver (27MHz) at the mobile section receives the signal and then encodes and feeds the signal to the PIC controller. The received signal indicates that the car got started and the mobile is switched on to driving mode. When the GSM modem of the mobile section gets the call for the first time, signal is feed to the PIC controller by interfacing it with GSM modem using RS232 cable. The signal from PIC is feed to the call indicator section. In this section there is a LCD display where the number of the dialed subscriber gets displayed. The speaker in that section utters a voice message that the called subscriber is in driving. If within no time if the mobile section gets the call for the second time, the signal is again feed to the PIC controller as discussed above. The signal from the PIC is now feed to the indicator section again. But for the second time, the Buzzer blows off and there is a switch which provides an option either to accept or reject the call. The number of the called subscriber is again displayed on the LCD display. If the call is accepted the PIC controller with the help of a decoder converts bit stream into continuous signal and transmits the signal undergoing frequency and amplitude modulation in RF-Transmitter. RF-Receiver in the dash board section receives the transmitted signal and converts it in to bit stream and feed to the micro controller (8051). The micro controller with the help of a relay driver steps down the speed of the car. After terminating the call again a signal is transmitted to the mobile section that the mobile got switched to driving mode.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

11
An adaptive hands free technique for mobile communication system

If the call is rejected then also a voice message is heard from the speaker that the subscriber is busy. Immediately after the voice message is heard again a signal is transmitted to the mobile section that the mobile got switched to driving mode.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

12
An adaptive hands free technique for mobile communication system

CHAPTER 3: MICRO CONTROLLER


In this project we are using two micro controllers namely: 1. 8051 micro controller 2. PIC micro controller

3.1 8051 MICRO CONTROLLER (89s51)


3.1.1 INTRODUCTION: 89S51 microcontrollers is a low-power, high-performance CMOS 8-bit micro computer with 8K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel high-density nonvolatile memory technology and is compatible with the industry-standard 89S51 microcontrollers. 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 Flash on a monolithic chip, the Atmel 89s51 Microcontroller is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. 3.1.2 FEATURES OF 89S51 MICROCONTROLLERS: The 89s51 microcontrollers provides the following standard features: 8k bytes of flash, 256 bytes of ram, 32 i/o lines, 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 89s51 Microcontroller is designed with Static Logic for operation down to zero frequency and supports two software selectable power saving modes. The idle mode stops the CPU while allowing the ram, timer/counters, serial port, and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until next Reset.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

13
An adaptive hands free technique for mobile communication system

3.1.3 PIN DIAGRAM

Fig6: Pin Diagram of 89s51

3.1.4 PIN DESCRIPTION    VCC - Supply voltage. GND - Ground. Port0 Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to Port 0 pins, the pins can be used as high impedance inputs. Port 0 can also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory.  Port1 Port 1 is an 8-bit bi-directional I/O port with internal pull ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 1 pins that

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

14
An adaptive hands free technique for mobile communication system

are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, Port1 also receives the low-order address bytes during Flash programming and verification.  Port2 Port 2 is an 8-bit bi-directional I/O port with internal pull ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port2 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).  Port3 Port 3 is an 8-bit bi-directional I/O port with internal pull ups. The Port 3 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. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups.  RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.  ALE/PROG Address Latch Enable is an output pulse for latching the low byte of the address during accesses to external memory. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

15
An adaptive hands free technique for mobile communication system

PSEN Program Store Enable is the read strobe to external program memory. When the 89s51 Microcontroller is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

EA/VPP EA (External Access Enable) 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.

XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2 Connected to the output of the inverting oscillator amplifier.

Timer0-and-Timer1 Timer 0 and Timer 1 in the 89S51 microcontrollers operate the same way as Timer 0 and Timer 1 in the 89S51 microcontrollers. The type of operation is selected by bit C/T2. Timer 2 has three operating modes: capture, auto-reload and baud rate generator.

3.1.5 SPECIAL FUNCTION REGISTERS A map of the on-chip memory area is called as Special Function Register (SFR). Note that not all of the addresses are occupied, and unoccupied addresses may not be implemented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect. Timer 2 Registers Control and status bits are contained in

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

16
An adaptive hands free technique for mobile communication system

registers T2CON and T2MOD for Timer 2. The register pair (RCAP2H, RCAP2L) is the Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode. Interrupt registers the individual interrupt enable bits are in the IE register. Two priorities can be set for each of the six interrupt sources in the IP register. Interrupts The 89S51 microcontrollers has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. 3.1.6 ARCHITECTURE OF 89s51

Fig7: Architecture of 89s51

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

17
An adaptive hands free technique for mobile communication system

3.2 PIC Micro Controller (18F452)


3.2.1 INTRODUCTION PIC18F452 microcontroller is a 40-pin microcontroller housed in a DIL package, with a pin configuration similar to the popular PIC16F877. PIC18F2X2 microcontrollers are 28-pin devices, while PIC18F4X2 microcontrollers are 40-pin devices. The architectures of the two groups are almost identical except that the larger devices have more input-output ports and more A/D converter channels. In this section we shall be looking at the architecture of the PIC18F452 microcontroller in detail. The architectures of other standard PIC18F-series microcontrollers are similar, and the knowledge gained in this section should be enough to understand the operation of other PIC18F-series microcontrollers. Program memory addresses consist of 21 bits, capable of accessing 2Mbytes of program memory locations. The PIC18F452 has only 32Kbytes of program memory, which requires only 15 bits. The remaining 6 address bits are redundant and not used. A table pointer provides access to tables and to the data stored in program memory. The program memory contains a 31-level stack which is normally used to store the interrupt and subroutine return addresses. The data memory bus is 12 bits wide, capable of accessing 4Kbytes of data memory locations. The data memory also consists of special function registers (SFR) and general purpose registers, all these are organized in banks. The PIC18F452 consists timers/counters, capture/compare/PWM registers, USART, A/D converter, and EEPROM data memory. The PIC18F452 consists of: 1. 2. 3. 4. 5. 4 timers/counters 2 capture/compare/PWM modules 2 serial communication modules 8 10-bit A/D converter channels 256 bytes EEPROM

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

18
An adaptive hands free technique for mobile communication system

3.2.2 PIN DIAGRAM

Fig8: Pin Diagram of PIC

3.2.3 PIN DESCRIPTION Parallel I/O Ports The parallel ports in PIC18F microcontrollers are very similar to those of the PIC16 series. The number of I/O ports and port pins varies depending on which PIC18F microcontroller is used, but all of them have at least PORTA and PORTB. The pins of a port are labeled as RPn, where P is the port letter and n is the port bit number. For example, PORTA pins are labeled RA0 to RA7; PORTB pins are labeled RB0 to RB7, and so on. The first three operations are the same in the PIC16 and the PIC18F series. In some applications we may want to send a value to the port and then read back the value just sent. The PIC16 series has a weakness in the port design such that the value read from a port may be different from the value just written to it. This is because the reading is the actual port bit pin value, and this value can be changed by external devices connected to the port pin. In the PIC18F series, a latch register (e.g., LATA for PORTA) is introduced to the I/O ports to hold the actual

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

19
An adaptive hands free technique for mobile communication system

value sent to a port pin. Reading from the port reads the latched value, which is not affected by any external device. In this section we shall be looking at the general structure of I/O ports. PORTA in the PIC18F452 microcontroller PORTA is 7 bits wide and port pins are shared with other functions. There are three registers associated with PORTA: 1. 2. 3. Port data registerPORTA Port direction registerTRISA Port latch registerLATA

PORT A PORTA is the name of the port data register. The TRISA register defines the direction of PORTA pins, where logic 1 in a bit position defines the pin as an input pin, and a 0 in a bit position defines it as an output pin. LATA is the output latch registers which shares the same data latch as PORTA. Writing to one is equivalent to writing to the other. But reading from LATA activates the buffer at the top of the diagram, and the value held in the PORTA/LATA data latch is transferred to the data bus independent of the state of the actual output pin of the microcontroller. Bits 0 through 3 and 5 of PORTA are also used as analog inputs. After reset, these pins are programmed as analog inputs and RA4 and RA6 are configured as digital inputs. To program the analog inputs as digital I/O, the ADCON1 register (A/D register) must be programmed accordingly. Writing 7 to ADCON1 configures all PORTA pins as digital I/O. The RA4 pin is multiplexed with the Timer 0 clock input (T0CKI). PORT B In PIC18F452 microcontroller PORTB is an 8-bit bidirectional port shared with interrupt pins and serial device programming pins. PORTB is controlled by three registers: 1. 2. 3. Port data registerPORTB Port direction registerTRISB Port latch registerLATB

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

20
An adaptive hands free technique for mobile communication system

The general operation of PORTB is similar to that of PORTA. Each port pin has a weak internal pull-up which can be enabled by clearing bit RBPU of register INTCON2. These pullups are disabled on a power-on reset and when the port pin is configured as an output. On a power-on reset, PORTB pins are configured as digital inputs. Internal pull-ups allow input devices such as switches to be connected to PORTB pins without the use of external pull-up resistors. This saves costs because the component count and wiring requirements are reduced. www.nPortB pins RB4RB7 can be used as interrupt-on-change inputs, whereby a change on any of pins 4 through 7 causes an interrupt flag to be set. The interrupt enable and flag bits RBIE and RBIF are in register INTCON. PORTC, PORTD, PORTE, and in addition to PORTA and PORTB, the PIC18F452 has 8-bit bidirectional ports PORTC and PORTD, and 3-bit PORTE. Each port has its own data register (e.g., PORTC), data PIC18F452 PORTB RB4RB7 pins. PORT C and PORT D In the PIC18F452 microcontroller PORTC is multiplexed with several peripheral functions. On a power-on reset, PORTC pins are configured as digital inputs. In the PIC18F452 microcontroller, PORTD has Schmitt trigger input buffers. On a power-on reset, PORTD is configured as digital input. PORTD can be configured as an 8-bit parallel slave port (i.e., a microprocessor port) by setting bit 4 of the TRISE register. PORT E In the PIC18F452 microcontroller, PORTE is only 3 bits wide. Port E pins are shared with analog inputs and with parallel slave port read/write control bits. On a power-on reset, PORTE pins are configured as analog inputs and register ADCON1 must be programmed to change these pins to digital I/O. The PIC18F452 microcontroller has four programmable timers which can be used in many tasks, such as generating timing signals, causing interrupts to be generated at specific time intervals, measuring frequency and time intervals, and so on. This section introduces the timers available in the PIC18F452 microcontroller.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

21
An adaptive hands free technique for mobile communication system

3.2.4 FEATURES OF PIC 18F452 Power Supply PIC18F452 can operate with a supply voltage of 4.2V to 5.5V at the full speed of 40MHz. The lower power version, PIC18F452, can operate from 2.0 to 5.5 volts. At lower voltages the maximum clock frequency is 4MHz, which rises to 40MHz at 4.2V. The RAM data retention voltage is specified as 1.5V and will be lost if the power supply voltage is lowered below this value. In practice, most microcontroller-based systems are operated with a single 5V supply derived from a suitable voltage regulator. Reset The reset action puts the microcontroller into a known state. Resetting a PIC18F microcontroller starts execution of the program from address 0000H of the program memory. The microcontroller can be reset during one of the following operations: 1. 2. 3. 4. 5. Power-on reset (POR) MCLR reset Watchdog timer (WDT) reset Brown-out reset (BOR) Reset instruction

Power-on Reset The power-on reset is generated automatically when power supply voltage is applied to the chip. The MCLR pin should be tied to the supply voltage directly or, preferably, through a 10K resistor. For applications where the rise time of the voltage is slow, it is recommended to use a diode, a capacitor, and a series resistor. In some applications the microcontroller may have to be reset externally by pressing a button. Normally the MCLR input is at logic1.When the RESET button is pressed, this pin goes to logic 0 and resets the microcontroller.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

22
An adaptive hands free technique for mobile communication system

The Clock Sources The PIC18F452 microcontroller can be operated from an external crystal or ceramic resonator connected to the microcontrollers OSC1 and OSC2 pins. In addition, an external resistor and capacitor, an external clock source and in some models internal oscillators can be used to provide clock pulses to the microcontroller. Watchdog Timer In PIC18F-series microcontrollers family members the watchdog timer (WDT) is a free running on-chip RC-based oscillator and does not require any external components. When the WDT times out, a device RESET is generated. If the device is in SLEEP mode, the WDT time-out will wake it up and continue with normal operation. The watchdog is enabled / disabled by bit SWDTEN of register WDTCON. Setting SWDTEN = 1 enables the WDT, and clearing this bit turns off the WDT. On the PIC18F452 microcontroller an 8-bit post scalar is used to multiply the basic time-out period from 1 to 128 in powers of 2. This post scalar is controlled from configuration register CONFIG2H. The typical basic WDT time-out period is 18ms for a post scalar value of 1. The PIC18F452 has five parallel ports named PORTA, PORTB, PORTC, PORTD, and PORTE. Most port pins have multiple functions. For example, PORTA pins can be used as parallel inputs-outputs or analog inputs. PORTB pins can be used as parallel inputs-outputs or as interrupt inputs. Timers The PIC18F452 microcontroller has four programmable timers which can be used in many tasks, such as generating timing signals, causing interrupts to be generated at specific time intervals, measuring frequency and time intervals, and so on.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

23
An adaptive hands free technique for mobile communication system

Timer 0: Timer 0 is similar to the PIC16 series. Timer 0, except that it can operate either in 8-bit or in 16-bit mode. Timer 0 has the following basic features: y y y y 8-bit or 16-bit operation 8-bit programmable pre scalar External or internal clock source Interrupt generation on overflow Timer 0 control register is T0CON, shown in Figure 2.24. The lower 6 bits of this register have similar functions to the PIC16-series OPTION register. The top two bits are used to select the 8-bit or 16-bit mode of operation and to enable/disable the timer. Timer 1: PIC18F452 Timer 1 is a 16-bit timer controlled by register T1CON Timer 2: Timer 2 is an 8-bit timer with the following features: y y y y y 8-bit timer (TMR2) 8-bit period register (PR2) Programmable pre-scalar Programmable post-scalar Interrupt when TM2 matches PR2

Timer 3: The structure and operation of Timer 3 is the same as for Timer 1, having registers TMR3H and TMR3L. Capture/Compare/PWM Modules (CCP) The PIC18F452 microcontroller has two capture/compare/PWM (CCP) modules, and they work with Timers 1, 2, and 3 to provide capture, compare, and pulse width modulation (PWM) operations. Each module has two 8-bit registers.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

24
An adaptive hands free technique for mobile communication system

Analog-to-Digital Converter (A/D) Module An analog-to-digital converter (A/D) is another important peripheral component of a micro controller. The A/D converts an analog input voltage into a digital number so it can be processed by a microcontroller or any other digital system. There are many analog-to-digital converter chips available on the market, and an embedded systems designer should understand the characteristics of such chips so they can be used efficiently. Interrupts The PIC18F452 microcontroller has both core and peripheral interrupt sources. The core interrupt sources are: y y y External edge-triggered interrupt on INT0, INT1, and INT2 pins. PORTB pins change interrupts (any one of the RB4RB7 pins changing state) Timer 0 overflow interrupt

The peripheral interrupt sources are: y y y y y y y y y Parallel slave port read/write interrupt A/D conversion complete interrupt USART receive interrupt USART transmit interrupt Synchronous serial port interrupt CCP1 interrupt TMR1 overflow interrupt TMR2 overflow interrupt Comparator interrupt

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

25
An adaptive hands free technique for mobile communication system

3.2.5 MEMORY ORGANIZATION Program Memory Organization All PIC18F devices have a 21-bit program counter and hence are capable of addressing 2Mbytes of memory space. User memory space on the PIC18F452 microcontroller is 00000H to 7FFFH. Accessing a nonexistent memory location (8000H to 1FFFFFH) will cause a read of all 0s. The reset vector, where the program starts after a reset, is at address 0000. Addresses 0008H and 0018H are reserved for the vectors of high-priority and low-priority interrupts respectively, and interrupt service routines must be written to start at one of these locations. The PIC18F microcontroller has a 31-entry stack that is used to hold the return addresses for subroutine calls and interrupt processing. The stack is not part of the program or the data memory space. The stack is controlled by a 5-bit stack pointer which is initialized to 00000 after a reset. During a subroutine call (or interrupt) the stack pointer is first incremented, and the memory location it points to is written with the contents of the program counter. During the return from a subroutine call (or interrupt), the memory location the stack pointer has pointed to is decremented. The projects in this book are based on using the C language. Program memory is addressed in bytes, and instructions are stored as two bytes or four bytes in program memory. The least significant byte of an instruction word is always stored in an even address of the program memory. An instruction cycle consists of four cycles: A fetch cycle begins with the program counter incrementing in Q1. In the execution cycle, the fetched instruction is latched into the instruction register in cycle Q1. This instruction is decoded and executed during cycles Q2, Q3, and Q4. A data memory location is read during the Q2 cycle and written during the Q4 cycle. Data Memory Organization The data memory address bus is 12 bits with the capability to address up to 4Mbytes. The memory in general consists of sixteen banks, each of 256 bytes, where only 6 banks are used. The PIC18F452 has 1536 bytes of data memory (6 banks of 256 bytes each) occupying the lower

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

26
An adaptive hands free technique for mobile communication system

end of the data memory. Bank switching happens automatically when a high-level language compiler is used, and thus the user need not worry about selecting memory banks during programming. The special function register (SFR) occupies the upper half of the top memory bank. SFR contains registers which control operations such as peripheral devices, timers/ counters, A/D converter, interrupts, and USART. 3.2.6 ARCHITECTURE OF PIC 18F452

Fig9: Architecture of PIC 18f452

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

27
An adaptive hands free technique for mobile communication system

CHAPTER 4: SERIAL COMMUNICATION


4.1 INTRODUCTION:
Computers transfer data in two ways: parallel and serial. In parallel data transfers, often 8 or more lines (wire conductors) are used to transfer data to a device that is only a few feet away. Examples of parallel transfers are printers and hard disks; each uses cables with many wire strips. Although in such cases a lot of data can be transferred in a short amount of time by using many wires in parallel, the distance cannot be great. To transfer to a device located many meters away, the serial method is used. In serial communication, the data is sent one bit at a time, in contrast to parallel communication, in which the data is sent a byte or more at a time. The 8051 has serial communication capability built into it, thereby making possible fast data transfer using only a few wires. When a microprocessor communicates with the outside world, it provides the data in byte-sized chunks. In some cases, such as printers, the information is simply grabbed from the 8bit data bus of the printer. This can work only if the cable is not too long, since long cables diminish and even distort signals. The Figures shows serial versus parallel data transfers Peer-to-peer connection
Receiver Sender

Many-to-many connection

Sender

Receiver

Fig10: Communication Process

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

28
An adaptive hands free technique for mobile communication system

The fact that in serial communication a single data line is used instead of the 8-bit data line of parallel communication makes it not only much cheaper but also makes it possible for two computers located in two different cities to communicate over the telephone. For serial data communication to work the byte of data must be converted to serial bits using a parallel-inserial-out shift register; then it can be transmitted over a single data line. This also means that at the receiving end there must be a serial-in-parallel-out shift register to receive the serial data and pack them into a byte. Of course, if data is to be transferred on the telephone, it must be converted from 0s and 1s to audio tones, which are sinusoidal-shaped signals. This conversion is performed by a peripheral device called modem, which stands for modulator/ demodulator. When the distance is short, the digital signal can be transferred as it is on a simple wire and requires no modulation. This is how IBM PC keyboards transfer data to the motherboard. However, for long-distance data transfers using communication lines such as a telephone, serial data communication requires a modem to modulate (convert from 0s and 1s to audio tones) and demodulate (converting from audio tones to 0s and 1s). Serial data communication uses two methods, asynchronous and synchronous. The synchronous method transfers a block of data (characters) at a time while the asynchronous transfers a single byte at a time. It is possible to write software to use either of these methods, but the programs can be tedious and long. For this reason, there are special IC chips made by many manufacturers for serial data communications. These chips are commonly referred to as UART (Universal Asynchronous Receiver-Transmitter) and USART (Universal SynchronousAsynchronous Receiver-Transmitter). The 8051 chip has a built-in UART. Data transfer rate: The rate of data transfer in serial data communication is stated in bps (bits per second). Another widely used terminology for bps is baud rate. However, the baud and bps rates are not necessarily equal. This is due to the fact that baud rate is the modem terminology and is defined as the number of signal changes per second. In modems, there are occasions when a single change of signal transfers several bits of data. As far as the conductor wire is concerned, the baud rate and bps are the same.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

29
An adaptive hands free technique for mobile communication system

The data transfer rate of a given computer system depends on communication ports incorporated into that system. For example, the early IBM PC/XT could transfer data at the rate of 100 to 9600 bps. However in recent years, Pentium-based PCs transfer data at rates as high as 56K bps. It must be noted that in asynchronous serial data communication, the baud rate is generally limited to 100,000 bps.

4.2 RS232 STANDARDS


To allow compatibility among data communication equipment made by various manufacturers, an interfacing standard called RS232 was set by the Electronics Industries Association (EIA) in 1960. In 1963 it was modified and called RS232A. RS232B and RS232C were issued in 1965 and 1969, respectively. Today, RS232 is the most widely used serial I/O interfacing standard. This standard is used in PCs and numerous types of equipment. However, since the standard was set long before the advent of the TTL logic family, its input and output voltage levels are not TTL compatible. In RS232, a 1 is represented by -3 to -25V, while a 0 bit is +3 to +25V, making -3 to +3 undefined. For this reason, to connect any RS232 to a microcontroller system we must use voltage converters such as MAX232 to convert the TTL logic levels to the RS232 voltage level, and vice versa. MAX232 IC chips are commonly referred to as line drivers. Connection to RS232 The details of the physical connections of the 8051 to RS232 connectors are given here. The RS232 standard is not TTL compatible; therefore, it requires a line driver such as the MAX232 chip to convert RS232 voltage levels to TTL levels, and vice versa. The interfacing of 8051 with RS232 connectors via the MAX232 chip is discussed here.

4.3 MAX232
Since the RS232 is not compatible with todays microprocessors and microcontrollers, a line driver (voltage converter) is needed to convert the RS232s signals to TTL voltage levels that will be acceptable to the 8051s TxD and RxD pins. One example of such a converter is

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

30
An adaptive hands free technique for mobile communication system

MAX232 from Maxim Corp. The MAX232 converts from RS232 voltage levels to TTL voltage levels, and vice versa. One advantage of the MAX232 chip is that it uses a +5V power supply we can power both the 8051 and MAX232, with no need for the dual power supplies that are common in many older systems. The MAX232 has two sets of line drivers for transferring and receiving data. The line drivers used for TxD are called T1 and T2, while the line drivers for RxD are designated as R1 and R2. In many applications only one of each is used. RxD and TxD pins in the 8051: The 8051 has two pins that are used specifically for transferring and receiving data serially. These two pins are called TxD and RxD and are part of the port 3 group (P3.0 and P3.1). Pin 11 of the 8051 (P3.1) is assigned to TxD and pin 10 (P3.0) is designated as RxD. These pins are TTL compatible; therefore, they require a line driver to make them RS232 compatible. One such line driver is the MAX232 chip. Baud rate in the 8051: The 8051 transfers and receives data serially at many baud rates. The baud rate in the 8051 is programmable. This is done with the help of timer 1.The relationship between the crystal frequency and the baud rate is discussed here. The 8051 divides the crystal frequency by 12 to get the machine cycle frequency. In the case of XTAL = 11.0592 MHz, the machine cycle frequency is 921.6 kHz (11.0592 MHz / 12 = 921.6 kHz). The 8051s serial communication UART circuitry divides the machine cycle frequency of 921.6 kHz by 32 once more before timer 1 to set the baud rate uses it. Therefore, 921.6 kHz divided by 32 gives 28,800 Hz. To get the baud rates compatible with the PC, we must load TH1 with the values shown in table given below. The values shown in this table are the Baud rates supported by 486/Pentium IBM PC BIOS. 2400 4800 9600 19200 Table 1: Baud rates

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

31
An adaptive hands free technique for mobile communication system

CHAPTER 5: SOFTWARE TOOLS


5.1 INTRODUCTION
OrCAD-Circuit Design:   This tool is used to design the schematic of the hardware. Using Orcad the PCB layout is designed Keil IDEs:    This tool is used to develop the source code needed for the design. The tool helps us not only to develop but also compile the code and simulate the code. The keil tool is also used to convert the compiled Embedded C code to its equivalent hex code. Flash Programmer:  y Flash programmer is used to fuse the built hex code into the Microcontroller AT89c51. Language: Embedded C.

5.2 ORCAD CAPTURE CIS


OrCAD Capture CIS is designed to reduce production delays and cost overruns through efficient management of components. It reduces the time spent searching existing parts for reuse, manually entering part information content, and maintaining component data. Users search parts based on their electrical characteristics and OrCAD Capture CIS automatically retrieves the associated part. Flexible and scalable, the solution is quickly implemented. OrCad Capture CIS is ideal for individual design teams or multi-site teams who need to collaborate across multiple locations, OrCAD Capture CIS gives designers access to correct part data early in the design process and enables complete component. Specifications to be passed to board designers and other members of the design team, reducing the potential for downstream errors. It provides access to cost information so designers can use preferred, lower cost, and in stock parts. The embedded part selector accesses information stored in MRP/ERP systems and engineering databases and synchronizes externally
NALLA MALLA REDDY ENGINEERING COLLEGE ELECTRONICS AND COMMUNICATION ENGINEERING

32
An adaptive hands free technique for mobile communication system

sourced data with the schematic design database, so bills of materials can be automatically generated. 5.2.1 BENEFITS Provides fast, intuitive schematic editing. Boosts schematic editing efficiency by design reuse Automates the integration of FPGA and PLD devices Makes changes quickly through a single spreadsheet editor Imports and exports virtually every commonly used design file format Reduces delays caused by out-of-stock parts (CIS) Promotes reuse of preferred components (CIS) Encourages reuse of known good part data (CIS) Makes reuse of duplicate circuitry easy through hierarchical blocks (CIS)

Fig11: Schematic Layout

5.3 KEIL C COMPILER:


Keil Software publishes one of the most complete development tool suites for 8051 software, which is used throughout industry. For development of C code, their Developer's Kit product includes their C51 compiler, as well as an integrated 8051 simulator for debugging. A

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

33
An adaptive hands free technique for mobile communication system

demonstration version of this product is available on their website, but it includes several limitations The C programming language was designed for computers, though, and not embedded systems. It does not support direct access to registers, nor does it allow for the reading and setting of single bits, two very important requirements for 8051 software. In addition, most software developers are accustomed to writing programs that will be executed by an operating system, which provides system calls the program may use to access the hardware. However, much code for the 8051 is written for direct use on the processor, without an operating system. To support this, the Keil compiler has added several extensions to the C language to replace what might have normally been implemented in a system call, such as the connecting of interrupt handlers. The purpose of this manual is to further explain the limitations of the Keil compiler, the modifications it has made to the C language, and how to account for these in developing software for the 8051 microcontroller. KEIL LIMITATIONS There are several very important limitations in the evaluation version of Keil's Developer's Kit that users need be aware of when writing software for the 8051. Object code must be less than 2 Kbytes The compiler will compile any-sized source code file, but the final object code may not exceed 2 Kbytes. If it does, the linker will refuse to create a final binary executable (or HEX file) from it. Along the same lines, the debugger will refuse any files that are over 2Kbytes, even if they were compiled using a different software package. Program code starts at address 0x4000 All C code compiled and linked using the Keil tools will begin at address 0x4000 in code memory. Such code may not be programmed into devices with less than 16Kbytes of Read-Only Memory. Code written in assembly may circumvent this limitation by using the "origin" keyword to set the start to address 0x0000. No such work-around exists for C programs, though.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

34
An adaptive hands free technique for mobile communication system

However, the integrated debugger in the evaluation software may still be used for testing code. Once tested, the code may be compiled by the full version of the Keil software, or by another compiler that supports the C extensions used by Keil. C MODIFICATIONS The Keil C compiler has made some modifications to another wise ANSI-compliant implementation of the C programming language. These modifications were made solely to facilitate the use of a higher-level language like C for writing programs on microcontrollers. Variable Types The Keil C compiler supports most C variable types and adds several of its own. Standard Types The evaluation version of the Keil C compiler supports the standard ANSI C variable types, with the exception of the floating-point types. These types are summarized below. Type Char Unsigned char Enum Short Bits 8 8 16 16 Bytes Range 1 1 2 2 2 2 2 4 4 -128 to +127 0 to 255 -32,768 to +32,767 -32,768 to +32,767 0 to 65,535 -32,768 to +32,767 0 to 65,535 -2,147,483,648 to +2,147,483,647 0 to 4,294,697,295

Unsigned short 16 Int Unsigned int Long Unsigned long 16 16 32 32

Table2: Embedded Specifications

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

35
An adaptive hands free technique for mobile communication system

In addition to these variable types, the compiler also supports the struct and union data structures, as well as type redefinition using typedef. Keil Types To support a microcontroller and embedded systems applications, Keil added several new types to their compiler. These are summarized in the table below. Type Bit Sbit Sfr sf16 Bits 1 1 8 16 Bytes Range 0 0 1 2 0 to 1 0 to 1 0 to 255 0 to 65,535

Table3: keil specifications Of these, only the bit type works as a standard variable would. The other three have special behavior that a programmer must be aware of. bit This is a data type that gets allocated out of the 8051's bit-addressable on-chip RAM. Like other data types, it may be declared as either a variable. However, unlike standard C types, if may not be used as a pointer. Sbit, sfr, and sf16 These are special types for accessing 1-bit, 8-bit, and 16-bit special function registers. Because there is no way to indirectly address registers in the 8051, addresses for these variables must be declared outside of functions within the code. Only the data addressed by the variable may be manipulated in the code. Conveniently, the standard special function registers are all defined in the reg51.h file that any developer may include into their source file. Only registers unique to the particular

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

36
An adaptive hands free technique for mobile communication system

8051-derivative being used for the project need have these variable declared, such as registers and bits related to a second on-chip serial port. Keil Variable Extensions In writing applications for a typical computer, the operating system handles manages memory on behalf of the programs, eliminating their need to know about the memory structure of the hardware. Even more important, most computers having a unified memory space, with the code and data sharing the same RAM. This is not true with the 8051, which has separate memory spaces for code, on-chip data, and external data. To accommodate for this when writing C code, Keil added extensions to variable declarations to specify which memory space the variable is allocated from, or points to. The most important of these for student programmers are summarized in the following table.

Extension Memory Type Data Directly-addressable data memory (data memory addresses 0x00-0x7F) Indirectly-addressable data

Related ASM MOV A, 07Fh

Idata Xdata Code

memory MOV R0, #080h MOV A, R0 MOVX @DPTR MOVC @A+DPTR

(data memory addresses 0x00-0xFF) External data memory Program memory

Table 4: Variable Extensions These extensions may be used as part of the variable type in declaration or casting by placing the extension after the type, as in the example below. If the memory type extension is not specified, the compiler will decide which memory type to use automatically, based on the memory model.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

37
An adaptive hands free technique for mobile communication system

Keil Function Extensions Keil provides two important extensions to the standard function declaration to allow for creation of interrupt handlers and reentrant functions.

Fig 12: Keil Programming

5.4 FLASH PROGRAMMER


This ISP Programmer can be used either for in-system programming or as a stand-alone SPI programmer for Atmel ISP programmable devices. The programming interface is compatible to STK200 ISP programmer hardware so the users of STK200 can also use the software which can program both the 8051 and AVR series devices.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

38
An adaptive hands free technique for mobile communication system

HARDWARE

fig13: Circuit Diagram of the In-System Programmer Interface The power to the interface is provided by the target system. The 74HCT541 IC isolates and buffers the parallel port signals. It is necessary to use the HCT type IC in order to make sure the programmer should also work with 3V type parallel port. SOFTWARE The ISP-30a.zip file contains the main program and the I/O port driver. Place all files in the same folder. The main screen view of the program is shown in figure9.4.2. Also make sure do not program the RSTDISBL fuse in ATmega8, ATtiny

26 and ATtiny2313otherwise further SPI programming is disable and you will need a parallel programmer to enable the SPI programming. For the fuses setting consult the

datasheet of the respective device. For the auto hardware detection it is necessary to short pin 2 and 12 of DB25 connector, otherwise the software uses the default parallel port i.e. LPT1.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

39
An adaptive hands free technique for mobile communication system

Fig14: Main screen of the program ISP-Pgm Ver 3.0a

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

40
An adaptive hands free technique for mobile communication system

CHAPTER 6: HARDWARE TOOLS


The following are the hardware components used: PIC 18F452 and 89s51 micro controller RF transmitter and Receiver Encoder and decoder GSM modem Power supply unit Buzzer and Stepper motor LCD display

6.1 GSM MODEM:


Definition: Global system for mobile communication (GSM) is a globally accepted standard for digital cellular communication. GSM is the name of a standardization group established in 1982 to create a common European mobile telephone standard that would formulate specifications for a pan-European mobile cellular radio system operating at 900MHz. 6.1.1 GSM NETWORK GSM provides recommendations, not requirements. The GSM specifications define the functions and interface requirements in detail but do not address the hardware. The reason for this is to limit the designers as little as possible but still to make it possible for the operators to buy equipment from different suppliers. The GSM network is divided into three major systems: the switching system (SS), the base station system (BSS), and the operation and support system (OSS). The basic GSM network elements are shown in below figure

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

41
An adaptive hands free technique for mobile communication system

Fig15: GSM Network Elements

GSM MODEM: A GSM modem is a wireless modem that works with a GSM wireless network. A wireless modem behaves like a dial-up modem. The main difference between them is that a dialup modem sends and receives data through a fixed telephone line while a wireless modem sends and receives data through radio waves. A GSM modem can be an external device or a PC Card / PCMCIA Card. Typically, an external GSM modem is connected to a computer through a serial cable or a USB cable. A GSM modem in the form of a PC Card / PCMCIA Card is designed for use with a laptop computer. It should be inserted into one of the PC Card / PCMCIA Card slots of a laptop computer. Like a GSM mobile phone, a GSM modem requires a SIM card from a wireless carrier in order to operate. As mentioned in earlier sections of this SMS tutorial, computers use AT commands to control modems. Both GSM modems and dial-up modems support a common set of standard AT commands. You can use a GSM modem just like a dial-up modem. In addition to the standard AT commands, GSM modems support an extended set of AT commands. These extended AT commands are defined in the GSM standards. With the extended AT commands, you can do things like:

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

42
An adaptive hands free technique for mobile communication system

y y y y y

Reading, writing and deleting SMS messages. Sending SMS messages. Monitoring the signal strength. Monitoring the charging status and charge level of the battery. Reading, writing and searching phone book entries. The number of SMS messages that can be processed by a GSM modem per minute is

very low -- only about six to ten SMS messages per minute. 6.1.2 FACTS OF GSM/GPRS MODEM: The GSM/GPRS Modem comes with a serial interface through which the modem can be controlled using AT command interface. An antenna and a power adapter are provided. The basic segregation of working of the modem is as under Voice calls SMS Voice calls: Voice calls are not an application area to be targeted. In future if interfaces like a microphone and speaker are provided for some applications then this can be considered.

SMS: SMS is an area where the modem can be used to provide features like: Pre-stored SMS transmission These SMS can be transmitted on certain trigger events in an automation system SMS can also be used in areas where small text information has to be sent. The navigator keeps on sending SMS at particular time intervals. SMS can be a solution where GSM data call or GPRS services are not available. 6.1.3 APPLICATIONS SUITABLE FOR GSM COMMUNICATION: If your application needs one or more of the following features, GSM will be more costeffective then other communication systems.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

43
An adaptive hands free technique for mobile communication system

Short Data Size: You data size per transaction should be small like 1-3 lines. E.g. banking transaction data, sales/purchase data, consignment tracking data, updates. These small but important transaction data can be sent through SMS messaging which cost even less than a local telephone call or sometimes free of cost worldwide. Hence with negligible cost you are able to send critical information to your head office located anywhere in the world from multiple points. You can also transfer faxes, large data through GSM but this will be as or more costly compared to landline networks. Multiple remote data collection points: If you have multiple data collections points situated all over your city, state, country or worldwide you will benefit the most. The data can be sent from multiple points like your branch offices, business associates, warehouses, and agents with devices like GSM modems connected to PCs, GSM electronic terminals and Mobile phones. Many a times some places like warehouses may be situated at remote location may not have landline or internet but you will have GSM network still available easily. High uptime: If your business require high uptime and availability GSM is best suitable for you as GSM mobile networks have high uptime compared to landline, internet and other communication mediums. Also in situations where you expect that someone may sabotage your communication systems by cutting wires or taping landlines, you can depend on GSM wireless communication.

Large transaction volumes: GSM SMS messaging can handle large number of transaction in a very short time. You can receive large number SMS messages on your server like e-mails without internet connectivity. E-mails normally get delayed a lot but SMS messages are almost instantaneous for instant transactions. Consider situation like shop owners doing credit card transaction with GSM

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

44
An adaptive hands free technique for mobile communication system

technology instead of conventional landlines. time you find local transaction servers busy as these servers use multiple telephone lines to take care of multiple transactions, whereas one GSM connection is enough to handle hundreds of transaction. Mobility, Quick installation: GSM technology allows mobility, GSM terminals, modems can be just picked and installed at other location unlike telephone lines. Also you can be mobile with GSM terminals and can also communicate with server using your mobile phone. You can just purchase the GSM hardware like modems, terminals and mobile handsets, insert SIM cards, configure software and are ready for GSM communication.

6.2 RS 232
When we look at the connector pin out of the RS232 port, we see two pins which are certainly used for flow control. These two pins are RTS, request to send and CTS, clear to send. With DTE/DCE communication (i.e. a computer communicating with a modem device) RTS is an output on the DTE and input on the DCE. CTS are the answering signal coming from the DCE. Before sending a character, the DTE asks permission by setting its RTS output. No information will be sent until the DCE grants permission by using the CTS line. If the DCE cannot handle new requests, the CTS signal will go low. A simple but useful mechanism allowing flow control in one direction. The assumption is that the DTE can always handle incoming information faster than the DCE can send it. In the past, this was true. Modem speeds of 300 baud were common and 1200 baud was seen as a high speed connection. For further control of the information flow, both devices have the ability to signal their status to the other side. For this purpose, the DTR data terminal ready and DSR data set ready signals are present. The DTE uses the DTR signal to signal that it is ready to accept information, whereas the DCE uses the DSR signal for the same purpose.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

45
An adaptive hands free technique for mobile communication system

The last flow control signal present in DTE/DCE communication is the CD carrier detect. It is not used directly for flow control, but mainly an indication of the ability of the modem device to communicate with its counterpart. This signal indicates the existence of a communication link between two modem devices. 6.2.1 MAX 232 MAX-232 is primary used for people building electronics with an RS-232 interface. Serial RS-232 communication works with voltages (-15V ... -3V for high) and +3V ... +15V for low) which are not compatible with normal computer logic voltages. In the other direction (sending data from some logic over RS-232) the low logic voltage has to be "bumped up", and a negative voltage has to be generated.

Fig16: Pin Diagram of Max 232

6.3 RF MODULES
Radio Frequency-any frequency within the electromagnetic spectrum associated with radio wave propagation. When an RF current is supplied to an antenna, an electromagnetic field is created that then is able to propagate through space. Many wireless technologies are based on RF field propagation.

Receiver Module Fig17: RF module

Transmitter Module

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

46
An adaptive hands free technique for mobile communication system

Radio Frequency: The 10 kHz to 300 GHz frequency range that can be used for wireless communication. Generally refers to the radio signal generated by the system transmitter, or to energy present from other sources that may be picked up by a wireless receiver. Applications:
y y y y y y y y y

Wireless mouse, keyboard Wireless data communication Alarm and security systems Home Automation, Remote control Automotive Telemetry Intelligent sports equipment Industrial telemetry and Tele-communications In-building environmental monitoring and control High-end security and fire alarms

6.3.1 TRANSMITTER The TWS-434 extremely small, and are excellent for applications requiring short-range RF remote controls. The transmitter module is only 1/3 the size of a standard postage stamp, and can easily be placed inside a small plastic enclosure. TWS-434: The transmitter output is up to 8mW at 433.92MHz with a range of approximately 400 foot (open area) outdoors. Indoors, the range is approximately 200 foot, and will go through most walls.

Fig18: Transmitter

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

47
An adaptive hands free technique for mobile communication system

The TWS-434 transmitter accepts both linear and digital inputs can operate from 1.5 to 12 Volts-DC, and makes building a miniature hand-held RF transmitter very easy. The TWS=434 is approximately 1/3 the size of a standard postage stamp. PIN DIAGRAM

Fig19: Tws-434 Pin Diagram 6.3.2 RECEIVER

Fig20: Receiver RWS-434: The receiver also operates at 433.92MHz, and has a sensitivity of 3uV. The WS-434 receiver operates from 4.5 to 5.5 volts-DC, and has both linear and digital outputs. PIN DIAGRAM

Fig21: Pin out Diagram

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

48
An adaptive hands free technique for mobile communication system

Application circuit for transmitter and receiver

Fig22: Application circuit

Generating Data The TWS-434 modules do not incorporate internal encoding. If you want to send simple control or status signals such as button presses or switch closures, consider using an encoder and decoder IC set that takes care of all encoding, error checking, and decoding functions. Motorola and Holtek make these chips. They are an excellent way to implement basic wireless transmission control.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

49
An adaptive hands free technique for mobile communication system

Receiver Data Output A 0V to Vcc data output is available on pins. This output is normally used to drive a digital decoder IC or a microprocessor which is performing the data decoding. The receivers output will only transition when valid data is present. In instances, when no carrier is present the output will remain low. Decoding Data The RWS-434 modules do not incorporate internal decoding. If you want to receive Simple control or status signals such as button presses or switch closes, you can use the encoder and decoder IC set described above. Decoders with momentary and latched outputs are available. Transmitting and Receiving Full duplex or simultaneous two-way operation is not possible with these modules. If transmit and receive module are in close proximity and data is sent to a remote receive module while attempting to simultaneously receive data from a remote transmit module, the receiver will be overloaded by its close proximity transmitter. This will happen even if encoders and decoders are used with different address settings for each transmitter and receiver pair. If two way communications is required, only half duplex operation is allowed. Antennas- Wire Whip The WC418 is made of 26-gauge carbon steel music wire that can be soldered to a PC board. This antenna has a plastic coated tip for safety and is 6.8 inches long, allowing .1 inch for insertion in a terminal or PC board.

Fig 23: Antenna

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

50
An adaptive hands free technique for mobile communication system

Antenna The following should help in achieving optimum antenna performance: y Proximity to objects such a users hand or body, or metal objects will cause an antenna to detune. For this reason the antenna shaft and tip should be positioned as far away from such objects as possible. y Optimum performance will be obtained from a one-forth or half wave straight whip mounted at a right angle to the ground plane. A one-forth wave antenna for 418 MHz is 6.7 inches long.

6.4 ENCODER AND DECODER


6.4.1 ENCODER (HT-12E) The Encoder, which we are using in our project, is HT12E series, which is a Holtek, made Encoder. The 212 encoders are a series of CMOS LSIs for remote control system applications. They are capable of encoding information, which consists of N address bits and 12_N data bits. Each address/ data input can be set to one of the two logic states. The programmed addresses/data are transmitted together with the header bits via an RF or an infrared transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E enhances the application flexibility o f the 212 series of encoders. 6.4.2 FEATURES y y y y Operating voltage 2.4V~12V for the HT12E Low power and high noise immunity CMOS technology Built-in oscillator needs only 5% resistor HT12E: 18-pin DIP/20-pin SOP package

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

51
An adaptive hands free technique for mobile communication system

6.4.3 PIN DIAGRAM

Fig24: Encoder Pin Diagram PIN DESCRIPTION

Table 5: Pin Description of Encoder 6.4.4 DECODER (HT-12D) The Decoder, which we are using in our project, is HT12D series, which is a Holtek, made Decoder. The 2 12 decoders are a series of CMOS LSIs for remote control system applications. For proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. They compare the serial input data three times continuously with their

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

52
An adaptive hands free technique for mobile communication system

local addresses. If no error or unmatched codes are found, the input data codes are decoded and then transferred to the output pins. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits. 6.4.5 FEATURES y y y y y y Operating voltage: 2.4V~12V Low power and high noise immunity CMOS technology Low standby current Capable of decoding 12 bits of information Received codes are checked 3 times Built-in oscillator needs only 5% resistor

6.4.6 PIN DIAGRAM

Fig25: Decoder pin diagram PIN DESCRIPTION

Table6: Pin Description of Decoder

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

53
An adaptive hands free technique for mobile communication system

6.5 LCD DISPLAY (2X16 Character)


Dot matrix LCD modules is used for display the parameters and fault condition.16 characters 2 lines display is used. It has controller which interface datas and LCD panel. Liquid crystal displays (LCDs) have materials, which combine the properties of both liquids and crystals. Rather than having a melting point, they have a temperature range within which the molecules are almost as mobile as they would be in a liquid, but are grouped together in an ordered form similar to a crystal. An LCD consists of two glass panels, with the liquid crystal material sandwiched in between them. The inner surface of the glass plates are coated with transparent electrodes which define the character, symbols or patterns to be displayed polymeric layers are present in between the electrodes and the liquid crystal molecules to maintain a defined orientation angle. One each polarizers are pasted outside the two glass panels. These polarizers would rotate the light rays passing through them to a definite angle, in a particular direction When the LCD is in the off state, light rays are rotated by the two polarizes and the liquid crystal, such that the light rays come out of the LCD without any orientation, and hence the LCD appears transparent. When sufficient voltage is applied to the electrodes, the liquid crystal molecules would be aligned on a specific direction. The light rays passing through the LCD would be rotated by the polarizes, which would result in activating/highlighting the desired characters.

Fig 26: LCD Display

The LCD's are lightweight with only a few millimeters thickness. since the LCD's consume less power, they are compatible with low power electronic circuits, and can be

powered for long durations .The LCD's don't generate light is needed to read the display. By

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

54
An adaptive hands free technique for mobile communication system

using backlighting, reading is possible in the dark .The LCD's have long life and a wide operating temperature range. One of the most popular output devices for embedded electronics is LCD. The LCD interface has become very simple. This is due to the availability modules for LCDs. The LCD along with necessary controller (LCD Controller) and mounting facility is made available in the module itself. The LCD controller takes care of everything necessary for the LCD. We communicate with the LCD controller with the help of a command set provided by the manufacturer.

6.6 BUZZER
Basically, the sound source of a piezoelectric sound component is a piezoelectric diaphragm. A piezoelectric diaphragm consists of a piezoelectric ceramic plate which has electrodes on both sides and a metal plate (brass or stainless steel, etc.). A piezoelectric ceramic plate is attached to a metal plate with adhesives. Applying D.C. voltage between electrodes of a piezoelectric diaphragm causes mechanical distortion due to the piezoelectric effect. For a misshaped piezoelectric element, the distortion of the piezoelectric element expands in a radial direction. And the piezoelectric diaphragm bends toward the direction. The metal plate bonded to the piezoelectric element does not expand. Conversely, when the piezoelectric element shrinks, the piezoelectric diaphragm bends in the direction Thus, when AC voltage is applied across electrodes, the bending is repeated, producing sound waves in the air.

Fig 27: Buzzer

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

55
An adaptive hands free technique for mobile communication system

6.7 RELAY
A relay is an electrically operated switch. Current flowing through the coil of the relay creates a magnetic field which attracts a lever and changes the switch contacts. The coil current can be on or off so relays have two switch positions and they are double throw (changeover) switches. Relays allow one circuit to switch a second circuit which can be completely separate from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit. There is no electrical connection inside the relay between the two circuits, the link is magnetic and mechanical. Relays are very simple devices. There are four major parts in every relay. They are y y y y Electromagnet Armature that can be attracted by the electromagnet Spring Set of electrical contacts

WORKING When a current flows through the coil, the resulting magnetic field attracts an armature that is mechanically linked to a moving contact. The movement either makes or breaks a connection with a fixed contact. When the current to the coil is switched off, the armature is returned by a force approximately half as strong as the magnetic force to its relaxed position. Usually this is a spring, but gravity is also used commonly in industrial motor starters. Most relays are manufactured to operate quickly. In a low voltage application, this is to reduce noise. In a high voltage or high current application, this is to reduce arcing.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

56
An adaptive hands free technique for mobile communication system

CHOOSING A RELAY: One needs to consider several features when choosing a relay: 1. Physical size and pin arrangement: If you are choosing a relay for an existing PCB you will need to ensure that its dimensions and pin arrangement are suitable. You should find this information in the supplier's catalogue. 2. Coil voltage: The relay's coil voltage rating and resistance must suit the circuit powering the relay coil. Many relays have a coil rated for a 12V supply but 5V and 24V relays are also readily available. Some relays operate perfectly well with a supply voltage which is a little lower than their rated value. 3. Coil resistance: The circuit must be able to supply the current required by the relay coil. You can use Ohm's law to calculate the current: Relay coil current = supply voltage / coil resistance passes a current of

For example: A 12V supply relay with a coil resistance of 400 30mA. Most ICs will require a transistor to amplify the current.

4. Switch ratings (voltage and current): The relay's switch contacts must be suitable for the circuit they are to control. You will need to check the voltage and current ratings. Note that the voltage rating is usually higher for AC, for example: "5A at 24V DC or 125V AC". 5. Switch contact arrangement (SPDT, DPDT etc.): Most relays are SPDT or DPDT which are often described as "single pole changeover" (SPCO) or "double pole changeover" (DPCO).

Fig 28: Relay

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

57
An adaptive hands free technique for mobile communication system

6.8 STEPPER MOTOR Stepper motors operate differently from DC brush motors, which rotate when voltage is applied to their terminals. Stepper motors, on the other hand, effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. The electromagnets are energized by an external control circuit, such as a microcontroller. To make the motor shaft turn, first one electromagnet is given power, which makes the gear's teeth magnetically attracted to the electromagnet's teeth. When the gear's teeth are thus aligned to the first electromagnet, they are slightly offset from the next electromagnet. So, when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the next one, and from there the process is repeated. Each of those slight rotations is called a "step", with an integer number of steps making a full rotation. In that way, the motor can be turned by a precise angle. Stepper motor characteristics 1. Stepper motors are constant power devices. 2. As motor speed increases, torque decreases. 3. Steppers exhibit more vibration than other motor types, as the discrete step tends to snap the rotor from one position to another. The vibration makes stepper motors noisier than DC motors. 4. The effect can be mitigated by accelerating quickly through the problem speeds range, physically damping the system, or using a micro-stepping driver. 5. Motors with a greater number of phases also exhibit smoother operation than those with fewer phases

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

58
An adaptive hands free technique for mobile communication system

Fig 29: Stepper Motor

CONCLUSION AND FUTURE SCOPE


CONCLUSION Using Mobile phone while driving is common, but controversial. Certainly there has been large number of figures that shows that people have used their mobile phones just before their accidents. Studies have shown that if people reduce their usage of cell phone while driving, it can reduce the accident rates too. FUTURE SCOPE This technology will overcome most of the road accidents occurring as people are using mobile phone while driving. This technology should be implemented in the cars by the manufacturers as it has very effective use of preventing road accidents by reducing the speed of the car whenever the call is answered. There may be further more development can be seen in this technology in the coming years as the world has the technology evolving tendency. Further development will solve almost all the reasons for car accidents using mobile phone.

Fig 30: Sample Model

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

59
An adaptive hands free technique for mobile communication system

REFERENCES
Vince Stanford, Pervasive computing goes the last hundred feet with RFID systems, IEEE pervasive computing www.keil.com www.wavecom.com www.microcontroller.com www.rentron.com www.flashprogrammer.com www.alldatasheets.com Text books:

1. Raj kamal Microcontrollers Architecture, Programming, Interfacing and System Design 2nd edition, PHI publications 2. Mazidi and Mazidi Embedded Systems,3rd edition 3. PCB Design Tutorial David.L.Jones 4. PIC Microcontroller Manual Microchip. 5. Embedded C Michael.J.Pont.

NALLA MALLA REDDY ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING

Vous aimerez peut-être aussi