Documentation

Published on June 2016 | Categories: Documents | Downloads: 78 | Comments: 0 | Views: 526
of 74
Download PDF   Embed   Report

Comments

Content

GSM BASEDPATIENT MONITORIG SYSTEM
2013

PIR + GSM based Hospital patient
monitoring Security
Abstract Today we are living in 21st century where crime become increasing and everyone
wants to secure they asset at their home. In that situation user must have system with advance
technology so person do not worry when getting away from his home. It is therefore the
purpose of this design to provide home security device, which send fast information to user
GSM (Global System for Mobile) mobile device using SMS (Short Messaging System) and
also activate - deactivate system by SMS. The Modular design of this Home Security System
make expandable their capability by add more sensors on that system. Hardware of this
system has been designed using microcontroller AT Mega 328, PIR (Passive Infra Red)
motion sensor as the primary sensor for motion detection, camera for capturing images, GSM
module for sending and receiving SMS and buzzer for alarm. For software this system using
Arduino IDE for Arduino and Putty for testing connection programming in GSM module.
This Home Security System can monitor home area that surrounding by PIR sensor and
sending SMS, save images capture by camera, and make people panic by turn on the buzzer
when trespassing surrounding area that detected by PIR sensor. The Modular Home Security
System has been tested and succeed detect human movement

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 1

GSM BASEDPATIENT MONITORIG SYSTEM
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.

Security is one thing that is very influential in today life, everyone needs security guarantees
when they work. Like health, security is an important aspect in life. Hence, various kinds of
development in the technology field is designed to provide ROBOLABS# 14-281, BigC
Street , Kamala Nagar,Besides, Ananthapuramu. Phone: 08554 222026
www.myrobolabs.com 2 security at all times to protect they assets and privacy. In addition to
the course with the application of security system, it can reduce the crime rate in the society
especially the crime of theft at home. Due to the increasingly rapid movement of people,
making them requires a security technology that has the characteristics of mobile technology
in terms of getting information easily and quickly. This Paper mainly focuses on providing
security when the user is away from home. SMS (Short Message Service) is a GSM mobile
technology that can perform remote communication wherever they are. Through this facility
messages can send quickly, accurately and at a low cost. Mobile phone with SMS facility will
be very useful when applied to integrated security systems, where the information send by a
security

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 2

GSM BASEDPATIENT MONITORIG SYSTEM
2013

2.1 BLOCK DIAGRAM:

FIGURE1:BLOCK DIAGRAM

2.2 BLOCK DIAGRAM DESCRIPTION:
Block diagram comprises of Microcontroller, heart beat sensor, temperature sensor, regulated
power supply, LCD display, ADC (analog to digital converter)
The heart beat and temperature sensor are interfaced to microcontroller via port pins . Heart
beat rate is produced from the LM358 op-amp temperature rate produced by LM35 is fed to

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 3

GSM BASEDPATIENT MONITORIG SYSTEM
2013
microcontroller via ADC(analog to digital converter). An LCD is used to display the sensed
data.
Most digital logic circuits and processors need a 5 volt power supply. To use these parts we
need to build a regulated 5 volt source. Usually you start with an unregulated power To make
a 5 volt power supply, we use a LM7805 voltage regulator IC (Integrated Circuit).

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.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 4

GSM BASEDPATIENT MONITORIG SYSTEM
2013

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.

3.3 GSM INTERFACED WITH AT89C52:

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 5

GSM BASEDPATIENT MONITORIG SYSTEM
2013

FIGURE4:GSM MODEM INTERFACEING CIRCUIT

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.
For example, the PC is a Data Terminal (DTE). The two modems (yours and that one of your
provider) are DCEs, they make the communication between you and your provider possible.
RS-232

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 6

GSM BASEDPATIENT MONITORIG SYSTEM
2013
In telecommunications, RS-232 is a standard for serial binary data signals connecting
between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment).
It is commonly used in computer serial ports. In RS-232, data is sent as a time-series of bits.
Both synchronous and asynchronous transmissions are supported by the standard. In addition
to the data circuits, the standard defines a number of control circuits used to manage the
connection between the DTE and DCE. Each data or control circuit only operates in one
direction that is, signaling from a DTE to the attached DCE or the reverse. Since transmit
data and receive data are separate circuits, the interface can operate in a full duplex manner,
supporting concurrent data flow in both directions. The standard does not define character
framing within the data stream, or character encoding.

FIGURE5: FEMALE 9 PIN PLUG

Functions

Signals

PIN

DTE

DCE

Data

TxD

3

Output

Input

RxD

2

Input

Output

RTS

7

Output

Input

CTS

8

Input

Output

DSR

6

Input

Output

DCD

1

Input

Output

Handshake

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 7

GSM BASEDPATIENT MONITORIG SYSTEM
2013
STR

4

Output

Input

Common

Com

5

--

--

Other

RI

9

Output

Input

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.
6. Data Set Ready (DSR)

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 8

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Asserted by DCE to indicate an active connection. If DCE is not a modem (e.g. a
null-modem cable or other equipment), this signal should be permanently asserted (set to 0),
possibly by a jumper to another signal.
7. Carrier Detect (CD)
Asserted by DCE when a connection has been established with remote equipment.
8. Ring Indicator (RI)
Asserted by DCE when it detects a ring signal from the telephone line.

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
case it was imperative that we connected the RTS line of the microcontroller (DTE) to ground
to enable receipt of bit streams from the modem.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 9

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Specifying Baud Rate, Parity & Stop bits
Serial communication using RS-232 requires that you specify four parameters: the baud rate
of the transmission, the number of data bits encoding a character, the sense of the optional
parity bit, and the number of stop bits. Each transmitted character is packaged in a character
frame that consists of a single start bit followed by the data bits, the optional parity bit, and
the stop bit or bits. A typical character frame encoding the letter "m" is shown here.

FIGURE6: CHARACTER FRAME ENCODING ‘M’
We specified the parameters as baud rate – 2400 bps, 8 data bits, no parity, and 1 stop bit
(2400-8-N-1). This was set in pre-operational phase while setting up the modem through the
hyper terminal, as per the serial transmission standards in 8052 microcontroller.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 10

