m5zn_905e7e2b5fb2e09

advertisement

Telemonitoring Of HB & BT 2011-2012

| P a g e 1

Telemonitoring Of HB & BT 2011-2012

1.1 Medical Background

Human Heart Anatomy

The human heart is a muscle that lies left of the chest between the lungs behind the sternum and above the diaphragm. It is surrounded by the pericardium. It has about the size of a fist, and its weight is about 250-350grams.

The heart has four chambers. The two lower pumping chambers of the heart are called the right and left ventricle, while the two upper filling chambers are the right and left atrium. In the normal circulation, the blood that returns from the body through the superior and inferior vena cava and to the right atrium is low in oxygen. This blood passes through the tricuspid valve into the right ventricle, and then travels to the lungs, through the pulmonary valve and pulmonary arteries, to receive oxygen. The oxygen–rich blood returns through the upper and lower pulmonary veins into the left atrium, then moves to the left ventricle through the mitral valve. The blood is then pumped out to the body from the left ventricle through the aortic valve and the aorta, which is a large blood vessel that carries oxygenated blood to the smaller blood vessels in the body.

The right and left atrium are separated by a middle wall, called the interatrial septum. The right and left ventricle are separated by a middle wall, called the interventricular septum. The main function of the right heart (right atrium and right ventricle) is receiving the oxygen-poor blood coming from the upper and lower body into the heart and pumping it into the lungs so that it can get oxygenated. The main function of the left heart (left atrium and left ventricle) is to receive oxygen-rich blood from the lungs and pump it into the body through the aorta.

[1]

| P a g e 2

Telemonitoring Of HB & BT

Figure1.1 :The Human Heart Anatomy. [1]

The cardiac cycle is a term referring to all or any of the events related to the flow or blood pressure that occurs from the beginning of one heart beat( pump) to the beginning of the next. Each beat involves five major stages. The first two stages, often considered together as the "ventricular filling" stage, involve the movement of blood from atria into ventricles. The next three stages involve the movement of blood from the ventricles to the pulmonary artery (in the case of the right ventricle) and the aorta

(in the case of the left ventricle). The frequency of the cardiac cycle is described by the heart rate.

In a healthy heart, this process usually goes smoothly, resulting in a normal resting heart rate of 60 to 100 beats per minute .

[3] But if there is a problem with rate of heartbeats that's called Cardiac Arrhythmia that including tachycardia, and bradycardia.

[3]

Bradycardia (slow heart rate) in the context of adult medicine, is the resting heart rate of under 60 beats per minute, though it is seldom symptomatic until the rate drops below 50 beats/min. It may cause cardiac arrest in some patients, because those with bradycardia may not be pumping enough oxygen to their hearts. It sometimes results in fainting, shortness of breath, and if severe enough death.

[3]

2011-2012

| P a g e 3

Telemonitoring Of HB & BT 2011-2012

Tachycardia (high heart rate) typically refers to a heart rate that exceeds the normal range for a resting heart rate (abnormally high cardiac rhythm >100 bpm). It can be dangerous depending on the speed and type of rhythm.

Cardiac Arrhythmia can be caused by many things or events, including :

Scarring of heart tissue (such as from a heart attack)

Changes to heart's structure, such as from cardiomyopathy

Blocked arteries in heart (coronary artery disease)

High blood pressure

Diabetes

Overactive thyroid gland (hyperthyroidism)

Drug abuse

Stress

Medications

Dietary supplements and herbal treatments

Electrical shock. [2]

Body Temperature

The body is very good at keeping its temperature within a narrow, safe range in spite of large variations in temperatures outside the body. When you are too hot, the blood vessels in your skin expand (dilate) to carry the excess heat to your skin's surface. You may begin to sweat, and as the sweat evaporates, it helps cool your body. When you are too cold, your blood vessels narrow (contract) so that blood flow to your skin is reduced to conserve body heat. You may start shivering, which is an involuntary, rapid contraction of the muscles. This extra muscle activity helps generate more heat. Under normal conditions, this keeps your body temperature within a narrow, safe range. [3]

The notion that illness and fever (elevation of body temperature above normal) are linked has been known since the time of Hippocrates and Galen. However, the concept of temperature as a quantifiable vital sign (like pulse rate and blood pressure) that could be measured and recorded is a relatively recent phenomena. Although the thermometer is as ancient as the microscope and older than the stethoscope, its use as an instrument for physical diagnosis in medicine is a relatively recent phenomenon.

| P a g e 4

Telemonitoring Of HB & BT 2011-2012

RELATIONSHIP BETWEEN HEART RATE AND BODY

TEMPERATURE:

The heart rate means the number of cardiac cycle per minutes. While the temperature of the body is a measure of the body's ability to generate and get rid of heat. [3] The relation between them is described by Anton Dehaen, who noted that changes in temperature with shivering or fever. He also described an increase in heart rate with increased body temperature. [4]

This concept has been examined in early years and results that body temperature is an independent determinant of heart rate, causing an increase of approximately 10 beats per minute per degree centigrade. [8]

This relationship occurs because the blood vessels of the body, particularly the peripheral blood vessels, i.e those of the skin can dilate or contract depending on body temperature. When the temperature of the body drops, the peripheral blood vessels contract to conserve heat. When the body's temperature increases above normal, the peripheral blood vessels dilate to allow more heat to escape. The blood vessels dilating lowers the blood pressure in the body, because the blood distribution has increased to areas which previously had less distribution. The body now has to compensate, because of the change in pressure less blood is being pumped to the vital organs of the body. It does this by increasing the cardiac output, the amount of blood pumped out of the heart per given time. Cardiac output can be increased by increasing the heart rate. Thus an increase in temperature, through the vasodilation of blood vessels causes a drop in blood pressure, which is compensated for by increasing the cardiac output, which can be achieved through increasing the heart rate. Therefore heart rate increases when temperature increases. [2]

| P a g e 5

Telemonitoring Of HB & BT 2011-2012

1.2 Statement Of Problems

Tachycardia and Bradycardia are arrhythmias of heart that indicate any abnormal of the number of heart pulses per minute, which identify any damage to the heart and investigate the effect of drugs. In addition, the body illness and Tachycardia cause elevation of body temperature above normal. So that, any abnormal body temperature which means the body cannot save temperature at the save range.

Therefore, these parameters should be monitor continually, and doctor or carer should be abreast on these results continually, but it is hard to them to stay near to patient all the time.

1.3 Objectives

Design this project for monitor some physiological parameters by using some various electronic components and Radio Frequency Communication.

Design sensor circuits for measure the heart rate and body temperature.

Design simulation for this project by using software program (Proteus).

Implementation of the project on the real ground.

Calibrating of the project circuits.

 Testing on patients and comparison between our result values and normal values.

| P a g e 6

Telemonitoring Of HB & BT 2011-2012

1.4 Methodology

Heart rate is measured by finding the pulse of the body. This pulse rate can be measured at any point on the body where the artery'spulsation is transmitted to the surface by pressuring it with the index and middle fingers; often it is compressed against an underlying structure like bone. The thumb should not be used for measuring another person's heart rate, as its strong pulse may interfere with correct perception of the target pulse. [12]

The skin is easily accessed for temperature measurement by using a reusable metallic disks attached to thermistors or thermocouples. The reusable probes can be placed in a number of locations including the back, chest or abdominal wall, axilla

(armpit), or distal extremities. Measurement of skin temperature is also affected by moisture (sweat) and pressure applied to the probe. An increase in the amount of pressure on the probe will increase temperature measured. [4]

1.5 Overview

The first Chapter starts with the medical background about of the human heart anatomy, body temperature and relationship between them. The chapter gives the human heart rate range, also discusses the causes of Cardiac Arrhythmia. The second chapter deals the functional block diagrams of project and basic units for monitoring

Process. The third chapter explains implementation of hardware and software, also the simulation circuits and flowchart programs. The fourth chapter deals with the results test for some students. The last chapter deals the problems faced in project and recommendations for future work.

| P a g e 7

Telemonitoring Of HB & BT

1.6 Timeline Of Project

2011-2012

| P a g e 8

Telemonitoring Of HB & BT 2011-2012

| P a g e 9

Telemonitoring Of HB & BT

2.1 The Basic Monitoring System

 This monitoring system has three basic stages:

1.

The Sensors Unit.

2.

The Transmission Unit.

3.

The Receiving Unit.

2011-2012

Figure 2.1 : The Basic Three Stages For Monitoring System .

2.2 The Sensors Unit

A biosensors can be generally defined as a device that consists of a biological recognition system, often called a Bioreceptor, and a transducer. In general, any biological interaction with the Bioreceptor is designed to produce an effect measured by the transducer, which converts the information into a measurable effect, such as an electrical signal. [5]

The temperature sensor (DS1261) and heart beat sensor have the same general concept.

| P a g e 10

Telemonitoring Of HB & BT 2011-2012

2.2.1

Temperature Sensor ( DS1621 )

The DS1621 measures temperature using a bandgap-based temperature sensor. A delta-sigma analog-to-digital converter (ADC) converts the measured temperature to a digital value that is calibrated in °C. The DS1621 Digital Thermometer and

Thermostat provides 9-bit temperature readings with range of -55°C to + 125°C in

0.5°C increments.

[6]

Figure 2.2

: DS1621 Functional Block Diagram.

[6]

| P a g e 11

Telemonitoring Of HB & BT 2011-2012

2.2.2

Heart Beat Monitor

