Sie sind auf Seite 1von 448

4.5.

Saline Monitoring :

Fig 4.5.1: Saline monitoring circuit.

The circuit for saline monitoring is built using 555 timer as shown in Fig 4.5.1. A saline bottle is placed between an LED and LDR , between pins 1 and 2 of the 555 timer. Whenever there is full there is an open circuit between pins 1 and 2; and the light from the LED doesnot reach the LDR . When the saline falls below a particular level, the light from the LED reaches the LDR and the 555 timer is triggered, giving a high output. Thus causing the buzzer to go high.

4.6. Buzzer :

Fig 4.6.1: Buzzer circuit

The buzzer circuit diagram is as shown in Fig 4.6.1. One end of the buzzer is connected to two transistors connected as Darlington pair and the other end to 5V power supply. When a signal appears at the base of the darlington pair, the end of the buzzer connected to the two transistors gets grounded. Hence the buzzer goes high. http://www.scribd.com/doc/9680794/5/Saline-Status-Monitoring-Circuit
http://bipublication.com/files/IJPA-V3I12012-03.pdf http://www.scribd.com/doc/9680794/5/Saline-Status-Monitoring-Circuit

Upload Log In Sign Up

Explore

Documents School WorkHealth & MedicineBrochures/CatalogsMagazines/NewspapersHow-To Guides/ManualsRecipes/MenusBooks - FictionBooks - Non-fictionGovernment Docs+ all categories RecentFeatured People AuthorsStudentsResearchersPublishersGovernment & NonprofitsBusinessesMusiciansArtists & DesignersTeachers+ all categories Most FollowedPopular <iframe height="0" src="//www.googletagmanager.com/ns.html?id=GTM-ZWF6" style="display:none;visibility:hidden" width="0"></iframe> Language: English Download 13 Go BackComment Link Embed of 82 Readcast

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

PATIE NT MONI TORIN

G SYSTE M

USING PIC 16F877


Copyrights : Mahesh

Bharath , 2005
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

CON TEN TS
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

CONTENTS
1. SYNOPSIS -2. BLOCK DIAGRAM -3. INTRODUCTIO N -4. CIRCUIT DIAGRAM -5.

CIRCUIT DESCRIPTION -6. HARDWARE DETAILS -7. SOFTWARE DETAILS -8. CONCLUSION 9. FUTURE ENHANCEMEN TS -10. COST

ESTIMATE -11. BIBLIOGRAPH Y-

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

SYNOP SIS

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

SYNOPSIS
Our project is a working model which

incorporates sensors to measure parameters likebody temperature, heart beat rate, respiratory temperature and

ECG; and transfer it to thecomputer so that the patients health condition can be analyzed by doctors in any part of thehospital.

Thus, it reduces the doctors workload and also gives accurate results. Further thissystem uses WAP technology which enables

the viewing of all parameters on the mobilephone. A microcontroller board is used for analyzing the inputs from the patient and

anyabnormality felt by the patient causes the monitoring system to give an alarm. Also all theprocess parameters within an

interval selectable by the user are recorded online. This is veryuseful for future analysis and review of patients health condition.For

more versatile medical applications, this project can be improvised, byincorporating blood pressure monitoring systems, dental

sensors and annunciation systems,thereby making it useful in hospitals as a very efficient and dedicated patient care system.

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

BLOC K

DIAGR AM

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

BLOCK DIAGRA M
WAP CPU
SerialPortRS232 InterfaceMicroco

ntrollerBoardSig nalConditioning BoardBodyTemp eratureSensorRe spTemperatureS ensorSaline StatusSensorHea rt BeatSensorECG

SensorAttendanc eCard Reader


SPEAKER

AudioAlert

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

10

INTRO DUCTI ON

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

11

INTRODUCT ION
Measurement of Body

Temperature and Respiratory Temperature:

Thermistor is used for the measurement of body temperature and respiratorytempe

rature. This Thermistor is a passive transducer and its resistance depends on the heatbeing applied on it. We have arranged

the thermistor in the potential divider circuit. Thisthermistor exhibits a large change in resistance with a change in the body

temperature. Therespiratory temperature is determined by holding the thermistor near the nose. Initially thethermistor is calibrated to

normal body temperature. The thermistor part is attached to thepatient whose temperature has to be measured, which changes the resistance

value and thusthe corresponding change in the temperature is displayed on the monitor graphically . Also alltemperature

measurements are updated in the patients database. Here in our project we usebead thermistor.

Electro Cardiogram (ECG):

This is a four lead ECG monitoring system. Four sensors are kept at various parts

of the body ; the two arms and the two legs. All the signal outputs from the sensors areconditioned by an external circuit consisting of an

instrumentation amplifier and a trimpotand is given to the PC through a PIC controller. An interactive program in Visual Basic

isdeveloped to read the voltage signals and display a waveform pattern. The four leads used areof silver electrode.

Saline Monitoring System:

For saline monitoring the infrared emitter and detector are placed in a position suchthat

the saline bottle passes between them . They are placed near the neck of the saline bottle.
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

12As long as saline is present, the path of the infrared rays is blocked and the infrared detectoris blocked from

collecting infrared rays from the infrared emitter. And so the output willindicate normal saline status. The software is

written to give an audio alert when the salinelevel falls below the safe level.
Patient Calling System:

The patient calling system

consists of four switches which when pressed givesdisplay on the screen and activates an audio alert indicating that a patient is calling.

Theseswitches are placed in the vicinity of the patient to enable medical access in an emergency.
Heart Beat Monitor

:The patients heart beat rate is monitored using a photoelectric sensor which cansense the patients pulse rate . This method of

tracking the heart rate is more efficient than thetraditional method which derives the same from the ECG graph.

Attendance Card Reader:

In order to facilitate easy maintenance and verification of the patients medicalrecord due knowledge is

required regarding the staff interacting with the patient. This isachieved by using a punched identity card and its associated card

reader. The card readeruses photo-electric sensors to recognise 16 different medical ward members.
WAP and Audio Alert:

Whenever the temperature or the heart beat rate exceed the normal range of values;whenever the saline falls below the preset level and when

any patient presses the emergencycall switch , provision has been made for an audio alert and also short text messaging

theconcerned doctor through Wireless Application Protocol.


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

13

CIRCU IT DIAGR AM

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

14
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

15

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

16
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

17

CIRCU IT DESCR

IPTIO N
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

18

1. Power Supply Circuit

:
All the electronic components only work with a DC supply ranging from 12V to+12V. We are

using the commonly available energy source of 230v50Hz and steppingdown , rectifying, filtering and

regulating the voltage.


Step Down Transformer

:
When AC is applied to the primary winding of the power

transformer it can either bestepped down or up depending on the value of DC needed. In our circuit the transformer of 230v/12-0-12v is

used to perform the step down operation where a 230V AC appears as 12VAC across the secondary winding. The current rating of

the transformer used in our project is250mA.. Apart from stepping down AC voltages, it gives isolation between the power

sourceand power supply circuitries.


Rectifier Unit

:
In the power supply unit, rectification is normally

achieved using a solid state diode.Diode has the property that will let the electron flow easily in one direction at proper

biasingcondition. As AC is applied to the diode, electrons only flow when the anode and cathode isnegative. Reversing the

polarity of voltage will not permit electron flow.A commonly used circuit for supplying large amounts of DC power is the

bridgerectifier. A bridge rectifier of four diodes (4*IN4007) are used to achieve full waverectification . Two diodes will conduct during

the negative cycle and the other two willconduct during the positive half cycle. The DC voltage appearing across

the output terminalsof the bridge rectifier will be somewhat lass than 90% of the applied rms value. Normally one

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