GSM BASEDPATIENT MONITORIG SYSTEM
2013
3.1 Micro Controller Arduino
3.1.1 INTRODUCTION:
Arduino Uno

Arduino Uno R3 Front

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 11

Arduino Uno R3 Back

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Arduino Uno R2

Arduino Uno

Arduino Uno

Arduino Uno

Front

SMD

Front

Back

BUY ON STORE

BUY FROM DISTRIBUTORS

Overview
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14
digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset
button. It contains everything needed to support the microcontroller; simply connect it to a
computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed
as a USB-to-serial converter.


1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other
new pins placed near to the RESET pin, the IOREF that allow the shields to adapt to the
voltage provided from the board. In future, shields will be compatible with both the board
that uses the AVR, which operates with 5V and with the Arduino Due that operates with 3.3V.
The second one is a not connected pin, that is reserved for future purposes.



Stronger RESET circuit.



Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0. The
Uno and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is
the latest in a series of USB Arduino boards, and the reference model for the Arduino
platform; for a comparison with previous versions, see the index of Arduino boards.
Summary
Microcontroller

ATmega328

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 12

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Operating Voltage
Input Voltage
(recommended)

5V
7-12V

Input Voltage (limits)

6-20V

Digital I/O Pins

14 (of which 6 provide PWM output)

Analog Input Pins

6

DC Current per I/O Pin

40 mA

DC Current for 3.3V Pin

50 mA

Flash Memory

32 KB (ATmega328) of which 0.5 KB used by
bootloader

SRAM

2 KB (ATmega328)

EEPROM

1 KB (ATmega328)

Clock Speed

16 MHz

Length

68.6 mm

Width

53.4 mm

Weight

25 g

Schematic & Reference Design
EAGLE files: arduino-uno-Rev3-reference-design.zip (NOTE: works with Eagle 6.0 and
newer)
Schematic: arduino-uno-Rev3-schematic.pdf
Note: The Arduino reference design can use an Atmega8, 168, or 328, Current models use
an ATmega328, but an Atmega8 is shown in the schematic for reference. The pin
configuration is identical on all three processors.
Power
The Arduino Uno can be powered via the USB connection or with an external power supply.
The power source is selected automatically.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 13

GSM BASEDPATIENT MONITORIG SYSTEM
2013
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery.
The adapter can be connected by plugging a 2.1mm center-positive plug into the board's
power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the
POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using
more than 12V, the voltage regulator may overheat and damage the board. The recommended
range is 7 to 12 volts.
The power pins are as follows:


VIN. The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source). You can
supply voltage through this pin, or, if supplying voltage via the power jack, access it through
this pin.



5V.This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or
the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't advise it.



3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is
50 mA.



GND. Ground pins.



IOREF. This pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin voltage and
select the appropriate power source or enable voltage translators on the outputs for working
with the 5V or 3.3V.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 14

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Input and Output
Each of the 14 digital pins on the Uno can be used as an input or output,
using pinMode(), digitalWrite(), anddigitalRead() functions. They operate at 5 volts. Each pin
can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 kOhms. In addition, some pins have specialized functions:


Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial
chip.



External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for
details.



PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with
the analogWrite() function.



SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.



LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and
the analogReference() function. Additionally, some pins have specialized functionality:

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 15

GSM BASEDPATIENT MONITORIG SYSTEM
2013


TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.
There are a couple of other pins on the board:



AREF. Reference voltage for the analog inputs. Used with analogReference().



Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.
See also the mapping between Arduino pins and ATmega328 ports. The mapping for the
Atmega8, 168, and 328 is identical.
Communication
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on
the board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The '16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .inf file is required. The Arduino software
includes a serial monitor which allows simple textual data to be sent to and from the Arduino
board. The RX and TX LEDs on the board will flash when data is being transmitted via the
USB-to-serial chip and USB connection to the computer (but not for serial communication on
pins 0 and 1).
A SoftwareSerial library allows for serial communication on any of the Uno's digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus; see the documentation for details. For
SPI communication, use the SPI library.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 16

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Programming
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on your
board). For details, see the reference and tutorials.
The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you to
upload new code to it without the use of an external hardware programmer. It communicates
using the original STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP (InCircuit Serial Programming) header using Arduino ISP or similar; see these instructions for
details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available .
The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by:


On Rev1 boards: connecting the solder jumper on the back of the board (near the map
of Italy) and then resetting the 8U2.



On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
ground, making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader). See this user-contributed tutorial for more information.
Automatic (Software) Reset
Rather than requiring a physical press of the reset button before an upload, the Arduino Uno
is designed in a way that allows it to be reset by software running on a connected computer.
One of the hardware flow control lines (DTR) of theATmega8U2/16U2 is connected to the
reset line of the ATmega328 via a 100 nanofarad capacitor. When this line is asserted (taken
low), the reset line drops long enough to reset the chip. The Arduino software uses this
capability to allow you to upload code by simply pressing the upload button in the Arduino
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 17

GSM BASEDPATIENT MONITORIG SYSTEM
2013
environment. This means that the bootloader can have a shorter timeout, as the lowering of
DTR can be well-coordinated with the start of the upload.
This setup has other implications. When the Uno is connected to either a computer running
Mac OS X or Linux, it resets each time a connection is made to it from software (via USB).
For the following half-second or so, the bootloader is running on the Uno. While it is
programmed to ignore malformed data (i.e. anything besides an upload of new code), it will
intercept the first few bytes of data sent to the board after a connection is opened. If a sketch
running on the board receives one-time configuration or other data when it first starts, make
sure that the software with which it communicates waits a second after opening the
connection and before sending this data.
The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side of
the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be
able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line;
see this forum thread for details.
USB Overcurrent Protection
The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from
shorts and overcurrent. Although most computers provide their own internal protection, the
fuse provides an extra layer of protection. If more than 500 mA is applied to the USB port,
the fuse will automatically break the connection until the short or overload is removed.
Physical Characteristics
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with the
USB connector and power jack extending beyond the former dimension. Four screw holes
allow the board to be attached to a surface or case. Note that the distance between digital pins
7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the other pins.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 18

GSM BASEDPATIENT MONITORIG SYSTEM
2013