Heart beat is sensed by using a high intensity type LED and LDR(Light Dependent

Resister), whose resistance depends on the amount of light that is induced on it.

[7]

The finger is placed between the LED and LDR, the skin may be illuminated with visible (red) using transmitted or reflected light for detection. The very small changes in reflectivity or in transmittance caused by the varying blood content of human tissue are almost invisible. Various noise sources may produce disturbance signals with amplitudes equal or even higher than the amplitude of the pulse signal. Valid pulse measurement therefore requires extensive preprocessing of the raw signal.

[9]

Figure 2.3 : The Probe Body.[10]

]

The setup described here uses a red LED for transmitted light illumination and a

LDR as detector. If light falling on the detector (LDR) is of high enough frequency, photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band. The resulting free electron (and its hole partner) conduct electricity, thereby lowering resistance. The voltage signal is then passed through a dual operational amplifier (LM358). Output is given to another non-inverting input of the same LM358; here the second amplification is done. The value is preset in the non-inverting input. [11]

| P a g e 12

Telemonitoring Of HB & BT 2011-2012

Figure 2.4 : Heart Beat Monitor Functional Block Diagram. [11]

2.3 The Transmission Unit

This unit is to monitor biosignals from patient by sensors unit, and the data collected by (Microcontroller) and displaying on LCD. Then encoded data by

(Encoder), after this process done coming the process of sending data through the air by (AM Transmitter Circuit).

Figure 2.5 : Transmission Functional Block Diagram.

| P a g e 13

Telemonitoring Of HB & BT 2011-2012

2.4 The Receiving Unit

When receiving data from the air by (AM Receiver Circuit), then this data passed to decoded process by (Decoder), then insert this data to (Microcontroller) that collect them and display those values on the LCD. After the displaying, the microcontroller compares values of heart beat and body temperature . If there is abnormal value in patient's status the switch the alarm on.

Figure 2.6 : Reception Functional Block Diagram.

| P a g e 14

Telemonitoring Of HB & BT 2011-2012

| P a g e 15

Telemonitoring Of HB & BT 2011-2012

3.1 Sensors Simulation Circuit

3.1.1 Temperature Sensor Circuit Diagram

Description

The DS1621 Digital Thermometer and Thermostat, measures temperature using a bandgap-based temperature sensor. Provides 9-bit temperature readings, which indicate the temperature of the device. The thermal alarm output Tout, is active when the temperature of the device exceeds a user-defined temperature TH. The output remains active until the temperature drops below user defined temperature TL, allowing for any hysteresis necessary. User-defined temperature settings are stored in nonvolatile memory so parts may be programmed prior to insertion in a system.

Temperature settings and temperature readings are all communicated to/from the

DS1621 over a simple 2-wire serial interface. [6]

Figure 3.1

: Temperature Sensor Circuit Diagram.

Bandgap based digital sensors

Bandgap based digital temperature sensors are silicon semiconductors that rely on the characteristic variation in energy states between electrons occupying the top of the valence band and the bottom of the conduction band as the temperature changes.

Sensor circuits based on this technology can be matched with a microcontroller that activates the circuit, performs analog to digital conversion, stores the result in memory, and receives and transmits data digitally. [14]

| P a g e 16

Telemonitoring Of HB & BT 2011-2012

Pin Description

Table 3.0

SDA 2-Wire Serial Data Input/Output

SCL 2-Wire Serial Clock

GND Ground

TOUT Thermostat Output Signal

A0 Chip Address Input

A1 Chip Address Input

A2 Chip Address Input

VDD Power Supply Voltage

Features

Temperature measurements require no external components.

Measures temperatures from -55°C to +125°C in 0.5°C increments.

Fahrenheit equivalent is -67°F to 257°F in 0.9°F increments -67°F to 257°F in 0.9°F increments

Temperature is read as a 9-bit value (2-byte transfer)

Wide power supply range (2.7V to 5.5V)

Converts temperature to digital word in less than 1 second

Thermostatic settings are user definable and nonvolatile Data is read from/written via a 2-wire serial interface (open drain I/O lines)

Applications include thermostatic controls, industrial systems, consumer products, thermometers, or any thermal sensitive system

8-pin DIP or SO package (150mil ,208mil and 300mil)

Operation

The temperature reading is provided in a 9-bit, two’s complement reading by issuing the read temperature command. Table 3.1

describes the exact relationship of output data to measured temperature. The data is transmitted through the 2-wire serial interface, MSB first.

| P a g e 17

Telemonitoring Of HB & BT 2011-2012

Table 3.1

: Temperature / Data Relationships

TEMPERATURE

+125°C

+25°C

+½°C

+0°C

-½°C

-25°C

-55°C

DIGITAL OUTPUT

(Binary)

01111101 00000000

00011001 00000000

00000000 10000000

00000000 00000000

11111111 10000000

11100111 00000000

11001001 00000000

DIGITAL OUTPUT

(Hex)

7D00h

1900h

0080h

0000h

FF80h

E700h

C900h

Since data is transmitted over the 2-wire bus MSB first, temperature data may be written to/read from the DS1621 as either a single byte (with temperature resolution of 1°C) or as two bytes. The second byte would contain the value of the least significant (0.5°C) bit of the temperature reading. Note : that the remaining 7 bits of this byte are set to all "0"s.

 Temperature is represented in the DS1621 in terms of a ½°C LSB, yielding the following 9-bit format:

MSB

1 1 1 0 0 1 1 1

T = 25°C

LSB

0 0 0 0 0 0 0 0

Figure 3.2 : Temperature , TH, and TL Format.

.[ @Te ]

Higher resolutions may be obtained by reading the temperature and truncating the

0.5°C bit (the LSB) from the read value. This value is TEMP_READ. A Read

Counter command should be issued to yield the COUNT_REMAIN value. The Read

Slope command should then be issued to obtain the COUNT_PER_C value. The higher resolution temperature may be then be calculated by the user using the following:

The DS1621 always powers up in a low power idle state, and the Start Convert T command must be used to initiate conversions. The DS1621 can be programmed to perform continuous consecutive conversions (continuous-conversion mode) or to

| P a g e 18

Telemonitoring Of HB & BT 2011-2012 perform single conversions on command (one-shot mode). The conversion mode is programmed through the 1SHOT bit in the configuration register as explained in the

Operation and Control section. In continuous conversion mode, the DS1621 begins continuous conversions after a Start Convert T command is issued. Consecutive conversions continue to be performed until a Stop Convert T command is issued, at which time the device goes into a low-power idle state. Continuous conversions can be restarted at any time using the Start Convert T command.

In one-shot mode, the DS1621 performs a single temperature conversion when a

Start Convert T command is issued. When the conversion is complete, the device enters a low-power idle state and remains in that state until a single temperature conversion is again initiated by a Start Convert T command.

Thermostat Control

In its operating mode, the DS1621 functions as a thermostat with programmable hysteresis as shown in Figure 3.3

. The thermostat output updates as soon as a temperature conversion is complete.

When the DS1621’s temperature meets or exceeds the value stored in the high temperature trip register (TH), the output becomes active and will stay active until the temperature falls below the temperature stored in the low temperature trigger register

(TL). In this way, any amount of hysteresis may be obtained. The active state for the output is programmable by the user so that an active state may either be a logic "1"

(VDD) or a logic "0" (0V). This is done using the POL bit in the configuration register as explained in the Operation and Control section.

DQ (Thermostat output, Active = High)

Figure 3.3 : Thermostat Output Operation . [ 6 ]

| P a g e 19

Telemonitoring Of HB & BT 2011-2012

Operation and Control

The DS1621 must have temperature settings resident in the TH and TL registers for thermostatic operation. A configuration/status register also determines the method of operation that the DS1621 will use in a particular application, as well as indicating the status of the temperature conversion operation.

 The configuration register is defined as follows:

MSb Bit 6 Bit 5 Bit 4 Bit3 Bit 2 Bit 1 LSb

DONE THF TLF NVB X X XX POL 1SHOT

Where: a) DONE = Conversion Done bit. “1” = Conversion complete, “0” =

Conversion in progress. b) THF = Temperature High Flag. This bit will be set to “1” when the temperature is greater than or equal to the value of TH. It will remain “1” until reset by writing “0” into this location or removing power from the device. This feature provides a method of determining if the DS1621 has ever been subjected to temperatures above TH while power has been applied. c) TLF = Temperature Low Flag. This bit will be set to “1” when the temperature is less than or equal to the value of TL. It will remain “1” until reset by writing “0” into this location or removing power from the device.

This feature provides a method of determining if the DS1621 has ever been subjected to temperatures below TL while power has been applied. d) NVB = Nonvolatile Memory Busy flag. “1” = Write to an E 2

memory cell in progress, “0” = nonvolatile memory is not busy. A copy to E 2

may take up to 10 ms. e) POL = Output Polarity Bit. “1” = active high, “0” = active low. This bit is nonvolatile. f) 1SHOT = One Shot Mode. If 1SHOT is “1”, the DS1621 will perform one temperature conversion upon receipt of the Start Convert T protocol. If

1SHOT is “0”, the DS1621 will continuously perform temperature conversions. This bit is nonvolatile. g) X = Reserved.

For typical thermostat operation the DS1621 will operate in continuous mode.

However, for applications where only one reading is needed at certain times or to

| P a g e 20

Telemonitoring Of HB & BT 2011-2012 conserve power, the one-shot mode may be used. Note: that the thermostat output

