Upload
piyushji125
View
218
Download
0
Embed Size (px)
Citation preview
7/29/2019 Patient Gsm New
1/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
CHAPTER-1
INTRODUCTION
The project deals with the design and development of hardware and software for
temperature and heartbeat measurement of a patient over LCD
The data which are recorded continuously in this project are Heartbeat of the patient. The
digital value read is sent to the microcontroller. The microcontroller temporarily stores this
value.
The heartbeat pulses can be seen by the doctor at regular intervals in LCD to know the
patient condition.
1.1. OBJECTIVE
The project intends to interface the microcontroller with the LCD and Heart beat
monitoring system and send the information like heartbeat pulses of the patient to the doctors
work station on LCD. The project uses the LCD, Heartbeat sensor and Embedded Systems to
design this application. The main objective of this project is to design a system that continuously
monitors the heartbeat of the patient and if they are likely to exceed the normal values, the
system immediately sends a message to the doctors LCD.
This project is a device that collects data from the sensors, codes the data into
a format that can be understood by the controlling section. This system also collects information
from the master device and implements commands that are directed by the master.
7/29/2019 Patient Gsm New
2/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
1.2 BACK GROUND OF THE PROJECT
The software application and the hardware implementation help the
microcontroller read the output of the sensors and send these values to the doctors mobilewhenever he sends a request to the controlling unit. The measure of efficiency is based on how
fast the microcontroller can read the sensor output values and send a message to the doctors
mobile whenever these parameters exceed the normal values. The system is totally designed
using LCD and embedded systems technology.
The Controlling unit has an application program to allow the
microcontroller read the sensor output values and send them to the user mobile whenever he
sends a request to the controlling unit. The performance of the design is maintained bycontrolling unit.
7/29/2019 Patient Gsm New
3/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
CHAPTER-2
PROJECT DESCRIPTION
2.1 BLOCK DIAGRAM
The block diagram of the design is as shown in Fig 3.1. It consists of power supply unit,
microcontroller, GSM modem, Serial communication unit, sensor module. The brief description
of each unit is explained as follows.
Fig: Block diagram for Heartbeat Monitoring
System
7/29/2019 Patient Gsm New
4/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
2.2 CIRCUIT DIAGRAM
7/29/2019 Patient Gsm New
5/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
2.3 WORKING PROCEDURE
The working of the project goes like this: The temperature and heartbeat of the patientwill be monitored continuously and the status of the patient will be monitored and sent to the
doctor wherever he may be.
Thus, the two values, the temperature and the heartbeat pulse will be sent to the doctor
who knows the entire health conditions of the patient. Thus, to send this data, we are using the
wireless technology, GSM. When the monitoring system sends a message to the doctors mobile,
even this system should have a device which can send or receive the messages from/to the
doctor. The device we are using is the GSM modem. The modem is exactly similar to our mobilephones. Even the modem requires a SIM card to communicate with the outside world. The
modem will be interfaced with the microcontroller through serial interface.
The data which are monitored continuously in this project are Temperature and Heartbeat
of the patient. The analog quantities are taken and converted into corresponding digital values
using a single channel ADC. This converted digital value is sent to the microcontroller. The
microcontroller temporarily stores this value.
The doctor can read the temperature and heartbeat value whenever he wishes to. The
doctor can take care of the patients condition wherever he may be. The doctor has to send
predefined messages to the modem to retrieve the data. The modem receives the predefined
messages and intimates the same to the microcontroller. Now, it is the job of the microcontroller
to read the value, process it and send the requested value to the doctors mobile. The user can
read the updated data whenever he reads the predefined messages to the modem. These values
can also be displayed on the LCD.
7/29/2019 Patient Gsm New
6/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
CHAPTER 3
MICROCONTROLLER
3.1. A brief history of the 8051 family:
In 1981, Intel Corporation introduced an 8-bit microcontroller called the 8051. This
microcontroller had 128 bytes of RAM,4K bytes of on- chip ROM, two timers, one serial port,
and four ports(each 8-bit wide) all on a single chip. At the time it is also referred to as a system
on chip. This is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a
time. Data larger than 8 bits has to be broken into 8 bit pieces to be processed by the CPU. The
8051 has a total of four I/O ports, each 8-bit wide.
The 8051 became widely popular after Intel allowed other manufactures to make and
market any flavors of the 8051 they please with the condition that they remain code-compatible
with the 8051. This led to many versions of the 8051 with different speeds and amounts of on-
chip ROM marketed by more than half a dozen manufacturers. It is important to note that
although there are different flavors of the 8051 in terms of speed and amount of on-chip ROM,
they are all compatible with the original 8051 as far as the instructions are concerned. This
means that if you write your program for one, it will run on any of them regardless of the
manufacturer.
The 8051 is the original member of the 8051 family. Intel refers to it as MCS-51.
The Microcontroller AT89c51 is from Atmel Corporation. It has a wide collection of 8051
chips, as shown below. The AT89C51 is a popular and inexpensive chip used in many small
projects. It has 4K bytes of flash ROM. Notice that AT89C51-12PC, where C before the 51
stands for CMOS, which has low power consumption, 12 indicates 12MHz, P is for plastic
DIP package, and another C is for commercial.
7/29/2019 Patient Gsm New
7/39
7/29/2019 Patient Gsm New
8/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
3.3 PIN DIAGRAM:
FIG PIN DIAGRAM OF 89S52 IC
3.4 PIN DESCRIPTION
VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high
impedance inputs. Port 0 can also be configured to be the multiplexed low order address/data bus
during accesses to external program and data memory. In this mode, P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming and outputs the code bytes during
program verification.
7/29/2019 Patient Gsm New
9/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
External pull-ups are required during program verification.
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high
by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1
can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter
2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives
the low-order address bytes during Flash programming and verification.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 outputbuffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high
by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order
address byte during fetches from external program memory and during accesses to external data
memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong
internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit
addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2
also receives the high-order address bits and some control signals during Flash programming and
verification.
7/29/2019 Patient Gsm New
10/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high
by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being
pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of
various special features of the AT89S52, as shown in the following table. Port 3 also receives
some control signals for Flash programming and verification.
RST
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives High for 96 oscillator periods after the Watchdog times
out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the
default state of bit DISRTO, the RESET HIGH out feature is enabled. ALE/PROG Address
Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to
external memory. This pin is also the program pulse input (PROG) during Flash programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be
used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped
during each access to external data memory. If desired, ALE operation can be disabled by setting
bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC
instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if
the microcontroller is in external execution mode.
7/29/2019 Patient Gsm New
11/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
PSEN
Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to external
data memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device
to fetch code from external program memory locations starting at 0000H up to FFFFH. Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be
strapped to VCC for internal program executions. This pin also receives the 12-volt
programming enable voltage
(VPP) during Flash programming.
XTAL1
Input to the inverting oscillator amplifier and input to the
Internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
CHAPTER 4
POWER SUPPLY
All digital circuits require regulated power supply. In this article we are going to learn how to get
a regulated positive supply from the mains supply.
7/29/2019 Patient Gsm New
12/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
Figure shows the basic block diagram of a fixed regulated power supply. Let us go through each
block.
4.1 TRANSFORMER
A transformer consists of two coils also called as WINDINGS namely PRIMARY &
SECONDARY. They are linked together through inductively coupled electrical conductors also
called as CORE. A changing current in the primary causes a change in the Magnetic Field in the
core & this in turn induces an alternating voltage in the secondary coil. If load is applied to the
secondary then an alternating current will flow through the load. If we consider an ideal
condition then all the energy from the primary circuit will be transferred to the secondary circuit
through the magnetic field.
So
The secondary voltage of the transformer depends on the number of turns in the Primary as well as in the
secondary.
7/29/2019 Patient Gsm New
13/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
4.2 RECTIFIER
A rectifier is a device that converts an AC signal into DC signal. For rectification purpose we use
a diode, a diode is a device that allows current to pass only in one direction i.e. when the anode
of the diode is positive with respect to the cathode also called as forward biased condition &
blocks current in the reversed biased condition.
Rectifier can be classified as follows:
1) Half Wave rectifier.
This is the simplest type of rectifier as you can see in the diagram a half wave rectifier consists
of only one diode. When an AC signal is applied to it during the positive half cycle the diode is
forward biased & current flows through it. But during the negative half cycle diode is reverse
biased & no current flows through it. Since only one half of the input reaches the output, it is
very inefficient to be used in power supplies.
2) Full wave rectifier.
7/29/2019 Patient Gsm New
14/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
Half wave rectifier is quite simple but it is very inefficient, for greater efficiency we would like
to use both the half cycles of the AC signal. This can be achieved by using a center tappedtransformer i.e. we would have to double the size of secondary winding & provide connection to
the center. So during the positive half cycle diode D1 conducts & D2 is in reverse biased
condition. During the negative half cycle diode D2 conducts & D1 is reverse biased. Thus we get
both the half cycles across the load.
One of the disadvantages of Full Wave Rectifier design is the necessity of using a center tapped
transformer, thus increasing the size & cost of the circuit. This can be avoided by using the Full
Wave Bridge Rectifier.
3) Bridge Rectifier.
7/29/2019 Patient Gsm New
15/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
As the name suggests it converts the full wave i.e. both the positive & the negative half cycle
into DC thus it is much more efficient than Half Wave Rectifier & that too without using a center
tapped transformer thus much more cost effective than Full Wave Rectifier. Full Bridge Wave
Rectifier consists of four diodes namely D1, D2, D3 and D4. During the positive half cycle
diodes D1 & D4 conduct whereas in the negative half cycle diodes D2 & D3 conduct thus the
diodes keep switching the transformer connections so we get positive half cycles in the output.
If we use a center tapped transformer for a bridge rectifier we can get both positive & negative
half cycles which can thus be used for generating fixed positive & fixed negative voltages.
4.3 VOLTAGE REGULATOR
A Voltage regulator is a device which converts varying input voltage into a constant regulated
output voltage. Voltage regulator can be of two types
1) Linear Voltage Regulator
Also called as Resistive Voltage regulator because they dissipate the excessive voltage
resistively as heat.
2) Switching Regulators.
They regulate the output voltage by switching the Current ON/OFF very rapidly. Since their
output is either ON or OFF it dissipates very low power thus achieving higher efficiency as
compared to linear voltage regulators. But they are more complex & generate high noise due to
7/29/2019 Patient Gsm New
16/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
their switching action. For low level of output power switching regulators tend to be costly but
for higher output wattage they are much cheaper than linear regulators.
The most commonly available Linear Positive Voltage Regulators are the 78XX series where the
XX indicates the output voltage. And 79XX series is for Negative Voltage Regulators.
After filtering the rectifier output the signal is given to a voltage regulator. The maximum input
voltage that can be applied at the input is 35V.Normally there is a 2-3 Volts drop across the
regulator so the input voltage should be at least 2-3 Volts higher than the output voltage. If the
input voltage gets below the Vmin of the regulator due to the ripple voltage or due to any other
reason the voltage regulator will not be able to produce the correct regulated voltage.
3 Circuit diagram:
Fig 2.3. Circuit Diagram of power supply
IC 7805:
7805 is an integrated three-terminal positive fixed linear voltage regulator. It supports an input
voltage of 10 volts to 35 volts and output voltage of 5 volts. It has a current rating of 1 amp
although lower current models are available. Its output voltage is fixed at 5.0V. The 7805 also
7/29/2019 Patient Gsm New
17/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
has a built-in current limiter as a safety feature. 7805 is manufactured by many companies,
including National Semiconductors and Fairchild Semiconductors.
The 7805 will automatically reduce output current if it gets too hot.The last two digits represent
the voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series of regulators is
designed to work in complement with the 79xx series of negative voltage regulators in systems
that provide both positive and negative regulated voltages, since the 78xx series can't regulate
negative voltages in such a system.
The 7805 & 78 is one of the most common and well-known of the 78xx series regulators, as it's
small component count and medium-power regulated 5V make it useful for powering TTL
devices.
Table. Specifications of IC7805
SPECIFICATIONS IC 7805
Vout 5V
Vein - Vout Difference 5V - 20V
Operation Ambient Temp 0 - 125C
Output Imax 1A
7/29/2019 Patient Gsm New
18/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
CHAPTER-5
SENSORS
The sensors used in this project are Heartbeat and Temperature sensor. The
output of temperature sensor is given to the ADC so as to convert the analog value into digital
data and then give it to the microcontroller. The Heartbeat sensor used is basically a LED and
LDR arrangement.
5.1 HERT BEAT SENSOR
7/29/2019 Patient Gsm New
19/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
LED and LDR arrangement
The Heartbeat sensor used in this project is basically a LED and LDR arrangement.
The LED used in this arrangement is a high intensity LED.
Heart beat is sensed by using a high intensity type LED and LDR. The finger is
placed between the LED and LDR. As sensor, a photo diode or a photo transistor 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 preprocessing of the raw signal.
The setup described here uses a red LED for transmitted light illumination anda LDR as detector. With only slight changes in the preamplifier circuit the same hardware and
software could be used with other illumination and detection concepts. These values are sent to
the ADC for conversion of analog to digital and then sent to the microcontroller.
5.2 LM35 TEMPERATURE SENSOR
7/29/2019 Patient Gsm New
20/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
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 14C at room temperature and 34C over a full 55 to +150C temperature
range.
The LM35s low output impedance, linear output, and precise inherent calibration make
interfacing to readout or control circuitry especially easy. It can be used with single power
supplies, or with plus and minus supplies. As it draws only 60 A from its supply, it has very
low self-heating, less than 0.1C in still air.
5.2.1 FEATURES
Calibrated directly in Celsius (Centigrade)
Linear + 10.0 mV/C scale factor
0.5C accuracy guaranteed (at +25C)
Rated for full 55 to +150C 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.08C in still air
Nonlinearity only 14C typical
Low impedance output, 0.1 W for 1 mA load
7/29/2019 Patient Gsm New
21/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
The characteristic of this LM35 sensor is:
For each degree of centigrade temperature it outputs 10milli volts.
7/29/2019 Patient Gsm New
22/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
CHAPTER-6
ANALOG TO DIGITAL CONVERTER
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.
6.1 PIN DIAGRAM
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 110s.
7/29/2019 Patient Gsm New
23/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
6.2 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.
7/29/2019 Patient Gsm New
24/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
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 clockgenerator of the ADC0804, the CLK IN and CLK R are connected to a capacitor and a resistor.
In that case, the clock frequency is determined by the equation:
f = 1/ (1.1RC)
Typical values are R=10K ohms and C= 150 pf. Substituting in the above equation, the
frequency is calculated as 606 kHz. Thus, the conversion time is 110s.
INTR
This is an output pin and is active low. It is a normally high pin and when the conversion is
finished, it goes low to signal the CPU that the converted data is ready to be picked up. After
INTR goes low, the CS pin is made low i.e., CS=0 and send a high-to-low pulse to the RD pin to
get the data out of the ADC0804 chip.
Vin(+) and Vin(-)
These are the differential analog inputs where Vin=Vin(+) Vin(-). The Vin(-) pin is connected
to ground and the Vin(+) pin is used as the analog input to be converted to digital.
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
7/29/2019 Patient Gsm New
25/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
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
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.
Clock source for ADC0804:
The speed at which an analog input is converted to the digital output depends on thespeed of the CLK input. According to the ADC0804 datasheets, the typical operating frequency
is approximately 640 kHz at 5 volts.
ADC interface with Microcontroller:
7/29/2019 Patient Gsm New
26/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
7/29/2019 Patient Gsm New
27/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
CHAPTER-7
LIQUID CRYSTAL DISPLAY
LCD stands forLiquid Crystal Display. LCD is finding wide spread use replacing LEDs (seven
segment LEDs or other multi segment LEDs) because of the following reasons:
1. The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in contrast to LEDs,
which are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the
task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep
displaying the data.
4. Ease of programming for characters and graphics.
7.1 LCD SCREEN
LCD screen consists of two lines with 16 characters each. Each character consists of 5x7 dot
matrix. Contrast on display depends on the power supply voltage and whether messages are
displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied on pin marked as
Vee. Trimmer potentiometer is usually used for that purpose. Some versions of displays have
built in backlight (blue or green diodes). When used during operating, a resistor for current
limitation should be used (like with any LE diode).
7/29/2019 Patient Gsm New
28/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
LCD Connection
Depending on how many lines are used for connection to the microcontroller, there are 8-bit and
4-bit LCD modes. The appropriate mode is determined at the beginning of the process in a phase
called initialization. In the first case, the data are transferred through outputs D0-D7 as it has
been already explained. In case of 4-bit LED mode, for the sake of saving valuable I/O pins of
the microcontroller, there are only 4 higher bits (D4-D7) used for communication, while other
may be left unconnected.
Consequently, each data is sent to LCD in two steps: four higher bits are sent first (that normally
would be sent through lines D4-D7), four lower bits are sent afterwards. With the help of
initialization, LCD will correctly connect and interpret each data received.
Besides, with regards to the fact that data are rarely read from LCD (data mainly are transferredfrom microcontroller to LCD) one more I/O pin may be saved by simple connecting R/W pin to
the Ground. Such saving has its price.
Even though message displaying will be normally performed, it will not be possible to read from
busy flag since it is not possible to read from display.
7/29/2019 Patient Gsm New
29/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
7.2 LCD INTERFACING WITH 8051
7/29/2019 Patient Gsm New
30/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
CHAPTER-8
RS-232 AND MAX-232
8.1 RS 232:
RS-232 is simple, universal, well understood and supported but it has some
serious shortcomings as a data interface. The standards to 256kbps or less and line lengths
of 15M (50 ft) or less but today we see high speed ports on our home PC running very high
speeds and with high quality cable maxim distance has increased greatly. The rule of
thumb for the length a data cable depends on speed of the data, quality of the cable.
.
Sub-D15 Male Sub-D15 Female
This is a standard 9 to 25 pin cable layout for async data on a PC AT serial cable
Description Signal 9-pin DTE 25-pin DCE Source DTE or DCE
Carrier Detect CD 1 8 from Modem
Receive Data RD 2 3 from ModemTransmit Data TD 3 2 from Terminal/Computer
Data Terminal Ready DTR 4 20 from Terminal/Computer
Signal Ground SG 5 7 from Modem
Data Set Ready DSR 6 6 from Modem
Request to Send RTS 7 4 from Terminal/Computer
Clear to Send CTS 8 5 from Modem
Ring Indicator RI 9 22 from Modem
7/29/2019 Patient Gsm New
31/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
8.2 MAX 232:
DESCRIPTION:
The MAX232 device is a dual driver/receiver that includes a capacitive voltage
generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-232
inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and a typical
7/29/2019 Patient Gsm New
32/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
hysteresis of 0.5 V, and can accept 30-V inputs. Each driver converts TTL/CMOS input levels into
EIA-232 levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas .
8.2.1 FEATURES:
Operates With Single 5-V Power Supply
Lin Bi CMOS Technology
Two Drivers and Two Receivers
30-V Input Levels
Low Supply Current . . . 8 mA Typical
Meets or Exceeds TIA/EIA-232-F and ITU
Recommendation V.28
8.2.2 APPLICATIONS:
TIA/EIA-232-F
Battery-Powered Systems
Terminals
Modems
Computers
ESD Protection Exceeds 2000 V Per
MIL-STD-883, Method 3015
Package Options Include Plastic
Small-Outline (D, DW) Packages and
Standard Plastic (N) DIPs
7/29/2019 Patient Gsm New
33/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
Absolute maximum ratings
Input supply voltage range, VCC : 0.3 V to 6 V
Positive output supply voltage range: VS+ VCC 0.3 V to 15 V
Negative output supply voltage range: VS0.3 V to 15 V
Input voltage range, VI: Driver:0.3 V to VCC + 0.3 V
Receiver: 30 V
Output voltage range, VO: T1OUT, T2OUT VS 0.3 V to VS+ + 0.3 V
R1OUT, R2OUT : 0.3 V to VCC + 0.3 V
Short-circuit duration: T1OUT, T2OUT: Unlimited
Package thermal impedance, D package :113C/W
DW package : 105C/W
N package : 78C/W
Storage temperature range, Tstg : 65C to 150C
Lead temperature 1,6 mm (1/16 inch) from case for 10 seconds: 260 C
Stresses beyond those listed under absolute maximum ratings may cause permanent
damage to the device. These are stress ratings only, and functional operation of the device at
7/29/2019 Patient Gsm New
34/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
these or any other conditions beyond those indicated under recommended operating conditions
is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affect
device reliability. NOTE 1: All voltage values are with respect
to network ground terminal.2. The package thermal impedance is calculated in accordance with
JESD 51, except for through-hole packages, which use a trace length of zero description
8.2.3. MAX 232 Interfacing with RS232 and 89C51 microcontroller:
The MAX232 device is a dual driver/receiver that includes a capacitive voltage
generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts
EIA-232 inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and
a typical hysterics of 0.5 V, and can accept 30-V inputs. Each driver converts TTL/CMOS
input levels into EIA-232 levels. The driver, receiver, and voltage-generator functions areavailable as cells in the Texas.
CHAPTER-9
GSM MODEM
7/29/2019 Patient Gsm New
35/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
9.1 THEORY
Unlike mobile phones, a GSM modem doesnt have a keypad and display to interact with. It justaccepts certain commands through a serial interface and acknowledges for those. These
commands are called as AT commands. There are a list of AT commands to instruct the modem
to perform its functions. Every command starts with "AT". Thats why they are called as AT
commands. AT stands for attention.
7/29/2019 Patient Gsm New
36/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
SMS Related AT Commands
AT It is used to test the connection.
AT+CMGF=1 It is used to instruct the modem to operate in text mode. AT+CMGF=0will instruct the modem to operate in PDU mode.
AT+CMGS="mobile
number"
It is used to send a text message. It accepts the recipient mobile number.
As soon as this command is accepted the modem waits for the message
content. The text message has to be sent sequentially and terminated by
the char0x1A.
AT+CMGW="mobile
number"
It is used to store a message in the memory. After execution it returns
an index for the message stored. Eg: AT+CMGW=1 . Here 1 is the
index for the saved message. Later this index is used to process the
message like deleting it or forwarding to the recipient number.
AT+CMGD=2It is used to delete a message from the storage. The index of the storedmessage is used to delete it. Above command deletes the message with
index 2.
In our simple project, the program waits for the mobile number to be entered through thekeyboard. When a ten digit mobile number is provided, the program instructs the modem to send
the text message using a sequence of AT commands
Testing your GSM modem
The GSM modem can be tested by connecting it with a PC. The modem is equipped with
a RS232 cable. Just use a Serial to USB converter and connect it with the PC. Now you can proceed with sending the commands to the modem using any serial
communication program like Hyperterminal, minicom etc. Ensure the serial paramters are
configured to 8N1 and the baudrate is set to 9600bps.
For each command you send the modem acknowledges with a message. Example: Just try
sending "AT" to the modem. It sends back a result code "OK" which states that the
modem is responding. If its not working fine, it sends "ERROR".
APPLICATIONS
7/29/2019 Patient Gsm New
37/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
1. All the parameters can be viewed on the mobile phone.
2. Most reliable.
3. Cost effective.
4. Supports innumerable sensors to the system.
RESULTS AND CONCLUSION
Results
Assemble the circuit on the PCB as shown in Fig 5.1. After assembling the circuit on the
PCB, check it for proper connections before switching on the power supply.
7/29/2019 Patient Gsm New
38/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
Conclusion
The implementation of Heartbeat Monitoring System using GSM is done successfully. The
communication is properly done without any interference between different modules in the design.
Design is done to meet all the specifications and requirements. Software tools like Keil Uvision
Simulator, Proload to dump the source code into the microcontroller, Orcad Lite for the schematic
diagram have been used to develop the software code before realizing the hardware.
The performance of the system is more efficient. Continuously reading the output from
the sensors and pass the data to the doctors mobile whenever the read values exceed the normal
values or whenever the doctor sends a request to the controlling unit is the main job carried out
by the microcontroller. The mechanism is controlled by the microcontroller.
Circuit is implemented in Orcad and implemented on the microcontroller board. The performance
has been verified both in software simulator and hardware design. The total circuit is completely verified
functionally and is following the application software.
It can be concluded that the design implemented in the present work provide portability, flexibility and
the data transmission is also done with low power consumption.
REFRENCES AND BIBLOGRAPHY
Muhammad Ali Mazidi , Janice Gillispie Mazidi, Rolin D. Mckinlay.
Second edition, THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEM
K. J. Ayala. Third edition, The 8051 MICROCONTROLLER
General information about electronic voting machine
7/29/2019 Patient Gsm New
39/39
SMS BASED PATIENT REPORT FROM REMOTE
PLACE
www.eci.gov.in
www.eci.gov.in/faq/evm.asp
www.eci.gov.in/Audio_VideoClips/presentation/EVM.ppt
www.rajasthan.net/election/guide/evm.htm
www.indian-elections.com/electoralsystem/electricvotingmachine.html
Tutorial on microcontroller:
www.8051projects.net/microcontroller_tutorials/
Tutorial on LCD:
www.8051projects.net/lcd-interfacing/
http://www.eci.gov.in/http://www.eci.gov.in/faq/evm.asphttp://www.eci.gov.in/Audio_VideoClips/presentation/EVM.ppthttp://www.rajasthan.net/election/guide/evm.htmhttp://www.indian-elections.com/electoralsystem/electricvotingmachine.htmlhttp://www.8051projects.net/lcd-interfacing/http://www.eci.gov.in/faq/evm.asphttp://www.eci.gov.in/Audio_VideoClips/presentation/EVM.ppthttp://www.rajasthan.net/election/guide/evm.htmhttp://www.indian-elections.com/electoralsystem/electricvotingmachine.htmlhttp://www.8051projects.net/lcd-interfacing/http://www.eci.gov.in/