3.1.12 SERIAL COMMUNICATION:
Serial data communication uses two methods, asynchronous and synchronous. The
synchronous method transfers a block of data at a time, while the asynchronous method
transfers a single byte at a time.
In data transmission if the data can be transmitted and received, it is a duplex
transmission. This is in contrast to simplex transmissions such as with printers, in which the
computer only sends data. Duplex transmissions can be half or full duplex, depending on
whether or not the data transfer can be simultaneous. If data is transmitted one way at a time,
it is referred to as half duplex. If the data can go both ways at the same time, it is full duplex.
Of course, full duplex requires two wire conductors for the data lines, one for transmission
and one for reception, in order to transfer and receive data simultaneously.

Asynchronous serial communication and data framing
The data coming in at the receiving end of the data line in a serial data transfer is all
0s and 1s; it is difficult to make sense of the data unless the sender and receiver agree on a set
of rules, a protocol, on how the data is packed, how many bits constitute a character, and
when the data begins and ends.
Start and stop bits
Asynchronous serial data communication is widely used for character-oriented
transmissions, while block-oriented data transfers use the synchronous method.

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

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 19

GSM BASEDPATIENT MONITORIG SYSTEM
2013
The rate of data transfer in serial data communication is stated in bps (bits per
second). Another widely used terminology for bps is baud rate. However, the baud and bps
rates are not necessarily equal.

This is due to the fact that baud rate is the modem

terminology and is defined as the number of signal changes per second. In modems 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.

3.1.13 RS232 STANDARDS:
To allow compatibility among data communication equipment made by various
manufacturers, an interfacing standard called RS232 was set by the Electronics Industries
Association (EIA) in 1960. In 1963 it was modified and called RS232A. RS232B AND
RS232C were issued in 1965 and 1969, respectively. Today, RS232 is the most widely used
serial I/O interfacing standard.

This standard is used in PCs and numerous types of

equipment. However, since the standard was set long before the advert of the TTL logic
family, its input and output voltage levels are not TTL compatible.

In RS232, a 1 is

represented by -3 to -25V, while a 0 bit is +3 to +25V, making -3 to +3 undefined. For this
reason, to connect any RS232 to a micro controller system we must use voltage converters
such as MAX232 to convert the TTL logic levels to the RS232 voltage levels, and vice versa.
MAX232 IC chips are commonly referred to as line drivers.
RS232 pins
RS232 cable, commonly referred to as the DB-25 connector. In labeling, DB-25P
refers to the plug connector (male) and DB-25S is for the socket connector (female). Since
not all the pins are used in PC cables, IBM introduced the DB-9 Version of the serial I/O
standard, which uses 9 pins only, as shown in table.
DB-9 pin connector
12345
6789

FIG14: DB-9 PIN CONNECTOR
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 20

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Pin Functions
Pin
1
2
3
4
5
6
7
8
9

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.
RXD: carries data from DCE to the DTE
SG: signal ground

3.1.14 8052 CONNECTION TO RS232:
The RS232 standard is not TTL compatible; therefore, it requires a line driver such as
the MAX232 chip to convert RS232 voltage levels to TTL levels, and vice versa. The
interfacing of 8051 with RS232 connectors via the MAX232 chip is the main topic.

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.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 21

GSM BASEDPATIENT MONITORIG SYSTEM
2013

Since the RS232 is not compatible with today’s microprocessors and microcontrollers,
we need a line driver (voltage converter) to convert the RS232’s signals to TTL voltage levels
that will be acceptable to the 8051’s 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.

FIGURE 15:INTERFACING OF MAX-232 TO CONTROLLER

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

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 22

GSM BASEDPATIENT MONITORIG SYSTEM
2013
the polling method wastes much of the micro controller’s time by polling devices that do not
need service. So, in order to avoid tying down the micro controller, interrupts are used.

INTERRUPT SERVICE ROUTINE
For every interrupt, there must be an interrupt service routine (ISR), or interrupt
handler. When an interrupt is invoked, the micro controller runs the interrupts service routine.
For every interrupt, there is a fixed location in memory that holds the address of its ISR. The
group of memory location set aside to hold the addresses of ISRs is called the interrupt vector
table. Shown below:
INTERRUPT

ROM

PIN

FLAG CLEARING

LOCATION
(HEX)
0000

Reset

9

auto

External hardware Interrupt 0

0003

P3.2 (12)

auto

Timers0interrupt(TF0)

000B

P3.4 (14)

auto

External hardware Interrupt(INT1)

0013

P3.3 (13)

auto

Timers 1 interrupt (TF1)

001B

P3. 5(15)

auto

Serial COM (RI and TI)

0023

10,11

Programmer
Clears it

TABLE 8: INTERRUPT VECTOR TABLE FOR THE 8051

Six Interrupts in the 8051
In reality, only five interrupts are available to the user in the 8051, but many
manufacturers’ data sheets state that there are six interrupts since they include reset .the six
interrupts in the 8051 are allocated as above.
1. Reset. When the reset pin is activated, the 8051 jumps to address location 0000.this is
the power-up reset.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 23

GSM BASEDPATIENT MONITORIG SYSTEM
2013
2. Two interrupts are set aside for the timers: one for Timer 0 and one for Timer
1.Memory location 000BH and 001BH in the interrupt vector table belong to Timer 0
and Timer 1, respectively.
3. Two interrupts are set aside for hardware external harder interrupts. Pin number
12(P3.2) and 13(P3.3) in port 3 is for the external hardware interrupts INT0 and
INT1, respectively. These external interrupts are also referred to as EX1 and
EX2.Memory location 0003H and 0013H in the interrupt vector table are assigned to
INT0 and INT1, respectively.
4. Serial communication has a single interrupt that belongs to both receive and transmit.
The interrupt vector table location 0023H belongs to this interrupt.

Interrupt Enable Register
D7

D6
EA

D5
--

D4
ET2

D3
ES

D2
ET1

D1
EX1

D0
ET0

EX0

EA

IE.7

disables all interrupts. If EA=0, no interrupts is acknowledged.
If EA=1, each interrupt source is individually enabled disabled
By setting or clearing its enable bit.

-ET2

IE.6

Not implemented, reserved for future use.*

IE.5 Enables or disables Timer 2 overflow or capture interrupt (8052

Only).
ES

IE.4