(TOUT) will remain in the state it was in after the last valid temperature conversion cycle when operating in one-shot mode.

Wire Serial Data Bus

The DS1621 supports a bidirectional 2-wire bus and data transmission protocol. A device that sends data onto the bus is defined as a transmitter, and a device receiving data as a receiver. The device that controls the message is called a “master." The devices that are controlled by the master are “slaves." The bus must be controlled by a master device which generates the serial clock (SCL), controls the bus access, and generates the START and STOP conditions. The DS1621 operates as a slave on the

2-wire bus. Connections to the bus are made via the open-drain I/O lines SDA and

SCL.

 The following bus protocol has been defined ( See Figure 3.4

):

Data transfer may be initiated only when the bus is not busy.

During data transfer, the data line must remain stable whenever the clock line is HIGH. Changes in the data line while the clock line is high will be interpreted as control signals.

 Accordingly, the following bus conditions have been defined: a) Bus not busy : Both data and clock lines remain HIGH. b) Start data transfer : A change in the state of the data line, from HIGH to

LOW, while the clock is HIGH, defines a START condition. c) Stop data transfer : A change in the state of the data line, from LOW to

HIGH, while the clock line is HIGH, defines the STOP condition. d) Data valid : The state of the data line represents valid data when, after a

START condition, the data line is stable for the duration of the HIGH period of the clock signal. The data on the line must be changed during the

LOW period of the clock signal. There is one clock pulse per bit of data.

Each data transfer is initiated with a START condition and terminated with a STOP condition. The number of data bytes transferred between START and STOP conditions is not limited and is determined by the master device.

The information is transferred byte-wise and each receiver acknowledges with a ninth-bit.

| P a g e 21

Telemonitoring Of HB & BT 2011-2012

Within the bus specifications a regular mode (100kHz clock rate) and a fast mode

(400kHz clock rate) are defined. The DS1621 works in both modes. e) Acknowledge : Each receiving device, when addressed, is obliged to generate an acknowledge after the reception of each byte. The master device must generate an extra clock pulse which is associated with this acknowledge bit.

A device that acknowledges must pull down the SDA line during the acknowledge clock pulse in such a way that the SDA line is stable LOW during the HIGH period of the acknowledge related clock pulse. Of course, setup and hold times must be taken into account. A master must signal an end of data to the slave by not generating an acknowledge bit on the last byte that has been clocked out of the slave. In this case, the slave must leave the data line HIGH to enable the master to generate the STOP condition.

Figure 3.4 : Data Transfer On 2-Wire Serial Bus. [ 6 ]

| P a g e 22

Telemonitoring Of HB & BT 2011-2012

Figure 3.4

details how data transfer is accomplished on the 2-wire bus.

Depending upon the state of the R/W bit, two types of data transfer are possible:

Data transfer from a master transmitter to a slave receiver .

The first byte transmitted by the master is the slave address. Next follows a number of data bytes. The slave returns an acknowledge bit after each received byte.

Data transfer from a slave transmitter to a master receiver.

The first byte, the slave address, is transmitted by the master. The slave then returns an acknowledge bit. Next follows a number of data bytes transmitted by the slave to the master. The master returns an acknowledge bit after all received bytes other than the last byte. At the end of the last received byte, a

‘not acknowledge’ is returned.

The master device generates all of the serial clock pulses and the START and

STOP conditions. A transfer is ended with a STOP condition or with a repeated

START condition. Since a repeated START condition is also the beginning of the next serial transfer, the bus will not be released.

 The DS1621 may operate in the following two modes :

Slave receiver mode : Serial data and clock are received through SDA and

SCL. After each byte is received an acknowledge bit is transmitted. START and STOP conditions are recognized as the beginning and end of a serial transfer. Address recognition is performed by hardware after reception of the slave address and direction bit.

Slave transmitter mode : The first byte is received and handled as in the slave receiver mode. However, in this mode the direction bit will indicate that the transfer direction is reversed. Serial data is transmitted on SDA by the

DS1621 while the serial clock is input on SCL. START and STOP conditions are recognized as the beginning and end of a serial transfer.

Slave Address

A control byte is the first byte received following the START condition from the master device. The control byte consists of a 4-bit control code; for the DS1621, this is set as 1001 binary for read and write operations. The next 3 bits of the control byte are the device select bits (A2, A1, A0). They are used by the master device to select which of eight devices are to be accessed. These bits are in effect the 3 least significant bits of the slave address. The last bit of the control byte (R/W ) defines the

| P a g e 23

Telemonitoring Of HB & BT 2011-2012 operation to be performed. When set to a “1” a read operation is selected, when set to a “0” a write operation is selected. Following the START condition the DS1621 monitors the SDA bus checking the device type identifier being transmitted. Upon receiving the 1001 code and appropriate device select bits, the slave device outputs an acknowledge signal on the SDA line.

Command Set

Data and control information is read from and written to the DS1621. To write to the DS1621, the master will issue the slave address of the DS1621 and the R/W bit will be set to “0”. After receiving an acknowledge, the bus master provides a command protocol. After receiving this protocol, the DS1621 will issue an acknowledge and then the master may send data to the DS1621. If the DS1621 is to be read, the master must send the command protocol as before and then issue a repeated START condition and the control byte again, this time with the R/W bit set to “1” to allow reading of the data from the DS1621. The command set for the

DS1621 as shown in Table 3.2

is as follows: a) Read Temperature [AAh]

This command reads the last temperature conversion result. The DS1621 will send 2 bytes, in the format described earlier, which are the contents of this register. b) Access TH [A1h]

If R/W is “0” this command writes to the TH (HIGH TEMPERATURE) register. After issuing this command, the next 2 bytes written to the

DS1621, in the same format as described for reading temperature, will set the high temperature threshold for operation of the TOUT output. If R/W is

“1” the value stored in this register is read back. c) Access TL [A2h]

If R/W is “0” this command writes to the TL (LOW TEMPERATURE) register. After issuing this command, the next 2 bytes written to the

DS1621, in the same format as described for reading temperature, will set the high temperature threshold for operation of the TOUT output. If R/W is

“1” the value stored in this register is read back.

d) Access Config [ACh] If R/W is “0” this command writes to the configuration register. After issuing this command, the next data byte is the value to be written into the configuration register. If R/W is “1” the next data byte read is the value stored in the configuration register. e) Read Counter [A8h] This command reads the value Count_Remain. This command is valid only if R/W is “1”.

| P a g e 24

Telemonitoring Of HB & BT 2011-2012 f) Read Slope [A9h] This command reads the value Count_Per_C. This command is valid only if R/W is “1”. g) Start Convert T [EEh] This command begins a temperature conversion.

No further data is required. In one-shot mode the temperature conversion will be performed and then the DS1621 will remain idle. In continuous mode this command will initiate continuous conversions. h) Stop Convert T [22h] This command stops temperature conversion. No further data is required. This command may be used to halt a DS1621 in continuous conversion mode. After issuing this command, the current temperature measurement will be completed and the DS1621 will remain idle until a Start Convert T is issued to resume continuous operation.

Table 3.2

: DS1621 Command Set.

INSTRUCTION DESCRIPTION PROTOCOL

2-WIRE

BUS DATA

AFTER

ISSUING

PROTOCOL

Read

Temperature

TEMPERATURE CONVERSION COMMANDS

Read last converted temperature value from temperature register.

Read Counter Reads value of Count_Remain

AAh

A8h

<read 2 bytes data>

<read data>

Read Slope

Start Convert T

Reads value of the Count_Per_C

Initiates temperatureconversion.

Stop Convert T Halts temperature conversion.

A9h

EEh

22h

THERMOSTAT COMMANDS

<read data> idle idle

A1h <write data> Access TH Reads or writes high temperature limit value into TH register.

Access TL Reads or writes low temperature limit value into TL register.

Access Config Reads or writes configuration data to configuration register.

A2h

ACh

<write data>

<write data>

NOTES

1

1

2

2

2

NOTES:

1.

In continuous conversion mode a Stop Convert T command will halt continuous conversion. To restart the Start Convert T command must be issued. In one-shot mode a Start Convert T command must be issued for every temperature reading desired.

2.

Writing to the 𝐸 2

requires a maximum of 10ms at room temperature. After issuing a write command, no further writes should be requested for at least

10ms.

| P a g e 25

Telemonitoring Of HB & BT 2011-2012

3.1.2 Heart Beat Monitor Circuit Diagram

Heart rate measurement is one of the very important parameters of the human cardiovascular system. The heart rate of a healthy adult at rest is around 72 beats per minute (BPM).

Babies have a much higher heart rate at around 120 bpm, while older children have heart rates at around 90 bpm, as shown in Table 3.3

. The heart rate rises gradually during exercises and returns slowly to the rest value after exercise.

Lower than normal heart rates are usually an indication of a condition known as

Bradycardia, while higher than normal heart rates are known as Tachycardia. [14]

Table 3.3

: Average Heart Beat Rate.

[ 14 ]

AGE

0-1 Month

2-3 Month

4-12 Month

1-3 Years

4-5 Years

6-8 Years

9-11 Years

12-16 Years

>16 Years

RANGE

100-180

110-180

80-180

80-160

80-120

70-115

60-110

60-110

60-100

AVERAGE RATE

140

145

130

120

100

92.5

85

85

80

Heartbeat is sensed by using a high intensity type LED and photo detector(LDR) it is shown in Figure 3.5.

Figure 3.5 : Fingertip Placement Over The Probe Sensor.