19alteration of the input voltage will reverse the polarities. Opposite ends of

the transformerwill therefore always be 180 deg out of phase with each other.For a positive cycle, two diodes are connected to the

positive voltage at the topwinding and only one diode conducts. At the same time one of the other two diodes conductsfor the negative voltage

that is applied from the bottom winding due to the forward bias forthat diode. In this circuit due to positive half cycle D1 & D2 will conduct to

give 10.8vpulsating DC. The DC output has a ripple frequency of 100Hz. Since each altercationproduc es a resulting

output pulse, frequency = 2*50 Hz. The output obtained is not a pure DCand therefore filtration has to be done.
Filtering Unit

:
Filter circuits which usually capacitor is acting as a surge arrester always follow therectifier unit. This capacitor is

also called as a decoupling capacitor or a bypassing capacitor,is used not only to short the ripple with frequency of 100Hz to

ground but also to leave thefrequency of the DC to appear at the output. A load resistor R1 is connected so that areference to

the ground is maintained.1000 f/25v : for the reduction of ripples from the pulsating.10

f/63v : for maintaining the stability of the voltage at the load side.O.01 f : for bypassing the high

frequency disturbances.
Voltage Regulators

:
The primary purpose of a regulator is to aid the rectifier and

filter circuit in providinga constant DC voltage to the device. Power supplies without regulators have an inherentproblem

of changing DC voltage values due to variations in the load or due to fluctuations inthe AC liner voltage. With a regulator connected to the

DC output, the voltage can be


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

20maintained within a close tolerant region of

the desired output. IC7805 and IC7905 is used inthis project for providing +5v and 5v DC supply.
2. ECG Section:

The muscular contractions necessary to maintain the hearts pumping action areinitiated by depolarization and

repolarization of the SA node and then the depolarization andsubsequent repolarization of the AV node. This electrical activity of the

heart generatesexternal action potentials. Hence by measuring these potentials at the surface of the body theelectrical

activity of the heart can be alalyzed end the technique used for this is calledElectrocard io Graphy.This is achieved by applying

electrodes to certain positions on the body and record thepotentials generated between various combinations of these electrodes

with an amplifier andthe computer screen display. We have used 4 electrodes for the Left Arm, Left Leg, RightArm and Right Leg. Silver electrodes

are preferred as they do not irritate the body and alsothe contact impedance of Silver is Minimum.The output from the

ECG electrodes are fed to a signal conditioning circuit. Thiscircuit uses high gain amplifiers OP07 to achieve

required signed gain. The gain of amplifieris set to meet the minimum input signed requirement of the PLC microcontroller.

The OP07belongs to the family of differentiate amplifiers which can very efficiently reject theinterference of signals which

are of a non biological origin. The offset voltage is overcomeby using a 500K trim pot connected for

offset balancing of the OP07. The output fromeach of the four amplifiers are connected to the analog channel inputs ANOAN3 of the

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

21microcontrolle r. The controller is programmed to process the ECG signals

from a minimumof 3 electrodes.


3. Heart Beat Rate Sensor Cirtuit:

Monitoring the heart beat rate of the patient can be

easily accomplished by analyzingthe ECG pulse . Here, the ECG pulse is amplified and the average time interval or

theinstantaneous time interval between two successive R peaks is measured, from which theheart beat rate is derived. But this

method fails to indicate heart blocks immediately and sophoto electric pulse transducers are used.The pulse rate monitoring

method indicates a heart block immediately by sensing thecessation of blood circulation in the limb terminals. This technique uses

photoelectrictran sducers which are easy to apply then the 3 ECG electrodes. Also the output signalamplitude is large with better signal to

noise ratio.The finger probe used for pulse pick up consists of a Ga As infrared LED and asilicon NPN phototransistor mounted in an

enclosure that fits over the tip of the patientsfinger. The peak spectral emission of the LED is at 0.94 mm with a 0.707 peak

bandwidth of 0.04mm. The silicon phototransistor is sensitive to radiation between 0.4 and 1.1.mm. Dueto the narrow bond

of the spectrum involved the radiation heat output is minimized. Thephoto transistor is used as an emitter follower

configuration. The IR signal from the LED istransmitted through the finger tip of the patients finger and the conductivity of

thephototransisto r depends on the amount of radiation reaching it with each contraction of theheart, blood is forced to the extremities

and amount of blood in finger increases. This altersthe optical density and so the IR signal transmission through the finger reduces,

causing acorrespondence variation in phototransistor output. The phototransistor is connected as partof a voltage

divider circuit, with 10K and 22 K carbon resistors and produces a voltage
Electronics and Communication

EngineeringPanimalar Polytechnic College, Chennai

22pulse that closely follows the heart beat rate. This pulse output is given to the bit 4 of thePort D of the

microcontroller for signal processing.

4. Saline Status Monitoring Circuit:


The Saline water injection plays a

key role in the treatment and recovery of many apatient that it requires constant monitoring. This condition can be easily fulfilled

by using IRsensors which can detect a drop in the saline below the quantity. By means of annunciationsyst ems, the hospital

staff can be informed and an action of replacing the saline can be easilyaccomplish ed before the bottle becomes empty. Also the

usage of WAP facilities sending of the saline status to the doctor concerned for any further action required.The circuit uses an IR

emitter and an IR detector which are placed in a straight linewith the saline bottle in between, at the point representing the preset saline

level. Thepresence of saline water, in a full bottle, refacts the emitted radiation, thus generating nooutput at the

IR detector. When the saline level falls below the preset value ; the emitted IRradiation causes an photoelectric current output

from the detector. The detector output is ananalog quantity which is made to drive a switching NPN transistor BC107 to get a

binaryoutput from the collector of the transistor. This digital output is fed to the pin 23 of the PICmicro controller, corresponding to

Port bit 4 . The signal is processed and the saline status isdisplayed on the screen. In case of the saline becoming empty the annunciation

systems areactivated.

5. Attendance Card Reader:


A patient's medical record is never complete without the data regarding the

doctorswho treated him/her. In our bid to automate the entire patient care system, this requirement is
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

23also accomplished by using an unique attendance card reader for the medical staff interactingwith the patient.This

device is placed along side the patient in his/her ward. It uses an IR emitterIRdetected circuit to read a medical attendants

punched card. The project uses a 4 hole cardwith four emitter detector pairs. Thus, a maximum 2
4

= 16 staff can be identified usingthis circuit. Each staff is allotted his punched card and the details of each of the 16 staff isuploaded

into the patients database. Thus, details regarding the date and time of a medicalattendant s visit, along with his identity is available for

any further reference.The circuit uses IR detectors which give analog outputs according to the card theyread. A set of NPN

switching transistors BC107 translate the analog output of thephotoelectric card reader in to binary digital signals. These

signals are connected to the bits0 to 3 of Port C (i.e. pin 15 to pin 18) of the PIC micro controller.

6. Patient Call Switches Circuit:


The patient calling system consists of four switches when pressed gives display onthe

screen and activates an audio alert indicating that a patient is calling. These switches areplaced in the vicinity of the patient to enable

medical access in an emergency.

7. Body Temperature Measurement Circuit:


The temperature measuring circuit uses a thermistor

each for the body temperatureand the respiratory temperature.A thermistor is a ceramic semiconductor which exhibits a large change in

resistancewith a change in its body temperature. The thermistors have much better sensitivity thanRTD's and are therefore

better suited for precision temperature measurements. Theavailability of high resistance values allows the thermistors to be

used with long extension


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

24leads since the lead resistance or contact

resistance effects can be greatly diminished. Thenon-linearity of the thermistor resistancetemperature characteristics outs a practical

limit onthe temperature span over which a thermistor can be operated in measurement or controlcircuit. RTD's have lower sensitivity