Enables or disables the serial ports interrupt.

ET1

IE.3

Enables or disables Timers 1 overflow interrupt

EX1

IE.2

Enables or disables external interrupt 1.

ET0

IE.1

Enables or disables Timer 0 overflow interrupt.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 24

GSM BASEDPATIENT MONITORIG SYSTEM
2013
EX0

IE.0

Enables or disables external interrupt

4.2 TEMPERATURE SENSOR(LM35):
LM35 converts temperature value into electrical signals. LM35 series sensors are precision
integrated-circuit temperature sensors whose output voltage is linearly proportional to the
Celsius temperature. The LM35 requires no external calibration since it is internally
calibrated. . The LM35 does not require any external calibration or trimming to provide
typical accuracies of ±1⁄4°C at room temperature and ±3⁄4°C over a full −55 to +150°C
temperature range.

The LM35’s 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.1°C in still air.
Features


Calibrated directly in ° Celsius (Centigrade)



Linear + 10.0 mV/°C scale factor



0.5°C accuracy guaranteed (at +25°C)



Rated for full −55° to +150°C range



Suitable for remote applications



Low cost due to wafer-level trimming



Operates from 4 to 30 volts



Less than 60 μA current drain



Low self-heating, 0.08°C in still air



Nonlinearity only ±1⁄4°C typical



Low impedance output, 0.1 W for 1 mA load

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 25

GSM BASEDPATIENT MONITORIG SYSTEM
2013

The characteristic of this LM35 sensor is:
For each degree of centigrade temperature it outputs 10milli volts.

4.4 GSM MODEM:
GSM Technology:
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
In 1982, the European Conference of Postal and Telecommunications Administrations
(CEPT) created the Group Special Mobile (GSM) to develop a standard for a mobile
telephone system that could be used across Europe.

In 1987, a memorandum of

understanding was signed by 13 countries to develop a common cellular telephone system
across Europe. Finally the system created by SINTEF lead by Torleiv Maseng was selected.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 26

GSM BASEDPATIENT MONITORIG SYSTEM
2013
In 1989, GSM responsibility was transferred to the European Telecommunications Standards
Institute (ETSI) and phase I of the GSM specifications were published in 1990. The first
GSM network was launched in 1991 by Radiolinja in Finland with joint technical
infrastructure maintenance from Ericsson.
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 Frequencies
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 used for first-generation
systems.
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.
Time division multiplexing is used to allow eight full-rate or sixteen half-rate speech
channels per radio frequency channel. There are eight radio timeslots (giving 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.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 27

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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.
Mobile Telephony Standards

TABLE10: MOBILE TELEPHONY STANDARDS
1G
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.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 28

GSM BASEDPATIENT MONITORIG SYSTEM
2013


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).



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 entirely
digital second generation.
Second Generation of Mobile Networks (2G)
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
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.



TDMA (Time Division Multiple Access) uses a technique of time division of
communication channels to increase the volume of data transmitted simultaneously.
TDMA technology is primarily used on the American continent, in New Zealand and
in the Asia-Pacific region.

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.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 29

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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 limited in order to comply with
the IMT-2000 (International Mobile Telecommunications-2000) specifications from the ITU
(International Telecommunications Union).
3G
The IMT-2000 (International Mobile Telecommunications for the year 2000) specifications
from the International Telecommunications Union (ITU) defined the characteristics
of 3G (third generation of mobile telephony). The most important of these characteristics are:
1. High transmission data rate.
2. 144 Kbps with total coverage for mobile use.
3. 384 Kbps with medium coverage for pedestrian use.
4. 2 Mbps with reduced coverage area for stationary use.
5. World compatibility.
6. Compatibility of 3rd generation mobile services with second generation networks.
3G offers data rates of more than 144 Kbit/s, thereby allowing the access to multimedia uses
such as video transmission, video-conferencing or high-speed internet access. 3G networks
use different frequency bands than the previous networks: 1885-2025 MHz and 2110-2200
MHz.
The

main

3G

standard

used

in

Europe

is

called UMTS (Universal

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
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 30

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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
The GSM (Global System for Mobile communications) network is at the start of the
21st century, the most commonly used mobile telephony standard in Europe. It is called as
Second Generation (2G) standard because communications occur in an entirely digital mode,
unlike the first generation of portable telephones.
When it was first standardized in 1982, it was called as Group Special Mobile and later, it
became an international standard called "Global System for Mobile communications" in
1991.
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.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 31

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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 respective time slot.
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 Multiplex 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 implementation using TDMA principle is of
GSM’s (Global System for Mobile communication). To reduce the effect of co-channel
interference, fading and multipath, the GSM technology can use frequency hoping, where a
call jumps from one channel to another channel in a short interval.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 32

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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:
There are lots of advantages of TDMA in cellular technologies.
1. It can easily adapt to transmission of data as well as voice communication.
2. 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.
3. 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.
The second problem in TDMA is that it is subjected to multipath distortion. To overcome this
distortion, a time limit can be used on the system. Once the time limit is expired, the signal is
ignored.
The concept of cellular network
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 33

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Mobile telephone networks are based on the concept of cells, circular zones that overlap to
cover a geographical area.

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.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 34

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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:

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 35

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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
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 inactivity (terminal
off).
3. The Equipment Identify Register (EIR) is a database listing the mobile terminals.
4. The Authentication Centre (AUC) is responsible for verifying user identities.
5. 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.

Introduction to Modem:

Modem stands for modulator-demodulator.
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.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 36

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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 builtin 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 have a
built-in loudspeaker and microphone for voice communication.
 Auto-answer: An auto-answer modem enables the computer to receive calls in the
absence of the operator.
 Data compression: Some modems perform data compression, which enables them to
send data at faster rates. However, the modem at the receiving end must be able to
decompress the data using the same compression technique.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 37

GSM BASEDPATIENT MONITORIG SYSTEM
2013
 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.

FIGURE18:GSM SIM300 MODEM
A GSM modem can be an external device or a PC Card / PCMCIA Card. Typically, an
external GSM modem is connected to a computer through a serial cable or a USB cable. A
GSM modem in the form of a PC Card / PCMCIA Card is designed for use with a laptop
computer. It should be inserted into one of the PC Card / PCMCIA Card slots of a laptop
computer. Like a GSM mobile phone, a GSM modem requires a SIM card from a wireless
carrier in order to operate.
A SIM card contains the following information:


Subscriber telephone number (MSISDN)



International subscriber number (IMSI, International Mobile Subscriber Identity)



State of the SIM card



Service code (operator)

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 38

GSM BASEDPATIENT MONITORIG SYSTEM
2013


Authentication key



PIN (Personal Identification Code)



PUK (Personal Unlock Code)

Computers use AT commands to control modems. Both GSM modems and dial-up modems
support a common set of standard AT commands. In addition to the standard AT commands,
GSM modems support an extended set of AT commands. These extended AT commands are
defined in the GSM standards. With the extended AT commands, the following operations can
be performed:


Reading, writing and deleting SMS messages.



Sending SMS messages.



Monitoring the signal strength.



Monitoring the charging status and charge level of the battery.



Reading, writing and searching phone book entries.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 39

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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
AT commands are instructions used to control a modem. AT is the abbreviation of ATtention.
Every command line starts with "AT" or "at". That's the reason, modem commands are called
AT commands. Many of the commands that are used to control wired dial-up modems, such
as ATD (Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data state) are
also supported by GSM modems and mobile phones.
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 (International
Mobile Equipment Identity) (AT+CGSN) and software version (AT+CGMR).
 Get basic information about the subscriber. For example, MSISDN (AT+CNUM) and
IMSI number (International Mobile Subscriber Identity) (AT+CIMI).
 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).
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 40