| P a g e 26

Telemonitoring Of HB & BT 2011-2012

The red high intensity light emitted by led initially falls on LDR .This is the condition where the heartbeat is calibrated to zero using resistor R16. When a patient places his finger in between LED and LDR the light is restricted by the finger .The intensity of light penetration decreases if the blood is pumped into the finger .If the blood is not pumped then the light intensity is high .This high and low light intensity helps to measure heartbeat .Actually light falling on LDR cuts due to blood movement

.The duration of light disturbed is measured which gives the time duration of each heart beat pulse ,inverse of this time gives the heartbeat count per minute . This signal is amplified in two stages using dual operational amplifiers.

This resistors R 14,R15

,R16 are used to provide a reference voltage to the input of the comparator and R 17 resistor is used to adjust the square wave pulse obtained, C4 is used as feedback capacitor .The output after amplification is obtained at pin number 7 of Op-Amp and fed to microcontroller. It is Shown in Figure 3.6.

| P a g e 27

Figure 3.6: Heart Beat Monitor Circuit Diagram .

Telemonitoring Of HB & BT

The main components that are used in heart beat monitoring system are:

1.

A light-emitting diode (LED): is a semiconductor light source.

2011-2012

Figure 3.7: Photo Diode (LED) .

2.

LDR (Light Dependent Resistor) : is made from cadmium sulphide containing no or very few free electrons when not illuminated. Its resistance is then quite high. When it absorbs light, electrons are liberated and the conductivity of the material increases. conduction band band

Cadmium

Sulphide track band

gap valence bands

Figure 3.8: Structure of a Light Dependent Resistor (LDR). [7]

3.

Comparator Voltage

Finally, the signal is compared to a reference voltage using R17 for output voltage comparator and adjust the square wave pluse.An output

LED is illuminated if the signal is greater than the desired threshold, indicating a heartbeat.

| P a g e 28

Telemonitoring Of HB & BT 2011-2012

4.

Dual Operational Amplifiers (LM358):

General Description

The LM158 series consists of two independent, high gain, internally frequency compensated operational amplifiers which were designed specifically to operate from a single power supply over a wide range of voltages Operation from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply voltage. Application areas include transducer amplifier, DC gain blocks and all the conventional OP-AMP circuits which now can be easily implemented in single power supply systems. Some of the features are: a.

Internally Frequency Compensated for Unity Gain b.

Large DC Voltage Gain: 100dB c.

Wide Power Supply Range: LM258/LM258A, LM358/LM358A : 3V~32V

(or ±1.5V ~ 16V) d.

Input Common Mode Voltage Range Includes Ground e.

Large Output Voltage Swing: 0V DC to Vcc -1.5V DC f.

Power Drain Suitable for Battery Operation.

Pin Diagram

Figure 3.9

| P a g e 29

Telemonitoring Of HB & BT 2011-2012

3.2 The Monitoring System Circuit

The data which is input through the sensors to Pre-monitoring are shown on the LCD display, then it will be sent to the Post-monitoring via RF communication.

| P a g e 30

Figure 3.10 : Pre-Monitoring Circuit Diagram.

Telemonitoring Of HB & BT 2011-2012

Figure 3.11 : Post-Monitoring Circuit Diagram.

1.

Microcontroller (AT89C2051)

Description

The main components of monitoring system:

The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2K bytes of Flash programmable and erasable readonly memory (PEROM). The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set. By combining a versatile 8-bit

CPU with Flash on a monolithic chip, the Atmel AT89C2051 is a power-ful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89C2051 provides the following standard features: 2K bytes of Flash, 128 bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt

| P a g e 31

Telemonitoring Of HB & BT 2011-2012 architecture, a full duplex serial port, a precision analog comparator, on chip oscillator and clock circuitry. In addition, the AT89C2051 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

Pin Configuration

Figure 3.12

Pin Description

VCC Supply voltage

GND Ground

Port 1 The Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to

P1.7 provide internal pull-ups. P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive input (AIN0) and the negative input (AIN1), respectively, of the on-chip precision analog comparator. The Port 1 output buffers can sink 20 mA and can drive LED displays directly. When 1s are written to Port 1 pins, they can be used as inputs. When pins

P1.2 to P1.7 are used as inputs and are externally pulled low, they will source current (IIL) because of the internal pull-ups.

Port 1 also receives code data during Flash programming and verification.

| P a g e 32

Telemonitoring Of HB & BT 2011-2012

Port 3 Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups. P3.6 is hard-wired as an input to the output of the on-chip comparator and is not accessible as a general-purpose I/O pin. The Port 3 output buffers can sink 20 mA. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port

3 pins that are externally being pulled low will source current

(IIL) because of the pull-ups.

RST Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin high for two machine cycles while the oscillator is running resets the device. Each machine cycle takes 12 oscillator or clock cycles.

XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2 Output from the inverting oscillator amplifier.

2.

LCD (16x2)

Description

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs.

The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on.

A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This

LCD has two registers, namely, Command and Data. The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.

| P a g e 33

Telemonitoring Of HB & BT 2011-2012

Pin Diagram

Figure 3.13

Pin Description

Table 3.4

Pin No Function

1 Ground (0V)

Supply voltage; 5V (4.7V –

2

5.3V)

Table 3.4

3 Contrast adjustment; through a variable resistor

4

Selects command register when low; and data register when high

5

6

Low to write to the register; High to read from the register

Sends data to data pins when a high to low pulse is given

7

8

9

10

11

8-bit data pins

12

13

14

15 Backlight V

CC

(5V)

16 Backlight Ground (0V)

Name

Ground

Vcc

V

EE

Register Select

Read/write

Enable

DB0

DB1

DB2

DB3

DB4

DB5

DB6

DB7

Led+

Led-

| P a g e 34

Telemonitoring Of HB & BT 2011-2012

3.

BUZZER

A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, household appliances such as a microwave oven, or shows. buzzer is a ceramic-based piezoelectric sounder like a Son alert which makes a high-pitched tone.

As shown on Figure 3.14

.

Figure 3.14

4.

Transistor BC547

Description

BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of resistance, is commonly used to amplify current. A small current at its base controls a larger current at collector & emitter terminals. BC547 is mainly used for amplification and switching purposes. It has a maximum current gain of 800. Its equivalent transistors are BC548 and BC549. The transistor terminals require a fixed DC voltage to operate in the desired region of its characteristic curves. This is known as the biasing. For amplification applications, the transistor is biased such that it is partly on for all input conditions. The input signal at base is amplified and taken at the emitter. BC547 is used in common emitter configuration for amplifiers.

The voltage divider is the commonly used biasing mode. For switching applications, transistor is biased so that it remains fully on if there is a signal at its base. In the absence of base signal, it gets completely off.

Pin Diagram

Figure 3.15

| P a g e 35

Telemonitoring Of HB & BT 2011-2012

5.

POWER SUPPLY a) LM7805 (Voltage Regulator IC)

Description

It is a three pin IC used as a voltage regulator. It converts unregulated

DC current into regulated DC current.

Pin Diagram

Figure 3.16

Pin Description

Table 3.5

Pin No

1

2

3

Function

Input voltage (5V-18V)

Ground (0V)

Regulated output; 5V (4.8V-5.2V)

Name

Input

Ground

Output

b) Battery

A battery +9V is to provide electrical energy to electronic devices which are connected to it.

Figure 3.17

| P a g e 36

Telemonitoring Of HB & BT 2011-2012

3.3 The RF Wireless Remote Module

The RF module, as the name suggests, operates at Radio Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz. In this RF system, is a form of modulation that represents the digital data as variations in the amplitude of carrier wave. This kind is known as Amplitude Shift Keying (ASK). [15]

Transmission through RF is better for many reasons. Firstly signals through RF can travel through larger distances making it suitable for long range applications, secondly

RF signals can travel even when there is an obstruction between transmitter & receiver, and thirdly RF transmission is more strong , reliable and RF communication uses a specific frequency.

This RF module comprises of an RF Transmitter and an RF Receiver. The transmitter/receiver (Tx/Rx) pair operates at a frequency of 315 MHz to 434 MHz.

An RF transmitter receives serial data and transmits it wirelessly through RF through its antenna connected at pin4. The transmission occurs at the rate of 1Kbps -

10Kbps.The transmitted data is received by an RF receiver operating at the same frequency as that of the transmitter. The RF module is often used along with a pair of encoder/decoder. The encoder is used for encoding parallel data for transmission feed while reception is decoded by a decoder. HT12E-HT12D, HT640-HT648,etc. are some commonly used encoder/decoder pair ICs.[16]

Typical Applications of RF modules:

1.

vehicle monitoring

2.

remote control

3.

RF contactless smart cards

4.

small-range wireless network

5.

wireless data terminals

6.

biological signal acquisition

7.

wireless data transmissions

8.

Remote control of appliances and electronics devices.

9.

many other applications field related to RF wireless controlling.

| P a g e 37

Telemonitoring Of HB & BT

1) TX- RX MODULES (434 MHz)

Pin Diagram

2011-2012

Figure 3.18 : The Transmitter & Receiver Diagram.

RF Transmitter

Pin Description

Table 3.6

Pin No

1

2

3

4

Function

Ground (0V)

Serial data input pin

Supply voltage; 5V

Antenna output pin

RF Receiver

Pin Description

Table 3.7

Pin No

1

2

3

4

5

6

7

8

Function

Antenna input pin

Ground (0V)