and are more linear and can therefore be used inapplications, where the temperature spans are very wide. Thermistors has

other importantadvanta ges over RTD's in that they are available in smaller sizes, with faster response times,at lower costs and

with greater resistance to shock and vibration effects.In this circuit we have arranged thermistor in the form of potential

divider when thermistor isR1 and a potentiometer is acting as a R2 which forms potential divider network and producesan

output from potential divider network which is given to analog input channel of themicrocontroll er.In general to obtain clear and constant o/p with

respect to the input change, the sensormust be low power consumer. If we draw a lowest current sensitivity the thermistor

willimprove and provides better performance. Due to the above grounds we have constructed thethermistor circuits to produce low

milli volts which can be easily digitized by the PIC. If notthe thermistor will to drive large o/p voltage may cause self heating of the

device. Self heating means large current flows through the thermistor create heat on it without acceptingthe

body temperature.
8. Respiratory Temperature Measurement Circuit

:The air is warmed during its passage

through the lungs and the expiratory tract andhence there is a detectable difference of temperature between the inhaled air and

exhaled air.This difference in the temperature of the exhaled air is the respiratory temperature and it canbe sensed by using a thermistor placed

in front of the nostrils by means of a suitably holding


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

25device. In case the different of temperature of outside air and that of exhaled air is small, thethermistor can be initially heated to an

appropriate temperature and the variation of itsresistance in synchronism with the respiration rate, as a result of the cooling effect of

the airstream can be detected.The thermistors with dissipations of about 5 mw to 25 m w are used. It is placed asput of a voltage

dividing circuit with a 330 resistance in series with the +5V supply. Theoutput from the voltage divider is given

as input to the analog channel of the microcontroller.


9. PIC Microcontroller Circuit:

The PIC 16F 877 microcontroller

used has a high performance RISC CPU. It is a 40pin DIP package with many efficient and application friendly features.We have

used a 10 MHz external crystal in crystal oscillator mode during two 22pf capacitors. The crystal output is given to pins 13 and 14 of the

DIP.The microcontroller operates over a voltage range from 2.0v to 5.5v. The +5V inputis given to pins 11 and 32 as the positive

supply for logic and I10pms, and pin 12, 31 areconnected to the ground reference of the +EV regulated power supply board.The PIC

16F877 has 8 analog channels and out of these analog channels AN0- AN3are used for input from the ECG signal conditioning

circuit, channels AN5 and AN6 are usedfor the temperature measurement circuits.The port pins RDO-RD3 are used by the patient call

switch circuit and the port pinsRCO-RC3 are used by the attendance card reader circuit.The output from the heart beat sensor

is given to bit 4 of port D and output from thesaline status monitoring circuit is given to bit 4 of Port C.
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

26Pin number 25 is used in USART asynctmonous transmit mode and is connected tothe pin 11 of the MAX232

driver.Pin 26 is used in USART asynchmonous receive mode and is connected to in 12 of MAX 232 IC.

10. MAX 232:

The MAX 232 power supply section has 2 charge pumps ,the first usesexternal capacitors C1 to double the

+5V input to +10V with input impedance of approximately 200

. The second charge pump uses external capacitor to invert+10V to 10V with an overall output

impedance of 45 .
The best circuit uses 22

F capacitors for C1 and C4 but the value is not critical.Normally these capacitors are low cost aluminium electrolyte capacitors or

tantalum ifsize iscritical. Increasing the value of C1 and C2 to 47 F will lower the output impedance of

+5Vto +10V doubler by about 5 and +10V to 10V inverter by about 10

. Increasing the valueof C3 and C4 lowers the ripple on the power supplies thereby lowering the 16KHz ripple onthe RS 232 output. The value

of C1 and C4 can be lowered to 1 F in systems where size iscritical at the expense of an additional 20

impedance +10V output and 40 additionalimpeda nce at 10V input.


Transmitter Section:

Each of the two transmitters is a CMOS inverter powered by + 10V internallygenerat ed supply. The input is TTL and CMOS

compatible with a logic threshold of about26% of V


cc

. The input if an unused transmitter section can be

left unconnected: an internal400K pull up resistor connected between the transistor input and V
cc

will pull the input highforming the unused transistor output low.
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

27The open circuit output voltage swing is guaranteed to meet the RS232 specification +5V output swing under the worst of both

transmitter driving the 3K . Minimum loadimpedance, the V


cc

input at 4.5V and maximum

allowable ambient temperature typicalvoltage with 5K and V


cc

= +9 V. The slew rate at output is limited to less than 30V/ s andthe powered done output impedance will

be a minimum of 300 with +2V applied to theoutput with V


cc

= 0V.The outputs are short circuit

protected and can be short circuited toground indefinitely.


Reciever Section:

The two receivers fully conform to RS

232 specifications. Their input impedance isbetween 3K either with or without 5V power applied

and their switching threshold is withinthe +3V of RS232 specification. To ensure compatibility with either

RS232 or TTL/CMOSinput . The MAX232 receivers have V


IL

of 0.8V and V
IH

of 2.4V the receivers have 0.5V of

hysterisis to improve noise rejection.The TTL/CMOS compatible output of receiver will below whenever the RS232 input

is greater than 2.4V. The receiver output will be high wheninput is floating or driven between +0.8V and 30V.
11. RS 232:

The most common communication interface for short distance is RS-232. RS232defines serial communication for one device to

one computer communication port, withspeeds upto 19,200 baud. Typically 7 or 8 bits (on/off) signal are transmitted to represent

acharacter or digit. 9 pin connector is used .


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

28

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

29

HARD WARE

DETAI LS
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

30

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

31
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

32

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

33
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

34

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

35
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

36

Indirect Addressing, INDF and FSR Registers The INDF register is not a physical register. Addressing the INDFregister will cause indirect addressing. Indirect addressing ispossible by using the INDF register. Any instruction using the INDFregister actually

accesses the register pointed to by the File SelectRegister, FSR. Reading the INDF register itself, indirectly (FSR =0) will read 00h. Writing to the INDF register indirectly results in ano operation (although status bits may be affected). An effective 9-bit address is

obtained by concatenating the 8-bit FSR register andthe IRP bit (STATUS<7>),as shown in figure 2.6.

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

37

ANALOG TO DIGITAL CONVERSION


The Analog-toDigital (A/D) Converter module has fiveinputs for the 28-pin devices and eight for the otherdevices.The analog input charges

a sample and hold capacitor.The output of the sample and hold capacitor is the inputinto the converter. The converter then generates a digitalresult of this analog level via successive approximation.The

A/D conversion of the analog input signalresults in a corresponding 10-bit digital number. TheA/D module has high and low voltage reference inputthat is software selectable to some combination of V
DD

,V
SS

, RA2, or RA3.The A/D converter has a unique feature of beingable to operate while the device is in SLEEPmode. To operate in SLEEP, the A/D clock mustbe derived from theA/Ds internal RC

oscillator.The A/D module has four registers. Theseregistersare: A/D Result High Register (ADRESH) A/D Result Low Register (ADRESL) A/D Control Register0 (ADCON0) A/D Control Register1

(ADCON1)The ADCON0 register, shown in Register 11-1,controlsthe operation of the A/D module. The ADCON1register, configures the functions of the port pins.The port pins can be configured as analog inputs(RA3

can also be the voltage reference), or asdigital I/O. Additional information on using the A/Dmodule can be found in the PICmicro MidRange MCU Family reference Manual (DS33023).

11.4.1 A/D RESULT REGISTERSThe ADRESH:ADRES L register pair is the locationwhere the 10-bit A/D result is loaded at the completionof the A/D conversion. This