GSM BASEDPATIENT MONITORIG SYSTEM
2013
 Send and receive fax (ATD, ATA, AT+F*).
 Send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write (AT+CMGW)
or delete (AT+CMGD) SMS messages and obtain notifications of newly received
SMS messages (AT+CNMI).
 Read (AT+CPBR), write (AT+CPBW) or search (AT+CPBF) phonebook entries.
 Perform security-related tasks, such as opening or closing facility locks (AT+CLCK),
checking

whether

a

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

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 41

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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.
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.
2. Message Status Reports
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 status report
feature is on or off. After setting it, the mobile phone will set 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.
3. Message Submission Reports
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
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 42

GSM BASEDPATIENT MONITORIG SYSTEM
2013
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 mechanism prevents the sending of
the same SMS message to the recipient multiple times.
Sometimes the message submission report mechanism is not used and the acknowledgement
of message submission is done in a lower layer.
4. Message Delivery Reports
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. Otherwise it sends back a negative 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. If the SMS center
does not receive the message delivery report after a period of time, it concludes that the
message delivery report has been lost. The SMS center then ends the SMS message to the
recipient for the second time.
Sometimes the message delivery report mechanism is not used and the acknowledgement of
message delivery is done in a lower layer.

4.5HEART BEAT SENSOR:
The Heart Beat signal is obtained by LED and LDR combination. Pulses form hands
interrupts the Light reaching the LDR and this signal is read by microcontroller, The RF
signal is transmitted by transmitter in a digital format. This circuit uses Manchester encoding
to avoid a long trail of one or zero. The protocol is well defined for different device types
ensuring compatibility with your whole entertainment system 5 bit address and 6 bit
command length. Constant bit time of 1.778ms bits are of equal length of 1.778ms in this
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 43

GSM BASEDPATIENT MONITORIG SYSTEM
2013
protocol, A logical zero is represented by a pulse in the first half of the bit time. A logical one
is represented by a pulse in the second half of the bit time

FIGURE19: HEART BEAT SENSOR
Heart beat is sensed by using a high intensity type LED and LDR. The finger is placed
between the LED and LDR. As sensor LDR can be used. The skin may be illuminated with
visible (red) using transmitted or reflected light for detection. The very small changes in
reflectivity or in transmittance caused by the varying blood content of human tissue are
almost invisible. Various noise sources may produce disturbance signals with amplitudes
equal or even higher than the amplitude of the pulse signal. Valid pulse measurement
therefore requires extensive pre-processing of the raw signal. The new signal processing
approach presented here combines analog and digital signal processing in a way that both
parts can be kept simple but in combination are very effective in suppressing

4.6LIGHT DEPENDENT RESISTOR(LDR):
LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits.
Normally the resistance of an LDR is very high, sometimes as high as 1,000,000 ohms, but
when they are illuminated with light, the resistance drops dramatically. Thus in this project,
LDR plays an important role in switching on the lights based on the intensity of light i.e., if
the intensity of light is more (during daytime) the lights will be in off condition. And if the
intensity of light is less (during nights), the lights will be switched on.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 44

GSM BASEDPATIENT MONITORIG SYSTEM
2013

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

4.7ANALOG TO DIGITAL CONVERTER(ADC):
Analog-to-digital converters are among the most widely used devices for data acquisition.
Digital systems use binary values, but in the physical world everything is continuous i.e.,
analog values. Temperature, pressure (wind or liquid), humidity and velocity are the physical
analog quantities.
These physical quantities are to be converted into digital values for further processing. One
such device to convert these physical quantities into electrical signals is sensor. Sensors for
temperature, pressure, humidity, light and many other natural quantities produce an output
that is voltage or current. Thus, an analog-to-digital converter is needed to convert these
electrical signals into digital values so that the microcontroller can read and process them.
An ADC has an n-bit resolution where n can be 8,10,12,16 or even 24 bits. The higher
resolution ADC provides a smaller step size, where step size is the smallest change that can
be detected by an ADC. In addition to resolution, conversion time is another major factor in
judging an ADC.
Conversion time is defined as the time it takes the ADC to convert the analog input to a
digital number.
ADC0804:
The ADC chip that is used in this project is ADC0804. The ADC0804 IC is an 8-bit parallel
ADC in the family of the ADC0800 series from National Semiconductor. It works with +5
volts and has a resolution of 8 bits. In the ADC0804, the conversion time varies depending on
the clocking signals applied to the CLK IN pin, but it cannot be faster than 110µs.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 45