Ground (0V)

Supply voltage; 5V

Supply voltage; 5V

Serial data input pin

Serial data input pin

Ground (0V)

Name

Ground

Data

Vcc

ANT

Name

ANT

Ground

Ground

Vcc

Vcc

Data

Data

Ground

| P a g e 38

Telemonitoring Of HB & BT 2011-2012

2) HT12E-Encoder IC

Description

HT12E is an encoder integrated circuit of 12 2

series of encoders.

They are paired with 12 2

series of decoders for use in remote control system applications. It is mainly used in interfacing RF and infrared circuits. The chosen pair of encoder/decoder should have same number of addresses and data format.

Simply put, HT12E converts the parallel inputs into serial output. It encodes the 12 bit parallel data into serial for transmission through an

RF transmitter. These 12 bits are divided into 8 address bits and 4 data bits. HT12E has a transmission enable pin which is active low. When a trigger signal is received on TE pin, the programmed addresses/data are transmitted together with the header bits via an RF or an infrared transmission medium. HT12E begins a 4-word transmission cycle upon receipt of a transmission enable. This cycle is repeated as long as TE is kept low. As soon as TE returns to high, the encoder output completes its final cycle and then stops.

Pin Diagram

Figure 3.19

| P a g e 39

Telemonitoring Of HB & BT 2011-2012

Operation Description

The 12 2

series of encoders begin a 4-word transmission cycle upon receipt of a transmission enable (TE for the HT12E, active low). This cycle will repeat itself as long as the transmission enable (TE) is held low. Once the transmission enable returns high the encoder output completes its final cycle and then stops as shown below.

Figure 3.20

Pin Description

Table 3.8

Pin No

1

2

3

4

5

10

11

12

13

6

7

8

9

14

15

16

17

18

Function

8 bit Address pins for input

Ground (0V)

4 bit Data/Address pins for input

Transmission enable; active low

Oscillator input

Oscillator output

Serial data output

Supply voltage; 5V (2.4V-12V)

Name

A0

A1

A2

A3

A4

A5

A6

A7

Ground

AD1

AD2

AD3

AD4

TE

Osc2

Osc1

Output

Vcc

| P a g e 40

Telemonitoring Of HB & BT 2011-2012

3) HT12D- Decoder IC

Description

HT12D is a decoder integrated circuit that belongs to 12 2

series of decoders. This series of decoders are mainly used for remote control system applications, like burglar alarm, car door controller, security system etc. It is mainly provided to interface RF and infrared circuits. They are paired with 12 2

series of encoders. The chosen pair of encoder/decoder should have same number of addresses and data format.

In simple terms, HT12D converts the serial input into parallel outputs. It decodes the serial addresses and data received by, say, an RF receiver, into parallel data and sends them to output data pins. The serial input data is compared with the local addresses three times continuously. The input data code is decoded when no error or unmatched codes are found. A valid transmission in indicated by a high signal at VT pin. HT12D is capable of decoding 12 bits, of which 8 are address bits and 4 are data bits. The data on 4 bit latch type output pins remain unchanged until new is received.

Pin Diagram

Figure 3.21

| P a g e 41

Telemonitoring Of HB & BT 2011-2012

Operation Description

The 12 2

series of decoders provides various combina- tions of addresses and data pins in different packages so as to pair with the 12 2 series of encoders. The decoders receive data that are transmitted by an encoder and interpret the first N bits of code period as addresses and the last 12-N bits as data, where N is the address code number. A signal on the DIN pin activates the oscillator which in turn decodes the incoming address and data. The decoders will then check the received address three times continuously. If the received address codes all match the contents of the decoder's local address, the 12-N bits of data are decoded to activate the output pins and the VT pin is set high to indicate a valid transmission. This will last unless the address code is incorrect or no signal is received.

The output of the VT pin is high only when the transmission is valid.

Otherwise it is always low.

Pin Description

Table 3.9

Pin No

1

2

3

4

5

6

7

8

9

10

15

16

17

18

11

12

13

14

Function

8 bit Address pins for input

Ground (0V)

4 bit Data/Address pins for output

Serial data output

Oscillator input

Oscillator output

Valid transmission; active high

Supply voltage; 5V (2.4V-12V)

Name

A0

A1

A2

A3

A4

A5

A6

A7

Ground

AD1

AD2

AD3

AD4 input

Osc2

Osc1

VT

Vcc

| P a g e 42

Telemonitoring Of HB & BT 2011-2012

3.4 Software Description

3.4.1 Flowchart Of Transmission Program

The pre-microcontroller prints an instructions on LCD that shows the time for putting sensor. After that the controller starts to calculate the number of beats and initializes the temperature sensor (DS1621).

The DS1621 operates as a slave (device that is controlled by the microcontroller) on the 2-wire bus. Connections to the bus are made via the open-drain I/O lines SDA

(data line) and SCL(clock line). with transfer any command or data it may be initiated only when the bus is not busy. During data transfer, the data line must remain stable whenever the clock line is HIGH. Changes in the data line while the clock line is high will be interpreted as control signals. Each data transfer is initiated with a START condition and terminated with a STOP condition, so at the first step the controller sends START condition then send value (90H) that indicates write mode then send the command`s value (EEH) that includes to the DS1621 to start conversion temperature's value then sends STOP condition.

In the second step the microcontroller initializes the beats counter through timer with mode (60H) that means using timer 1 in mode 2 with external clock then delay for 30 seconds for calculate the number of heart beats. When delay is be completed the microcontroller reads the number of beats from timer low. In the third step the microcontroller sends START condition then send value (90H) that indicates write mode then send the command`s value (AAH) that includes to the DS1621 to read the last converted value then sends STOP condition. In the forth step the microcontroller sends START condition then send value (91H) that indicates read mode to read the temperature value and save this value in new register then send stop condition. After reading values, the microcontroller prints those values on LCD and sends them to the post-microcontroller via wireless communication.

| P a g e 43

Telemonitoring Of HB & BT 2011-2012

| P a g e 44

Figure 3.22 : Flowchart Of Transmission Program.

Telemonitoring Of HB & BT 2011-2012

3.4.1 Flowchart Of Reception Program

In the post-microcontroller, the VT pin of the HT12D decoder is be monitored until it comes high that indicates valid transition. Then the microcontroller reads the transmitted values from decoder, and prints them on LCD . After this finished, the microcontroller compares those values with the normal ranges, if they are in the normal range the controller goes back and monitors the VT pin for new readings. But, if the values are not within the normal range the controller sends to switch on the buzzer then go back to read the new values.

| P a g e 45

Figure 3.23 : Flowchart Of Reception Program.

Telemonitoring Of HB & BT 2011-2012

| P a g e 46

Telemonitoring Of HB & BT 2011-2012

Description

This project used the Telemonitoring for physiological parameters, such as Heart beat rate, Body temperature and it could be used for other parameters in the future.

All results of this project have good accuracy with a real values and an abnormal values range, some of this results are shown below:

Table 4.1

: The Normal Range Values.

Biosensors Module

Measured

Parameters

Heart Rate Heart Beat Monitor

Temperature Sensor

(D1621)

Body Temperature

Display Type

Numerical

Numerical

Normal Rang

60 - 120

35 - 38

Figure 4.1 : The Normal Range Values.

| P a g e 47

Telemonitoring Of HB & BT 2011-2012

Figure 4.2 : The Abnormal Range Values.

Note: Show in Receiver Circuit The Led ON.

4.1

Implementation Parts

1.

Simulation

The simulation done by two microcontrollers ( Pre and Post

Microcontrollers ), two LCD and Buzzers. The pre-micro connect to temperature sensors via two lines ( SDA – SCL ) and connects to pulse generator by one line, then to LCD via 6 lines that indicates the first simulation circuit.

The connection this circuit and the second simulation circuit done by 5 lines for sending data serially. These lines are alternative of wireless communications which we couldn't find it in simulation's programs. This lines connect to post-micro that connect to LCD by 6 lines and to buzzer via one line to provide an alarm for any abnormal range values.

| P a g e 48

Telemonitoring Of HB & BT 2011-2012

| P a g e 49

Figure 4.3 : The Simulation Serial Circuits.

Telemonitoring Of HB & BT 2011-2012

2.

Design Of Sensors

The main function of DS 1621 temperature sensor is measuring the environment temperature which means that it's a fixed chip sensor on board. In our project we developed the same function of sensor but with replacement position which provides the ability to measure body temperature by putting the sensor in underarm. And connect the sensor with board by long wires.

Figure 4.4 : The DS 1621 By Using A Long Wires.

| P a g e 50

Figure 4.5 : The Heart Beat Monitor .

Telemonitoring Of HB & BT 2011-2012

3.

Design Of Wireless a) RF Transmitter

The transmitter module is connect with Encoder IC via one line for transfer data. The Antenna connected with transmitter via one line for transmit RF within range of 434MHz. The length of antenna is 17cm for

434MHz

Figure 4.6 : The Transmitter Module.

b) RF Receiver

The receiver module receives signal from Transmitter module via antenna, that connects with Decoder IC via one line for data then send them to post-Micro that displayed same data.

| P a g e 51

Figure 4.7 : The Receiver Module.

Telemonitoring Of HB & BT 2011-2012

4.2

Test the Work Of Sensors

We will Comparison the test results HR and Temperature for some patients between our device and Lab device. a) Heart Beat

Table 4.2

: Percentage Error Of HB.

Patient No. Lab Device Our Device

1

2