register pair is 16bits wide.The A/D module gives the flexibility to left or right justify
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

38

the 10-bit result in the 16-bit result register. The A/DFormat Select bit (ADFM) controls this justification.Figure 11-4 shows the operation of the A/D result justification.The

extra bits are loaded with 0s. When anA/D result will not overwrite these locations (A/D disable),these registers may be used as two general

purpose 8-bit registers

.
When setting up an Asynchronous Transmission,follow these steps:1. Initialize the SPBRG register for the appropriatebaud rate. If a high speed baud rate is

desired,set bit BRGH (Section 10.1).5. Enable the transmission by setting bit TXEN,which will also set bit TXIF.2. Enable the asynchronous serial port by clearingbit SYNC and setting bit SPEN.6. If 9-bit

transmission is selected, the ninth bitshould be loaded in bit TX9D.3. If interrupts are desired, then set enable bitTXIE.7. Load data to the TXREG register (startstransmission). 4. If 9-bit transmission is

desired, then set transmitbit TX9.8. If using interrupts, ensure that GIE and PEIE(bits 7 and 6) of the INTCON register are set.
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

39
When setting up an Asynchronous Reception, followthese steps:1. Initialize the SPBRG register for the appropriatebaud rate. If a high speed baud rate is desired,set bit BRGH (Section

10.1).6. Flag bit RCIF will be set when reception is completeand an interrupt will be generated if enablebit RCIE is set.2. Enable the asynchronous serial port by clearingbit SYNC and setting bit SPEN.7. Read the

RCSTA register to get the ninth bit (ifenabled) and determine if any error occurredduring reception.3. If interrupts are desired, then set enable bitRCIE.8. Read the 8-bit received data by reading theRCREG

register.4. If 9-bit reception is desired, then set bit RX9.9. If any error occurred, clear the error by clearingenable bit CREN.5. Enable the reception by setting bit CREN.10. If using interrupts, ensure that GIE and PEIE(bits 7 and 6) of

the INTCON register are set


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

40
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

41
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

42
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

43
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

44
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

45
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

46
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

47
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

48

SOFT WARE DETAI LS

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

49

ASSEMBLY LANGUAGE PROGRAM PIC16F877

list p=16f877 ; list directive to define processor#include <p16f877.inc> ; processor specific variable definitionsRrdy_Flag EQU 0x20Sync_Flag EQU 0X21Count EQU 0X22Temp EQU 0X23H_Byte EQU 0X24L_Byte EQU 0X25R0 EQU 0X26 ; RAM AssignmentsR1 EQU 0X27R2 EQU

0X28H_Temp EQU 0X29 ; temporary registerL_Temp EQU 0X2A ; temporary registerByte0 EQU 0X2bByte1 EQU 0X2cByte2 EQU 0X2dByte3 EQU 0X2eRbuf0 EQU 0X31 ;0X21 TO 0X28Rbuf1 EQU 0X31Rbuf2 EQU 0X32Rbuf3 EQU 0X33Rbuf4 EQU 0X34Rbuf5 EQU

0X35Rbuf6 EQU 0X36Rbuf7 EQU 0X37Rbuf8 EQU 0X38Rbuf9 EQU 0X39;**************** ********************* ********************* **; Reset and Interrupt Vectorsorg 00000h ; Reset Vectorgoto Startorg 00004h ; Interrupt vector;*************** ********************* *********************

***; Interrupt Service RoutineIntVector; save context (WREG and STATUS registers) if needed.banksel PIR1btfss PIR1,RCIF ; Did USART cause interrupt?goto ISREndbcf PIR1,RCIFmoviw 06h ; mask unwanted bits

Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

50
andwf RCSTA,w ; check for errorbtfss STATUS,z ; was error status but set?Goto RcvError ; found error flag itReceive_Intbtfss Sync_Flag,0goto Syn_Rxmovlw ']'Subwf RCREG,Wbtfss STATUS,Zgoto

Rxcharbsf Rrdy_Flag,0bcf Sync_Flag,0goto ISREndRxcharbtfss RCREG,6goto Numeralsmovlw 0X0Fandwf RCREG,Waddlw 0X09Rxpromovwf INDFincf FSR,Fgoto ISREndNumeralsmovlw 0X0Fandwf RCREG,Wgoto RxproSyn_Rxmovlw '['subwf RCREG,Wbtfss

STATUS,Zgoto ISREndbsf Sync_Flag,0goto ISREnd ; go to end of ISR, restore context, returnRcvErrorbcf RCSTA,CREN ; Clear receiver statusbsf RCSTA,CRENISREnd; Restore context if needed.retfie;********** ********************* ********************* ********; Program

begins hereorg 00200h ; Beginning of program EPROMStartbanksel TRISAmovlw 0xffmovwf TRISAmovlw 0xffmovwf TRISB

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

51

movlw 0xbfmovwf TRISCmovlw 0xffclrf TRISDmovlw 0x40 ; 9600 baud @10MHzbanksel SPBRGmovwf SPBRGbanksel PIR1bcf PIR1,RCIF ; Clear RCIF Interrupt Flagbanksel PIE1bsf PIE1,RCIE ; Set RCIE Interrupt Enablebanksel ADCON0movlw 0x81movwf ADCON0banksel

ADCON1movlw 0x80movwf ADCON1banksel INTCONbsf INTCON,PEIE ; Enable peripheral interruptsbsf INTCON,GIE ; Enable global interruptsbcf STATUS,RP0bcf STATUS,RP1movlw 0x20movwf FSRclrf INDFClearNextincf FSR,Fclrf INDFmovf FSR,Wxorlw 0x39btfss

STATUS,Zgoto ClearNext;************ ********************* ********************* ******; Main loopWaitbtfss Rrdy_Flag,0 ;sgoto Waitclrf Rrdy_Flagmovf Rbuf0,Wxorlw 0X01 ;btfss STATUS,Z ; sgoto ChkNext1swapf Rbuf1,F ;movf Rbuf2,Wiorwf Rbuf1,W

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

52
andiw 0x10ioriw oxefbsf STATUS,RP0 ;movwf TRISA ;SET DATA DIRECTION FOR PORT Abcf STATUS,RP0 ;swapf Rbuf3,F ;movf Rbuf4,W ;iorwf Rbuf3,W

;WREG = RXBUF3 || RXBUF4bsf STATUS,RP0 ;movwf TRISB ;SET DATA DIRECTION FOR PORT Bbcf STATUS,RP0 ;swapf Rbuf5,F ;mov Rbuf6,wiorwf Rbuf5,W ;WREG = RXBUF5 || RXBUF6andiw 0Xbfioriw 0x80bsf STATUS,RP0 ;movwf TRISC ;SET DATA DIRECTION FOR PORT Cbcf

STATUS,RP0 ;swapf Rbuf7,F ;movf Rbuf8,W ;iorwf Rbuf7,W ;WREG = RXBUF7 || RXBUF8bsf STATUS,RP0 ;movwf TRISD ;SET DATA DIRECTION FOR PORT Abcf STATUS,RP0 ;SELECT BANK 0goto Wait ;ChkNext1movf Rbuf0,Wxorlw 0X02 ;btfss STATUS,Z ; sgoto ChkNext2Wt0btfss PIR1,TXIF ;sgoto

Wt0movlw '{'movwf TXREGcall Delaycall DelayWt1btfss PIR1,TXIF ;sgoto Wt1swapf PORTA,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall Delay

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

53
Wt2btfss PIR1,TXIF;sgoto Wt2movf PortA,wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf PCLATH,1bcf

PCLATH,2movwf TXREGcall Delaycall DelayWt3btfss PIR1,TXIF ;sgoto Wt3swapf PORTB,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall DelayWt4btfss PIR1,TXIF;sgoto