GSM BASEDPATIENT MONITORIG SYSTEM
2013

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 110µs.
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.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 46

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Vcc: This is the +5 volt power supply. It is also used as a reference voltage when the Vref/2
input (pin 9) is open.
Vref/2: Pin 9 is an input voltage used for the reference voltage. If this pin is open, the analog
input voltage for the ADC0804 is in the range of 0 to 5 volts.Vref/2 is used to implement
analog input voltages other than 0.5V. i.e., if the analog input range needs to be 0 to 4 volts,
Vref/2 is connected to 2 volts.
D0-D7: D0-D7 (D7 is the MSB) are the digital data output pins since ADC0804 is a parallel
ADC chip. To calculate the output voltage, the below equation is used:
Dout = Vin/ (step size)
where Dout = digital data output pins (in decimal) and Vin = analog input value
Step size is the smallest change and is given by (2 x Vref/2)/256 for ADC0804.
Analog Ground and Digital Ground: These are the input pins providing the ground for both
the analog signal and the digital signal. Analog ground is connected to the ground of the
analog Vin while digital ground is connected to the ground of the Vcc pin. The reason that
there are two ground pins is to isolate the analog Vin signal from transient voltages caused by
digital switching of the output D0-D7.
Clock Source for ADC0804:
The speed at which an analog input is converted to the digital output depends on the speed of
the CLK input. According to the ADC0804 datasheets, the typical operating frequency is
approximately 640 kHz at 5 volts.
ADC interface with 8051:

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 47

GSM BASEDPATIENT MONITORIG SYSTEM
2013

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:

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 48

GSM BASEDPATIENT MONITORIG SYSTEM
2013

FIGURE 22: BLOCK DIAGRAM OF POWER SUPPLY

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 turn’s ratio, determines the ratio of the voltages. A step-down transformer
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 49

GSM BASEDPATIENT MONITORIG SYSTEM
2013
has a large number of turns on its primary (input) coil which is connected to the high voltage
mains supply, and a small number of turns on its secondary (output) coil to give a low output
voltage.

FIGURE 23: ELECTRICAL TRANSFORMER
Turns ratio = Vp/ VS = Np/NS
Power Out= Power In
VS X IS=VP X IP
Vp = primary (input) voltage
Np = number of turns on primary coil
Ip = primary (input) current

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 Rectifier

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 50

GSM BASEDPATIENT MONITORIG SYSTEM
2013


Full wave rectifier
1. Center tap full wave rectifier.
2. Bridge type full bridge rectifier.

Comparison of rectifier circuits
Type of Rectifier
Parameter

Half wave

Full wave

Bridge

Number of diodes
1

2

4

2Vm

Vm

PIV of diodes
Vm

D.C output voltage

Vdc, at

Vm/

0.318Vm

2Vm/

0.636Vm

2Vm/

0.636Vm

no-load

Ripple factor

1.21

0.482

0.482

f

2f

2f

0.812

0.812

Ripple
frequency
Rectification
efficiency

0.406

Transformer

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 51

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Utilization

0.287

0.693

0.812

Factor(TUF)
RMS voltage Vrms

Vm/2

Vm/√2

Vm/√2

TABLE 11:COMPARISON OF RECTIFIER CIRCUITS
Full-wave Rectifier
From the above comparisons we came to know that full wave bridge rectifier as more
advantages than the other two rectifiers. So, in our project we are using full wave bridge
rectifier circuit.
Bridge Rectifier
A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave
rectification. This is a widely used configuration, both with individual diodes wired as shown
and with single component bridges where the diode bridge is wired internally.
A bridge rectifier makes use of four diodes in a bridge arrangement as shown in
fig(a) to achieve full-wave rectification. This is a widely used configuration, both with
individual diodes wired as shown and with single component bridges where the diode bridge
is wired internally.

FIGURE 24: FULL WAVE BRIDGE RECTIFIER

Operation
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 52

GSM BASEDPATIENT MONITORIG SYSTEM
2013
During positive half cycle of secondary, the diodes D2 and D3 are in forward biased
while D1 and D4 are in reverse biased as shown in the fig(b). The current flow direction is
shown in the fig (b) with dotted arrows.

FIGURE 25: OPERATION DURING POSITIVE CYCLE
During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward
biased while D2 and D3 are in reverse biased as shown in the fig(c). The current flow
direction is shown in the fig (c) with dotted arrows.

FIGURE 26: OPERATION DURING NEGATIVE CYCLE

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 53

GSM BASEDPATIENT MONITORIG SYSTEM
2013
(b) An inductor, in series with the load, prevents the passage of the ripple current (due to high
impedance at ripple frequency) while allowing the d.c (due to low resistance to d.c)
(c) various combinations of capacitor and inductor, such as L-section filter

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.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 54

GSM BASEDPATIENT MONITORIG SYSTEM
2013

FIGURE 27: VOLTAGE REGULATOR

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 55

GSM BASEDPATIENT MONITORIG SYSTEM
2013
A potentiometer (colloquially known as a "pot") is a three-terminal resistor with a sliding
contact that forms an adjustable voltage divider.[1] If only two terminals are used (one side
and the wiper), it acts as a variable resistor or rheostat. Potentiometers are commonly used to
control electrical devices such as volume controls on audio equipment. Potentiometers
operated by a mechanism can be used as position transducers, for example, in a joystick.

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 56

GSM BASEDPATIENT MONITORIG SYSTEM
2013
The electrical functionality of a resistor is specified by its resistance: common commercial
resistors are manufactured over a range of more than 9 orders of magnitude. When specifying
that resistance in an electronic design, the required precision of the resistance may require
attention to the manufacturing tolerance of the chosen resistor, according to its specific
application. The temperature coefficient of the resistance may also be of concern in some
precision applications. Practical resistors are also specified as having a maximum power
rating which must exceed the anticipated power dissipation of that resistor in a particular
circuit: this is mainly of concern in power electronics applications. Resistors with higher
power ratings are physically larger and may require heat sinking. In a high voltage circuit,
attention must sometimes be paid to the rated maximum working voltage of the resistor.
The series inductance of a practical resistor causes its behavior to depart from ohms law; this
specification can be important in some high-frequency applications for smaller values of
resistance. In a low-noise amplifier or pre-amp the noise characteristics of a resistor may be
an issue. The unwanted inductance, excess noise, and temperature coefficient are mainly
dependent on the technology used in manufacturing the resistor. They are not normally
specified individually for a particular family of resistors manufactured using a particular
technology.[1] A family of discrete resistors is also characterized according to its form factor,
that is, the size of the device and position of its leads (or terminals) which is relevant in the
practical manufacturing of circuits using them.

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.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 57

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Ceramic capacitors come in various shapes and styles, including:


