Академический Документы
Профессиональный Документы
Культура Документы
2013
1. INTRODUCTION
As the goal of this project, we see a device that can detect ailments in a patient and
inform them to the concerned medical personnel, without the intervention of even the patient
himself. This process is done with the help of GSM technology. The GSM technology is used
for reading and sending SMS to the concerned person.
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 900 MHz. It is
estimated that many countries outside of Europe will join the GSM partnership.
FIGURE1:BLOCK DIAGRAM
The heart beat circuitry consists of a Quad Op-amp IC and three electrodes. These
electrodes are placed to the patient who is suffering with high B.P as well as heart problems.
The output of this circuitry is considered into logic levels and this output is given to one of
the pin of the micro controller.
The GSM Modem is used for sending and receiving messages from the patient to a
doctor and vice versa. Whenever the heart beat rate or the B.P. exceeds the threshold value.
The micro controller will automatically send the signals to the GSM Modem. Through the
GSM Modem, the message will gives to the concerned person or a doctor.
The LCD display is used to display the status of the GSM modem and as well as the
heart beat rate continuously.
For the circuitry operation, it requires the +5V DC power supply.
3.CIRCUIT SCHEMATICS
The circuit schematic is divided into four modules
3.1 LM35 sensor interfaced with AT89C52
3.2 Heart rate sensor interfaced with AT89C52
3.3 GSM interfaced with AT89C52.
3.4 LCD interfaced with AT89C52.
C). The sensor circuitry is sealed and therefore it is not subjected to oxidation and other
processes. With LM35, temperature can be measured more accurately than with a
thermistor. It also possess low self heating and does not cause more than 0.1 oC temperature
rise in still air.
Analog to digital converters find huge application as an intermediate device to convert the
signals from analog to digital form. These digital signals are used for further processing by
the digital processors. Various sensors like temperature, pressure, force etc. convert the
physical characteristics into electrical signals that are analog in nature.
The heart beat sensor (Electrodes) circuitry is connected to the P3.2 of the micro
controller. The heart beat circuitry consists of a Quad Op-amp IC and three electrodes. These
electrodes are placed to the patient who is suffering with high B.P as well as heart problems.
The output of this circuitry is considered into logic levels and this output is given to one of
the pin of the micro controller.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 5
In order to interface the GSM to the microcontroller we are using the UART device. One pin
of UART is connected to GSM . DTE and DCE
The terms DTE and DCE are very common in the data communications market. DTE is short
for Data Terminal Equipment and DCE stands for Data Communications Equipment. As the
full DTE name indicates this is a piece of device that ends a communication line, whereas the
DCE provides a path for communication.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 6
Functions
Signals
PIN
DTE
DCE
Data
TxD
Output
Input
RxD
Input
Output
RTS
Output
Input
CTS
Input
Output
Input
Output
DCD
Input
Output
STR
Output
Input
Common
Com
--
--
Other
RI
Output
Input
Handshake
TABLE1:RS-232 SIGNALS
RS-232 Signals
1. Transmitted Data (TxD)
Data sent from DTE to DCE.
2. Received Data (RxD)
Data sent from DCE to DTE.
3. Request To Send (RTS)
Asserted (set to 0) by DTE to prepare DCE to receive data. This may require action
on
the part of the DCE, e.g. transmitting a carrier or reversing the direction of a half-
duplex line.
4. Clear To Send (CTS)
Asserted by DCE to acknowledge RTS and allow DTE to transmit.
5. Data Terminal Ready (DTR)
Asserted by DTE to indicate that it is ready to be connected. If the DCE is a modem,
it should go "off hook" when it receives this signal. If this signal is de-asserted, the modem
should respond by immediately hanging up.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 8
RTS/CTS Handshaking
The standard RS-232 use of the RTS and CTS lines is asymmetrical. The DTE asserts RTS to
indicate a desire to transmit and the DCE asserts CTS in response to grant permission. This
allows for half-duplex modems that disable their transmitters when not required and must
transmit a synchronization preamble to the receiver when they are re-enabled. There is no
way for the DTE to indicate that it is unable to accept data from the DCE. A non-standard
symmetrical alternative is widely used: CTS indicates permission from the DCE for the DTE
to transmit, and RTS indicates permission from the DTE for the DCE to transmit. The
"request to transmit" is implicit and continuous. The standard defines RTS/CTS as the
signaling protocol for flow control for data transmitted from DTE to DCE. The standard has
no provision for flow control in the other direction. In practice, most hardware seems to have
repurposed the RTS signal for this function. A minimal 3-wire RS-232 connection
consisting only of transmits data, receives data and
Ground, and is commonly used when the full facilities of RS-232 are not required. When
only flow control is required, the RTS and CTS lines are added in a 5-wire version. In our
The LCD is interfaced with microcontroller (AT89C52). This microcontroller has 40 pins
with four 8-bit ports (P0, P1, P2, and P3). Here P1 is used as output port which is connected to
data pins of the LCD. The control pins (pin 4-6) are controlled by pins 2-4 of P0 port. Pin 3 is
connected to a preset of 10k? to adjust the contrast on LCD screen.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this
LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers.
1.
command is an instruction given to LCD to do a predefined task like initializing, clearing the
screen, setting the cursor position, controlling display etc.
2.
Data Register - stores the data to be displayed on the LCD. The data is the ASCII value
TABLE2:LCD COMMANDS
4HARDWARE COMPONENTS
The hardware components used in this circuit diagram are
4.1 MICRO CONTROLLER (AT89C52)
4.2 LM35 SENSOR
4.3 LCD
4.4 GSM
4.5 HEARTBEAT SENSOR
4.6 LDR
4.7 ADC
4.8 POWER SUPPLY
4.9 POTENTIOMETER
just sufficient for our application. The on-chip Flash ROM allows the program memory to be
reprogrammed in system or by conventional non-volatile memory Programmer. Moreover
ATMEL is the leader in flash technology in todays market place and hence using AT 89C52
is the optimal solution.
Code memory
Code memory is the memory that holds the actual 89C51 programs that is to be run.
This memory is limited to 64K. Code memory may be found on-chip or off-chip. It is
possible to have 4K of code memory on-chip and 60K off chip memory simultaneously. If
Internal RAM
The 89C51 have a bank of 128 of internal RAM. The internal RAM is found on-chip.
So it is the fastest Ram available. And also it is most flexible in terms of reading and writing.
Internal Ram is volatile, so when 89C51 is reset, this memory is cleared. 128 bytes of internal
memory are subdivided. The first 32 bytes are divided into 4 register banks. Each bank
contains 8 registers. Internal RAM also contains 128 bits, which are addressed from 20h to
2Fh. These bits are bit addressed i.e. each individual bit of a byte can be addressed by the
user. They are numbered 00h to 7Fh. The user may make use of these variables with
commands such as SETB and CLR.
Flash memory is a nonvolatile memory using NOR technology, which allows the user
to electrically program and erase information. Flash memory is used in digital cellular
phones, digital cameras, LAN switches, PC Cards for notebook computers, digital set-up
boxes, embedded controllers, and other devices.
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 1sare written to port 0 pins, the pins can be used as high
impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data
bus during accesses to external program and data memory. In this mode P0 has internal pullups. 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.
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 output pulse for latching the low byte of the address during
accesses 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/6the oscillator
frequency, and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external Data Memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit
set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly
pulled high. Setting the ALE-disable bit has no effect if the micro controller is in external
execution mode.
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.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2
Output from the inverting oscillator amplifier.
3.1.7 REGISTERS:
In the CPU, registers are used to store information temporarily. That information
could be a byte of data to be processed, or an address pointing to the data to be fetched. The
vast majority of 8051 registers are 8bit registers.
D7
D6
D5
D4
D3
D2
D1
D0
The most widely used registers of the 8051 are A(accumulator), B, R0, R1, R2, R3,
R4, R5, R6, R7, DPTR(data pointer), and PC(program counter). All of the above registers
are 8-bits, except DPTR and the program counter. The accumulator, register A, is used for all
arithmetic and logic instructions.
Name
Address
ACC
Accumulator
0E0H
B register
0F0H
PSW
0D0H
SP
Stack pointer
81H
DPTR
DPL
Low byte
82H
DPH
High byte
83H
P0
Port0
80H
P1
Port1
90H
P2
Port2
0A0H
P3
Port3
0B0H
IP
0B8H
IE
0A8H
TMOD
89H
TCON
Timer/counter control
88H
T2CON
Timer/counter 2 control
0C8H
T2MOD
0C9H
TH0
8CH
TL0
8AH
TH1
8DH
TL1
8BH
TH2
0CDH
TL2
0CCH
0CBH
RCAP2L
0CAH
Serial control
98H
SBUF
99H
PCON
Power control
87H
A Register (Accumulator)
This is a general-purpose register, which serves for storing intermediate results during
operating. A number (an operand) should be added to the accumulator prior to execute an
instruction upon it. Once an arithmetical operation is preformed by the ALU, the result is
placed into the accumulator
B Register
B register is used during multiply and divide operations which can be performed only
upon numbers stored in the A and B registers. All other instructions in the program can use
this register as a spare accumulator (A).
Registers (R0-R7)
This is a common name for the total 8 general purpose registers (R0, R1, R2 ...R7).
Even they are not true SFRs, they deserve to be discussed here because of their purpose. The
bank is active when the R registers it includes are in use. Similar to the accumulator, they are
used for temporary storing variables and intermediate results. Which of the banks will be
active depends on two bits included in the PSW Register. These registers are stored in four
banks in the scope of RAM.
This is one of the most important SFRs. The Program Status Word (PSW) contains
several status bits that reflect the current state of the CPU. This register contains: Carry bit,
Auxiliary Carry, two register bank select bits, Overflow flag, parity bit, and user-definable
status flag. The ALU automatically changes some of registers bits, which is usually used in
regulation of the program performing.
P - Parity bit. If a number in accumulator is even then this bit will be automatically
set (1), otherwise it will be cleared (0). It is mainly used during data transmission and
receiving via serial communication.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 25
RS2
Space in RAM
Bank0 00h-07h
Bank1 08h-0Fh
Bank2 10h-17h
Bank3 18h-1Fh
SP
Register
(Stack
Pointer)
The stack is a section of RAM used by the CPU to store information temporily. This
information could be data or an address. The CPU needs this storage area since there are
only a limited number of registers.
How stacks are accessed in the 8051
If the stack is a section of RAM, there must be registers inside the CPU to point to it.
The register used to access the stack is called the SP (Stack point) Register. The stack pointer
in the 8051 is only 8 bits wide; which means that it can take values of 00 to FFH. When the
8051 is powered up, the SP register contains value 07. This means that RAM location 08 is
the first location used for the stack by the 8051. The storing of a CPU register in the stack is
called a PUSH, and pulling the contents off the stack back into a CPU register is called a
POP. In other words, a register is pushed onto the stack to save it and popped off the stack to
retrieve it. The job of the SP is very critical when push and pop actions are performed.
3.1.11 TIMERS:
On-chip timing/counting facility has proved the capabilities of the micro controller for
implementing the real time application. These includes pulse counting, frequency
measurement, pulse width measurement, baud rate generation, etc,. Having sufficient number
of timer/counters may be a need in a certain design application. The 8051 has two
timers/counters. They can be used either as timers to generate a time delay or as counters to
count events happening outside the micro controller.
TIMER 0 REGISTERS
The 16-bit register of Timer 0 is accessed as low byte and high byte. the low byte
register is called TL0(Timer 0 low byte)and the high byte register is referred to as TH0(Timer
0 high byte).These register can be accessed like any other register, such as A,B,R0,R1,R2,etc.
TIMER 1 REGISTERS
GATE
C/T
M1
M0
MODE
Operating Mode
prescaler
8-bit auto reload 8-bit auto reload timer/counter;THx Holds a value
TABLE6:TMOD SELECTION
C/T (clock/timer)
This bit in the TMOD register is used to decide whether the timer is used as a delay
generator or an event counter. If C/T=0, it is used as a timer for time delay generation. The
clock source for the time delay is the crystal frequency of the 8051.this section is concerned
with this choice. The timers use as an event counter is discussed in the next section.
In the
asynchronous method, each character is placed between start and stop bits. This is called
framing. In the data framing for asynchronous communications, the data, such as ASCII
characters, are packed between a start bit and a stop bit. The start bit is always one bit, but the
stop bit can be one or two bits. The start bit is always a 0 (low) and the stop bit (s) is 1
(high).
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.
terminology and is defined as the number of signal changes per second. In modems a single
change of signal, sometimes transfers several bits of data. As far as the conductor wire is
concerned, the baud rate and bps are the same, and for this reason we use the bps and baud
interchangeably.
equipment. However, since the standard was set long before the advert of the TTL logic
family, its input and output voltage levels are not TTL compatible.
In RS232, a 1 is
Description
Data carrier detect (DCD)
Received data (RXD)
Transmitted data (TXD)
Data terminal ready(DTR)
Signal ground (GND)
Data set ready (DSR)
Request to send (RTS)
Clear to send (CTS)
Ring indicator (RI)
TABLE 7 : DB9 PIN FUNCTIONS
Note: DCD, DSR, RTS and CTS are active low pins.
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
Communications are these
TXD: carries data from DTE to the DCE.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 32
The 8051 has two pins that are used specifically for transferring and receiving data
serially. These two pins are called TXD and RXD and a part of the port 3 group (P3.0 and
P3.1). pin 11 of the 8051 is assigned to TXD and pin 10 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.
Since the RS232 is not compatible with todays microprocessors and microcontrollers,
we need a line driver (voltage converter) 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
MAX232 from Maxim Corp. The MAX232 converts from RS232 voltage levels to TTL
voltage levels, and vice versa.
3.1.15 INTERRUPTS:
A single micro controller can serve several devices. There are two ways to do that:
INTERRUPTS or POLLING.
INTERRUPTS vs POLLING
The advantage of interrupts is that the micro controller can serve many devices (not
all the same time, of course); each device can get the attention of the micro controller based
on the priority assigned to it. The polling method cannot assign priority since it checks all
devices in round-robin fashion. More importantly, in the interrupt method the micro
controller can also ignore (mask) a device request for service. This is again not possible with
the polling method. The most important reason that the interrupt method is preferable is that
the polling method wastes much of the micro controllers time by polling devices that do not
need service. So, in order to avoid tying down the micro controller, interrupts are used.
ROM
PIN
FLAG CLEARING
LOCATION
Reset
(HEX)
0000
auto
0003
P3.2 (12)
auto
Timers0interrupt(TF0)
000B
P3.4 (14)
auto
0013
P3.3 (13)
auto
001B
P3. 5(15)
auto
0023
10,11
Programmer
Clears it
D6
EA
D5
--
D4
ET2
D3
ES
EX0
D2
ET1
D1
EX1
D0
ET0
IE.7
-ET2
IE.6
Only).
ES
IE.4
ET1
IE.3
EX1
IE.2
ET0
IE.1
EX0
IE.0
The LM35s low output impedance, linear output, and precise inherent calibration make
interfacing to readout or control circuitry especially easy. It can be used with single power
supplies, or with plus and minus supplies. As it draws only 60 A from its supply, it has very
low self-heating, less than 0.1C in still air.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 36
Each pixel of an LCD typically consists of a layer of molecules aligned between two
transparent electrodes, and two polarizing filters the axes of transmission of which are (in
most of the cases) perpendicular to each other. With no actual liquid crystal between the
polarizing filters, light passing through the first filter would be blocked by the second
(crossed) polarizer. In most of the cases the liquid crystal has double refraction
The surface of the electrodes that are in contact with the liquid crystal material are
treated so as to align the liquid crystal molecules in a particular direction. This treatment
typically consists of a thin polymer layer that is unidirectionally rubbed using, for example, a
LCD with top polarizer removed from device and placed on top, such that the top and
bottom polarizers are parallel.
The optical effect of a twisted nematic device in the voltage-on state is far less
dependent on variations in the device thickness than that in the voltage-off state. Because of
this, these devices are usually operated between crossed polarizer such that they appear bright
with no voltage . These devices can also be operated between parallel polarizer, in which case
the bright and dark states are reversed. The voltage-off dark state in this configuration
appears blotchy, however, because of small variations of thickness across the device.
CONTROL LINES
EN:
Line is called "Enable." This control line is used to tell the LCD that you are sending
it data. To send data to the LCD, your program should make sure this line is low (0) and then
set the other two control lines and/or put data on the data bus. When the other lines are
completely ready, bring EN high (1) and wait for the minimum amount of time required by
the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.
RS:
Line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high
(1), the data being sent is text data which would be displayed on the screen. For example, to
display the letter "T" on the screen you would set RS high.
RW:
Line is the "Read/Write" control line. When RW is low (0), the information on the
data bus is being written to the LCD. When RW is high (1), the program is effectively
In 1987, a memorandum of
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 in England
and then in Asia (Hong-Kong and Japan).
GSM (Global System for Mobile communications) is the most commonly used
standard in Europe at the end of the 20th century and supported in the United States.
This standard uses the 900 MHz and 1800 MHz frequency bands in Europe. In the
United States, however, the frequency band used is the 1900 MHz band. Portable
telephones that are able to operate in Europe and the United States are therefore
called tri-band.
CDMA (Code Division Multiple Access) uses a spread spectrum technique that allows
a radio signal to be broadcast over a large frequency range.
With the 2G networks, it is possible to transmit voice and low volume digital data, for
example text messages (SMS, for Short Message Service) or multimedia messages (MMS,
for Multimedia Message Service). The GSM standard allows a maximum data rate of 9.6
kbps.
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
main
3G
standard
used
in
Europe
is
Mobile
Telecommunications System) and uses WCDMA (Wideband Code Division Multiple Access)
encoding. UMTS technology uses 5 MHz bands for transferring voice and data, with data
rates that can range from 384 Kbps to 2 Mbps. HSDPA (High Speed Downlink Packet
Access) is a third generation mobile telephony protocol, (considered as "3.5G"), which is able
to reach data rates on the order of 8 to 10 Mbps. HSDPA technology uses the 5 GHz
frequency band and uses WCDMA encoding.
Introduction to the GSM Standard
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
callers 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
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 49
Cellular networks are based on the use of a central transmitter-receiver in each 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 cellular network, each cell is surrounded by 6 neighbouring cells (thus a cell is generally
drawn as a hexagon). To avoid interference, adjacent cells cannot use the same frequency. In
practice, two cells using the same frequency range must be separated by a distance of two to
three times the diameter of the cell.
Architecture of the GSM Network
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 identified and a
mobile terminal.
The terminals (devices) are identified by a unique 15-digit identification number
called IMEI (International Mobile 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.
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 to a Network Station
Subsystem (NSS), which is responsible for managing user 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 in
the area of the switch (MSC).
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
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 52
Introduction to Modem:
Authentication key
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.
Introduction to AT Commands
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 56
whether
facility
is
locked
(AT+CLCK)
and
changing
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.])
Control the presentation of result codes / error messages of AT commands. For
example, the user can control whether to enable certain error messages (AT+CMEE)
and whether error messages should be displayed in numeric format or verbose format
(AT+CMEE=1 or AT+CMEE=2).
Get or change the configurations of the mobile phone or GSM/GPRS modem. For
example, change the GSM network (AT+COPS), bearer service type (AT+CBST),
radio link protocol parameters (AT+CRLP), SMS center address (AT+CSCA) and
storage of SMS messages (AT+CPMS).
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
messaging such as the SMS center address.
It should be noted that the mobile phone manufacturers usually do not implement all AT
commands, command parameters and parameter values in their mobile phones. Also, the
behavior of the implemented AT commands may be different from that defined in the
standard. In general, GSM modems, designed for wireless applications, have better support of
AT commands than ordinary mobile phones.
Basic concepts of SMS technology
1. Validity Period of an SMS Message
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.
FIGURE20: LDR
The output of the LDR is given to ADC which converts the analog intensity value into
corresponding digital data and presents this data as the input to the microcontroller
Pin description:
CS (Chip select): Chip select is an active low input used to activate the ADC0804 chip. To
access the ADC0804, this pin must be low.
RD (read): This is an input signal and is active low. ADC converts the analog input to its
binary equivalent and holds it in an internal register. RD is used to get the data out of
ADC0804 chip. When CS=0, if a high-to-low pulse is applied to the RD pin, the 8-bit digital
output shows up at the D0-D7 data pins.
WR (write): This is an active low input used to inform the ADC0804 to start the conversion
process. If CS=0 when WR makes a low-to-high transition, the ADC0804 starts converting
the analog input value Vin to an 8-bit digital value. The amount of time it takes to convert
varies depending on the CLK IN and CLK R values.
CLK IN and CLK R: CLK IN is an input pin connected to an external clock source when an
external clock is used for timing. However, the 804 has an internal clock generator. To use the
internal clock generator of the ADC0804, the CLK IN and CLK R are connected to a
capacitor and a resistor. In that case, the clock frequency is determined by the equation:
f = 1/ (1.1RC)
Typical values are R=10K ohms and C= 150 pf. Substituting in the above equation, the
frequency is calculated as 606 kHz. Thus, the conversion time is 110s.
INTR: This is an output pin and is active low. It is a normally high pin and when the
conversion is finished, it goes low to signal the CPU that the converted data is ready to be
picked up. After INTR goes low, the CS pin is made low i.e., CS=0 and send a high-to-low
pulse to the RD pin to get the data out of the ADC0804 chip.
Vin(+) and Vin(-): These are the differential analog inputs where Vin=Vin(+) Vin(-). The
Vin(-) pin is connected to ground and the Vin(+) pin is used as the analog input to be
converted to digital.
FIGURE 21:ADC
4.8POWER SUPPLY:
The power supply are designed to convert high voltage AC mains electricity to a
suitable low voltage supply for electronics circuits and other devices. A power supply can by
broken down into a series of blocks, each of which performs a particular function. A d.c
power supply which maintains the output voltage constant irrespective of a.c mains
fluctuations or load variations is known as Regulated D.C Power Supply
For example a 5V regulated power supply system as shown below:
3.5.1 TRANSFORMER:
A transformer is an electrical device which is used to convert electrical power from
one electrical circuit to another without change in frequency.
Transformers convert AC electricity from one voltage to another with little loss of
power. Transformers work only with AC and this is one of the reasons why mains electricity
is AC. Step-up transformers increase in output voltage, step-down transformers decrease in
output voltage. Most power supplies use a step-down transformer to reduce the dangerously
high mains voltage to a safer low voltage. The input coil is called the primary and the output
coil is called the secondary. There is no electrical connection between the two coils; instead
they are linked by an alternating magnetic field created in the soft-iron core of the
transformer. The two lines in the middle of the circuit symbol represent the core.
Transformers waste very little power so the power out is (almost) equal to the power in. Note
that as voltage is stepped down current is stepped up. The ratio of the number of turns on
each coil, called the turns ratio, determines the ratio of the voltages. A step-down transformer
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 66
3.5.2 RECTIFIER:
A circuit, which is used to convert a.c to d.c, is known as RECTIFIER. The process of
conversion a.c to d.c is called rectification
TYPES OF RECTIFIERS
Half wave
Full wave
Bridge
Number of diodes
1
2Vm
Vm
PIV of diodes
Vm
Vdc, at
Vm/
0.318Vm
2Vm/
0.636Vm
2Vm/
0.636Vm
no-load
Ripple factor
1.21
0.482
0.482
2f
2f
0.812
0.812
Ripple
frequency
Rectification
efficiency
0.406
Transformer
0.287
0.693
0.812
Factor(TUF)
RMS voltage Vrms
Vm/2
Vm/2
Vm/2
Operation
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 69
4.8.3 FILTER :
A Filter is a device, which removes the a.c component of rectifier output but allows
the d.c component to reach the load
Capacitor Filter
We have seen that the ripple content in the rectified output of half wave rectifier is
121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high percentages
of ripples is not acceptable for most of the applications. Ripples can be removed by one of the
following methods of filtering:
(a) A capacitor, in parallel to the load, provides an easier by pass for the ripples voltage
though it due to low impedance. At ripple frequency and leave the d.c.to appears the load.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 70
section filter,
multiple section filter etc. which make use of both the properties mentioned in (a) and (b)
above. Two cases of capacitor filter, one applied on half wave rectifier and another with full
wave rectifier.
Filtering is performed by a large value electrolytic capacitor connected across the DC
supply to act as a reservoir, supplying current to the output when the varying DC voltage
from the rectifier is falling. The capacitor charges quickly near the peak of the varying DC,
and then discharges as it supplies current to the output. Filtering significantly increases the
average DC voltage to almost the peak value (1.4 RMS value).
To calculate the value of capacitor(C),
C = *3*f*r*Rl
Where,
f = supply frequency,
r = ripple factor,
Rl = load resistance
Note: In our circuit we are using 1000microfarads.
4.8.4 REGULATOR
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable
output voltages. The maximum current they can pass also rates them. Negative voltage
regulators are available, mainly for use in dual supplies. Most regulators include some
automatic protection from excessive current ('overload protection') and overheating ('thermal
protection'). Many of the fixed voltage regulator ICs have 3 leads and look like power
transistors, such as the 7805 +5V 1A regulator shown on the right. The LM7805 is simple to
use. You simply connect the positive lead of your unregulated DC power supply (anything
from 9VDC to 24VDC) to the Input pin, connect the negative lead to the Common pin and
then when you turn on the power, you get a 5 volt supply from the output pin.
78XX
The Bay Linear LM78XX is integrated linear positive regulator with three terminals.
The LM78XX offer several fixed output voltages making them useful in wide range of
applications. When used as a zener diode/resistor combination replacement, the LM78XX
usually results in an effective output impedance improvement of two orders of magnitude,
lower quiescent current. The LM78XX is available in the TO-252, TO-220 & TO263packages,
Features
Output Current of 1.5A
Output Voltage Tolerance of 5%
Internal thermal overload protection
Internal Short-Circuit Limited
No External Component
Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V
Offer in plastic TO-252, TO-220 & TO-263
Direct Replacement for LM78XX
4.9POTENTIOMETER:
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 72
FIGURE28:POTENTIOMETER
Potentiometers are rarely used to directly control significant power (more than a watt).
Instead they are used to adjust the level of analog signals (e.g. volume controls on audio
equipment), and as control inputs for electronic circuits.
4.10 RESISTOR:
A resistor is a two-terminal passive electronic component which implements electrical
resistance as a circuit element. When a voltage V is applied across the terminals of a resistor,
a current I will flow through the resistor in direct proportion to that voltage. The reciprocal of
the constant of proportionality is known as the resistance R, since, with a given voltage V, a
larger value of R further "resists" the flow of current I as given by Ohm's law:
Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in most electronic equipment. Practical resistors can be made of various
compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such
as nickel-chrome). Resistors are also implemented within integrated circuits, particularly
analog devices, and can also be integrated into hybrid and printed circuits.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 73
4.11 CAPACITOR:
in electronics,
a ceramic
capacitor is
a capacitor constructed
of
alternating
layers
of metal and ceramic, with the ceramic material acting as the dielectric. The coefficient
depends on whether the dielectric is Class 1 or Class 2. A ceramic capacitor (especially the
class 2) often has high dissipation factor, high frequency coefficient of dissipation
A ceramic capacitor is a two-terminal, non-polar device. The classical ceramic capacitor is
the "disc capacitor". This device pre-dates the transistor and was used extensively in vacuumtube equipment (e.g., radio receivers) from about 1930 through the 1950s, and in discrete
transistor equipment from the 1950s through the 1980s. As of 2007, ceramic disc capacitors
are in widespread use in electronic equipment, providing high capacity and small size at low
price compared to other low value capacitor types.
bare leadless disc, sits in a slot in the PCB and is soldered in place, used for UHF
applications
Class I capacitors: accurate, temperature-compensating capacitors. They are the most stable
over voltage, temperature, and to some extent, frequency. They also have the lowest losses.
On the other hand, they have the lowest volumetric efficiency. A typical class I capacitor will
have a temperature coefficient of 30 ppm/C. This will typically be fairly linear with
temperature. These also allow for high Q filtersa typical class I capacitor will have a
dissipation factor of 0.15%. Very high accuracy (~1%) class I capacitors are available (typical
ones will be 5% or 10%). The highest accuracy class 1 capacitors are designated C0G
or NP0.
Class II capacitors: better volumetric efficiency, but lower accuracy and stability. A typical
class II capacitor may change capacitance by 15% over a 55 C to 85 C temperature range.
A typical class II capacitor will have a dissipation factor of 2.5%. It will have average to poor
accuracy (from 10% down to +20/-80%).
Class III capacitors: high volumetric efficiency, but poor accuracy and stability. A typical
class III capacitor will change capacitance by -22% to +56% over a temperature range of 10
C to 55 C. It will have a dissipation factor of 4%. It will have fairly poor accuracy
(commonly, 20%, or +80/-20%). These are typically used for decoupling or in other power
supply applications.
At one point, Class IV capacitors were also available, with worse electrical characteristics
than Class III, but even better volumetric efficiency. They are now rather rare and considered
obsolete, as modern multilayer ceramics can offer better performance in a compact package.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 75
ELECTROLYTIC CAPACITOR
Very low supply current drain (500 A)essentially independent of supply voltage
Connection Diagram:
The simplest solution is to connect simple RC circuit which will suppress each quick voltage
change. Since the bouncing time is not defined, the values of elements are not strictly
determined. In the most cases, the values shown on figure are sufficient.
If complete safety is needed, radical measures should be taken. The circuit (RS flip-flop)
changes logic state on its output with the first pulse triggered by contact bounce. Even though
this is more expensive solution (SPDT switch), the problem is definitely resolved. Besides,
since the condensator is not used, very short pulses can be also registered in this way. In
addition to these hardware solutions, a simple software solution is also commonly applied.
When a program tests the state of some input pin and finds changes, the check should be done
one more time after certain time delay. If the change is confirmed, it means that switch (or
pushbutton) has changed its position. The advantages of such solution are: it is free of charge,
effects of disturbances are eliminated and it can be adjusted to the worst-quality contacts.
Switch Interfacing with 8051:
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 79
For any pin to be used as an input pin, a HIGH (1) should be written to the pin if the pin
will always to be read as LOW.In the above figure, when the switch is not pressed, the 10k
resistor provides the current needed for LOGIC 1 and closure of switch provides LOGIC 0 to
the controller PIN.
Keil Compiler:
Keil compiler is software used where the machine language code is written and
compiled. After compilation, the machine source code is converted into hex code which is to
be dumped into the microcontroller for further processing. Keil compiler also supports C
language code.
Proload:
Proload is software which accepts only hex files. Once the machine code is converted
into hex code, that hex code has to be dumped into the microcontroller and this is done by the
Proload. Proload is a programmer which itself contains a microcontroller in it other than the
one which is to be programmed. This microcontroller has a program in it written in such a
way that it accepts the hex file from the Keil compiler and dumps this hex file into the
microcontroller which is to be programmed. As the Proload programmer kit requires power
supply to be operated, this power supply is given from the power supply circuit designed
above. It should be noted that this programmer kit contains a power supply section in the
board itself but in order to switch on that power supply, a source is required. Thus this is
accomplished from the power supply board with an output of 12volts.
Programming Software
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 84
4.15 PROGRAM:
#include<reg52.h>
#include<serial.h>
#include<lcd.h>
//PORT1 FOR ADC0804
sbit intr=P3^2;
unsigned char countx=0;
void convgsm(unsigned int ch)
{
unsigned int temp=0,temp2=0;
temp2=ch;
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 85
temp2=temp2%1000;
temp=temp2/100;
tx(temp+0x30);
//dlcd(temp+0x30);
temp2=temp2%100;
temp=temp2/10;
tx(temp+0x30);
//dlcd(temp+0x30);
temp2=temp2%10;
tx(temp2+0x30);
//dlcd(temp2+0x30);
}
void sendmsg(unsigned char *chrm)
{
int i=0;
{
do
{
txs("AT\r\n");
}while(rx()!='O');
txs("AT+CREG?\r\n");
delay(400);
txs("AT+CMGF=1\r\n");
delay(400);
txs("AT+CNMI=1,2,0,0\r\n");
delay(400);
}
sbit aintr4=P0^3;
sbit ard=P0^1;
sbit awr=P0^2;
sbit acs=P0^0;
#define adcport P1
");
serialinit();
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 88
");
");
intr=1;
while(1)
{
//
countx++;
//delay(300);
//
//
tx(timer_count);
if(countx==15)
{
countx=0;
txs("AT+CMGS=\"8897376635\"\r\n"); //here phone number
delay(300);
txs("temperature value is ");
clcd(0x85);
convgsm(adc0804());
if(count==2)
{
convgsm(70);
}
if(count==3)
{
convgsm(73);
}
if(count==4)
{
convgsm(71);
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 90
if(count==5)
{
convgsm(69);
}
if(count==6)
{
convgsm(74);
}
if(count==7)
{
convgsm(72);
}
if(count==8)
{
convgsm(70);
}
if(count==9)
{
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 91
tx(0x1a);
clcd(0x85);
dlcd('s');
dlcd(' ');
dlcd(' ');
delay(400);
}
else
{
clcd(0x85);
conv2(adc0804());
clcd(0xcc);
if(intr==1)
{
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 92
if(count==3)
{
conv2(73);
}
if(count==4)
{
conv2(71);
}
if(count==5)
{
conv2(69);
}
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 93
if(count==6)
{
conv2(74);
}
if(count==7)
{
conv2(72);
}
if(count==8)
{
conv2(70);
}
if(count==9)
{
count=0;
conv2(71);
}
}
else
{
conv2(0);
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 94
}
delay(400);
countx++;
}
}
5.1ADVANTAGES:
1.
2.
3.
4.
5.
6.
7.
5.2 DISADVANTAGES:
1. The sensors are costly
2. If power supply fails circuit wont work
6.1APPLICATIONS:
1.Heart rate monitor can be used in hospitals for the diagnostic purposes.
2.Since the instrument is not expensive, it can even be used at home.
3.The instrument also has the flexibility which helps us to affix it to vehicles,etc..
4.The other part of the instrument ,which measures the temperature can also be used in
hospitals for diagnostic purpose.
5.The instrument can also be integrated with higher level equipment and used in various
applications.
6.The instrument can also be used in watches,etc.
7. By using this Old age people Heart Rate remote monitoring continuously.
8.Central diagnostic system implementation in hospitals.
7.FLOW CHART:
FIGURE34:FLOW CHART
8.2SNAPSHOTS:
FIGURE35:SNAPSHOT