Wt4movf PORTB,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall DelayWt5btfss PIR1,TXIF ;sgoto Wt5swapf PORTC,Wandiw 0X0Fbsf PCLATH,1bsf PCLATH,2call

HexTablebcf PCLATH,1bcf PCLATH,2

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

54
movwf TXREGcall Delaycall DelayWt6btfss PIR1,TXIF;sgoto Wt6movf

PORTC,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall DelayWt7btfss PIR1,TXIF ;sgoto Wt7swapf PORTD,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf

PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall DelayWt8btfss PIR1,TXIF;sgoto Wt8movf PORTD,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall DelayWt9btfss

PIR1,TXIFgoto wt9movlw '}'movwf TXREG

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

55
call Delaycall Delaygoto WaitChkNext2movf Rbuf0,Wxorlw 0X03 ;btfss STATUS,Z ; sgoto

ChkNext3swapf Rbuf1,F ;movf Rbuf2,Wiorwf Rbuf1,Wmovwf PORTAswapf Rbuf3,F ;movf Rbuf4,W ;iorwf Rbuf3,W ;WREG = RXBUF3 || RXBUF4movwf PORTBswapf Rbuf5,F ;movf Rbuf6,W ;iorwf Rbuf5,W ;WREG = RXBUF5 || RXBUF6movwf PORTCswapf Rbuf7,F

;movf Rbuf8,W ;iorwf Rbuf7,W ;WREG = RXBUF7 || RXBUF8movwf PORTDgoto Wait ;ChkNext3movf Rbuf0,Wxorlw 0X04 ;btfss STATUS,Z ; sgoto Waitrlf Rbuf1,Frlf Rbuf1,Frlf Rbuf1,Fmovf Rbuf1,Wandlw B'00111000'iorlw 0x81movwf ADCON0call Delay ; Acq

Time Delaybsf ADCON0,GO ;START CONVERSIONWfEocbtf sc ADCON0,GO ;DONEgoto WfEocmovf ADRESH,W ;movwf H_Byte ;bsf STATUS,RP0movf ADRESL,W ;

Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

56
bcf STATUS,RP0movwf L_Byte ; H_BYTE:L_BYTE = ADRESH:ADRESLAWt0 btfss PIR1,TXIF ;sgoto AWt0movlw '{'movwf TXREGcall Delaycall DelayAWt1btfss PIR1,TXIF ;sgoto AWt1swapf

H_Byte,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall DelayAWt2btfss PIR1,TXIF;sgoto AWt2movf H_Byte,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf

PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall DelayAWt3btfss PIR1,TXIF ;sgoto AWt3swapf L_Byte,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall

DelayAWt4btfss PIR1,TXIF;s

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

57
goto AWt4movf L_Byte,Wandlw 0x0fbsf PCLATH,1bsf PCLATH,2call HexTablebcf

PCLATH,1bcf PCLATH,2movwf TXREGcall Delaycall DelayAWt5btfss PIR1,TXIFgoto AWt5movlw '}'movwf TXREGcall Delaycall Delaygoto WaitDelaymovlw 0xffmovwf CountDwaitdecfsz Count,Fgoto Dwaitreturnorg 0x600HexTableaddwf

PCL,fretlw 0x30retlw 0x31retlw 0x32retlw 0x33retlw 0x34retlw 0x35retlw 0x36retlw 0x37retlw 0x38retlw 0x39retlw 0x41retlw 0x42retlw 0x43retlw 0x44retlw 0x45retlw 0x46end

Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

58

USER END SOFTWARE IN VISUAL BASICFlow Chart:

STARTVariable DeclarationPort OpenReadAttend enceValuesNo.of Entries1234soon


Read Value fromBody&resp.tem p,ECG&heartbeatse nsors,U.En

Display all valuesin text boxDisplay all graphsSend SMS tomobileRead analogDigital I/P
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

59

PROGRAM:F orm4.frm
Private Sub BTemptimer_Ti mer()MSComm1 .Output =

"[45]"Sleep (20)Rtext = MSComm1.Input Rtext = Mid$(Rtext, 2, 4)Pt2 = T2T2 = Val("&h" & Rtext)T2 = T2 / 5T2 = -

T2+195T2=Roun d(T2,1)If T2 < 77 Then T2 = Pt2End If Text7.text =T2Label4.Capti on = "BodyTemp Vs Time"DrawWidt

h = 2Line (536, 184)-(536, 384), vbYellowLine (536, 384)-(744, 384), vbYellowLine (528, 192)-(536, 184), vbYellowLine

(544, 192)-(536, 184), vbYellowLine (736, 376)-(744, 384), vbYellowLine (736, 392)-(744, 384), vbYellowDraw