3

104

80

95

108

82

92

%Error

% 3.6

% 2.5

% 3.2

As shown in table previous the Accuracy =%96.8

The Line Chart

HB

120

100

80

60

40

20

Our Device

Lab Device

Patient No.

1 2 3

Figure 4.8 : The Variation Of Heart Beat Result Values From Our Device With Other Devices.

.

| P a g e 52

Telemonitoring Of HB & BT b) Temperature

Table 4.3

: Percentage Error Of Temperature.

Patient No. Lab Device Our Device

1

2

3

36.3 °C

37 °C

36.3 °C

36 °C

37 °C

36 °C

As shown in table previous the Accuracy =%99.5

The Line Chart

%Error

%0.83

%0

% 0.83

2011-2012

Temp

45

40

35

30

25

1 2 3

37,2

37

36,8

36,6

36,4

Our Device

Lab Device

36,2

36

35,8 Patient No.

Figure 4.9 : The Variation Of Body Temperature Result Values.

4.3

Wireless Communications

The Transmitter (MO-SAWR-A) and Receiver (MO-RX3400-A) Modules are extremely small, excellent for applications requiring short-range RF. In project used frequency of 315MHz and antenna length 23 cm and approximately Receiver range is 100m.

Your results may vary depending on your surroundings.

Antenna length about : 23cm for 315MHz ,17cm for 434MHz

(MO-RX3400-A434M) module About150m with MO-RX3

(Tested in open space)

| P a g e 53

Telemonitoring Of HB & BT 2011-2012

| P a g e 54

Telemonitoring Of HB & BT 2011-2012

Conclusion

Biomedical engineering (BME) is the application of engineering principles and techniques to the medical field. It combines the design and problem solving skills of engineering with medical and biological sciences to improve patient’s health care and the quality of life of individuals. A medical device is intended for use in the diagnosis of disease, or in the cure, treatment, or prevention of diseases. Thus in

Implementation of The Telemonitoring for condition of Patients , the heart beat and body temperature are successfully sensed. Temperature is measured using DS1621, where it follows on board proprietary temperature measurement technique. Heart beat is measured using LED, LDR and operational amplifier. Hence both parameters are displayed on a LCD display. Then both the parameters are transmitted and received displayed in a distant location.

Recommendations

EEG, ECG and other biological parameters can also be monitored.

Continuous monitoring and future diagnosis can be performed via the same system (TELEMEDICINE).

More than a single patient at different places can be monitored using single system.

We will work in the field of biomedical engineering we must raise awareness among the sociality and in all hospitals and health centers about techniques wireless health monitoring, and make it available to use.

Problems Faced

In sending data via wireless we got some problems. Firstly, the data was not received with the first reading in other way when transmitter sends the second data the receiver receives the first one, we solve this problem by sending the same data twice at time. The second problem was at send first data the first integer number was be random which make a shift values when receiving them, for solve this problem we ignored this integer number at the first then start real reading from the second integer number at each time in receiving data. The last problem that we couldn't solve it was when we send data from away we get some random values if there is a noise around the circuits.

| P a g e 55

Telemonitoring Of HB & BT

References

1.

Dr.Villafane (2008 - 2009, April 2008). "A Normal Heart." From

2011-2012 http://www.mykentuckyheart.com/information/NormalHeart.htm

.

2.

Research., M. F. f. M. E. a. (Feb.11, 2011, Aug. 10, 2012). "Heart arrhythmias." From http://www.mayoclinic.com/health/heartarrhythmias/DS00290/DSECTIO

N=causes .

3.

DANIEL J. SCHNECK, J. D. B. (2003). Biomechanics: Principles and

Applications. Boca Raton London New York Washington, D.C.

4.

Wiley, J. (2006). Encyclopedia of Medical Devices and Instrumentation.

Hoboken, New Jersey, simultaneously in Canada.

5.

Rashid Bashir, S. W. (2006). Biomolecular Sensing, Processing and

Analysis. Purdue University,West Lafayette, Indiana, Library of Congress

Cataloging.

6.

Maxim, D. S. DS1621 Digital Thermometer and Thermostat. Data Sheet

DS 1621.

7.

Diffenderfes, Robert (2005). electronic devices: system and applications. new Delhi: Delmar. pp. 480.

8.

Emerg Med J. 2009 Sep (Sep,26 2009 ). "The relationship between body temperature, heart rate and respiratory rate in children.". from http://www.ncbi.nlm.nih.gov/pubmed/19700579 .

9.

J.Binu (Jun 2007). "Biomedical monitoring system (at89c2051 + tx/rx)." from http://www.8051projects.info/forum/doubts-my-projects/24biomedical-monitoring-system-at89c2051-tx-rx-3.html#post2108 .

10.

Haydon, T. (2011 ). "How Does Pulse Oximetry Work." from http://homecaremag.com/senior-care-products/abcs-pulse-oximetry .

11.

Prof Bitar. (10.6,2009) Heartbeat Monitor _Lab_LM741.

12.

Regulation of Human Heart Rate. Serendip. Retrieved on June 27, 2007. from http://en.wikipedia.org/wiki/Heart_rate

13.

Mikal K. Hendee, P. E. Comparison of Thermistor Sensors to Bandgap-

Based Digital Sensors.

| P a g e 56

Telemonitoring Of HB & BT 2011-2012

14.

D.J.R.Kiran Kumar, N. K. (August 2012 ). "Design and Implementation of

Portable Health Monitoring system using PSoC Mixed Signal Array chip

" International Journal of Recent Technology and Engineering (IJRTE)

Vol.1.

15.

Bales, C. W., "A Comparison of Logarithmic and K-th Law Detectors",

IEEE Trans. AES, July 1978, pp. 693-696

16.

EngineersGarag (2012). "RF Module (Transmitter & Receiver)." from http://www.engineersgarage.com/electronic-components/rf-moduletransmitter-receiver .

| P a g e 57

Telemonitoring Of HB & BT 2011-2012

Appendix

(A)

Software Code

;Transmission Code

;---------==========----------==========---------=========---------

Ds1621W EQU 90h

DS1621R EQU 91h

DB0 EQU P1.1

DB1 EQU P1.0

DB2 EQU P3.7

DB3 EQU P3.1

SDA EQU P3.4

SCL EQU P3.3

LCD_RS EQU P1.7

LCD_E EQU P1.6

LCD_DB4 EQU P1.5

LCD_DB5 EQU P1.4

LCD_DB6 EQU P1.3

LCD_DB7 EQU P1.2

Heart EQU P3.5

;******************************

DSEG

ORG 20H

FLAGS: DS 1

Lastread bit flags.0

Cancel bit flags.1

Cancel1 bit flags.2

Alarm bit flags.3

SQW bit flags.4

ACK bit flags.5

Bus_Flt bit flags.6

_2W_BUS bit flags.7

BitCnt: DS 1

TempM: DS 1

TempL: DS 1

Valut_1:DS 1

Valut_2:DS 1

Valut_3:DS 1

Valut_4:DS 1

Beats: DS 1

ValuB_1:DS 1

ValuB_2:DS 1

SCL_High Macro setb SCL jnb SCL ,$

| P a g e 58

Telemonitoring Of HB & BT

ENDM

; ###################################

CSEG AT 0 org 00H clr p3.0

Call Reset_LCD mov r4,#80h

Call WLCDCom

Call Title mov r4,#0c2h

Call WLCDCom

Call Title2

mov r6,#10

H0: Call SDelay

Djnz r6,H0

Top: mov Tmod,#60h

mov Th1,#00h

mov Tl1,#00h

mov r4,#01h

Call WLCDCom

mov r4,#82h

Call wlcdcom

Call Notes

mov r4,#0c0h

Call WLCDCom

Call Notes2

mov r6,#15

H1: call SDelay

djnz r6,H1

setb Heart

Call Send_Start

mov a,#DS1621W

Call Send_Byte

mov a,#0eeh

Call Send_Byte

Call Send_Stop

Call MDelay

;7.5 second delay for puting sensors

Setb Tr1

mov r6,#60 ;30 seconds for reading beats and temp.

H2: Lcall SDelay

Djnz r6,H2

mov Beats,Tl1

Clr Tr1

Clr Tf1

Call Send_Start

mov a,#DS1621W

Call Send_Byte

mov a,#0aah

Call Send_Byte

2011-2012

| P a g e 59

Telemonitoring Of HB & BT

Call Send_Stop

Call MDelay

Call Send_Start

mov a,#DS1621R

Call Send_Byte

Call Read_Byte

mov TempM,a

Call Read_Byte

mov TempL,a

Call Send_Stop

setb P3.0 ; On Buzzer

mov r4,#01h ;processing

Call WLCDCom

mov r4,#82h

Call WLCDCom

Call Processing

mov r6,#10

H3: Call SDelay

djnz r6,H3

;5 seconds for buzzer

Clr P3.0 ; Off Buzzer

mov r4,TempL

cjne r4,#80h,L0w

mov valuT_4,#05h

Ajmp next

L0w: mov ValuT_4,#00h

;if there is 0.5c temp reading

Next: mov r2 ,TempM

Call Hex2B

;start conversion numbers mov ValuT_1,r5 mov ValuT_2,r4 mov ValuT_3,r3 mov a,Beats add a,Beats mov r2,a

Call Hex2B

; take beats value square mov ValuB_1,r4 mov ValuB_2,r3 ;end conversion numbers mov r4,#01h ;start printing temp. value on LCD

