GSM Based Vehicle Fuel Monitoring System: A Major Project Report On
GSM Based Vehicle Fuel Monitoring System: A Major Project Report On
GSM Based Vehicle Fuel Monitoring System: A Major Project Report On
CERTIFICATE
ACKNOWLEDGEMENT
DECLARATION
CHAPTER 1: INTRODUCTION
01
CHAPTER 2: THE MICROCONTROLLER
03
2.1 Introduction
03
2.2 AT89C51 microcontroller
03
2.3Pin configuration
04
2.3.1Pin description
06
2.4 Operating description
08
2.4.1 Memory map and registers
09
2.4.2 Timer/counters
12
2.5 Interrupt system
15
2.5.1 Baud rate
16
2.5.2 Number of interrupts in 89c51
16
2.5.3 Steps in enabling an interrupt
17
2.5.4 Description of each bit in IE register
17
2.5.5 Interrupt priority in 89c51
18
2.5.6 Description of each bit in IP registers
18
19
3.1 introduction
19
3.2 microprocessor
20
3.3 digital signal processing
21
3.4 ASIC
21
3.5 CISC
22
3.6 Memory architecture
24
28
28
4.2 circuit diagram
28
4.3 Transformer
29
4.3.1 Transformer
working
29
4.3.2 classification
of transformers
31
4.3.2.1 step down transformer
31
4.3.2.1 step up transformer
32
4.3.2.3 turns ratio and voltage
33
4.4 rectifier
33
4.5 half wave rectifier
34
4.6 full wave rectifier
35
4.7 capacitor filter
37
4.8 voltage regulator
37
4.9 LCD
38
CHAPTER 5 GSM
44
DEPT. OF ECE, BRIL
Page 6
GSM BASED VEHICLE FUEL MONITORING SYSTEM
46
5.1.2 2G
46
5.1.3 3G
47
5.2 introduction
to GSM standards
49
5.3 concept of cellular networks
50
5.4 Architecture
of GSM networks
51
5.5 Introduction
to modem
53
5.6 GSM modem
54
5.7 Introduction
to AT commands
56
5.8 basic concepts of SMS technology
58
5.8.1 Validity period of SMS
58
5.8.2 Message status reports
58
5.8.3 message submission reports
59
5.8.4 message delivery reports
59
5.9 MAX 232
60
5.9.1 features
60
5.9.2 applications
60
5.9.3 description
60
5.9.4 pin diagram of MAX 232
61
63
69
Page 7
GSM BASED VEHICLE FUEL MONITORING SYSTEM
CHAPTER 7 CONCLUSION
74
2.1
AT89C51 microcontroller
04
2.2
AT89C51 block diagram
05
2.3 Memory map
10
2.4
Timer block diagram
12
3.1 block diagram of embedded systems
19
3.2
Three basic elements of a microprocessor
20
3.3 block diagram of microcontroller
21
3.4
Harvard architecture
25
3.5 schematic of von Newman architecture
26
4.1 block diagram of power supply
28
4.2 circuit diagram of power supply
28
4.3 transformer symbol
29
4.4
Transformer
29
4.5
Basic transformer
30
4.6 step down transformer
31
4.7 step up transformer
33
4.8 diode symbol
34
4.9 half wave rectifier
34
43
5.1 TDMA
49
5.2 cellular networks
51
5.3 architecture of networks
52
5.4 modem
53
5.5 GSM modem
55
5.6connection between pc and GSM module
56
5.7 pin diagram of MAX 232
61
5.8 function table
61
5.9 logic
diagram
62
6.1 Block diagram-9 connector
64
6.2 interfacing to MCURS 232
66
6.3 female connector
67
6.4 male connector
67
6.5 front view
68
6.6 MAX 232 pin diagram
71
6.7 internal diagram
71
6.8 water level indicator
73
LIST OF TABLES:
PAGE
NO.
2.1 modes
07
2.2
Memory locations
16
4.1
LCD module specifications
41
4.2 LCD command codes
42
4.3
Hardware connections
43
5.1 mobile telephony standards
46
6.1pin definitions of connectors
71
DEPT. OF ECE, BRIL Page 10
GSM BASED VEHICLE FUEL MONITORING SYSTEM
CHAPTER-1
INTRODUCTION
This project is used to monitor the fuel level in a vehicle. This fuel level monitoring plays
a very important role as if the fuel is completed when we went for a drive. If we get an
SMS when the fuel is about to complete then we don’t have tensions regarding fuel. This
can be implemented using GSM technology.
GSM stands for Global System for Mobile communication) is a digital mobile telephony
system that is widely used in Europe and other parts of the world. GSM uses a variation
of time division multiple access (TDMA) and is the most widely used of the three digital
wireless telephony technologies (TDMA, GSM, and CDMA).
In this project a GSM modem provides the communication interface. It transports device
protocols transparently over the network through a serial interface. A GSM modem is a
wireless modem that works with a GSM wireless network.
This GSM emodem can accept any GSM network operator SIM card and act just like a
mobile phon with its own unique number. Advantage of using this modem will be that
you can use its RS232 port to communicate and develop embedded applications.
Applications like SMS control, data transfer, remote control and logging can be
developed easily. The modem can either be connected to PC serial port directly or to any
microcontroller.
fuel tank
are
interfaced to
the microcontroller which are continuously monitored,
whenever
one
of the sensors
activates, immediately the information is sent to the
concerned mobile number in the code. Using this project we can continuously track the
status of the fuel level in the vehicle. The status of the sensors will be displayed on the
LCD.
TECHNICAL SPECIFICATIONS:
HARDWARE:
Microcontroller: AT89S52.
Crystal: 11.0592MHZ.
LCD: HD44780.
GSM modem
Power supply
Filter: 1000uf/25V
SOFTWARE:
UC flash
APPLICATIONS:
Car safety.
Vehicle monitoring.
Transport agencies
CHAPTER-2
THE MICROCONTROLLER
2.1 INTRODUCTION
A microcontroller is a general purpose device, but that is meant to read data, perform
limited calculations on that data and control its environment based on those calculations.
The prime use of a microcontroller is to control the operation of a machine using a fixed
program that is stored in ROM and that does not change over the lifetime of the system.
The microcontroller design uses a much more limited set of single and double byte
instructions that are used to move data and code from internal memory to the ALU. The
microcontroller is concerned with getting data from and to its own pins; the architecture
and instruction set are optimized to handle data in bit and byte size.
Atmel’s AT89c51 is a powerful microcomputer, which provides a high flexible and cost-
effective solution to many embedded control applications
FEATURES:
80C51 based architecture
128 x 8 RAM
VCC:
Supply voltage
GND:
Ground
Port 0:
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
access to external program and data memory. In this mode, P 0 has internal pull-ups. Port
0 also receives the code bytes during Flash programming and outputs the code bytes
during program verification. External pull-ups are required during program verification.
Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The port 1output buffers
can sink/source four TTL inputs. When 1s are written to port 1 pins, they are pulled high
by the internal pull-ups can be used as inputs. As inputs, Port 1 pins that are externally
being pulled low will source current (1) because of the internal pull-ups.
Port 2:
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 can be used as inputs. As inputs, Port 2 pins that are externally
being pulled low will source current because of the internal pull-ups.
Port 3:
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 can be used as inputs. As inputs, Port 3 pins that are externally
being pulled low will source current because of the internal pull-ups.
Port 3 also receives some control signals for Flash Programming and verification.
Port pin
Alternate Functions
P3.0
RXD(serial
input
port)
P3.1
TXD(serial
input
port)
P3.2
INT0(external
interrupt
0)
P3.3
INT1(external
interrupt
1)
P3.4
T0(timer
0 external input)
P3.5
T1(timer
1 external input)
P3.6
WR(external data memory write strobe)
P3.7
RD(external data memory read strobe)
RST:
Rest input A 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 access to external memory. This pin is also the program pulse input (PROG)
during Flash programming.
In normal operation ALE is emitted at a constant rate of 1/16 the oscillator frequency and
may be used for external timing or clocking purpose. Note, however, that one ALE pulse
is skipped during each access to external Data memory.
PSEN:
Program Store Enable is the read strobe to external program memory when the AT89c51
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:
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. Note,
however, that if lock bit 1 is programmed EA will be internally latched on reset. EA
should be strapped to Vcc for internal program executions. This pin also receives the 12-
volt programming enable voltage (Vpp) during Flash programming when 12-volt
programming is selected.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL 2:
Timer/Counters
Interrupt System
The AT89C51 has separate address spaces for program and data memory. The program
and data memory can be up to 64K bytes long. The lower 4K program memory can reside
on-chip. The AT89C51 has 128 bytes of on-chip RAM.
The lower 128 bytes can be accessed either by direct addressing or by indirect addressing.
The lower 128 bytes of RAM can be divided into 3 segments as listed below
Register Banks 0-3: locations 00H through 1FH (32 bytes). The device after reset
defaults to register bank 0. To use the other register banks, the user must select them in
software. Each register bank contains eight 1-byte registers R0-R7. Reset initializes the
stack point to location 07H, and is incremented once to start from 08H, which is the first
register of the second register bank.
Bit Addressable Area: 16 bytes have been assigned for this segment 20H-2FH. Each one
of the 128 bits of this segment can be directly addressed (0-7FH). Each of the 16 bytes in
this segment can also be addressed as a byte.
Scratch Pad Area: 30H-7FH are available to the user as data RAM. However, if the data
pointer has been initialized to this area, enough bytes should be left aside to prevent SP
data destruction.
DEPT. OF ECE, BRIL Page 19
GSM BASED VEHICLE FUEL MONITORING SYSTEM
FIG 2.3: MEMORY MAP
The Special Function Registers (SFR's) are located in upper 128 Bytes direct addressing
area. The SFR Memory Map in shows that. Not all of the addresses are occupied.
Unoccupied addresses are not implemented on the chip. Read accesses to these addresses
in general return random data, and write accesses have no effect. User software should
not write 1s to these unimplemented locations, since they may be used in future
microcontrollers to invoke new features. In that case, the reset or inactive values of the
new bits will always be 0, and their active values will be 1.
ACCUMULATOR (ACC):
The Stack Pointer Register is eight bits wide. It is incremented before data is stored
during PUSH and CALL executions. While the stack may reside anywhere in on chip
RAM, the Stack Pointer is initialized to 07H after a reset. This causes the stack to begin at
location 08H.
The Data Pointer consists of a high byte (DPH) and a low byte (DPL). Its function is to
hold a 16-bit address. It may be manipulated as a 16-bit register or as two independent 8-
bit registers.
The Serial Data Buffer is actually two separate registers, a transmit buffer and a receive
buffer register. When data is moved to SBUF, it goes to the transmit buffer, where it is
held for serial transmission. (Moving a byte to SBUF initiates the transmission.) When
data is moved from SBUF, it comes from the receive buffer.
TIMER REGISTERS:
Register pairs (TH0, TL0) and (TH1, TL1) are the 16-bit Counter registers for
Timer/Counters 0 and 1, respectively.
CONTROL REGISTERS:
Special Function Registers IP, IE, TMOD, TCON, SCON, and PCON contain control and
status bits for the interrupt system, the Timer/Counters, and the serial port.
2.4.2 TIMER/COUNTERS:
The IS89C51 has two 16-bit Timer/Counter registers: Timer 0 and Timer 1. All two can
be configured to operate either as Timers or event counters. As a Timer, the register is
incremented every machine cycle. Thus, the register counts machine cycles. Since a
machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator
frequency.
TIMERS:
OSCILLATOR
¸12D
FREQUENCY
TR
TLX THX
TFX
TCON Register
TMOD Register:
The timer mode SFR is used to configure the mode of operation of each of the two timers.
Using this SFR your program may configure each timer to be a 16-bit timer, or 13 bit
timer, 8-bit auto reload timer, or two separate timers. Additionally
you may configure the timers to only count when an external pin is activated or to
count “events”
that are indicated
on an external pin.
· It can
consider
as two duplicate
4-bit registers, each of which controls the action
of one
of the timers.
TCON Register:
The timer control SFR is used to configure and modify the way in which the
8051’s two timers operate. This SFR controls whether each of the two timers is
running or stopped and contains a flag to indicate that each timer has overflowed.
Additionally, some non-timer related bits are located in TCON SFR.
These bits are used to configure the way in which the external interrupt flags are
activated, which are set when an external interrupt occurs.
TIMER 0 (T0):
These two SFR’s taken together represent timer 0. Their exact behavior depends on how
the timer is configured in the TMOD SFR; however, these timers always count up. What
is configurable is how and when they increment in value.
TH0 TL0
These two SFR’s, taken together, represent timer 1. Their exact behavior depends on how
the timer is configured in the TMOD SFR; however, these timers always count up. What
is Configurable is how and when they increment in value.
TH1
TL1
The Timer or Counter function is selected by control bits C/T in the Special Function
Register TMOD. These two Timer/Counters have four operating modes, which are
selected by bit pairs (M1, M0) in TMOD. Modes 0, 1, and 2 are the same for both
Timer/Counters, but Mode 3 is different.
MODE 0:
Both Timers in Mode 0 are 8-bit Counters with a divide-by-32 pre scalar. Figure 8 shows
the Mode 0 operation as it applies to Timer 1. In this mode, the Timer register is
configured as a 13-bit register. As the count rolls over from all 1s to all 0s, it sets the
Timer interrupt flag TF1. The counted input is enabled to the Timer when TR1 = 1 and
either GATE = 0 or INT1 = 1. Setting GATE = 1 allows the Timer to be controlled by
external input INT1, to facilitate pulse width measurements. TR1 is a control bit in the
Special Function Register TCON. Gate is in TMOD.
MODE 1:
Mode 1 is the same as Mode 0, except that the Timer register is run with all 16 bits. The
clock is applied to the combined high and low timer registers (TL1/TH1). As clock pulses
are received, the timer counts up: 0000H, 0001H, 0002H, etc. An overflow occurs on the
FFFFH-to-0000H overflow flag. The timer continues to count. The overflow flag is the
TF1 bit in TCON that is read or written by software
MODE 2:
Mode 2 configures the Timer register as an 8-bit Counter (TL1) with automatic reload, as
shown in Figure 10. Overflow from TL1 not only sets TF1, but also reloads TL1 with the
contents of TH1, which is preset by software. The reload leaves the TH1 unchanged.
Mode 2 operation is the same for Timer/Counter 0.
MODE 3:
Timer 1 in Mode 3 simply holds its count. The effect is the same as setting TR1 = 0.
Timer 0 in Mode 3 establishes TL0and TH0 as two separate counters. The logic for Mode
3 on Timer 0 is shown in Figure 11. TL0 uses the Timer 0 control bits: C/T, GATE, TR0,
INT0, and TF0. TH0 is locked into a timer function (counting machine cycles) and over
the use of TR1 and TF1 from Timer 1. Thus, TH0 now controls the Timer 1 interrupt.
Mode 3 is for applications requiring an extra 8-bit timer or counter. With Timer 0 in Mode
3, the AT89C51 can appear to have three Timer/Counters. When Timer 0 is in Mode 3,
Timer 1 can be turned on and off by switching it out of and into its own Mode 3. In this
case, Timer 1 can still be used by the serial port as a baud rate generator or in any
application not requiring an interrupt.
SMOD bit in Special Function Register PCON. If SMOD = 0 the baud rate is 1/64 of the
oscillator frequency. If SMOD = 1, the baud rate is 1/32 of the oscillator frequency.
In the IS89C51, the Timer 1 overflow rate determines the baud rates in Modes 1 and 3.
There are basically five interrupts available to the user. Reset is also considered as an
interrupt. There are two interrupts for timer, two interrupts for external hardware interrupt
and one interrupt for serial communication.
Memory location
Interrupt name
0000H
Reset
0003H
External interrupt
0
000BH
Timer interrupt 0
0013H
External interrupt
1
001BH
Timer interrupt
0023H
Serial COM interrupt
Lower the vector, higher the priority. The External Interrupts INT0 and INT1 can each be
either level-activated or transition-activated, depending on bits IT0 and IT1 in Register
TCON. The flags that actually generate these interrupts are the IE0 and IE1 bits in
TCON. When the service routine is vectored, hardware clears the flag that generated an
external interrupt only if the interrupt was transition-activated. If the interrupt was level-
activated, then the external requesting source (rather than the on-chip hardware) controls
the request flag.
Bit D7 of the IE register must be set to high to allow the rest of register to take effect. If
EA=1, interrupts are enabled and will be responded to if their corresponding bits in IE are
high. If EA=0, no interrupt will be responded to even if the associated bit in the IE
register is high.
D6 bit: Reserved.
D7 bit: Reserved.
D6 bit: Reserved.
3.1 Introduction:
The very simplest embedded systems are capable of performing only a single function or
set of functions to meet a single predetermined purpose. In more complex systems an
application program that enables the embedded system to be used for a particular purpose
in a specific application determines the functioning of the embedded system. The ability
to have programs means that the same embedded system can be used for a variety of
different purposes. In some cases a microprocessor may be designed in such a way that
application software for a particular purpose can be added to the basic software in a
second process, after which it is not possible to make further changes. The applications
software on such processors is sometimes referred to as firmware.
The simplest devices consist of a single microprocessor (often called a "chip”), which
may itself be packaged with other chips in a hybrid system or Application Specific
Integrated Circuit (ASIC). Its input comes from a detector or sensor and its output goes to
a switch or activator which (for example) may start or stop the operation of a machine or,
by operating a valve, may control the flow of fuel to an engine.
Embedded
System
Software
Hardware
o
ALP
o
Processor
o
C
o
Peripherals
o
VB
o
memory
Etc.,
FIGURE 3.1: BLOCK DIAGRAM OF EMBEDDED S YS TEM
Software deals with the languages like ALP, C, and VB etc., and Hardware deals with
Processors, Peripherals, and Memory.
Construction industry
Transport
Buildings and premises
Domestic service
Communications
A silicon chip that contains a CPU. In the world of personal computers, the terms
microprocessor and CPU are used interchangeably. At the heart of all personal computers
and most workstations sits a microprocessor. Microprocessors also control the logic of
almost all digital devices, from clock radios to fuel-injection systems for automobiles.X
Ø
Instruction set: The set of instructions that the microprocessor can execute. X
Ø
Bandwidth : The number of bits processed in a single instruction.X
Ø
Clock speed : Given in megahertz (MHz), the clock speed determines how manyX
In both cases, the higher the value, the more powerful the CPU. For example, a 32- bit
microprocessor that runs at 50MHz is more powerful than a 16-bit microprocessor that
runs at 25MHz. In addition to bandwidth and clock speed, microprocessors are classified
as being either RISC (reduced instruction set computer) or CISC (complex instruction
set computer).X
A microprocessor has three basic elements, as shown above. The ALU performs all
arithmetic computations, such as addition, subtraction and logic operations (AND, OR,
etc). It is controlled by the Control Unit and receives its data from the Register Array.
The Register Array is a set of registers used for storing data. These registers can be
accessed by the ALU very quickly.
FIG 3.2: THREE BAS IC ELEMENTS OF A MICROPROCES S OR
ALU
CU
Memory
Timer, Counter, serial communication ROM,
Digital Signal Processors is one which performs scientific and mathematical operation.
Digital Signal Processor chips - specialized microprocessors with architectures designed
specifically for the types of operations required in digital signal processing. Like a
general-purpose microprocessor, a DSP is a programmable device, with its own native
instruction code. DSP chips are capable of carrying out millions of floating point
operations per second, and like their better-known general-purpose cousins, faster and
more powerful versions are continually being introduced. DSPs can also be embedded
within complex "system-on-chip" devices, often containing both analog and digital
circuitry.
ASIC is a combination of digital and analog circuits packed into an IC to achieve the
desired control/computation function
Ø
Peripherals to control timing critical functions
Analog circuits to provide clocks and interface to the real world which is analog in nature
Ø
I/Os to connect to external components like LEDs, memories, monitors etc.
There are two different types of computer instruction set there are:
higher speed (perform more million instructions per second, or millions of instructions
per second). Since each instruction type that a computer must perform requires additional
transistors and circuitry, a larger list or set of computer instructions tends to make the
microprocessor more complicated and slower in operation.
A new microprocessor can be developed and tested more quickly if one of its aims is to
be less complicated.
instructions will find it easier to develop code with a smaller instruction set.
Ø
The simplicity of RISC allows more freedom to choose how to use the space on a
microprocessor.
Higher-level language compilers produce more efficient code than formerly because they
have always tended to use the smaller set of instructions to be found in a RISC computer.
In a RISC machine, the instruction set contains simple, basic instructions, from which
more complex instructions can be composed.
Each instruction is the same length, so that it may be fetched in a single operation.
1machine-cycleinstructions:
Most instructions complete in one machine cycle, which allows the processor to handle
several instructions at the same time. This pipelining is a key technique used to speed up
RISC machines.
CISC, which stands for Complex Instruction Set Computer, is a philosophy for
designing chips that are easy to program and which make efficient use of memory. Each
instruction in a CISC instruction set might perform a series of operations inside the
program, and allows the programmer to learn a small but flexible set of instructions.
The ease of micro-coding new instructions allowed designers to make CISC machines
upwardly compatible: a new computer could run the same programs as earlier
computers because the new computer would contain a superset of the instructions of the
earlier computers.
implement a given task. This made more efficient use of the relatively slow main
memory.
Ø
Because micro program instruction sets can be written to match the constructs of
Still, designers soon realized that the CISC philosophy had its own problems, including:
So that as many instructions as possible could be stored in memory with the least possible
wasted space, individual instructions could be of almost any length---this means
that
different
instructions will take different amounts of clock time to execute, slowing
down the overall performance
of the machine.
Ø
Many
specialized instructions aren't used frequently enough to justify their
existence ---
approximately
20%
of
the
available
instructions
are
used
in a
typical
program.
Ø
CISC
instructions typically
set
the
condition
codes as
a
side
effect
of the
instruction. Not only does setting the condition codes take time, but programmers have to
remember to examine the condition code bits before a subsequent instruction changes
them.
Von-Neumann Architecture
Harvard Architecture:
Computers have separate memory areas for program instructions and data. There are two
or more internal data buses, which allow simultaneous access to both instructions and
data. The CPU fetches program instructions on the program memory bus.
The principal advantage of the pure Harvard architecture - simultaneous access to more
than one memory system - has been reduced by modified Harvard processors using
modern CPU cache systems. Relatively pure Harvard architecture machines are used
mostly in applications where tradeoffs, such as the cost and power savings from omitting
caches, outweigh the programming penalties from having distinct code and data address
spaces.X
Ø
http://en.wikipedia.org/wiki/Digital_signal_processors Digital signal processors (DSPs)
generally execute small, highly-optimized audio or video processing algorithms. They
avoid caches because their behavior must be extremely reproducible. The difficulties of
coping with multiple address spaces are of secondary concern to speed of execution. As a
result, some DSPs have multiple data memories in distinct address spaces to facilitate
SIMD and VLIW processing. TexasX
Ø
Microcontrollers are characterized by having smallX
amounts of program
(flashX
memory) and data (SRAM) memory, with no cache, and take advantage of the Harvard
architecture to speed processing by concurrent instruction and data access. The separate
storage means the program and data memories can have different bit depths, for example
using 16-bit wide instructions and 8-bit wide data. They also mean that instruction pre-
fetch can be performed in parallel with other activities. Examples include, the AVR by
Atmel Corp, the PIC by Microchip Technology, Inc. and the ARM Cortex-M3 processor
(not all ARM chips have Harvard architecture).X
Even in these cases, it is common to have special instructions to access program memory
as data for read-only tables, or for reprogramming.
Von-Neumann Architecture:
A computer has a single, common memory space in which both program instructions and
data are stored. There is a single internal data bus that fetches both
The von Neumann architecture is a design model for a stored-program digital computer
that uses a central processing unit (CPU) and a single separate storage structure ("memory")
to hold both instructions and data. It is named after the mathematician and early computer
scientist John von Neumann. Such computers implement a universalX
The terms "von Neumann architecture" and "stored-program computer" are generally
used interchangeably, and that usage is followed in this article.
FIGURE 3.5: S CHEMATIC OF THE VON-NEUMANN ARCHITECTURE.
Ø
The primary difference between Harvard architecture and the Von Neumann
architecture is in the Von Neumann architecture data and programs are stored in the same
memory and managed by the same information handling system.
Whereas the Harvard architecture stores data and programs in separate memory devices
and they are handled by different subsystems.
processing unit (CPU) can either be reading and instruction or writing/reading data
to/from the memory. Both of these operations cannot occur simultaneously as the data
and instructions use the same system bus.
Ø
In a computer using the Harvard architecture the CPU can both read an instruction and
access data memory at the same time without cache. This means that a computer with
Harvard architecture can potentially be faster for a given circuit complexity because data
access and instruction fetches do not contend for use of a single memory pathway.
Today, the vast majority of computers are designed and built using the Von
Neumann
architecture template primarily because of the dynamic capabilities and
efficiencies
gained in designing, implementing, operating one memory system as opposed
to two. Von Neumann architecture may be somewhat slower than the contrasting Harvard
Architecture for certain specific tasks, but it is much more flexible and allows for many
concepts unavailable to Harvard
architecture such as
self programming, word processing
and so on.
Ø
Harvard architectures are
typically only used
in either specialized systems or for
very specific uses. It is used in specialized digital signal processing (DSP), typically for
video and audio processing products. It is also used in many small microcontrollers used
in electronics applications such as Advanced RISK Machine (ARM) based products for
many vendors.
CHAPTER 4
POWER SUPPLY
A power
supply is an
electronic
device
that
supplies electricX
energy toX
an electrical load.X
The primary
function of a
power
supply
is to convert one
form of
electrical energy to another.
4.3 TRANSFORMER:
A transformer
is a device that transfers electrical energy from one circuit toX
another through inductively coupled conductors—the transformer'sX
coils. A
varying
current inX
the first
or primary winding creates a varying magnetic flux in theX
transformer's
core, and thus a varying magneticX
field through theX
secondary
winding.
This varying
magnetic
field induces a varying electromotive force (EMF) or "voltage" inX
the secondary winding.
This effect is called mutualX
induction.X
FIG 4.3: TRANS FORMER S YMBOL
A transformer consists of two coils (often called 'windings') linked by an iron core, as
shown in figure below. There is no electrical connection between the coils, instead they
are linked by a magnetic field created in the core.
Transformers are used to convert electricity from one voltage to another with minimal
loss of power. They only work with AC (alternating current) because they require a
changing magnetic field to be created in their core. Transformers can increase voltage
(step-up) as well as reduce voltage (step-down).
Alternating current flowing in the primary (input) coil creates a continually
changing magnetic field in the iron core. This field also passes through
the
secondary
(output)
coil and the
changing
strength of
the magnetic field
induces
an
alternating
voltage
in the secondary coil. If
the secondary coil is connected
to a load the induced
voltage
will make an induced current flow. The correct
term for the induced voltage is
'induced
electromotive
force' which is usually
abbreviated
to induced e.m.f.
The iron core is laminated to prevent 'eddy currents' flowing in the core. These are
currents produced by the alternating magnetic field inducing a small voltage in the core,
just like that induced in the secondary coil. Eddy currents waste power by needlessly
heating up the core but they are reduced to a negligible amount by laminating the iron
because this increases the electrical resistance of the core without affecting its magnetic
properties.
Transformers have two great advantages over other methods of changing voltage:
DEPT. OF ECE, BRIL Page 40
GSM BASED VEHICLE FUEL MONITORING SYSTEM
1. They provide total electrical isolation between the input and output, so they can be
safely used to reduce the high voltage of the mains supply.
Almost no power is wasted in a transformer. They have a high efficiency (power out /
power in) of 95% or more.
CLASSIFICATION OF TRANSFORMER:
Step-Up Transformer
Step-Down Transformer
Step down transformers are designed to reduce electrical voltage. Their primary voltage is
greater than their secondary voltage. This kind of transformer "steps down" the voltage
applied to it. For instance, a step down transformer is needed to use a 110v product in a
country with a 220v supply.
Step down transformers convert electrical voltage from one level or phase configuration
usually down to a lower level. They can include features for electrical isolation, power
distribution, and control and instrumentation applications. Step down transformers
typically rely on the principle of magnetic induction between coils to convert voltage
and/or current levels.
Step down transformers are made from two or more coils of insulated wire wound around
a core made of iron. When voltage is applied to one coil (frequently called the primary or
input) it magnetizes the iron core, which induces a voltage in the other coil,
(frequently called the secondary or output). The turn’s ratio of the two sets of windings
determines the amount of voltage transformation.
Step down transformers can be considered nothing more than a voltage ratio device.
With step down transformers the voltage ratio between primary and secondary will mirror
the "turn’s ratio" (except for single phase smaller than 1 kva which have compensated
secondary). A practical application of this 2 to 1 turn’s ratio would be a 480 to 240
voltage step down. Note that if the input were 440 volts then the output would be 220
volts. The ratio between input and output voltage will stay constant. Transformers should
not be operated at voltages higher than the nameplate rating, but may be operated at lower
voltages than rated. Because of this it is possible to do some non-standard applications
using standard transformers.
Single phase step down transformers 1 kva and larger may also be reverse connected to
step-down or step-up voltages. (Note: single phase step up or step down transformers
sized less than 1 KVA should not be reverse connected because the secondary windings
have additional turns to overcome a voltage drop when the load is applied. If reverse
connected, the output voltage will be less than desired.)
A step up transformer has more turns of wire on the secondary coil, which makes
a larger induced voltage in the secondary coil. It is called a step up transformer because
the voltage output is larger than the voltage input.X
Step-up transformer 110v 220v design is one whose secondary voltage is greater than its
primary voltage. This kind of transformer "steps up" the voltage applied to it. For
instance, a step up transformer is needed to use a 220v product in a country with a 110v
supply.
A step up transformer 110v 220v converts alternating current (AC) from one voltage to
another voltage. It has no moving parts and works on a magnetic induction principle; it
can be designed to "step-up" or "step-down" voltage. So a step up transformer increases
the voltage and a step down transformer decreases the voltage.
The primary components for voltage transformation are the step up transformer core and
coil. The insulation is placed between the turns of wire to prevent shorting to one another
or to ground. This is typically comprised of Mylar, nomex, Kraft paper, varnish, or other
materials. As a transformer has no moving parts, it will typically have a life expectancy
between 20 and 25 years.
FIG 4.7: S TEP-UP TRANS FORMER
The ratio of the number of turns on the primary and secondary coils determines the ratio
of the voltages...
...where
Vp is the primary (input) voltage, Vs is the secondary (output) voltage, Np is the
number
of turns on the primary coil,
and Ns is the number of turns on the secondary coil.
4.4 DIODES:
Diodes allow electricity to flow in only one direction. The arrow of the
symbol shows the direction in which the current can circuit Diodes are
flow. version of a valve and early diodes were the electrical
actually called valves.
In this direction, the diode is said to be 'forward-biased' and the only effect
on the signal
is that there will be a voltage loss of around 0.7V. In the opposite
direction, the diode is said to be 'reverse-biased' and no current will flow
through it.
4.4 RECTIFIER
The half-wave rectifier is the simplest type of rectifier since it only uses
one diode, as shown in figure.
Figure shows the AC input waveform to this circuit and the resulting output. As you can
see, when the AC input is positive, the diode is forward-biased and lets the current
through. When the AC input is negative, the diode is reverse-biased and the diode does
not let any current through, meaning the output is 0V. Because there is a 0.7V voltage loss
across the diode, the peak output voltage will be 0.7V less than Vs.
FIG 4.10: HALF-WAVE RECTIFICATION
While the output of the half-wave rectifier is DC (it is all positive), it would not be
suitable as a power supply for a circuit. Firstly, the output voltage continually varies
between 0V and Vs-0.7V, and secondly, for half the time there is no output at all.
DEPT. OF ECE, BRIL Page 45
GSM BASED VEHICLE FUEL MONITORING SYSTEM
The circuit in figure 3 addresses the second of these problems since at no time is the
output voltage 0V. This time four diodes are arranged so that both the positive and
negative parts of the AC waveform are converted to DC. The resulting waveform is
shown below.
When the AC input is positive, diodes A and B are forward-biased, while diodes C and D
are reverse-biased. When the AC input is negative, the opposite is true - diodes C and D
are forward-biased, while diodes A and B are reverse-biased.
DEPT. OF ECE, BRIL Page 46
GSM BASED VEHICLE FUEL MONITORING SYSTEM
The capacitor-input filter, also called "Pi" filter due to its shape that looks like the Greek
letter pi, is a type of electronic filter. Filter circuits are used to remove unwanted or
undesired frequencies from a signal.X
FIG 4.13: CAPACITOR FILTER
A typical capacitor input filter consists of a filter capacitor C1, connected across the
rectifier output, an inductor L, in series and another filter capacitor connected across the
load.X
The capacitor C1 offers low reactance to the AC component of the rectifier output while it
offers infinite reactance to the DC component. As a result the capacitor shunts an appreciable
amount of the AC component while the DC component X
The inductor L offers high reactance to the AC component but it offers almost zero
reactance to the DC component. As a result the DC component flows through X
The capacitor C2 bypasses the AC component which the inductor had failed to block. As
a result only the DC component appears across the load RL. X
78xx:’78’ indicate the positive series and ‘xx’indicates the voltage rating. Suppose 7805
produces the maximum 5V.’05’indicates the regulator output is 5V.
79xx:’78’ indicate the negative series and ‘xx’indicates the voltage rating. Suppose 7905
produces the maximum -5V.’05’indicates the regulator output is -5V.
GENERAL DESCRIPTION:
The Liquid Crystal Display (LCD) is a low power device (microwatts). Now a days in
most applications LCDs are using rather using of LED displays because of its
Field-effect LCDs
Field-effect LCDs are normally used in such applications where source of energy is a
prime factor (e.g., watches, portable instrumentation etc.).They absorb considerably less
power than the light-scattering type. However, the cost for field-effect units is typically
higher, and their height is limited to 2 inches. On the other hand, light-scattering units are
available up to 8 inches in height. Field-effect LCD is used in the project for displaying
the appropriate information.
RS (Command / Data):
This bit is to specify whether received byte is command or data. So that LCD can
recognize the operation to be performed based on the bit status.
RS
=
0
=>
Command
RS
=
1
=>
Data
RW (Read / Write):
RW bit is to specify whether controller wants READ from LCD or WRITE to LCD. The
READ operation here is just ACK bit to know whether LCD is free or not.
RW
=
0
=>
Write
RW
=
1
=>
Read
EN (Enable LCD):
EN
=
0
=>
High Impedance
EN
=
1
=>
Low Impedance
ACK
=
1
=>
Not ACK
ACK
=
0
=>
ACK
DEPT. OF ECE, BRIL Page 50
GSM BASED VEHICLE FUEL MONITORING SYSTEM
Symbol
Level
Function
Pin
1
VSS
-
Power, GND
VDD
Power, 5V
3
Vo
L: Instruction Input
H: Data Read (LCD->MPU)
R/W
H/L
H,H->L
Enable
7-14
DB0-DB7
H/L
NOT CONNECTED
15
NC
-
16
NC NOT CONNECTED
FEATURES:
Data can be placed at any location on the LCD. For 16×1 LCD, the address
locations are:
TABLE 4.2: LCD COMMAND CODES
DEPT. OF ECE, BRIL Page 52
GSM BASED VEHICLE FUEL MONITORING SYSTEM
HARDWARE CONNECTIONS:
CONTROLER PINS
LCD PINS
PIN NAME WITH FEATURE
(P1.0)
4
RS (Control Pin)
(P1.1)
5
RW (Control pin )
(P1.2)
6
EN (Control pin)
Port 0
7 to 14
Data Port
40
15 & 2
Vcc
20
16 & 1
Gnd
CHAPTER-5
DEFINITION OF GSM:
GSM (Global System for Mobile communications) is an open, digital cellular technology
used for transmitting mobile voice and data services.
GSM (Global System for Mobile communication) is a digital mobile telephone system
that is widely used in Europe and other parts of the world. GSM uses a variation of Time
Division Multiple Access (TDMA) and is the most widely used of the three digital
wireless telephone technologies (TDMA, GSM, and CDMA). GSM digitizes and
compresses data, then sends it down a channel with two other streams of user data, each
in its own time slot. It operates at either the 900 MHz or 1,800 MHz frequency band. It
supports voice calls and data transfer speeds of up to 9.6 Kbit/s, together with the
transmission of SMS (Short Message Service).
History:
By the end of 1993, over a million subscribers were using GSM phone networks being
operated by 70 carriers across 48 countries. As of the end of 1997, GSM service was
available in more than 100 countries and has become the de facto standard in Europe and
Asia.
GSM networks operate in a number of different frequency ranges (separated into GSM
frequency ranges for 2G and UMTS frequency bands for 3G). Most 2G GSM
networks operate in the 900 MHz or 1800 MHz bands. Some countries in the Americas
(including Canada and the United States) use the 850 MHz and 1900 MHz bands because
the 900 and 1800 MHz frequency bands were already allocated. Most 3G GSM networks
in Europe operate in the 2100 MHz frequency band. The rarer 400 and 450 MHz
frequency bands are assigned in some countries where these frequencies were previously
GSM-900 uses 890–915 MHz to send information from the mobile station to the base
station (uplink) and 935–960 MHz for the other direction (downlink), providing 124 RF
channels (channel numbers 1 to 124) spaced at 200 kHz. Duplex spacing of 45 MHz is
used. In some countries the GSM-900 band has been extended to cover a larger frequency
range. This 'extended GSM', E-GSM, uses 880–915 MHz (uplink) and 925– 960 MHz
(downlink), adding 50 channels (channel numbers 975 to 1023 and 0) to the
original
GSM-900 band.
eight burst periods) grouped into what is called a TDMA frame. Half rate channels use
alternate frames in the same timeslot. The channel data rate for all 8 channels is 270.833
Kbit/s, and the frame duration is 4.615 ms.
The transmission power in the handset is limited to a maximum of 2 watts in
GSM850/900 and 1 watt in GSM1800/1900. GSM operates in the 900MHz and 1.8GHz
bands in Europe and the 1.9GHz and 850MHz bands in the US. The 850MHz band is also
used for GSM and 3G in Australia, Canada and many South American countries. By
having harmonized spectrum across most of the globe, GSM’s international roaming
capability allows users to access the same services when travelling abroad as at home.
This
gives consumers
seamless
and same
number
connectivity in
more
than 218
countries.
Terrestrial GSM
networks now cover more than 80% of the world’s
population.
GSM
satellite roaming
has also
extended
service
access to areas
where
terrestrial
coverage is not available.
The first generation of mobile telephony (written 1G) operated using analogue
communications and portable devices that were relatively large. It used primarily the
following standards:
AMPS (Advanced Mobile Phone System), which appeared in 1976 in the United States,
was the first cellular network standard. It was used primarily in the Americas, Russia and
Asia. This first-generation analogue network had weak
security mechanisms
which allowed hacking of telephones
lines.
·
TACS (Total Access
Communication System) is the European version
of the
AMPS model. Using the 900 MHz frequency band, this system was largely used
·
ETACS (Extended Total Access Communication System)
is an improved
version
of the TACS standard developed in the United Kingdom that uses a larger number
of communication channels.
The
first-generation cellular
networks were made obsolete by
the appearance
of an
The second generation of mobile networks marked a break with the first generation of
cellular telephones by switching from analogue to digital. The main 2G mobile telephony
standards are:
GSM (Global System for Mobile communications) is the most commonly used X
CDMA (Code Division Multiple Access) uses a spread spectrum technique that
Extensions have been made to the GSM standard to improve throughput. One of these is
the GPRS (General Packet Radio System) service which allows theoretical data rates on
the order of 114 Kbit/s but with throughput closer to 40 Kbit/s in practice. As
this technology does not fit within the "3G" category, it is often referred
to as 2.5G
The EDGE (Enhanced Data
Rates for
Global Evolution)
standard, billed
as 2.75G, quadruples the throughput
improvements
of GPRS with its theoretical data rate
of 384 Kbps, thereby allowing the access for multimedia applications. In reality, the
EDGE standard allows maximum theoretical data rates of 473 Kbit/s, but it has been
limitedin
order
tocomply with theIMT-2000(International Mobile
Telecommunications-2000)
specifications
from
the
ITU
(International
Telecommunications
Union).
The IMT-2000
(International Mobile
Telecommunications for the
year 2000)
specifications
from
the
International Telecommunications Union
(ITU)
defined the
World compatibility.
the
5 GHz frequency band and uses WCDMA encoding.
In Europe, the GSM standard uses the 900 MHz and 1800 MHz frequency bands. In the
United States, however, the frequency band used is the 1900 MHz band. For this reason,
portable telephones that are able to operate in both Europe and the United States are
called tri-band while those that operate only in Europe are called bi-band.
The GSM standard allows a maximum throughput of 9.6 kbps which allows transmission
of voice and low-volume digital data like text messages (SMS, for Short Message
Service) or multimedia messages (MMS, for Multimedia Message Service).
GSM Standards:
GSM uses narrowband TDMA, which allows eight simultaneous calls on the
same radio frequency. There are three basic principles in multiple access, FDMA
(Frequency Division Multiple Access), TDMA (Time Division Multiple Access), and
CDMA (Code Division Multiple Access). All three principles allow multiple users to
share the same physical channel. But the two competing technologies differ in the way
user sharing the common resource.
TDMA allows the users to share the same frequency channel by dividing the signal into
different time slots. Each user takes turn in a round robin fashion for transmitting and
receiving over the channel. Here, users can only transmit in their
CDMA uses a spread spectrum technology that is it spreads the information contained in
a particular signal of interest over a much greater bandwidth than the
original signal. Unlike TDMA, in CDMA several users can transmit over the channel at
the same time.
TDMA IN BRIEF:
In late1980’s, as a search to convert the existing analog network to digital as a means to
improve capacity, the cellular telecommunications industry association chose TDMA over
FDMA. Time Division Multiple Access is a type of multiplexing where two
or more
channels of
information
are transmitted over the same link by allocating a
different
time interval
for the
transmission of each channel. The most complex
TDMA systems still rely on switch to determine when to perform a handoff. Handoff
occurs when a call is switched from one cell site to another while travelling. The TDMA
handset constantly monitors the signals coming from other sites and reports it to the
switch without caller’s awareness. The switch then uses this information for making better
choices for handoff at appropriate times. TDMA handset performs hard handoff, i.e.,
whenever the user moves from one site to another, it breaks the connection and then
provides a new connection with the new site.
Advantages of TDMA:
It has an ability to carry 64 kbps to 120 Mbps of data rates. This allows the operator to do
services like fax, voice band data and SMS as well as bandwidth intensive application
such as multimedia and video conferencing.
Since TDMA technology separates users according to time, it ensures that there
will be no interference
from simultaneous transmissions.
4. It provides users with
an extended battery life, since it transmits only portion of
the time during conversations. Since the cell size grows smaller, it proves to save
base station equipment,
space and maintenance.
TDMA is the most cost effective technology to convert an analog system to digital.
Disadvantages of TDMA:
One major disadvantage using TDMA technology is that the users has a predefined time
slot. When moving from one cell site to other, if all the time slots in this cell are full the
user might be disconnected. Likewise, if all the time slots in the cell in which the user is
currently in are already occupied, the user will not receive a dial tone.
Mobile telephone networks are based on the concept of cells, circular zones that overlap
to cover a geographical area.
FIGURE 5.2: CELLULAR NETWORKS
cell, called
a "base station" (or Base Transceiver Station,
written BTS).
The smaller the
radius of a
cell, the higher is the available bandwidth.
So, in highly
populated urban
areas, there are cells with a radius of a few hundred meters, while huge cells of up to 30
kilometers provide coverage in rural areas.
In a
GSM network, the user terminal is called a mobile
station. A mobile station
is made up
of a SIM (Subscriber Identity Module) card allowing the user to be uniquely
DEPT. OF ECE, BRIL
Page 61
GSM BASED VEHICLE FUEL MONITORING SYSTEM
Equipment Identity).
Each
SIM
card also has
a unique (and secret) identification number
called IMSI (International
Mobile Subscriber Identity). This code can be protected using a 4-digit key called a PIN
code.
The SIM card therefore allows each user to be identified independently of the terminal
used during communication with a base station. Communications occur through a radio
link (air interface) between a mobile station and a base station.
FIGURE 5.3: ARCHITECTURE OF GS M NETWORKS
All the base stations of a cellular network are connected to a base station
controller (BSC) which is responsible for managing distribution of the resources. The
system consisting
of the
base station controller and its connected base stations is called
the Base Station Subsystem (BSS).
Finally,
the
base
station
controllers are
themselves physically connected to
the Mobile
Switching
Centre
(MSC), managed
by the telephone network operator,
which connects them to the public telephone network and the Internet. The MSC belongs
identities, their location and establishment of communications with other subscribers. The
MSC is generally connected to databases that provide additional functions:
1.
The Home
Location Register (HLR) is
a
database
containing
information
(geographic
position, administrative information etc.)
of the
subscribers registered
2.
The Visitor
Location Register (VLR) is
a database containing information of
users other than the local subscribers. The VLR retrieves the data of a new user
from the HLR of the user's subscriber zone. The data is maintained as long as the
user is in the zone and is deleted when the user leaves or after a long period of
3.
The Equipment Identify Register (EIR)
is
a
database
listing
the mobile
terminals.
4.
The Authentication Centre (AUC) is responsible
for verifying
user identities.
The cellular network formed in this way is designed to support mobility via management
of handovers (movements from one cell to another).
Finally, GSM networks support the concept of roaming i.e., movement from one operator
network to another.
A modem is a device or program that enables a computer to transmit data over telephone
or cable lines. Computer information is stored digitally, whereas information transmitted
over telephone lines is transmitted in the form of analog waves. A modem converts
between these two forms.
Fortunately, there is one standard interface for connecting external modems to computers
called RS-232. Consequently, any external modem can be attached to any computer that
has an RS-232 port, which almost all personal computers have. There are also modems
that come as an expansion board that can be inserted into a vacant expansion slot. These
are sometimes called onboard or internal modems.
While the modem interfaces are standardized, a number of different protocols for
formatting data to be transmitted over telephone lines exist. Some, like CCITT V.34 are
official standards, while others have been developed by private companies. Most modems
have built-in support for the more common protocols at slow data transmission speeds at
least, most modems can communicate with each other. At high transmission speeds,
however, the protocols are less standardized.
Apart from the transmission protocols that they support, the following characteristics
distinguish one modem from another:
Bps: How fast the modem can transmit and receive data. At slow rates, modems are
measured in terms of baud rates. The slowest rate is 300 baud (about 25 cps).
At higher speeds, modems are measured in terms of bits per second (bps). The fastest
modems run at 57,600 bps, although they can achieve even higher data transfer rates by
compressing the data. Obviously, the faster the transmission rate, the faster the data can
be sent and received. It should be noted that the data cannot be received at a faster rate
than it is being sent.
Voice/data: Many modems support a switch to change between voice and data modes. In
data mode, the modem acts like a regular modem. In voice mode, the
modem acts like a regular telephone. Modems that support a voice/data switch
Data compression: Some modems perform data compression, which enables them to
send data at faster rates. However, the modem at the receiving end must
Flash memory: Some modems come with flash memory rather than conventional ROM
which means that the communications protocols can be easily updated if
necessary.
Fax capability: Most modern modems are fax modems, which mean that they can send
and receive faxes.
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 dial-up
modem sends and receives data through a fixed telephone line while a wireless modem
sends and receives data through radio waves.
FIGURE 5.5: GSM MODEM
Identity)
Authentication key
Computers use AT commands to control modems. Both GSM modems and dial-
The number of SMS messages that can be processed by a GSM modem per minute is very
low i.e., about 6 to 10 SMS messages per minute.
Besides this common AT command set, GSM modems and mobile phones support an AT
command set that is specific to the GSM technology, which includes SMS-related
commands like AT+CMGS (Send SMS message), AT+CMSS (Send SMS message from
storage), AT+CMGL (List SMS messages) and AT+CMGR (Read SMS messages).
It should be noted that the starting "AT" is the prefix that informs the modem about the
start of a command line. It is not part of the AT command name. For example,
D is the actual AT command name in ATD and +CMGS is the actual AT command name
in AT+CMGS.
Some of the tasks that can be done using AT commands with a GSM modem or mobile
phone are listed below:
Get basic information about the mobile phone or GSM modem. For example, name of
manufacturer (AT+CGMI), model number (AT+CGMM), IMEI number
Get basic information about the subscriber. For example, MSISDN (AT+CNUM)
Get the current status of the mobile phone or GSM/GPRS modem. For example, mobile
phone activity status (AT+CPAS), mobile network registration status
(AT+CREG), radio signal strength (AT+CSQ), battery charge level and battery charging
status (AT+CBC).
Establish a data connection or voice connection to a remote modem (ATD, ATA, etc).
passwords (AT+CPWD).
(Facility lock examples: SIM lock [a password must be given to the SIM card every time
the mobile phone is switched on] and PH-SIM lock [a certain SIM card is associated with
the mobile phone. To use other SIM cards with the mobile phone, a password must be
entered.)
example, the user can control whether to enable certain error messages
Get or change the configurations of the mobile phone or GSM/GPRS modem. For
example, change the GSM network (AT+COPS), bearer service type
Save and restore configurations of the mobile phone or GSM/GPRS modem. For example,
save (AT+CSAS) and restore (AT+CRES) settings related to SMS
An SMS message is stored temporarily in the SMS center if the recipient mobile phone is
offline. It is possible to specify the period after which the SMS message will be deleted
from the SMS center so that the SMS message will not be forwarded to the recipient
mobile phone when it becomes online. This period is called the validity period. A mobile
phone should have a menu option that can be used to set the validity period. After setting
it, the mobile phone will include the validity period in the outbound SMS messages
automatically.
Sometimes the user may want to know whether an SMS message has reached the recipient
mobile phone successfully. To get this information, you need to set a flag in the SMS
message to notify the SMS center that a status report is required about the delivery of this
SMS message. The status report is sent to the user mobile in the form of an SMS
message.
A mobile phone should have a menu option that can be used to set whether the
corresponding flag in the outbound SMS messages for you automatically. The status
report feature is turned off by default on most mobile phones and GSM modems.
After leaving the mobile phone, an SMS message goes to the SMS center. When it
reaches the SMS center, the SMS center will send back a message submission report to
the mobile phone to inform whether there are any errors or failures (e.g. incorrect SMS
message format, busy SMS center, etc). If there is no error or failure, the SMS center
sends back a positive submission report to the mobile phone. Otherwise it sends back a
negative submission report to the mobile phone. The mobile phone may then notify the
user that the message submission was failed and what caused the failure.
If the mobile phone does not receive the message submission report after a period
of time, it concludes that the message submission report has been lost. The mobile phone
may then send the SMS message again to the SMS center. A flag will be set in the new
SMS message to inform the SMS center that this SMS message has been sent before. If
the previous message submission was successful, the SMS
center will ignore the new
SMS message but send back a message submission report
to the mobile phone. This
Sometimes the message submission report mechanism is not used and the
acknowledgement of message submission
is done in a lower layer.
After receiving an SMS message, the recipient mobile phone will send back a message
delivery report to the SMS center to inform whether there are any errors or failures
(example causes: unsupported SMS message format, not enough storage space, etc). This
process is transparent to the mobile user. If there is no error or failure, the
recipient mobile phone sends back a positive delivery report to the SMS center.
If the sender requested a status report earlier, the SMS center sends a status report
to the sender when it receives the message delivery report from the recipient.
FEATURES:
Upgrade with Improved ESD (15kV HBM) and 0.1uF Charge-Pump Capacitors is
available With the MAX202.
5.9.3 DESCRIPTION:
FUNCTION TABLE:
FIGURE 5.8: FUNCTION TABLE
CHAPTER-6
SERIAL COMMUNICATION
THEORY:
The concept of serial communication is simple. The serial port sends and receives bytes
of information one bit at a time. Although this is slower than parallel communication,
which allows the transmission of an entire byte at once, it is simpler and can be used over
longer distances. For example, the IEEE 488 specifications for parallel communication
state that the cabling between equipment can be no more than 20 meters total, with no
more than 2 meters between any two devices. Serial, however, can extend as much as
1200 meters.
using 3 transmission lines: (1) Ground, (2) Transmit, and (3) Receive. Since serial is
asynchronous, the port is able to transmit data on one line while receiving data on
another. Other lines are available for handshaking, but are not required. The important
serial characteristics are baud rate, data bits, stop bits, and parity. For two ports to
communicate, these parameters must match.
Baud rate:
It is a speed measurement for communication. It indicates the number of bit transfers per
second. For example, 300 baud is 300 bits per second. When a clock cycle is referred it
means the baud rate. For example, if the protocol calls for a 4800 baud rate, then the
clock is running at 4800Hz. This means that the serial port is sampling the data line at
4800Hz. Common baud rates for telephone lines are 14400, 28800, and 33600. Baud rates
greater than these are possible, but these rates reduce the distance by which
devices can be separated. These high baud rates are used for device communication where
the devices are located together, as is typically the case with GPIB devices.
Data bits:
Measurement of the actual data bits in a transmission. When the computer sends a packet
of information, the amount of actual data may not be a full 8 bits. Standard values for the
data packets are 5, 7, and 8 bits. Which setting chosen depends on what information
transferred? For example, standard ASCII has values from 0 to 127 (7 bits). Extended
ASCII uses 0 to 255 (8 bits). If the data being transferred is simple text (standard ASCII),
then sending 7 bits of data per packet is sufficient for communication.
A packet refers to a single byte transfer, including start/stop bits, data bits, and parity.
Since the number of actual bits depends on the protocol selected, the term packet is used
to cover all instances.
Stop bits:
Stop bits used to signal the end of communication for a single packet. Typical values are
1, 1.5, and 2 bits. Since the data is clocked across the lines and each device has
its own clock, it is possible for the two devices to become slightly out of sync. Therefore,
the stop bits not only indicate the end of transmission but also give the computers some
room for error in the clock speeds. The more bits that are used for stop bits, the greater
the lenience in synchronizing the different clocks, but the slower the data transmission
rate.
Parity:
A simple form of error checking that is used in serial communication. There are
four types of parity: even, odd, marked, and spaced. The option of using no parity is also
available. For even and odd parity, the serial port sets the parity bit (the last bit after the
data bits) to a value to ensure that the transmission has an even or odd number of logic
high bits. For example, if the data is 011, then for even parity, the parity bit is 0 to keep
the number of logic-high bits even. If the parity is odd, then the parity bit is 1, resulting in
3 logic-high bits. Marked and spaced parity does not actually check the data bits, but
simply sets the parity bit high for marked parity or low for spaced parity. This allows the
receiving device to know the state of a bit to enable the device to determine if noise is
corrupting the data or if the transmitting and receiving device clocks are out of sync.
12345
6789
Pin Functions:
Data: TxD on pin 3, RxD on pin 2
Other: RI on pin 9
The method used by RS-232 for communication allows for a simple connection of three
lines: Tx, Rx, and Ground. The three essential signals for 2 way RS-232
CONNECTION DIAGRAM:
RXD
TXD
3
Embedded
Controller GND
TXD
RXD
2
MAX 232
SCON:
SM0SM1 SM2RENTB8RB8
TI
RI
TMOD:
T1:
TH1 TL1
If you wanted to do a general RS-232 connection, you could take a bunch of long wires
and solder them directly to the electronic circuits of the equipment you are using, but this
tends to make a big mess and often those solder connections tend to break and other
problems can develop. To deal with these issues, and to make it easier to setup or take
down equipment, some standard connectors have been developed that is commonly found
on most equipment using the RS-232 standards.
These connectors come in two forms: A male and a female connector. The female
connector has holes that allow the pins on the male end to be inserted into the connector.
The female DB-9 connector is typically used as the "plug" that goes into a typical PC. If
you see one of these on the back of your computer, it is likely not to be used for serial
communication, but rather for things like early VGA or CGA monitors (not SVGA) or for
some special control/joystick equipment.
This is the connector that you are more likely to see for serial communications on a
"generic" PC. Often you will see two of them side by side (for COM1 and COM2).
Special equipment that you might communicate with would have either connector, or
even one of the DB-25 connectors listed below.
The wiring of RS-232 devices involves first identifying the actual pins that are being
used. Here is how a female DB-9 connector is numbered:
FIGURE6.5: FRONT VIEW
If the numbers are hard to read, it starts at the top-right corner as "1", and goes left until
the end of the row and then starts again as pin 6 on the next row until you get to pin 9 on
the bottom-left pin. "Top" is defined as the row with 5 pins.
The male connector (like what you have on your PC) is simply this same order, but
reversed from right to left.
1
8
DCD (Data Carrier Detect)
2
3
RX (Receive Data)
3
2
TX (Transmit Data)
4
20
DTR (Data Terminal Ready)
5
7
GND (Signal Ground)
6
6
DSR (Data Set Ready)
7
4
RTS (Request To Send)
8
5
CTS (Clear To Send))
9
22
RI (Ring Indicator)
One thing to keep in mind when discussing these pins and their meaning is that
they are very closely tied together with modems and modem protocols. Often you don't
have a modem attached in the loop, but you still treat the equipment as if it were a modem
on a theoretical level.
6.3 MAX232:
Max 232 is a communications device used mainly for serial commands to and
from a flash ROM.The MAX232 is an integrated circuit that converts signals from anX
RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits.
The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTS
signals. The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a
singleX
+ 5 V supply via on-chip charge pumps and external capacitors. This makes it useful for
implementing RS-232 in devices that otherwise do not need any voltages outside the 0 VX
to + 5 V range, as power supply design does not need to be made more complicated justX
The
receivers reduce RS-232
inputs (which may be as high as ± 25 V), to standard
5 V TTLX
levels. These receivers
have a typical threshold of 1.3 V, and a typical
hysteresisX
of 0.5 V.
The later MAX232A is backwards compatible with the original MAX232 but may operate
at higher baud rates and can use smaller external capacitors – 0.1 μF in place of the 1.0 μF
capacitors used with the original device.X
The newer MAX3232 is also backwards compatible, but operates at a broader voltage
range, from 3 to 5.5V.
It is helpful to understand what occurs to the voltage levels. When a MAX232 IC receives
a TTL level to convert, it changes a TTL Logic 0 to between +3 and +15V, and changes
TTL Logic 1 to between -3 to -15V, and vice versa for converting from RS232 to TTL.
This can be confusing when you realize that the RS232 Data Transmission voltages at a
certain logic state are opposite from the RS232 Control Line voltages at the same logic
state. To clarify the matter, see the table below. For more information see RS-232 Voltage
Levels.X
RS232 Line Type & Logic Level
RS232
TTL
Voltage
to/from
Voltage
MAX232
Data Transmission (Rx/Tx)
Logic 0
+3V to +15V
0V
Data Transmission
(Rx/Tx)
Logic 1
-3V to -15V
5V
ControlSignals
(RTS/CTS/DTR/DSR)
-3V to -15V
5V
Logic 0
DEPT. OF ECE, BRIL
Page 81
GSM BASED VEHICLE FUEL MONITORING SYSTEM
ControlSignals
(RTS/CTS/DTR/DSR)
+3V to +15V
0V
Logic 1
TABLE 6.3: VOLTAGE LEVELS IN RS 232
Standard serial
interfacing of microcontroller (TTL) with PC or any RS232CX
Standard device , requires TTL to RS232 Level converter . A MAX232 is used for this
purpose. It provides 2-channel RS232C port and requires external 10uF capacitors. The
driver requires a single supply of +5V.X
FIGURE 6.6: MAX 232 PINDIAGRAM
This is the circuit diagram of a simple corrosion free water level indicator for home and
industries. In fact the level of any conductive non corrosive liquids can be measured using
this circuit. The circuit is based on 5 transistor switches. Each transistor is switched on to
drive the corresponding LED, when its base is supplied with current through the water
through the electrode probes.
One electrode probe is (F) with 6V AC is placed at the bottom of tank. Next probes are
placed step by step above the bottom probe. When water is rising the base of each
transistor gets electrical connection to 6V AC through water and the corresponding probe.
Which in turn makes the transistors conduct to glow LED and indicate the level of water.
The ends of probes are connected to corresponding points in the circuit as shown in
circuit diagram. Insulated Aluminum wires with end insulation removed will do for the
probe. Arrange the probes in order on a PVC pipe according to the depth and immerse it
in the tank.AC voltage is use to prevent electrolysis at the probes. So this setup will last
really long. I guarantee at least a 2 years of maintenance free operation.
COMPONENTS :
NOTES:
Use a transformer with 6V 500 mA output for power supply. Do not use a rectifier! we
need pure AC. Use good quality insulated Aluminum wire for probes. If Aluminum wires
are not available try Steel or Tin. Copper is the worst. Try the circuit first on a bread
board and if not working properly, make adjustments with the resistance values .This is
often needed because conductivity of water changes slightly from place to place. The type
number of the transistors used here are not critical and any small signal NPN transistor
will do the job. Few other suitable type numbers are BC546, BC107, PN2222, BC337,
BF494, ZTX300, BEL187 etc. The circuit can be enclosed in a plastic box with holes for
revealing the LEDs.
WATER LEVEL INDICATOR CIRCUIT DIAGRAM AND SENSOR
ARRANGEMENT:
CHAPTER-7
CONCLUSION
The indicator
The sensing unit usually uses a float connected to a potentiometer, typically printedX
ink design in a modern automobile. As the tank empties, the float drops and slides a
moving contact
along
the resistor,
increasing
its
[2]
resistance. In addition,X
when
the
resistance
is at a certain
point,
it will
also turn on a "low fuel"
light
on some vehicles.
Meanwhile,
the
indicator unit (usually mounted on
the dashboard)X
is
measuring
and displaying
the
amount of
electrical
current flowing through the sending
unit. When
the tank
level
is
high
and
maximum
current
is
flowing,
the
needle points to
"F"
indicating a full tank. When the tank is empty and the least current is flowing, the needle
an empty tank.
The
system
can
be fail-safe.X
If
an electrical fault opens, the electrical circuit
causes the
indicator
to
show the tank
as
being empty (theoretically provoking the driver
to refill the tank) rather than full (which would allow the driver to run out of fuel with no
prior notification). Corrosion or wear of the potentiometer will provide erroneous
readings of fuel level. However, this system has a potential risk associated with it. An
electric current is sent through the variable resistor to which a float is connected, so that
the value of resistance depends on the fuel level. In most automotive fuel gauges such
resistors are on the inward side of the gauge, i.e., inside the fuel tank. Sending current
through such a resistor has a fire hazard and an explosion risk associated with it. These
resistance
sensors
are
also showing an increased failure rate with the incremental
additions
of alcohol
in
automotive gasoline fuel. Alcohol increases
the corrosion rate at
the potentiometer,
as
it is capable of carrying current like
water. Potentiometer
applications for alcohol fuel use a pulse-and-hold methodology, with a periodic signal
being sent to determine fuel level decreasing the corrosion potential. Therefore, demand
for another safer, non-contact method for fuel level is desired.
Magneto resistance type fuel level sensors, now becoming common in small aircraft
applications, offer a potential alternative for automotive use. These fuel level sensors work
similar to the potentiometer example, however a sealed detector at the float pivot determines
the angular position of a magnet pair at the pivot end of the float arm. These are highly
accurate, and the electronics are completely outside the fuel. The non-contact nature of these
sensors address the fire and explosion hazard, and also the issues related X
Many large transport aircraft use a different fuel gauge design principle. An X
aircraft may use a number (around 30 on an A320) of low voltage tubular capacitor
probes where the fuel becomes the dielectric. At different fuel levels, different values of
capacitance are measured and therefore the level of fuel can be determined. In early
designs, the profiles and values of individual probes were chosen to compensate for fuel
tank shape and aircraft pitch and roll attitudes.X
This GSM based fuel monitoring system is further improvised by implementing GPS
technology by which the vehicle can also be tracked its location. By this technology the
vehicle theft can be reduced and the vehicles will be highly secured.
REFERENCES
MuhammadAliMazid
JaniceGillispieMazid
ü
KennethJ.Ayala
v
Fundamentals of Micro processors and Micro computers
ü
B. Ram
v
Electronic Components
ü
D.V.Prasad
www.national.com X
www.atmel.com X
www.microsoftsearch.com X
www.geocities.com X
SAVE FUEL FOR FUTURE GENERATIONS.
THANK YOU
J J J J
DEPT. OF ECE, BRIL Page 88