heart beat monitoring by gsm technology
TRANSCRIPT
-
7/25/2019 Heart Beat Monitoring by GSM Technology
1/53
Heart Beat Monitoring By GSM Technology
FROM:
Engr Rana Muhammad Shakeel
https://www.facebook.com/EngnrShakeel
pl like m! page:
https://www.facebook.com/Electrical"Electronics
For MORE #RO$E%&S:
http://electro'technolg!.blogspot.com
CHAPTER 1
INTRODUCTION
%ardio(ascular disease is one of the main causes of death in the man! countries and
in )***+ it accounted for o(er ), million deaths worldwide. -n addition+ se(eral million
people are disabled b! cardio(ascular disease 0O+ )***1. &he dela! between the first
s!mptom of an! cardiac ailment and the call for medical assistance has a large (ariation
among different patients and can ha(e fatal conse2uences. One critical inference drawn
from epidemiological data is that deplo!ment of resources for earl! detection and
treatment of heart disease has a higher potential of reducing fatalit! associated with
cardiac disease than impro(ed care after hospitaliation. 0ence new strategies are needed
in order to reduce time before treatment. Monitoring of patients is one possible solution.
3lso+ the trend towards an independent lifest!le has also increased the demand for
personalied non'hospital based care.
&his pro4ect 50eart beat monitoring b! 6SM technolog!7 can be used in hospitals
and also for patients who can be under continues monitoring while tra(eling from place to
place. Since the s!stem is continuousl! monitoring the patient and in case of an!
abnormal in the heart beat rate of the patient the s!stem will immediatel! message to the
concerned doctors and relati(es about the condition of the patient and abnormal details.
&o perform these operations the s!stem uses heart beat sensor+ 6SM modem+ and to
control all these de(ices the heart of the s!stem micro controller #8*9,)R;1 is used.1.1 Proposed Work
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
mailto:[email protected]://www.facebook.com/EngnrShakeelhttps://www.facebook.com/Electrical4Electronicshttp://electro-technolgy.blogspot.com/https://www.facebook.com/EngnrShakeelhttps://www.facebook.com/Electrical4Electronicshttp://electro-technolgy.blogspot.com/mailto:[email protected] -
7/25/2019 Heart Beat Monitoring by GSM Technology
2/53
Heart Beat Monitoring By GSM Technology
Some se(ere diseases and disorders e.g. heart failure needs close and continual
monitoring procedure after diagnosis+ in order to pre(ent mortalit! or further damage as
secondar! to the mentioned diseases or disorders. Monitoring these t!pes of patients+
usuall!+ occur at hospitals or healthcare centers. 0eart arrh!thmias for instance+ in man!
cases+ need continual long'term monitoring. 0owe(er+ the patients are often too earl!
released+ owing to need of hospital bed for another patient on the waiting list+ who needs
to be hospitalied immediatel!.
1.2Scope of the Work
-
7/25/2019 Heart Beat Monitoring by GSM Technology
3/53
Heart Beat Monitoring By GSM Technology
CHAPTER 2
S%STE" DESCRIPTION
2.1 INTRODUCTION
Embedded s!stems are one of the emerging technologies which are touching e(er!
nook and corner of the mind. 5-t is impossible to li(e without these embedded gadgets7'
sa!s E
-
7/25/2019 Heart Beat Monitoring by GSM Technology
4/53
Heart Beat Monitoring By GSM Technology
Recei,er
2.2.1 POWER SUPP'%
&he ;A9 line (oltage is step'down+ rectified+ filtered and regulated using
regulators to obtain desired (oltages. &his circuit can gi(e B,9 output at about ),A m3
current and B.8( and );( respecti(el!.
2.2.2 "ICROCONTRO''ER
&he microcontroller used is #8*9,)R; operates at )).A,*; M0 at ,9 .%.
Microcontroller controls all the operation. &he microcontroller obtains the input from the
heart beat sensors and monitors the heart beat rate.
2.2.3 'I-UID CR%STA' DISP'A% 'CD/
3
-
7/25/2019 Heart Beat Monitoring by GSM Technology
5/53
Heart Beat Monitoring By GSM Technology
&his 6SM'Modem should be a plug and pla! 6SM *AA / 6SM )8AA / 6SM )*AA
modem. 3 direct and eas! integration with RS;; and with in (oltage range for the power
suppl!.
3 39E%OMs 6SM/6#RS modem is suitable for the 6SM'SMS &ranscei(er S!stem.
&he features of S-M%OM'Modem:
&riband 6SM 6#RS modemE6SM *AA/)8AA/)*AA M01
esigned for 6#RS+ data+ fa=+ SMS and (oice applications
6#RS multi'slot class )A
6#RS mobile station class >
esigned for 6#RS+ data+ fa=+ SMS and (oice applications
Full! compliant with 6SM #hase ;/;B specifications
>uilt'in &%#/-# #rotocol
>uilt'in R&% in the module
3& %ommand based
2.2. HEART&EAT SENSOR
0eart beat sensor is designed to gi(e digital output of heat beat when a finger is
placed on it. hen the heart beat detector is working+ the beat eats #er Minute >#M1 rate. -t works on the principle of light modulation
b! blood flow through finger at each pulse.
2.3 CIRCUIT DIA)RA"
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
6/53
Heart Beat Monitoring By GSM Technology
CHAPTER 3
HARDWARE DESCRIPTION
3.1 POWER SUPP'%
&he transformer ;A9olts will be stepped down to );'A'); one side of the );9 is
gi(en to the G8A, and
-
7/25/2019 Heart Beat Monitoring by GSM Technology
7/53
Heart Beat Monitoring By GSM Technology
&he 16668fcapacitor ser(es as a Jreser(oirJ which maintains a reasonable input
(oltage to the G8A, throughout the entire c!cle of the ac line (oltage. &he bridge rectifier
W"601 keep recharging the reser(oir capacitor on alternate half'c!cles of the line
(oltage+ and the capacitor is 2uite capable of sustaining an! reasonable load in between
charging pulses.
&he 'EDand its series resistor226oh+1 ser(e as a pilot light to indicate when the power
suppl! is on and also helps to the reser(oir capacitor is completel! discharged after power
is turned off. &hen - know its safe to remo(e or install components for the ne=t
e=periment.
9i 1: Po;er s
-
7/25/2019 Heart Beat Monitoring by GSM Technology
8/53
Heart Beat Monitoring By GSM Technology
-
7/25/2019 Heart Beat Monitoring by GSM Technology
9/53
Heart Beat Monitoring By GSM Technology
&he #8*9,)R>;/R%;/R; are 8A%,) microcontrollers with )D/;/D" k> flash and
)A;" > of data R3M. 3 ke! feature of the #8*9,)R>;/R%;/R; is its C; mode option.
&he design engineer can choose to run the application with the con(entional 8A%,) clock
rate ); clocks per machine c!cle1 or select the C; mode si= clocks per machine c!cle1
to achie(e twice the throughput at the same clock fre2uenc!. 3nother wa! to benefit from
this feature is to keep the same performance b! reducing the clock fre2uenc! b! half+ thus
dramaticall! reducing the EM- &he flash program memor! supports both parallel
programming and in serial -S#. #arallel programming mode offers gang'programming at
high speed+ reducing programming costs and time to market. -S# allows a de(ice to be
reprogrammed in the end product under software control. &he capabilit! to field/update
the application firmware makes a wide range of applications possible. &he
#8*9,)R>;/R%;/R; is also capable of -3#+ allowing the flash program memor! to be
reconfigured e(en while the application is running.
2. 9e*t of on'chip flash user code memor! with -S# and -3#
Supports );'clock default1 or D'clock mode selection (ia software or -S#
S#- and enhanced 3R&
#%3 with #M and capture/compare functions Four 8'bit -/O ports with three high'current port ) pins )D m3 each1
&hree )D'bit timers/counters
#rogrammable watchdog timer
Eight interrupt sources with four priorit! le(els
Second #&R register
-
7/25/2019 Heart Beat Monitoring by GSM Technology
10/53
Heart Beat Monitoring By GSM Technology
P5=1R&2>RC2>RD2
9i 0: DIP06 pi! co!fi
-
7/25/2019 Heart Beat Monitoring by GSM Technology
11/53
Heart Beat Monitoring By GSM Technology
0. PIN DESCRIPTION
CC: Suppl! (oltage.
)ND: 6round.
Port 6:
#ort A is an 8'bit open'drain bi'directional -/O port. 3s an output port+ each pin
can sink eight &&< inputs. hen )s are written to port A pins+ the pins can be used as
high'impedance inputs. #ort A ma! also be configured to be the multiple=ed low'order
address/data bus during accesses to e=ternal pro'gram and data memor!. -n this mode #A
has internal pull'ups. #ort A also recei(es the code b!tes during Flash programming+ and
outputs the code b!tes during program (erification. E=ternal pull'ups are re2uired during
program (erification.
Port 1:
#ort ) is an 8'bit bi'directional -/O port with internal pull'ups. &he #ort ) output
buffers can sink/source four &&< inputs. hen )s are written to #ort ) pins the! are
pulled high b! the internal pull'ups and can be used as inputs. 3s inputs+ #ort ) pins that
are e=ternall! being pulled low will source1 because of the internal pull'ups. %urrent -- and is organied as );8/;,D/,); sectors+ each sector consists of );8 >. >lock )
contains the -3#/-S# routines and ma! be enabled such that it o(erla!s the first 8 k> of
the user code memor!. &he o(erla! function is controlled b! the combination of the
Software Reset >it SR1 at F%F.) and the >ank Select >it >SESE< bit
F%F.A1+ pro(ided that the SR bit F%F.)1 is cleared. Following a power'on se2uence+
the boot code is automaticall! e=ecuted and attempts to auto baud to a host. -f no auto
baud occurs within appro=imatel! "AA ms and the Soft-%E flag is not set+ control will be
passed to the user code. 3 software reset is used to accomplish this control transfer and as
a result the SR bit will remain set. &herefore the users code will need to clear the SR
bit in order to access the -3# routines in block ). 0owe(er+ caution must be taken when
d!namicall! changing the >SE< bit. Since this will cause different ph!sical memor! to be
mapped to the logical program address space+ the user must a(oid clearing the >SE< bit
when e=ecuting user code within the address range AAAA0 to )FFF0.
Po;ero! reset code eBec
-
7/25/2019 Heart Beat Monitoring by GSM Technology
13/53
Heart Beat Monitoring By GSM Technology
de(ice without a (alid reset could cause the M% to start e=ecuting instructions from an
indeterminate location. Such undefined states ma! inad(ertentl! corrupt the code in the
flash. 3 s!stem reset will not affect the ) k> of on'chip R3M while the de(ice is running+
howe(er+ the contents of the on'chip R3M during power up are indeterminate. hen
power is applied to the de(ice+ the RS& pin must be held high long enough for the
oscillator to start up usuall! se(eral milliseconds for a low fre2uenc! cr!stal1+ in addition
to two machine c!cles for a (alid power'on reset. 3n e=ample of a method to e=tend the
RS& signal is to implement a R% circuit b! connecting the RS& pin to 9 through a )A
mF capacitor and to 9SS through an 8.; k resistor as shown in Figure ,. ?ote that if an
R% circuit is being used+ pro(isions should be made to ensure the 9 rise time does not
e=ceed ) ms and the oscillator start'up time does not e=ceed )A ms. For a low fre2uenc!
oscillator with slow start'up time the reset signal must be e=tended in order to account for
the slow start'up time. &his method maintains the necessar! relationship between 9
and RS& to a(oid programming at an indeterminate location+ which ma! cause corruption
in the code of the flash. &he power'on detection is designed to work during initial power
up+ before the (oltage reaches the brownout detection le(el. &he #OF flag in the #%O?
register is set to indicate an initial power up condition. &he #OF flag will remain acti(e
until cleared b! software. Following a power'on or e=ternal reset the
#8*9,)R>;/R%;/R; will force the SR and >SE< bits F%FN):A1 P AA. &his causes
the boot block to be mapped into the lower 8 k> of code memor! and the de(ice will
e=ecute the -S# code in the boot block and attempt to auto baud to the host. -f the auto
baud is successful the de(ice will remain in -S# mode. -f+ after appro=imatel! "AA ms+ the
auto baud is unsuccessful the boot block code will check to see if the Soft-%E flag is set
from a pre(ious programming operation1. -f the Soft-%E flag is set the de(ice will enter
Soft-%E mode. -f the Soft-%E flag is cleared+ the boot code will e=ecute a software reset
causing the de(ice to e=ecute the user code from block A starting at address AAAA0. ?ote
that an e=ternal reset applied to the RS& pin has the same effect as a power'on reset.
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
14/53
Heart Beat Monitoring By GSM Technology
Soft;*re reset
3 software reset is e=ecuted b! changing the SR bit F%F.)1 from QAK to Q)K. 3
software reset will reset the program counter to address AAAA0 and force both the SR
and >SE< bits F%FN):A1 P )A. &his will result in the lower 8 k> of the user code
memor! being mapped into the user code memor! space. &hus the users code will be
e=ecuted starting at address AAAA0. 3 software reset will not change &%.; or R3M
data. Other SFRs will be set to their reset (alues.
&ro;!o;/R%;/R;s brownout detection threshold is
;., 9. hen 9 drops below this (oltage threshold+ the brownout detect triggers the
circuit to generate a brownout interrupt but the %# still runs until the supplied (oltage
returns to the brownout detection (oltage 9>O. &he default operation for a brownout
detection is to cause a processor reset. 9 must sta! below 9>O at least fouroscillator clock periods before the brownout detection circuit will respond. >rownout
interrupt can be enabled b! setting the E>O bit -E3.1. -f E>O bit is set and a brownout
condition occurs+ a brownout interrupt will be generated to e=ecute the program at
location AA">0. -t is re2uired that the E>O bit be cleared b! software after the brownout
interrupt is ser(iced. %learing E>O bit when the brownout condition is acti(e will
properl! reset the de(ice. -f brownout interrupt is not enabled+ a brownout condition will
reset the program to resume e=ecution at location AAAA0. 3 brownout detect reset will
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
15/53
Heart Beat Monitoring By GSM Technology
clear the >SE< bit F%F.A1 but will not change the SR bit F%F.)1 and therefore will
not change the banking of the lower 8 k> of user code memor! space.
W*tchdo reset
SE< bit
F%F.A1 but will not change the SR bit F%F.)1 and therefore will not change the
banking of the lower 8 k> of user code memor! space. &he state of the SR and >SE of internal memor!. &he de(ice can also address up to D" k>
for e=ternal data memor!.
EBp*!ded d*t* RA" *ddressi!
&he #8*9,)R>;/R%;/R; has ) k> of R3M
&he de(ice has four sections of internal data memor!:
). &he lower );8 > of R3M AA0 to GF01 are directl! and indirectl! addressable.
;. &he higher );8 > of R3M 8A0 to FF01 are indirectl! addressable.
. &he special function registers 8A0 to FF01 are directl! addressable onl!.
". &he e=panded R3M of GD8 > AA0 to ;FF01 is indirectl! addressable b! the mo(e
e=ternal instruction MO9C1 and clearing the EC&R3M bit
Since the upper );8 > occup! the same addresses as the SFRs+ the R3M must be
accessed indirectl!. &he R3M and SFRs space are ph!sicall! separate e(en though the!
ha(e the same addresses.
I!ter!*# *!d eBter!*# d*t* +e+or$ str
-
7/25/2019 Heart Beat Monitoring by GSM Technology
16/53
Heart Beat Monitoring By GSM Technology
D
-
7/25/2019 Heart Beat Monitoring by GSM Technology
17/53
Heart Beat Monitoring By GSM Technology
>oot block operations include erase user code+ program user code+ program securit! bits+
etc.
3 chip'erase operation can be performed using a commerciall! a(ailable parallel
programer. &his operation will erase the contents of this >oot >lock and it will be
necessar! for the user to reprogram this >oot >lock block )1 with the ?C#'pro(ided
-S#/-3# code in order to use the -S# or -3# capabilities of this de(ice.
.-S#
-S# is performed without remo(ing the microcontroller from the s!stem. &he -S#
facilit! consists of a series of internal hardware resources coupled with internal firmware
to facilitate remote programming of the #8*9,)R>;/R%;/R; through the serial port.
&his firmware is pro(ided b! ?C# and embedded within each #8*9,)R>;/R%;/R;
de(ice. &he ?C# -S# facilit! has made in'circuit programming in an embedded
application possible with a minimum of additional e=pense in components and circuit
board area. &he -S# function uses fi(e pins 9+ 9SS+ &C+ RC+ and RS&1. Onl! a
small connector needs to be a(ailable to interface !our application to an e=ternal circuit in
order to use this feature
.)sing the -S#
&he -S# feature allows for a wide range of baud rates to be used in !our application+
independent of the oscillator fre2uenc!. -t is also adaptable to a wide range of oscillator
fre2uencies. &his is accomplished b! measuring the bit'time of a single bit in a recei(ed
character. &his information is then used to program the baud rate in terms of timer counts
based on the oscillator fre2uenc!. &he -S# feature re2uires that an initial character an
uppercase 1 be sent to the #8*9,)R>;/R%;/R; to establish the baud rate. &he -S#
firmware pro(ides auto'echo of recei(ed characters. Once baud rate initialiation has
been performed+ the -S# firmware will onl! accept -ntel 0e='t!pe records
3R&s
&he 3R& operates in all standard modes. Enhancements o(er the standard
8A%,) 3R& include Framing Error detection+ and automatic address recognition.
Mode A
Serial data enters and e=its through RC and &C outputs the shift clock. Onl! 8
bits are transmitted or recei(ed+ first. &he baud rate is fi=ed at )D of the %# clock
fre2uenc!. 3R& configured to operate in this mode outputs serial clock on &C line no
matter whether it sends or recei(es data on RC line.
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
18/53
Heart Beat Monitoring By GSM Technology
Mode )
)A bits are transmitted through &C1 or recei(ed through RC1: a start bit
logical A1+ 8 data bits first1+ and a stop bit logical )1. hen data is recei(ed+ the
stop bit is stored in R>8 in Special Function Register S%O?. &he baud rate is (ariable
and is determined b! the &imer ); o(erflow rate.
Mode ;
)) bits are transmitted through &C1 or recei(ed through RC1: start bit
logical A1+ 8 data bits first1+ a programmable *th data bit+ and a stop bit logical )1.
hen data is transmitted+ the *th data bit &>8 in S%O?1 can be assigned the (alue of A
or e.g. the parit! bit #+ in the #S1 could be mo(ed into &>81. hen data is recei(ed+
the *th data bit goes into R>8 in Special Function Register S%O?+ while the stop bit is
ignored. &he baud rate is programmable to either ))D or ); of the %# clock
fre2uenc!+ as determined b! the SMO) bit in #%O?.
Mode
)) bits are transmitted through &C1 or recei(ed through RC1: a start bit
logical A1+ 8 data bits first1+ a programmable *th data bit+ and a stop bit logical )1.
-n fact+ mode is the same as mode ; in all respects e=cept baud rate. &he baud rate in
mode is (ariable and is determined b! the &imer ); o(erflow rate.
S%O? RE6-S&ER address *8h1 bit allocation
SPI
SPI fe*t first data transfer
Four programmable bit rates
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
19/53
Heart Beat Monitoring By GSM Technology
End of transmission S#-F1
rite collision flag protection %O;/R%;/R; and peripheral de(ices or between se(eral #8*9,)R>;/R%;/R;
de(ices. Figure below shows the correspondence between master and sla(e S#- de(ices.
&he S%T pin is the clock output and input for the master and sla(e modes+ respecti(el!.
&he S#- clock generator will start following a write to the master de(ices S#- data
register. &he written data is then shifted out of the MOS- pin on the master de(ice into the
MOS- pin of the sla(e de(ice. Following a complete transmission of one b!te of data+ the
S#- clock generator is stopped and the S#-F flag is set. 3n S#- interrupt re2uest will be
generated if the S#- -nterrupt Enable bit S#-E1 and the Serial #ort -nterrupt Enable bit
ES1 are both set. 3n e=ternal master dri(es the Sla(e Select input pin+ SS/#)N"+ low to
select the S#- module as a sla(e. -f SS/#)N" has not been dri(en low+ then the sla(e S#-
unit is not acti(e and the MOS-/#)N, port can also be used as an input port pin. %#03
and %#O< control the phase and polarit! of the S#- clock. Following fig shows the four
possible combinations of these two bits
W*tchdo ti+er
&he de(ice offers a programmable atchdog &imer &1 for fail safe protection
against software deadlock and automatic reco(er!. &o protect the s!stem against software
deadlock+ the user software must refresh the & within a user'defined time period. -f
the software fails to do this periodical refresh+ an internal hardware reset will be initiated
if enabled RE P )1. &he software can be designed such that the & times out if the
program does not work properl!.
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
20/53
Heart Beat Monitoring By GSM Technology
&he & in the de(ice uses the s!stem clock C&3
-
7/25/2019 Heart Beat Monitoring by GSM Technology
21/53
Heart Beat Monitoring By GSM Technology
sensiti(e interrupts onl!. SR3M contents are retained during #ower'down+ the minimum
9 le(el is ;.A 9. &he de(ice e=its #ower'down mode through either an enabled
e=ternal le(el sensiti(e interrupt or a hardware reset. &he start of the interrupt clears the
# bit and e=its #ower'down. 0olding the e=ternal interrupt pin low restarts the
oscillator+ the signal must hold low at least )A;" clock c!cles before bringing back high
to complete the e=it. pon interrupt signal restored to logic 9-0+ the interrupt ser(ice
routine program e=ecution resumes beginning at the instruction immediatel! following
the instruction which in(oked #ower'down mode. 3 hardware reset starts the de(ice
similar to power'on reset. &o e=it properl! out of #ower'down mode+ the reset or e=ternal
interrupt should not be e=ecuted before the 9 line is restored to its normal operating
(oltage. >e sure to hold 9 (oltage long enough at its normal operating le(el for the
oscillator to restart and stabilie normall! less than )A ms1.
S$ste+ c#ock *!d c#ock optio!s
C#ock i!p
-
7/25/2019 Heart Beat Monitoring by GSM Technology
22/53
Heart Beat Monitoring By GSM Technology
the e=ternal memor! and the peripheral de(ices+ careful consideration must be taken. 3lso
note that the cr!stal output C&3
-
7/25/2019 Heart Beat Monitoring by GSM Technology
23/53
Heart Beat Monitoring By GSM Technology
9i :He*rt @e*t se!sor&he 0eart >eat Sensor pro(ides a simple wa! to stud! the hearts function. &his
sensor monitors the flow of blood through Finger. 3s the heart forces blood through the
blood (essels in the Finger+ the amount of blood in the Finger changes with time. &he
sensor shines a light lobe small 0igh >right
-
7/25/2019 Heart Beat Monitoring by GSM Technology
24/53
Heart Beat Monitoring By GSM Technology
9i : A s*+p#e +e*s
-
7/25/2019 Heart Beat Monitoring by GSM Technology
25/53
Heart Beat Monitoring By GSM Technology
SPECI9ICATIONS:
PIN DETAI'S:
>oard has 'pin connector for using the sensor. etails are marked on #%> as below.
USIN) THE SENSOR
%onnect regulated % power suppl! of , 9olts. >lack wire is 6round+ ?e=t
middle wire is >rown which is output and Red wire is positi(e suppl!. &hese
wires are also marked on #%>.
&o test sensor !ou onl! need power the sensor b! connect two wires B,9 and
6?. Vou can lea(e the output wire as it is. hen >eat
-
7/25/2019 Heart Beat Monitoring by GSM Technology
26/53
-
7/25/2019 Heart Beat Monitoring by GSM Technology
27/53
Heart Beat Monitoring By GSM Technology
&he pulse signal is applied to the #).A input of ; that is 3&8*S,; %an be an!
8A,) t!pe1 which is monitored b! the program whene(er this input goes high. -nternall!
to ;+ there is a counter which counts how man! )ms inter(als there are between two
high going heart beat pulses. &his number is then di(ided b! DA+AAA and the result is the
pulse rate. For e=ample+ if the pulse rate is DA >#M beats per minute1 there will be a
pulse e(er! second. &he duration of one heart beat will be one seconds or )AAA = )ms.
i(iding DA+AAA b! )AAA will gi(e the correct result of DA which is shown on the displa!.
-f there is in(alid result >#MW;AA1 it is in(alid and waits for ne=t c!cle.
3.0 'I-UID CR%STA' DISP'A%
-
7/25/2019 Heart Beat Monitoring by GSM Technology
28/53
!."
!.#
!.$
!.%
!.
!.!
Microcontroller
D'
D(
D"
D#
LCD
E)
*S
Heart Beat Monitoring By GSM Technology
to read and more pleasant to work with for long periods of time than most ordinar! (ideo
monitors. &here are se(eral tradeoffs as well+ such as limited (iew angle+ brightness+ and
contrast+ not to mention high manufacturing cost.)D=;
-
7/25/2019 Heart Beat Monitoring by GSM Technology
29/53
Heart Beat Monitoring By GSM Technology
9cc #in ;1:
&his pin is connected to B,( power suppl!.
9ss #in )1:
&his pin is connected to ground.
PIN OUT
&he module that we are using is a )D character = ; line displa! that we stock o(er
here. -t uses an S&GAD,% controller+ which is 0""G8A compatible. &he figure below
shows the
-
7/25/2019 Heart Beat Monitoring by GSM Technology
30/53
Heart Beat Monitoring By GSM Technology
9i=: 'CD pi!3 co!!ectio!
3.. )S"
6SM 6lobal S!stem for Mobile %ommunications originall! from )ro
-
7/25/2019 Heart Beat Monitoring by GSM Technology
31/53
Heart Beat Monitoring By GSM Technology
3..2 )S" Architect&S
0andset
A
X.25
A-bis SS7
Net;ork s
-
7/25/2019 Heart Beat Monitoring by GSM Technology
32/53
Heart Beat Monitoring By GSM Technology
#S&? is called a 5mobile originated call7 MO%1 or 5outgoing call7+ and a call from a
fi=ed network to a 6SM mobile station is called a 5mobile terminated call7 M&%1 or
5incoming call7. -n this document+ the word 5product7 refers to an! product supporting
the 3& commands interface.
'ED St*t
-
7/25/2019 Heart Beat Monitoring by GSM Technology
33/53
Heart Beat Monitoring By GSM Technology
-f the command line has been performed successfull!+ an O( string is returned.
-n some cases+ such as 53&B%#-?Z7 or unsolicited1 incoming e(ents+ the product
does not return the O( string as a response. -n the following e=amples Y%RW and
Y%RWYetween the hardware S-M detect pin indicating 5present7 and the pre(ious results the
3&B%#-?Z Sends 5B%ME ERROR: ,),7 #lease wait+ init in progress1. hen the S-M
detect pin indicates card absence+ and if a S-M %ard was pre(iousl! inserted+ an -MS-
detach procedure is performed+ all user data is remo(ed from the product #honebooks+
SMS etc.1. &he product then switches to e+ere!c$ +ode.
2.2 &*ckro
3fter entering the #-? #ersonal -dentification ?umber1+ some S-M user data files are
loaded into the product #honebooks+ SMS status+ etc.1. #lease be aware that it might take
some time to read a large phonebook. &he 3&B%#-?Z %ommand response comes 4ust
after the #-? is checked. 3fter this response user data is loaded in background1. &his
means that some data ma! not be a(ailable 4ust after #-? entr! is confirmed b! KOTK. &he
reading of phonebooks will then be refused b!
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
34/53
Heart Beat Monitoring By GSM Technology
5B%ME ERROR: ,),7 or 5B%MS ERROR: ,),7 meaning+ 5#lease wait+ ser(ice is not
a(ailable+ init in progress7. &his t!pe of answer ma! be sent b! the product at se(eral
points:
when tr!ing to e=ecute another 3& command before the pre(ious one is completed
before response1+
when switching from 3? to F? or F? to 3?1 and tr!ing to read the
rele(ant phonebook immediatel!+
hen asking for B%#-?Z Status immediatel! after S-M insertion and before the
product has determined if the inserted card is a (alid S-M %ard.
3 )e!er*# co++*!ds
3 .1 Se#ect TE ch*r*cter set CSCS3.1.1 Descriptio!:
&his command informs the ME which character set is used b! the &E. &he ME can
con(ert each character of entered or displa!ed strings. &his is used to send+ read or write
short messages. See also B#%S for the phonebooksK character sets.
3.1.2 S$!t*B:
%ommand S!nta=: 3&B%S%SPY%haracter SetW
CO""AND POSSI&'E
RESPONSES
3&B%S%SP76SM7 OT
Note: GSM default alphabet Note: Command valid
3&B%S%SP7#%%#"G7 OT
Note: PC character set code page 437 Note: Command valid
3&B%S%SPZ B%S%S: J6SMJ+J#%%#"GJ+J%S&OMJ+J0ECJ1 OTNote: Get possible values Note: Possible values
3.1.3 Defi!ed ,*#
-
7/25/2019 Heart Beat Monitoring by GSM Technology
35/53
Heart Beat Monitoring By GSM Technology
5HEF7...............................................0e=adecimal mode. ?o character set used the user
can read
or write he=adecimal (alues.
0 Oper*tor se#ectio! COPS0.1 Descriptio!:
&here are three possible wa!s of selecting an operator #
-
7/25/2019 Heart Beat Monitoring by GSM Technology
36/53
Heart Beat Monitoring By GSM Technology
B%O#S: YmodeW N+ YformatW+ YoperW
Response s!nta= for 3&B%O#SPZ:
B%O#S: Nlist of supported YstatW+ long alphanumeric YoperW+ short alphanumeric
YoperWs+
?umeric YoperW1 s
0.2 Net;ork reistr*tio! CRE)
0.2.1 Descriptio!:
&his command is used b! the application to ascertain the registration status of the product.
0.2.2 S$!t*B:
%ommand S!nta=: 3&B%RE6P YmodeW
Response S!nta=: B%RE6 : YmodeW+ YstatW N +YlacW+YciW for 3&B%RE6Z %ommand onl!
CO""AND POSSI&'E
RESPONSES
3&B%RE6Z B%RE6: YmodeW+YstatW
OT
Note: (s defined here)above
3&B%RE6PA OT
Note: *isable net'or+ registration Note: Command valid
unsolicited result code
3&B%RE6P) OT
Note: nable net'or+ registration Note: Command valid
unsolicited result code
3&B%RE6P; OT
Note: nable net'or+ registration and location Note: Command valid
information unsolicited result code
3&B%RE6PZ B%RE6: A';1
Note: -,.,/ 0mode1 values are supported
AT CO""ANDS TO SEND S"SC")S:
Descriptio!:
&his command is used b! the application to send the te=t message of the product.
.1 S$!t*B:
%ommand S!nta=: 3&B%M6SP YmodeW
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
37/53
Heart Beat Monitoring By GSM Technology
Response S!nta=: B %M6S : YmodeW+ YstatW N +YlacW+YciW for 3&B %M6SZ %ommand onl!
CO""AND POSSI&'ERESPONSES
3&B%M6SZ B %M6S: YmodeW+YstatWOT
Note: (s defined here)above
3&B%M6SPA OT
Note: *isable message sending Note: Command valid
2nsolicited result code
3&B %M6S P) OT
Note: nable message sending Note: Command valid
2nsolicited result code
CHAPTER 0
SO9TWARE DESCRIPTION
0.1 SO9TWARE USED
0.1.1 (EI' SO9TWARE
&he TE-< 8A,) e(elopment &ools are designed to sol(e the comple= problems
facing embedded software de(elopers.-n this pro4ect we select the TE-< software of
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
38/53
Heart Beat Monitoring By GSM Technology
(ersion8.A8 .>ecause it pro(ides e(ice atabase and the [9ision -E sets all compiler+
assembler+ linker+ and memor! options for !ou. ?umerous e=ample programs are
included in this software+ and also the TE-< [9ision ebugger accuratel! simulates on'
chip peripherals -\%+ %3?+ 3R&+ S#-+ -nterrupts+ -/O #orts+ 3/ %on(erter+ /3
%on(erter+ and #M Modules1 of !our 8A,) de(ice.
Simulation helps !ou understand hardware configurations and a(oids time wasted
on setup problems. hen testing the software application with target hardware+ use the
MO?,)+ MO?*A+ MO?3-+ or FlashMO?,) &arget Monitors+ the -S,) -n'S!stem
ebugger+ or the '$&36 3dapter to download and test program code on !our
target s!stem.
0.1.2 E"&EDDED C
&he % programming language is perhaps the most popular programming language
for programming embedded s!stems. Most % programmers are spoiled because the!
program in en(ironments where not onl! there is a standard librar! implementation+ but
there are fre2uentl! a number of other libraries a(ailable for use. &he cold fact is+ that in
embedded s!stems+ there rarel! are man! of the libraries that programmers ha(e grown
used to+ but occasionall! an embedded s!stem might not ha(e a complete standard librar!+
if there is a standard librar! at all. Few embedded s!stems ha(e capabilit! for d!namic
linking+ so if standard librar! functions are to be a(ailable at all+ the! often need to be
directl! linked into the e=ecutable. Oftentimes+ because of space concerns+ it is not
possible to link in an entire librar! file+ and programmers are often forced to Jbrew their
ownJ standard c librar! implementations if the! want to use them at all. hile some
libraries are bulk! and not well suited for use on microcontrollers+ man! de(elopment
s!stems still include the standard libraries which are the most common for %
programmers.
% remains a (er! popular language for micro'controller de(elopers due to the code
efficienc! and reduced o(erhead and de(elopment time. % offers low'le(el control and is
considered more readable than assembl!. Man! free % compilers are a(ailable for a wide
(ariet! of de(elopment platforms. &he compilers are part of an -Es with -% support+
breakpoints+ single'stepping and an assembl! window. &he performance of % compilers
has impro(ed considerabl! in recent !ears+ and the! are claimed to be more or less as
good as assembl!+ depending on who !ou ask. Most tools now offer options for
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
39/53
Heart Beat Monitoring By GSM Technology
customiing the compiler optimiation. 3dditionall!+ using % increases portabilit!+ since
% code can be compiled for different t!pes of processors.
0.2 PRO)RA"
]includeYp8*(,)rd;.hW//]includeYRe(erse.cW
]define
-
7/25/2019 Heart Beat Monitoring by GSM Technology
40/53
Heart Beat Monitoring By GSM Technology
unsigned char =data recd^charNM3C^RE%^%03R
enum ucsthreadState);
-?-&^S&3&E P A+
MOEM^%0T+S-M#-?^%0T+
S-MRE6^%0T+
SE?^%M?S+0E3R&^>E3&^MO?-&OR-?6+S&O#+ ?O^3%&-O?
]includeY(ariable.hW
(oid main(oid1
while)1
switchucsthreadState1
case -?-&^S&3&E:
&ES&PAe=tPA
eat J+
-
7/25/2019 Heart Beat Monitoring by GSM Technology
41/53
Heart Beat Monitoring By GSM Technology
ucsthreadStateP0E3R&^>E3&^MO?-&OR-?6
break
case 0E3R&^>E3&^MO?-&OR-?6 :while&ES&PPA1
MSela!,1
while&ES&PPA1
&RA P )#rep^lcd^rite^ataJ 0eart >eat J+
-
7/25/2019 Heart Beat Monitoring by GSM Technology
42/53
Heart Beat Monitoring By GSM Technology
?ORMNGP
?ORMN8Ptemp)AA
?ORMN*Ptemp)A ?ORMN)APtemp)
Sms^%ommand&oModemH?ORMNA+)1
MSela!)A1
Sms^%ommand&oModemH?ORMNA+;1MSela!)A1
=ttempPA
&RA P A&
-
7/25/2019 Heart Beat Monitoring by GSM Technology
43/53
Heart Beat Monitoring By GSM Technology
&R) P )
&- P )
R-PAES P )
#SP)
(oid serial^interrupt(oid1 interrupt "
unsigned char temp^char
if&-1
&- P A
elseifR-1
temp^char P S>F
R- P A iftemp^charWP3 HH temp^charYP1 temp^charWPa HH temp^charYP1
temp^charWPA HH temp^charYP*1 temp^charPPJ1 temp^charPP+1
temp^charPPB1 temp^charPP:11
recd^charNrecd^countBB P temp^char
ifrecd^count WPM3C^RE%^%03R1
recd^count P A
(oid b!te^he=^to^bcd^con(ersionunsigned int tmp^he=^(alue1
int he=^(alue P int1tmp^he=^(alue
unsigned char he=^wt / (ariable to store the weights of he= no /
ucbcd)AA P ucbcd)A P ucbcd) P A
he=^wt P A=D" / he= digit weight (alue /
while)1
he=^(alue 'P he=^wt
ifhe=^(alueYA1
break ucbcd)AABB
ucbcd)AA P ucbcd)AA B A=A he=^(alue BP he=^wt
he=^wt P A=3 / he= digit ; weight (alue /
while)1
he=^(alue 'P he=^wt
ifhe=^(alueYA1 break
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
44/53
Heart Beat Monitoring By GSM Technology
ucbcd)ABB
ucbcd)A P ucbcd)A B A=A he=^(alue BP he=^wt
ucbcd) P he=^(alueBA=A
(oid
-
7/25/2019 Heart Beat Monitoring by GSM Technology
45/53
Heart Beat Monitoring By GSM Technology
(oid MSela!unsigned int dela!1
unsigned int i+4foriPAiYdela!iBB1for4PA4Y;AAA4BB1
(oid MSela!^lcdunsigned int dela!1
unsigned int i
foriPAiYdela!iBB1
(oid timer^-nterrupt(oid1 interrupt ) //)AMS &-MER -?&ERR#&
&RA P A
&
-
7/25/2019 Heart Beat Monitoring by GSM Technology
46/53
Heart Beat Monitoring By GSM Technology
(oid check^Modem(oid1
unsigned char count P A
gbok^flag P A
while)1
%learRecd%har3rra!1recd^countPA
&=d%ommand&oModemJ3&`r`nJ1
gbok^flag P m!str^recdchar ncmpJOTJ+;1
ifgbok^flag1 break
countBB
ifcount PP )A1
#rep^lcd^rite^ataJModem initJ+
-
7/25/2019 Heart Beat Monitoring by GSM Technology
47/53
Heart Beat Monitoring By GSM Technology
unsigned char u%har)+u%har;PA=AA
whileu%har;BStr
-
7/25/2019 Heart Beat Monitoring by GSM Technology
48/53
Heart Beat Monitoring By GSM Technology
MSela!)A1
sBB
S>F P %3RR-36E^RE&R?MSela!)A1
whileLm!str^recdchar^ncmpJOTJ+;11 HH Lm!str^recdchar^ncmpJERRORJ+,111
ifm!str^recdchar^ncmpJOTJ+;11
#rep^lcd^rite^ataJMessage Sent J+
-
7/25/2019 Heart Beat Monitoring by GSM Technology
49/53
Heart Beat Monitoring By GSM Technology
,. -F MS6 ?O& SE?&
0.0.APP'ICATIONS
-t can be used in hospitals+ ma! be in -% or general wards so that alwa!s a bulk!
E%6 unit is not re2uired.
-t can also be emplo!ed in the houses so that the doctor can come to know about
the abnormalities when awa!.
&he use of 6SM technolog! simplifies the deli(er! of health care ser(ices and
enhances communication between health care pro(iders and their patients.
CHAPTER
RESU'TS AND DISCUSSIONS-t is neccesarr! to monitor the heart beat rate of patients those alread! recei(ing
some forms of surgical treatment+so our de(ice will be nearl! helpful for them.
Our de(ice will be able to
' #ro(ides earl! detection of heart attacks
' Eliminates dela!s in recei(ing medical treatment
' -mpro(es healthcare ser(ices to at risk population
' Sa(es li(es and impro(es 2ualit! of li(ing
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
"ASSA)E SENDIN) 9AI'ED
-
7/25/2019 Heart Beat Monitoring by GSM Technology
50/53
Heart Beat Monitoring By GSM Technology
F-6:0eart >eat Monitoring >! 6SM &echnolog!
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
51/53
Heart Beat Monitoring By GSM Technology
a
F-6:Microcontroller ith
-
7/25/2019 Heart Beat Monitoring by GSM Technology
52/53
Heart Beat Monitoring By GSM Technology
F-6:6SM Modem with sim card inserted
CHAPTER
CONC'USION AND 9UTURE ENHANCE"ENTS
.1 CONC'USION
%ardio(ascular disease is one of the ma4or causes of untimel! deaths in world+
heart beat readings are b! far the onl! (iable diagnostic tool that could promote earl!detection of cardiac e(ents. ireless and mobile technologies are ke! components that
would help enable patients suffering from chronic heart diseases to li(e in their own
homes and lead their normal life+while at the same time being monitored for an! cardiac
e(ents. &his will not onl! ser(e to reduce the burden on the resources of the healthcare
center but would also impro(e the 2ualit! of healthcare sector. -n this pro4ect+the heart
beat rate of the patient is sensed.hen the implant detects a heart beat rate+ it will alert
the microcontroller which in turn will automaticall! send the message and pro(ide the
patientKs condition so that the patient will be gi(en medical attention within the first few
critical hours+ thus greatl! impro(ing his or her chances of sur(i(al.
.2 9UTURE ENHANCE"ENTS
&his algorithm deals onl! with single patient. &his algorithm can be e=tended to
multiple doctors and multiple patients.
B.L.D.E.As College of Engg & Tech.,Dept. of E&C age
-
7/25/2019 Heart Beat Monitoring by GSM Technology
53/53
Heart Beat Monitoring By GSM Technology
-n future we can also design #% software to anal!e this recei(ed signal and
generate the report and this can be sent back to the doctor.
ith the connection established between two ends we can also send patientKs
bod! temperature+ blood pressure to doctorKs side. -n addition to E%6 rate+ we can also send EE6 electroencephalogram1 and
EM6 electrom!ogram1 signals for anal!ing.
sing 6SM technolog! we can displa! the E%6 signal on doctorKs mobile
phone.
4.RE9ERENCES
(e!!eth G. A$*#* &he 8A,) Microcontroller 3rchitecture+ #rogramming and
3pplicatins+ ;nd Edition+ #enarm -nternational+ )**D
"