Call WLCDCom mov r4,#80h

Call WLCDCom

Call Disp_Temp

Call MDelay mov a,ValuT_1

CJNE a,#00h,H10

Ajmp Next2

H10: add a,#30h

2011-2012

| P a g e 60

Telemonitoring Of HB & BT

mov r4,a

Call WLCDData

Call MDelay

Next2: mov a,ValuT_2 add a,#30h mov r4,a

Call WLCDData

Call MDelay mov a,ValuT_3 add a,#30h mov r4,a

Call WLCDData

Call MDelay mov r4,#'.'

Call WLCDData

Call MDelay mov a,ValuT_4 add a,#30h mov r4,a

Call MDelay mov r4,#'C'

Call WLCDData

Call MDelay

Call WLCDData mov r4,#0c0h ;start printing beats value to LCD

Call WLCDCom

Call Disp_HB

Call MDelay mov a,ValuB_1 add a,#30h mov r4,a

Call WLCDData

Call MDelay mov a,ValuB_2 add a,#30h mov r4,a

Call WLCDData

Call MDelay

Call BPM

Call MDelay

; start sending all values to other device by pins mov a,ValuT_1

Call Send_Data

Call SDelay

mov a,ValuT_1

Call Send_Data

Call SDelay

mov a,ValuT_2

2011-2012

| P a g e 61

Telemonitoring Of HB & BT 2011-2012

Call Send_Data

Call SDelay

mov a,ValuT_3

Call Send_Data

Call SDelay

mov r6,#10

H14: Call SDelay

DJNZ r6,H14

mov a,ValuT_4

Call Send_Data

Call SDelay

mov a,ValuB_1

Call Send_Data

Call SDelay

mov a,ValuB_2

Call Send_Data

Call SDelay

mov a,#0DH

Call Send_Data

Call SDelay

mov r6,#60 ; 30 seconds delay befor the new reading

H4: Call SDelay

djnz r6,H4

Ajmp Top

| P a g e 62

Telemonitoring Of HB & BT

;############### Functions################

;######################################################

Title:

mov DPTR,#Masg1

Call LCD_Masg

Ret

Masg1: DB '#BIOMONITOR SYS#',00H

Title2:

mov DPTR,#Masg2

Call LCD_Masg

Ret

Masg2: DB 'For NMN Group',00H

Notes:

mov DPTR,#Masg3

Call LCD_Masg

Ret

Masg3: DB 'Put Sensors',00H

Notes2:

mov DPTR,#Masg4

Call LCD_Masg

Ret

Masg4: DB 'until Buzzer On',00H

Processing:

mov DPTR,#Masg5

Call LCD_Masg

Ret

Masg5: DB 'Processing...',00H

Disp_Temp:

mov DPTR,#Masg6

Call LCD_Masg

Ret

Masg6: DB 'Temp: ',00H

Disp_HB:

mov DPTR,#Masg7

Call LCD_Masg

Ret

Masg7: DB 'HR: ',00H

BPM:

mov DPTR,#Masg8

Call LCD_Masg

Ret

Masg8: DB ' BPM',00H

;######################################################

2011-2012

| P a g e 63

Telemonitoring Of HB & BT 2011-2012

SEND_DATA:

JNB ACC.0,MF1

SETB DB0

AJMP MF2

MF1:

MF2:

CLR DB0

JNB ACC.1,MF3

SETB DB1

AJMP MF4

MF3:

MF4:

MF5:

MF6:

CLR DB1

JNB ACC.2,MF5

SETB DB2

AJMP MF6

CLR DB2

JNB ACC.3,MF7

MF7:

MF8:

SETB DB3

AJMP MF8

CLR DB3

RET

;##########################################################

INITLCD4:

CLR LCD_RS

CLR LCD_E

MOV R4, #28h

CALL WLCDCom

MOV R4, #0ch

CALL WLCDCom

MOV R4, #06h

CALL WLCDCom

MOV R4, #01h

CALL WLCDCom

RET

; **********************************************************

RESET_LCD:

CLR LCD_RS

CLR LCD_E

CLR LCD_DB7

CLR LCD_DB6

SETB LCD_DB5

SETB LCD_DB4

SETB LCD_E

CLR LCD_E

MOV A, #4

CALL MDELAY

SETB LCD_E

CLR LCD_E

MOV A, #1

CALL MDELAY

SETB LCD_E

CLR LCD_E

MOV A, #1

| P a g e 64

Telemonitoring Of HB & BT 2011-2012

CALL MDELAY

CLR LCD_DB4

SETB LCD_E

CLR LCD_E

MOV A, #1

CALL MDELAY

MOV R4, #28h

CALL WLCDCom

MOV R4, #08H

CALL WLCDCom

MOV R4, #1

CALL WLCDCom

MOV R4,#06h

CALL WLCDCom

JMP INITLCD4

; **********************************************************

LCD_Masg:

Clr A

movc A,@A+DPTR

jz LCD_End

mov r4,A

Call WLCDData

inc DPTR

Call MDelay

jmp LCD_Masg

LCD_End:

Ret

; **********************************************************

Hex2B:

mov r3,#00d

mov r4,#00d

mov r5,#00d

mov b,#10

mov a,r2

Div ab

mov r3,b

mov b,#10

Div ab

mov r4,b

mov r5,a

Ret

; **********************************************************

READ_BYTE:

MOV BITCNT,#08H

MOV A,#00H

SETB SDA

READ_BITS:

SCL_HIGH

| P a g e 65

Telemonitoring Of HB & BT 2011-2012

MOV C,SDA

RLC A

CLR SCL

DJNZ BITCNT,READ_BITS

JB LASTREAD,ACKN

CLR SDA

ACKN:

SCL_HIGH

CLR SCL

RET

; **********************************************************

SEND_START:

SETB _2W_BUS

CLR ACK

CLR BUS_FLT

JNB SCL,FAULT

JNB SDA,FAULT

SETB SDA

SCL_HIGH

CLR SDA

ACALL DEELAY

CLR SCL

RET

FAULT:

SETB BUS_FLT

RET

; **********************************************************

SEND_STOP:

CLR SDA

SCL_HIGH

SETB SDA

CLR _2W_BUS

RET

; **********************************************************

Deelay:

NOP

RET

; **********************************************************

SEND_BYTE:

MOV BITCNT,#08H

SB_LOOP:

JNB ACC.7,NOTONE

SETB SDA

JMP ONE

NOTONE:

CLR SDA

| P a g e 66

Telemonitoring Of HB & BT 2011-2012

ONE:

SCL_HIGH

RL A

CLR SCL

DJNZ BITCNT,SB_LOOP

SETB SDA

SCL_HIGH

CLR ACK

JNB SDA,SB_EX

SETB ACK

SB_EX:

CALL DEELAY

CLR SCL

ACALL DEELAY

RET

; **********************************************************

WLCDCom:

CLR LCD_E

CLR LCD_RS

PUSH ACC

MOV A, R4

MOV C, ACC.4

MOV LCD_DB4, C

MOV C, ACC.5

MOV LCD_DB5, C

MOV C, ACC.6

MOV LCD_DB6, C

MOV C, ACC.7

MOV LCD_DB7, C

SETB LCD_E

CLR LCD_E

MOV C, ACC.0

MOV LCD_DB4, C

MOV C, ACC.1

MOV LCD_DB5, C

MOV C, ACC.2

MOV LCD_DB6, C

MOV C, ACC.3

MOV LCD_DB7, C

CLR LCD_E

SETB LCD_E

CLR LCD_E

CALL MADELAY

POP ACC

RET

; **********************************************************

WLCDData:

CLR LCD_E

SETB LCD_RS

| P a g e 67

Telemonitoring Of HB & BT 2011-2012

PUSH ACC

MOV A, R4

MOV C, ACC.4

MOV LCD_DB4, C

MOV C, ACC.5

MOV LCD_DB5, C

MOV C, ACC.6

MOV LCD_DB6, C

MOV C, ACC.7

MOV LCD_DB7, C

SETB LCD_E

CLR LCD_E

MOV C, ACC.0

MOV LCD_DB4, C

MOV C, ACC.1

MOV LCD_DB5, C

MOV C, ACC.2

MOV LCD_DB6, C

MOV C, ACC.3

MOV LCD_DB7, C

CLR LCD_E

SETB LCD_E

CLR LCD_E

NOP

NOP

Call MDelay

POP ACC

RET

; **********************************************************

MDELAY: ;one millisecond delay

PUSH ACC

MOV A,#30H

MD_DEL:

INC A

NOP

NOP

NOP

NOP

NOP

NOP

NOP

NOP

JNZ MD_DEL

NOP

POP ACC

RET

MADELAY:

PUSH ACC

MOV A,#036H

MAD_DEL:

INC A

NOP

| P a g e 68

Telemonitoring Of HB & BT 2011-2012

NOP

NOP

NOP

NOP

NOP

NOP

NOP

JNZ MAD_DEL

NOP

POP ACC

RET

;**********************************************************

SDELAY: ;half second delay routine

MOV R0,#02H

MFAM3: MOV R1,#0FFH

MFAM1: MOV R2,#0FFH

MFAM2: NOP

NOP

DJNZ R2,MFAM2

DJNZ R1,MFAM1

DJNZ R0,MFAM3

RET

END

| P a g e 69

Telemonitoring Of HB & BT 2011-2012

;Receiving Code

;---------==========----------==========---------=========---------

D0 EQU P1.1