disc, resin coated, with through-hole leads



multilayer rectangular block, surface mount



bare leadless disc, sits in a slot in the PCB and is soldered in place, used for UHF
applications



tube shape, not popular now

CLASSES OF CERAMIC CAPACITOR

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 filters—a 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 58

GSM BASEDPATIENT MONITORIG SYSTEM
2013
These correspond roughly to low K, medium K, and high K. Note that none of the classes are
"better" than any others the relative performance depends on application. Class I capacitors
are physically larger than class III capacitors, and for bypassing and other non-filtering
applications, the accuracy, stability, and loss factor may be unimportant, while cost and
volumetric efficiency may be. As such, Class I capacitors are primarily used in filtering
applications, where the main competition is from film capacitors in low frequency
applications, and more esoteric capacitors in RF applications. Class III capacitors are
typically used in power supply applications. Traditionally, they had no competition in this
niche, as they were limited to small sizes. As ceramic technology has improved, ceramic
capacitors are now commonly available in values of up to 100 µF, and they are increasingly
starting to compete.
With electrolytic capacitors, where ceramics offer much better electrical performance at
prices that, while still much higher than electrolytic, are becoming increasingly reasonable as
the technology improves.

ELECTROLYTIC CAPACITOR

FIGURE29: ELECTROLYTIC CAPACITOR
An electrolytic capacitor is a type of capacitor that uses an electrolyte, an ionic conducting
liquid, as one of its plates, to achieve a larger capacitance per unit volume than other types.
They are often referred to in electronics usage simply as "electrolytics". They are used in
relatively high-current and low-frequency electrical circuits, particularly in power supply
filters, where they store charge needed to moderate output voltage and current fluctuations in
rectifier output. They are also widely used as coupling capacitors in circuits where AC should
be conducted but DC should not. There are two types of electrolytics aluminum and tantalum.
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 59

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Electrolytic capacitors are capable of providing the highest capacitance values of any type of
capacitor but they have drawbacks which limit their use. The standard design requires that the
applied voltage must be polarized one specified terminal must always have positive potential
with respect to the other. Therefore they cannot be used with AC signals without a DC
polarizing bias. However there are special non-polarized electrolytic capacitors for AC use
which do not require a DC bias. Electrolytic capacitors also have relatively low breakdown
voltage, higher leakage current and inductance, poorer tolerances and temperature range, and
shorter lifetimes compared to other types of capacitors.

4.12 OPERATION AMPLIFIER (LM 358):
The LM358 series consists of two independent, high gain; internally frequency compensated
operational amplifiers which were designed specifically to operate from a single power
supply over a wide range of voltages. Operation from split power supplies is also possible
and the low power supply current drain is independent of the magnitude of the power supply
voltage.
Application areas include transducer amplifiers; dc gain blocks and all the conventional op
amp circuits, which now can be more easily implemented in single power supply systems.
For example, the LM158 series can be directly operated off of the standard +5V power
supply voltage which is used in digital systems and will easily provide the required interface
electronics without requiring the additional ±15V power supplies. The LM358 and LM2904
are available in a chip sized package (8-Bump micro SMD) using National’s micro SMD
package technology.
Features:


Available in 8-Bump micro SMD chip sized package,



Internally frequency compensated for unity gain



Large dc voltage gain: 100 dB



Wide bandwidth (unity gain): 1 MHz (temperature compensated)



Wide power supply range:
— Single supply: 3V to 32V
— or dual supplies: ±1.5V to ±16V

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 60

GSM BASEDPATIENT MONITORIG SYSTEM
2013


Very low supply current drain (500 μ A)—essentially independent of supply voltage



Low input offset voltage: 2 mV



Input common-mode voltage range includes ground



Differential input voltage range equal to the power supply voltage



Large output voltage swing

Voltage Controlled Oscillator (VCO):

Connection Diagram:

4.13 SWITCHES AND PUSHBUTTONS:
This is the simplest way of controlling appearance of some voltage on microcontroller’s input
pin. There is also no need for additional explanation of how these components operate.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 61

GSM BASEDPATIENT MONITORIG SYSTEM
2013
FIGURE30: PUSHBUTTON
This is about something commonly unnoticeable when using these components in everyday
life. It is about contact bounce, a common problem with mechanical switches. If contact
switching does not happen so quickly, several consecutive bounces can be noticed prior to
maintain stable state. The reasons for this are: vibrations, slight rough spots and dirt. Anyway,
this whole process does not last long (a few micro- or milliseconds), but long enough to be
registered by the microcontroller. Concerning the pulse counter, error occurs in almost 100%
of cases.

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 62

GSM BASEDPATIENT MONITORIG SYSTEM
2013
In 8051 PORT 1, PORT 2 & PORT 3 have internal 10k Pull-up resistors whereas this
Pull-up resistor is absent in PORT 0. Hence PORT 1, 2 & 3 can be directly used to interface
a switch whereas we have to use an external 10k pull-up resistor for PORT 0 to be used for
switch interfacing or for any other input. Figure 1 shows switch interfacing for PORT 1, 2 &
3. Figure 2 shows switch interfacing to PORT 0.

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.

4.14 FIRMWARE IMPLEMENTATION OF THE PROJECT
DESIGN:
This chapter briefly explains about the firmware implementation of the project. The required
software tools are discussed in section 4.2. Section 4.3 shows the flow diagram of the project
design. Section 4.4 presents the firmware implementation of the project design.
Software Tools Required
Keil µv3, Proload are the two software tools used to program microcontroller. The
working of each software tool is explained below in detail.
Programming Microcontroller
A compiler for a high level language helps to reduce production time. To program the
AT89S52 microcontroller the Keil µv3 is used. The programming is done strictly in the
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 63