Width = 2Line (oldx, oldy)-(536 + k, 384 - (T2 / (200 / 200#))), vbGreenDrawWi dth = 1oldx = 536 + k oldy = 384 - (T2 / (200 / 200#))k = k + 3If

k > 208 ThenLine (528, 182)-(744, 384), Form4.BackColo r, BFoldx = 536#oldy = 384#k = 0End If End Sub'Private Sub

btimer_Timer()'b timer.Enabled = False'out = out And &HCF


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

60'End SubPrivate Sub Command1_Clic k()MSComm1.O utput = "[3ffffbfff]"Sleep (50)EndEnd SubPrivate Sub Command3_Clic

k()Form4.HideF orm3.ShowEnd SubPrivate Sub Ecg1Timer_Tim er()MSComm1. Output = "[40]"Sleep (50)Rtext = MSComm1.Input

Rtext = Mid$(Rtext, 2, 4)Ecg1 = Val("&h" & Rtext)Ecg1 = Round(Ecg1, 1)Text9.Text = Ecg1End SubPrivate Sub

Form_Load()For i = 1 To 100Egra1(i) = 50Nextptr = 19MSComm1.Po rtOpen = TrueMSComm1. Output = "[1ffffbfff]"Sleep

(30)MSComm1. Output = "[3ffffbfff]"Sarr( 1) = 0Sarr(2) = 0Sarr(3) = 0Sarr(4) = 0Sarr(5) = 0Sarr(6) = 0Fnames(1) =

"D:\PanimalarC BSS\hitemp.wav "Fnames(2) = "D:\PanimalarC BSS\Patient1.wa v" 'p1 callFnames(3) = "D:\PanimalarC BSS\Patient2.wa

v" 'p2 callFnames(4) = "D:\PanimalarC BSS\Patient3.wa v " 'p3 callFnames(5) = "D:\PanimalarC BSS\Patient4.wa v" 'p4

callFnames(6) = "D:\PanimalarC BSS\Saline1.wav " 'p4 callFcnt = 0Label5.Caption = Format(Date, "dd/mm/yyyy)


Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

61Set db = OpenDatabase(" D:\PanimalarCB SS\hos12.mdb") Set rs = db.OpenRecords et("patient")Set Srs =

db.OpenRecords et("Digital")Set Drs = db.OpenRecords et("Doc")Pa = &H0Sal = &H0oldx = 536#oldy = 384#k =

0x=0a(0) = 5 a(1) = 5 a(2) = 5 a(3) = 6 a(4) = 5 a(5) = 5 a(6) = 5 a(7) = 5 a(8) = 3a(9) = 10 a(10) = 1 a(11) = 5 a(12) = 5 a(13) = 5 a(14) = 7 a(15) = 5

a(16) = 6a(17) = 5 a(18) = 5 a(19) = 5Lg = Shell("C:\Progra m Files\Microsoft Office\Office\out look.exe", vbNormalFocus)

End SubPrivate Sub Heartbeattimer_ Timer()MSCom m1.Output = "[2]"Sleep (20)Rtext = MSComm1.Input Rtext =

Mid$(Rtext, 8, 1)Beat = Val("&h" & Rtext)If Beat = 0 And Bflg = 0 ThenBcnt = Bcnt + 1Bflg = 1ElseIf Beat > 0 And Bflg = 1

ThenBflg = 0End If Text1.Text = Round(Bcnt, 0)End SubPrivate Sub Hrtcmd_Click()h cnt = 0Bcnt = 0End SubPrivate Sub

MMControl1_D one(NotifyCode As Integer)MMCont rol1.Command = "Close"Timer2.E nabled = TrueEnd SubPrivate Sub

Option1_Click() Rtemptimer.Ena bled = FalseBTemptime r.Enabled = FalseEcg1Timer. Enabled = FalseHeartbeatti

mer.Enabled = False
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

62Rtemptimer.E nabled = TruePicture1.Cls

Text1.Text = ClearText5.Text = ClearText7.Text = ClearText9.Text = Cleargrval = 0End SubPrivate Sub

Option2_Click() Rtemptimer.Ena bled = FalseBTemptime r.Enabled = FalseEcg1Timer. Enabled = FalseHeartbeatti mer.Enabled =

FalseBTemptime r.Enabled = TruePicture1.Cls Text1.Text = ClearText5.Text = ClearText7.Text = ClearText9.Text

= Cleargrval = 1End SubPrivate Sub Option3_Click() Rtemptimer.Ena bled = FalseBTemptime r.Enabled = FalseEcg1Timer.

Enabled = FalseHeartbeatti mer.Enabled = FalseEcg1Timer. Enabled = TruePicture1.Cls Text1.Text = ClearText5.Text =

ClearText7.Text = ClearText9.Text = ClearEnd SubPrivate Sub Option7_Click() Rtemptimer.Ena bled = FalseBTemptime

r.Enabled = FalseEcg1Timer. Enabled = FalseHeartbeatti mer.Enabled = FalseHeartbeatti mer.Enabled = TruePicture1.Cls Text1.Text =

ClearText5.Text = ClearText7.Text = ClearText9.Text = Clear


Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

63grval = 2End SubPrivate Sub Rtemptimer_Tim er()MSComm1. Output = "[46]"Sleep (20)Rtext = MSComm1.Input

Rtext = Mid$(Rtext, 2, 4)Pt1 = T1T1 = Val("&h" & Rtext)T1 = T1 / 5T1 = T1+195T1 = Round(T1, 1)If T1 < 77 Then T1

= Pt1EndIf Text5.Text = T1Label4.Captio n = "RespTemp Vs Time"DrawWidt h = 2Line (536, 184)-(536, 384), vbYellowLine

(536, 384)-(744, 384), vbYellowLine (528, 192)-(536, 184), vbYellowLine (544, 192)-(536, 184), vbYellowLine

(736, 376)-(745, 385), vbYellowLine (736, 392)-(744, 384), vbYellowDraw Width = 2Line (oldx, oldy)-(536 + k, 384 - (T1 /

(200 / 200#))), vbGreenDrawWi dth = 1oldx = 536 + k oldy = 384 - (T1 / (200 / 200#))k = k + 3If k > 208 ThenLine (528, 182)-(744, 384),

Form4.BackColo r, BFoldx = 536#oldy = 384#k = 0End If End SubPrivate Sub Timer1_Timer() Label6.Caption = Format(Time,

"hh:mm:ss")If Heartbeattimer.E nabled = True ThenText2.Visib le = TrueHrtcmd.Visi ble = TrueElse


Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

64Text2.Visible = FalseHrtcmd.Vis ible = FalseEnd If If (Ecg1 > 100) And Strt = 0 ThenStrt = 1End If

MSComm1.Outp ut = "[2]"Sleep (20)Rtext = MSComm1.Input Pa = Val("&h" & Mid$(Rtext, 8, 2))If ((Pa And &H1) = &H0) ThenLabel23.Vis

ible = Truep1 = "Yes"Sarr(2) = 1If pflg1 = 0 Thenpflg1 = 1Set objOutlookMsg = objOutlook.Creat eItem(olMailIte m)With

objOutlookMsg. To = "9884169070@s ms.sancharnet.in " ' The To Address Field.Subject = "P1 Call" ' txtSubject - The

Subject Field.Body = "Patient 1 is calling".Importan ce = olImportanceHig h ' Priority. Mostly Not Required.Send '

Send the Composed MessageEnd WithSet objOutlookMsg = NothingElseLabe l23.Visible = Falsep1 =

"No"Sarr(2) = 0End If If ((Pa And &H2) = &H0) ThenLabel24.Vis ible = Truep2 = "Yes"Sarr(3) = 1ElseLabel24.Vi sible = Falsep2 =

"No"End If If ((Pa And &H4) = &H0) ThenLabel25.Vis ible = Truep3 = "Yes"Sarr(4) = 1


Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

65ElseLabel25.V isible = Falsep3 = "No"End If If ((Pa And &H8) = &H0) ThenLabel26.Vis ible = Truep4 = "Yes"Sarr(5) =

1ElseLabel26.Vi sible = Falsep4 = "No"End If MSComm1.Outp ut = "[2]"Sleep (20)Rtext = MSComm1.Input pb = Val("&h" & Mid$(Rtext, 6,

2))If ((pb And &H10) = &H10) ThenLabel8.Visi ble = FalseSaline.Visib le = TrueSal = Empty Sarr(6) = 1Set objOutlookMsg

= objOutlook.Creat eItem(olMailIte m)With objOutlookMsg. To = "9884169070@s ms.sancharnet.in " ' The To

Address Field.Subject = "saline Emp" ' txtSubject - The Subject Field.Body = "Saline bottle Empty".Importan ce =

olImportanceHig h ' Priority. Mostly Not Required.Send ' Send the Composed MessageEnd WithSet objOutlookMsg

= NothingEnd If ElseSaline.Visibl e= FalseLabel8.Visi ble = TrueSal =Not EmptyEnd If If (T1 > 100) Or (T2 > 100)

ThenLabel22.Vis ible = TrueElseLabel22 .Visible = FalseEnd If


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

66MSComm1.O utput = "[2]"Sleep (50)Rtext = MSComm1.Input pc = Val("&h" & Mid$(Rtext, 6, 2))pc = pc And &HFSelect Case

(pc And &HF)Case &HEAtttxt(0) = "Rahul"Atttxt(1) = "Doctor"Atttxt(2 )= DateImage1.Pict ure =

LoadPicture("D:\ PanimalarCBSS\ dr1.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) =

Atttxt(1)Drs.Fiel ds(2) = Atttxt(2)Drs.Fiel ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If Case &HDAtttxt(0) = "Anita"Atttxt(1)

= "Nurse"Atttxt(2) = DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\ dr2.gif")If vvv2 = 0 ThenAtttxt(3)

= TimeDrs.AddNe wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel ds(2) = Atttxt(2)Drs.Fiel ds(3) =

Atttxt(3)Drs.Upd atevvv2 = 1End If Case &HCAtttxt(0) = "Naresh"Atttxt(1 )= "Compounder"At ttxt(2) = DateImage1.Pict

ure = LoadPicture("D:\ PanimalarCBSS\ dr3.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe wDrs.Fields(0) = Atttxt(0)

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

67Drs.Fields(1) = Atttxt(1)Drs.Fiel ds(2) = Atttxt(2)Drs.Fiel

ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If Case &HBAtttxt(0) = "Bhuvan"Atttxt( 1) = "Doctor"Atttxt(2 )=

DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\ dr4.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe wDrs.Fields(0) =

Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel ds(2) = Atttxt(2)Drs.Fiel ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If Case

&HAAtttxt(0) = "Raghu"Atttxt(1) = "Doctor"Atttxt(2 )= DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\

dr1.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel ds(2) =

Atttxt(2)Drs.Fiel ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If Case &H9Atttxt(0) = "Kamala"Atttxt( 1) = "Doctor"Atttxt(2

)= DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\ dr2.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe

wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel ds(2) = Atttxt(2)


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

68Drs.Fields(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If Case &H8Atttxt(0) = "Soman"Atttxt(1 )= "Doctor"Atttxt(2

)= DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\ dr3.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe

wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel ds(2) = Atttxt(2)Drs.Fiel ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End

If Case &H7Atttxt(0) = "Binu"Atttxt(1) = "Doctor"Atttxt(2 )= DateImage1.Pict ure = LoadPicture("D:\

PanimalarCBSS\ dr4.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel

ds(2) = Atttxt(2)Drs.Fiel ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If Case &H6Atttxt(0) = "Algates"Atttxt(1 )=

"Doctor"Atttxt(2 )= DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\ dr1.gif")If vvv2 = 0 ThenAtttxt(3) =

TimeDrs.AddNe wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel ds(2) = Atttxt(2)Drs.Fiel ds(3) =

Atttxt(3)Drs.Upd ate
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

69vvv2 = 1End If Case &H5Atttxt(0) =

"Jagadeesh"Atttx t(1) = "Doctor"Atttxt(2 )= DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\ dr2.gif")If vvv2

= 0 ThenAtttxt(3) = TimeDrs.AddNe wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel ds(2) = Atttxt(2)Drs.Fiel

ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If Case &H4Atttxt(0) = "Mohan"Atttxt(1 )= "Wardboy"Atttxt (2) =

DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\ dr3.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe wDrs.Fields(0) =

Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel ds(2) = Atttxt(2)Drs.Fiel ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If Case

&H3Atttxt(0) = "Naga"Atttxt(1) = "Anaesthesian"A tttxt(2) = DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\

dr4.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel ds(2) =

Atttxt(2)Drs.Fiel ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

70Case &H2Atttxt(0) = "Desai"Atttxt(1) = "Nurse"Atttxt(2) = DateImage1.Pict ure = LoadPicture("D:\

PanimalarCBSS\ dr1.gif")If vvv2 = 0 ThenAtttxt(3) = TimeDrs.AddNe wDrs.Fields(0) = Atttxt(0)Drs.Fiel ds(1) = Atttxt(1)Drs.Fiel

ds(2) = Atttxt(2)Drs.Fiel ds(3) = Atttxt(3)Drs.Upd atevvv2 = 1End If Case &H1Atttxt(0) = "Mukharjee"Attt xt(1) =

"Doctor"Atttxt(2 )= DateImage1.Pict ure = LoadPicture("D:\ PanimalarCBSS\ dr2.gif")If vvv2 = 0 ThenAtttxt(3) = Timevvv2 =

1End If Case &HFAtttxt(0) = ""Atttxt(1) = ""Atttxt(2) = ""vvv2 = 0Atttxt(3) = ""Image1.Picture = LoadPicture("")E

nd SelectX = X + 1If X >= 30 Thenrs.AddNewr s(0) = Format(Date, "dd/mm/yyyy")rs (1) = Format(Time, "hh:mm:ss")rs(2)

= T1 rs(3) = T2 rs(4) = Ecg1rs.UpdateSr s.AddNewSrs(0) = Format(Date, "dd/mm/yyyy")S rs(1) = Time Srs(2) = p1 Srs(3) = p2

Srs(4) = p3 Srs(5) = p4S rs(6) =SalSrs.UpdateX = 0End If


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

71End SubPrivate Sub Timer2_Timer() Fcnt = Fcnt + 1If Fcnt > 6 ThenFcnt = 1End If If (Sarr(Fcnt) = 1) ThenMMControl

1.FileName = Fnames(Fcnt)M MControl1.Com mand = "Open"MMContr ol1.Command = "Play"Sarr(Fcnt) = 0Timer2.Enabled

= FalseEnd If End SubPrivate Sub Timer3_Timer()I f Ecg1Timer.Enab led = True ThenIf Strt = 1 And ptr > 0

ThenEgra1(1) = 50 - ((a(ptr) * 10) / (200# / 50#))ptr = ptr 1ElseEgra1(1) = 50 - (Ecg1 / (200# / 50#))ptr = 19Strt = 0End If For i = 100 To

2 Step -1Egra1(i) = Egra1(i 1)NextPicture1.C lsvvv = 1For i = 1 To 99Picture1.Line (vvv, Egra1(i))(vvv + 2, Egra1(i + 1)),

vbYellowvvv = vvv + 2NextEndIf End SubPrivate Sub Timer4_Timer()


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

72If Heartbeattimer.E nabled = True Thenhcnt = hcnt + 1Text2.Text = hcntIf hcnt >= 60 ThenText3.Text = BcntIf (Bcnt < 72 Or Bcnt > 84)

ThenLabel9.Capt ion = "Heart Beat Abnormal"btime r.Enabled = TrueElseLabel9. Caption = "Heart Beat Normal"End If

hcnt = 0Bcnt = 0End If If hcnt < 3 ThenLabel9.Visi ble = TrueElseLabel9. Visible = FalseEnd If End If End Sub

Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

73

Form3.frm Private Sub Command1_C lick()

Form3.HideForm 5.ShowForm5.D ata1.RecordSour ce=DocForm5. Data1.Refresh Form5.DBGrid1. ClearFieldsForm 5.DBGrid1.ReBi ndEnd

SubPrivate Sub Command2_Clic k()Form3.HideF orm5.ShowForm 5.Data1.RecordS ource=patientF orm5.Data1.Refr esh

Form5.DBGrid1. ClearFieldsForm 5.DBGrid1.ReBi ndEnd SubPrivate Sub Command3_Clic k()Form3.HideF orm5.ShowForm

5.Data1.RecordS ource=Digital
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

74Form5.Data1. Refresh

Form5.DBGrid1. ClearFieldsForm 5.DBGrid1.ReBi ndEnd SubPrivate Sub Command5_Clic k()Form3.HideF orm5.ShowEnd SubPrivate Sub

Command6_Clic k()EndEnd SubPrivate Sub Form_DblCliclk( )Me.PrintFormE nd Sub


Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

75Form5.frmPriv ate Sub Command1_Clic k()Data1.Record set.MoveFirstWh ile Not (Data1.Recordset .EOF)Data1.Rec

ordset.DeleteDat a1.Recordset.Mo veNextWendDB Grid1.ClearField sEnd SubPrivate Sub Command2_Clic k()Form5.HideF orm4.ShowLine(

528,182)(744,384),Form4 .BackColor,BFol dx=536oldy=384 k=0End SubPrivate Sub Command3_Clic k ()Form4.MSCom

m1.Output =[3ffff80ff]Sle ep(50)EndEnd Sub


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

76Module1Optio n ExplicitPublic db as DatabasePublic textval , dtext, SString, Sendstr, Rtext As StringPublic trs, rps, prs, Srs, Drs

As RecordsetPublic X, Eout1, bout1, out, Timeout1, As IntegerPublic pch, pa, pb, attin, pc, As IntegerPublic oldx, oldy, Maxv

As SinglePublic k, grval As IntegerPublic t1, tt0, tt1, t2, t3, t4, tt2, Ecg1 As DoublePublic p1, p2, p3, p4, Sal As StringPublic Strt As

IntegerPublic Fnames(1 to 7) As StringPublic Egra1(1 to 100) As SinglePublic Fcnt As IntegerPublic a(0 to 19) As SinglePublic pt1,

pt2 As SinglePublic ptr, vvv, vvv2 Sarr(1 to 7) As IntegerPublic Beat, Bcnt, Bflg, Tcount As SinglePublic hcnt, hout As

IntegerPublic Declare Function Sleep Lib kernel32 (ByVal dwMilliseconds As Long) As LongPublic objOutlook As

New Outlook.Applicat ionPublic objOutlookMsg As Outlook.MailIte mPublic pflg, sale, t1flg, t2flg, hflg1, finflg,

myflg As IntegerPublic Lg As Long


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

77

CONC LUSIO N
Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

78

CONCLUSIO N
This Project which demonstrates an automated

patient monitoring system has its ownmerits and demerits which are discussed below:
Merits:

2.

The wireless alert system using WAP notifies physicians of critical results ontheir cellular phones.3.

With online recoding of medical parameters, the workload of the case providersand the nursing staff is reduced.4.

The clinical information database contains all data regarding the patients inelectronic form.5. The patient call switches help

emergency situations to be handled quickly.Future enhancements can be easily implemented with the PLC controller.

De-Merits:

1. The heart beat sensor is highly temperature dependent and the dynamiccharacte ristics change

with different levels of ambient light and temperature level.2. The ECG amplifier needs a high CMRR and additional

narrowband filters arenecessary to attenuate effects of mains and noise interference.3. Thermistors used for respiratory

temperature measurement may need to be heatedinitially in order to provide better sensitivity. However, this excessive heatingmay

cause discomfort to the patient.


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

79

FUTU RE ENHA

NCEM ENTS
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

80

FUTURE ENHANCEM ENTS


The human body scanning system could be made more sophisticated by incorporatingblo

od pressure and EEG sensors. The analog channel inputs AN4 and AN7 can be used andthe Port B can be programmed as

an input port along with an additional ADC chip in theexternal circuit.Hospitabl e wide wireless capability would allows doctor to

occur the patientsdatabase using their word held computers.The entire medical data acquisition could be made wireless and

wearable. Such apackage would contain the circuiting for inputs from ECG sensors, EEG sensors, pressuremeasure ment and pulse

rate transducers. This wearable module can transmit the datacontinuously over a fiber optic link or through an internet digital radio. The

received datacan be stored in separate memory and be processed by a microcontroller. This enhancementwill enable

monitoring of patients to be more flexible and strain-free.


Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

81

COST ESTIM ATE


Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

82

COST ESTIMATE
COMPONENTS PRICE (Rs.)

Power supply boardResistors

and wiresTransistors TrimpotsSwitche sIC OP079 pin female connectorMAX2 32PIC16F877He artbeat sensorECG

sensorSaline bottlePCB and GPBMicrocontro ller boardCabinetMis cellaneous105.00 35.0025.0040.00 40.00110.0015.0 070.00700.00130

0.00950.0017.00 50.00800.00450. 00600.00


TOTAL 5307.00
Electronics and Communication EngineeringPanimalar Polytechnic College, Chennai

83

BIBLI OGRA PHY


Electronics and Communication EngineeringPanimalar

Polytechnic College, Chennai

84

BIBLIOGRA PHY
1. Handbook of Bio-Medical Instrumentation R.S.Khandpur2.

Bio-Medical Instrumentation and measurements Leslie CromwellFred. J. Wejnbell- Erich . A. Pleiffer3. Linear Integrated

Circuits - Roy Chowdary4. IBM PC Handbook - IBM Corporation5. www.microchip.c om6. VISUAL BASIC---Ground Up Gary Cornell

Search Search History: Searching... Result 00 of 00 00 results for result for p.

4. Saline Status Monitoring Circuit: for Patient Monitoring System Using Pic16f877
This is the report of my final year project during my diploma course in Electronics, June 2003. This project deals with a controller that monitors the heart beat , temperature , ECG and saline level of (More) This is the report of my final year project during my diploma course in Electronics, June 2003. This project deals with a controller that monitors the heart beat , temperature , ECG and saline level of the patient. It uses a front end Visual Basic 6.0 interface (Source code can be downloaded from http://www2.engr.arizona.edu/~maheshbk/files/PatientMonitoringSystem_VB.zip ). The PIC assembly language program is included in the report. (Less) Download or Print Add To Collection 37.7K Reads 425 Readcasts 206 Embed Views

Published by cezortia Follow

Search TIP Press Ctrl-FF to search anywhere in the document.

Sections

CONTENTS SYNOPSIS CPU INTRODUCTION

4. Saline Status Monitoring Circuit: 5. Attendance Card Reader: 6. Patient Call Switches Circuit: 7. Body Temperature Measurement Circuit: 10. MAX 232: ASSEMBLY LANGUAGE PROGRAM - PIC16F877 USER END SOFTWARE IN VISUAL BASIC Flow Chart: PROGRAM: Form4.frm Form3.frm CONCLUSION FUTURE ENHANCEMENTS COST ESTIMATE BIBLIOGRAPHY

Info and Rating


Category: Research > Math & Engineering Rating: (20 Ratings) Upload Date: 01/03/2009 Copyright: Attribution Non-commercial Share Alike Technology general PIC16F877 patient monitoring Tags: medical data acquisition (more tags) Free download as PDF File (.pdf), Text File (.txt) or read online for free. Flag document for inapproriate content

Download and print this document


Choose a format to download in

.PDF

.TXT Download

Recommended

82 p. 9680794 Patient Monitoring System Using Pic16f877 (1) Gautam Talukdar 419 Reads

11 p. Micro Controller Based Patient Monitoring System Chandan Hirmath 501 Reads

28 p. Project Report on Heartbeat Monitoring bagdeparag 5898 Reads Next

More From This User

2 p. Latex Cheat Sheet cezortia 237 Reads

47 p. Review of Distributed File Systems: Concepts and Case Studies cezortia 580 Reads

10 p. Review of Distributed File Systems: Concepts and Case Studies cezortia 2073 Reads Next

Featured

32 p. Science & Salvation Random House Publishing Group

137 p. Universal Preschool Hoover Institution $10.00

4 p. Ricky Thunder USA TODAY Comics Next

Comments

Post comment Rohmaaac4 years ago 00 thanks so much for this so useful document but please how can i download it where i need some information with my best wishes Rohmaaac4 years ago 00 thanks so much for this so useful document but please how can i download it where i need some information with my best wishes

Rohmaaac4 years ago 00 thanks so much for this so useful document but please how can i download it where i need some information with my best wishes setsuna004 years ago 00 Thanks you sir for this great reference. setsuna004 years ago 00 Thanks you sir for this great reference. setsuna004 years ago 00 Thanks you sir for this great reference. ~luna~3 years ago 00 finally... i find it... tq 2 the owner... ~luna~3 years ago 00 finally... i find it... tq 2 the owner... ~luna~3 years ago 00 finally... i find it... tq 2 the owner... sudTHEkoolest2 years ago 00 its a very good project sudTHEkoolest2 years ago 00 its a very good project deleted_fbuser_13541143658 months ago 00 valuable deleted_fbuser_13541143658 months ago 00 valuable scribd. scribd. scribd. scribd. scribd. scribd. scribd. < div style="display:none;">< img src="//pixel.quantserve.com/pixel/p-13DPpb-yg8ofc.gif" border="0" height="1" width="1" alt="Quantcast">< /div> About

About Scribd Blog Join our team! Contact Us

Premium

Premium Reader Scribd Store

Advertise with us

Get started AdChoices

Support

Help FAQ Press

Partners

Publishers Developers / API

Legal

Terms Privacy Copyright

Copyright 2013 Scribd Inc. Language: English

Das könnte Ihnen auch gefallen