D1 EQU P1.0

D2 EQU P3.7

D3 EQU P3.0

VT EQU P3.5

LCD_RS EQU P1.7

LCD_E EQU P1.6

LCD_DB4 EQU P1.5

LCD_DB5 EQU P1.4

LCD_DB6 EQU P1.3

LCD_DB7 EQU P1.2

;=================

DSEG

Org 20H

Flags Data 20H

D10 Bit Flags.0

D11 Bit Flags.1

D12 Bit Flags.2

D13 Bit Flags.3

Flaags: DS 1

StatusT Bit Flaags.2

StatusB Bit Flaags.3

TempM: DS 1

ValuT_1: DS 1

ValuT_2: DS 1

ValuT_3: DS 1

ValuT_4: DS 1

Beats: DS 1

ValuB_1: DS 1

ValuB_2: DS 1

;==================

CSEG At 0

Org 00H clr p3.1

Call Reset_LCD mov r4,#80H

Call WLCDCom

Call Title mov r4,#0c2h

Call WLCDCom

Call Title2 mov valuT_1,#00H mov valuT_2,#00H mov valuT_3,#00H mov valuT_4,#00H mov valuB_1,#00H mov valuB_2,#00H

| P a g e 70

Telemonitoring Of HB & BT

Top:

CALL READ

CALL MDELAY

CALL READ mov ValuT_1,FLAGS

CALL MDELAY

CALL READ

MOV VALUT_2,FLAGS

CALL MDELAY

CALL READ

MOV VALUT_3,FLAGS

CALL MDELAY

Call READ mov ValuT_4,FLAGS

Call MDelay

CALL READ

MOV VALUB_1,FLAGS

CALL MDELAY

CALL READ

MOV VALUB_2,FLAGS

CALL MDELAY

CALL READ

CALL MDELAY mov r4,#01H

Call WLCDCom mov r4,#80H

Call WLCDCom

Call Disp_Temp mov a,ValuT_1 cjne a,#00H,H10 ajmp Next

H10: add a,#30H

mov r4,a

Call WLCDData

Call MDelay

Next: mov a,ValuT_2

add a,#30H

mov r4,a

Call WLCDData

Call MDelay

; printing temp. value to LCD

2011-2012

| P a g e 71

Telemonitoring Of HB & BT

mov a,ValuT_3

add a,#30H

mov r4,a

Call WLCDData

Call MDelay

mov r4,#'.'

Call WLCDData

Call MDelay

mov a,ValuT_4

add a,#30H

mov r4,a

Call WLCDData

Call MDelay

mov r4,#'C'

Call WLCDData

Call MDelay

mov r4,#0c0H

Call WLCDCom

Call Disp_HB

call Mdelay

mov a,ValuB_1

add a,#30H

mov r4,a

Call WLCDData

Call MDelay

mov a,ValuB_2

add a,#30H

mov r4,a

Call WLCDData

Call MDelay

Call BPM

Call MDelay

; monitoring with buzzer

mov a,ValuT_2

SWAP a

ORL a,ValuT_3

mov TempM,a

clr Cy

Subb a,#35H

jnb cy, Next2

Setb StatusT

ajmp Other

Next2: mov a,TempM

clr Cy

Subb a,#38H

jb cy,Other

Setb Statust

;printing beats value to LCD

2011-2012

| P a g e 72

Telemonitoring Of HB & BT 2011-2012

Other: mov a,ValuB_1

SWAP a

ORL a,ValuB_2 mov Beats,a

Clr Cy

Subb a,#60H jnb cy,Next3

Setb StatusB

Ajmp Finish

Next3: mov a,Beats

Clr Cy

Subb a,#90H

Jb cy,Finish

Setb StatusB

Finish: Jb StatusT,on_Buzzer

Jb StatusB,on_Buzzer

AJmp Last on_Buzzer: Setb P3.1

Last: mov r6,#30

Here: Call SDelay

Djnz r6,Here

mov r4,#01H

Call WLCDCom

mov r4,#80H

Call WLCDCom

Call Done

mov r4,#0c2H

Call WLCDCom

Call Group

Ajmp Top

;15 secands delay for buzzer and showing values

| P a g e 73

Telemonitoring Of HB & BT

;**************=== Functions ===*****************:

;#####################################;

;##########################################################

READ: SETB VT

JNB VT,$

MOV FLAGS,#00H

SETB D0

JNB D0,MF1

SETB D10

MF1: SETB D1

JNB D1,MF2

SETB D11

MF2: SETB D2

JNB D2,MF3

SETB D12

MF3: SETB D3

JNB D3,MF4

SETB D13

MF4: JB VT,$

RET

;##########################################################

Title:

mov DPTR,#Masg1

Call LCD_Masg

Ret

Masg1: DB '#BIOMONITOR SYS#',00H

Title2:

mov DPTR,#Masg2

Call LCD_Masg

Ret

Masg2: DB 'For NMN Group',00H

Disp_Temp:

mov DPTR,#Masg6

Call LCD_Masg

Ret

Masg6: DB 'Temp: ',00H

Disp_HB:

mov DPTR,#Masg7

Call LCD_Masg

Ret

Masg7: DB 'HR: ',00H

BPM:

mov DPTR,#Masg8

Call LCD_Masg

Ret

Masg8: DB ' BPM',00H

Done:

2011-2012

| P a g e 74

Telemonitoring Of HB & BT

mov DPTR ,#M1

Call LCD_Masg

Ret

M1: DB 'Done By:',00H

Group:

mov DPTR,#M2

Call LCD_Masg

Ret

M2: DB 'NMN Group',00H

;**********************************************************

INITLCD4:

CLR LCD_RS

CLR LCD_E

MOV R4, #28h

CALL WLCDCom

MOV R4, #0ch

CALL WLCDCom

MOV R4, #06h

CALL WLCDCom

MOV R4, #01h

CALL WLCDCom

RET

; **********************************************************

RESET_LCD:

CLR LCD_RS

CLR LCD_E

CLR LCD_DB7

CLR LCD_DB6

SETB LCD_DB5

SETB LCD_DB4

SETB LCD_E

CLR LCD_E

MOV A, #4

CALL MDELAY

SETB LCD_E

CLR LCD_E

MOV A, #1

CALL MDELAY

SETB LCD_E

CLR LCD_E

MOV A, #1

CALL MDELAY

CLR LCD_DB4

SETB LCD_E

CLR LCD_E

MOV A, #1

CALL MDELAY

MOV R4, #28h

CALL WLCDCom

MOV R4, #08H

2011-2012

| P a g e 75

Telemonitoring Of HB & BT

CALL WLCDCom

MOV R4, #1

CALL WLCDCom

MOV R4,#06h

CALL WLCDCom

JMP INITLCD4

; **********************************************************

LCD_Masg:

Clr A

movc A,@A+DPTR

jz LCD_End

mov r4,A

Call WLCDData

inc DPTR

Call MDelay

jmp LCD_Masg

LCD_End:

Ret

; **********************************************************

WLCDCom:

CLR LCD_E

CLR LCD_RS

PUSH ACC

MOV A, R4

MOV C, ACC.4

MOV LCD_DB4, C

MOV C, ACC.5

MOV LCD_DB5, C

MOV C, ACC.6

MOV LCD_DB6, C

MOV C, ACC.7

MOV LCD_DB7, C

SETB LCD_E

CLR LCD_E

MOV C, ACC.0

MOV LCD_DB4, C

MOV C, ACC.1

MOV LCD_DB5, C

MOV C, ACC.2

MOV LCD_DB6, C

MOV C, ACC.3

MOV LCD_DB7, C

CLR LCD_E

SETB LCD_E

CLR LCD_E

CALL MADELAY

POP ACC

RET

; **********************************************************

WLCDData:

2011-2012

| P a g e 76

Telemonitoring Of HB & BT

CLR LCD_E

SETB LCD_RS

PUSH ACC

MOV A, R4

MOV C, ACC.4

MOV LCD_DB4, C

MOV C, ACC.5

MOV LCD_DB5, C

MOV C, ACC.6

MOV LCD_DB6, C

MOV C, ACC.7

MOV LCD_DB7, C

SETB LCD_E

CLR LCD_E

MOV C, ACC.0

MOV LCD_DB4, C

MOV C, ACC.1

MOV LCD_DB5, C

MOV C, ACC.2

MOV LCD_DB6, C

MOV C, ACC.3

MOV LCD_DB7, C

CLR LCD_E

SETB LCD_E

CLR LCD_E

NOP

NOP

Call MDelay

POP ACC

RET

; **********************************************************

MDELAY:

PUSH ACC

;one millisecond delay

MOV A,#30H

MD_DEL:

INC A

NOP

NOP

NOP

NOP

NOP

NOP

NOP

NOP

JNZ MD_DEL

NOP

POP ACC

RET

MADELAY:

PUSH ACC

MOV A,#036H

MAD_DEL:

2011-2012

| P a g e 77

Telemonitoring Of HB & BT 2011-2012

INC A

NOP

NOP

NOP

NOP

NOP

NOP

NOP

NOP

JNZ MAD_DEL

NOP

POP ACC

RET

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SDELAY: ;half Second Delay Routine

MOV R0,#02H

MFAM3: MOV R1,#0FFH

MFAM1: MOV R2,#0FFH

MFAM2: NOP

NOP

DJNZ R2,MFAM2

DJNZ R1,MFAM1

DJNZ R0,MFAM3

RET

END

| P a g e 78

Download