GSM BASEDPATIENT MONITORIG SYSTEM
2013
embedded C language. Keil µv3 is a suite of executable, open source software development
tools for the microcontrollers hosted on the Windows platform.
The compilation of the C program converts it into machine language file (.hex). This
is the only language the microcontroller will understand, because it contains the original
program code converted into a hexadecimal format. During this step there are some warnings
about eventual errors in the program. This is shown in Fig 4.1. If there are no errors and
warnings then run the program, the system performs all the required tasks and behaves as
expected the software developed. If not, the whole procedure will have to be repeated again.
Fig 4.2 shows expected outputs for given inputs when run compiled program.
One of the difficulties of programming microcontrollers is the limited amount of
resources the programmer has to deal with. In personal computers resources such as RAM
and processing speed are basically limitless when compared to microcontrollers. In contrast,
the code on microcontrollers should be as low on resources as possible.

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.

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 64

GSM BASEDPATIENT MONITORIG SYSTEM
2013

FIGURE31:COMPILATION O FSOURCE CODE

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 65

GSM BASEDPATIENT MONITORIG SYSTEM
2013
FIGURE32;RUN THE COMPILED PROGRAM

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.

FIGURE33: DUMPING KIT
Features


Supports major Atmel 89 series devices



Auto Identify connected hardware and devices



Error checking and verification in-built



Lock of programs in chip supported to prevent program copying



20 and 40 pin ZIF socket on-board



Auto Erase before writing and Auto Verify after writing



Informative status bar and access to latest programmed file



Simple and Easy to use



Works on 57600 speed

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 66

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Description
It is simple to use and low cost, yet powerful flash microcontroller programmer for
the Atmel 89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and
Blank Check. All fuse and lock bits are programmable. This programmer has intelligent
onboard firmware and connects to the serial port. It can be used with any type of computer
and requires no special hardware. All that is needed is a serial communication ports which all
computers have.
All devices have signature bytes that the programmer reads to automatically identify
the chip. No need to select the device type, just plug it in and go! All devices also have a
number of lock bits to provide various levels of software and programming protection. These
lock bits are fully programmable using this programmer. Lock bits are useful to protect the
program to be read back from microcontroller only allowing erase to reprogram the
microcontroller. The programmer connects to a host computer using a standard RS232 serial
port. All the programming 'intelligence' is built into the programmer so you do not need any
special hardware to run it. Programmer comes with window based software for easy
programming of the devices.

Programming Software
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 67

GSM BASEDPATIENT MONITORIG SYSTEM
2013
Computer side software called 'Proload V4.1' is executed that accepts the Intel HEX format
file generated from compiler to be sent to target microcontroller. It auto detects the hardware
connected to the serial port. It also auto detects the chip inserted and bytes used. Software is
developed in Delphi 7 and requires no overhead of any external DLL.

4.15 PROGRAM:

void setup()
{
Serial.begin(9600);
pinMode(12, OUTPUT);
}

void loop()
{
int sensorValue = analogRead(A0);
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 68

GSM BASEDPATIENT MONITORIG SYSTEM
2013

if(sensorValue > 500){
GSMSMSON();
delay(30000);
}

}
//---------------------------------------------------------------------------------------------------------------

void GSMSMSON(){
Serial.begin(2400); //Baud rate of the GSM/GPRS Module
Serial.print("\r");
delay(1000);
Serial.print("AT+CMGF=1\r");
delay(1000);
Serial.print("AT+CMGS=\"+918099656583\"\r");

//Number to which

you want to send the sms
delay(1000);
Serial.print("Motion detector in your Home or Hospital \r");
of the message to be sent
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 69

//The text

GSM BASEDPATIENT MONITORIG SYSTEM
2013
delay(1000);
Serial.write(0x1A);
delay(1000);
}

5.1ADVANTAGES:
1.
2.
3.
4.
5.
6.
7.

It is highly accurate and precise and also very reliable.
Monitoring save the life and protect the health and life can be saved.
It helps in faster detection of input sensors
It will reduce the extra consumption of electricity
It is portable and hence can be placed anywhere.
The use of a microcontroller increases its scope of applications and modifications.
The microcontroller can be reprogrammed if any modification is required.

5.2 DISADVANTAGES:
1. The sensors are costly
2. If power supply fails circuit won’t work

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 70

GSM BASEDPATIENT MONITORIG SYSTEM
2013

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.

6.2FUTURE SCOPE :
It has been developed by integrating features of all the hardware components used.
Presence of every module has been reasoned out and placed carefully thus contributing to the
best working of the unit.
Secondly, using highly advanced IC’s and with the help of growing technology the
project has been successfully implemented.
The Whole health monitoring system,which we have proposed can be integrated into a
small compact unit as small as a cell phone or a wrist watch.This will help the patients to

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 71

GSM BASEDPATIENT MONITORIG SYSTEM
2013
easily carry this device with them wherever they go.The VLSI technologies will greatly come
handy in this regard.

FIGURE34:FLOW CHART

8.1CONCLUSION :
From this project we can conclude that this can be one of the best methods
for bio medical application where the doctors can analyze the subject condition from the
place where they are sitting and hence proper and timely Medicare to the patient can be given
so that percentage of death can be reduced to larger extent.

8.2SNAPSHOTS:

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 72

GSM BASEDPATIENT MONITORIG SYSTEM
2013

FIGURE35:SNAPSHOT

9.1 BIBLIOGRAPHY:
The 8051 Micro controller and Embedded Systems
- Janice Gillispie Mazidi
-Muhammad Ali Mazidi
The 8051 Micro controller Architecture, Programming & Applications
-Kenneth J.Ayala
Electronic Components
-D.V.Prasad
Fundamentals of Micro processors and Micro computers
-B.Ram
Micro processor Architecture, Programming & Applications
-Ramesh S.Gaonkar
Wireless Communications
-Theodore S. Rappaport
Mobile Tele Communications
-William C.Y. Lee
Embedded and Real-Time System by KVK PRASAD, Dream Tech Publications, 2009.

References on the Web:

[1]Analog Temperature Sensors. www.national.com
[2]89S52 Architecture. www.microsoftsearch.com
[3]modems. www.howstuffworks.com
PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 73

GSM BASEDPATIENT MONITORIG SYSTEM
2013
[4].Current GSM Constellations http://tycho.usno.navy.mil/gsmcurr.html

PYDAH COLLEGE OF ENGINEERING, PATAVALA
Page 74

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close