Sei sulla pagina 1di 35

ABSTRACT

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.
Athletes normally have lower heart rates than less active people. Babies have a much higher
heart rate at around 120 bpm, while older children have heart rates at around 90 bpm. The heart
rate rises gradually during exercises and returns slowly to the rest value after exercise. The rate
when the pulse returns to normal is an indication of the fitness of the person. 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.
This report describes the design of a very low-cost device which measures the
heart rate of the subject by clipping sensors on one of the fingers and then displaying the result
on a text based LCD. The device has the advantage that it is microcontroller based and thus can
be programmed to display various quantities, such as the average, maximum and minimum rates
over a period of time and so on. Another advantage of such a design is that it can be expanded
and can easily be connected to a recording device or a PC to collect and analyze the data for over
a period of time.

TABLE OF CONTENTS
SR. NO.

TOPIC

PAGE
NUMBER

0
1

Abstract
About the topic
Introduction
Background
Early approaches to BCI
Recent advancement in neurotechnologies
Electroencephalography
Introduction
Sources of EEG activities
Types of EEG Signals
BCI technologies
Introduction
Direct Control
Indirect Control
Communication
Brain process Modification
Mental state detection
Opportunitistic state detection
Advantages
Disadvantages
Conclusion
References
Appendices
Research Paper
Research Paper Followed

4
5
5
6
7
8
8
8
9
10
11
13
14
16
18
20
21
23
24
25
26
27
28
29
35

1.1
1.2
1.3
1.4
2
2.1
2.2
2.3
3
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
4
5
5.1
5.2

LIST OF FIGURES
Sr. No. Title
1.1
2.1
2.2
3.1
3.2
3.3
3.4

Basic use of BCI technology


EEG electrode connected to a patient
Neuron: Source of EEG

Monkey Controlling a robotic arm


BCI controlled wheel chair
Telepathy: A possible future with BCI
Emotion Detection using BCI

Page No.
8
9
14
18
19
20
21

1. Introduction
1.1 Objective:
To Design, development and testing of a low cost, low power, portable heart rate
measurement device using 8-bit microcontroller.

1.2 Description:
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). Athletes normally have lower heart rates than less active people. Babies have a much
higher heart rate at around 120 bpm, while older children have heart rates at around 90 bpm.
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.

Heart rate is simply and

traditionally measured by placing the thumb over the subjects arterial pulsation, and feeling,
timing and counting the pulses usually in a 30 second period. Heart rate (bpm) of the subject is
then found by multiplying the obtained number by 2. This method although simple, is not
accurate and can give errors when the rate is high. More sophisticated methods to measure the
heart rate utilize electronic techniques. Electro-cardiogram (ECG) is one of frequently used and
accurate methods for measuring the heart rate. ECG is an expensive device and its use for the
measurement of the heart rate only is not economical.
A PORTABLE CARDIO-MONITOR is a personal pulse rate monitoring device that
allows a subject to measure their heart rate in real time. This device was developed to provide a
lost cost, low power, portable solution for cardiac monitoring to patients. The device has the
advantage that it is microcontroller based and thus can be programmed to display various
quantities, such as the average, maximum and minimum rates over a period of time and so on.
Another advantage of such a design is that it can be expanded and can easily be connected to a
recording device or a PC to collect and analyze the data for over a period of time. The building
cost of the proposed device is around 400. One similar basic device from Cosy
Communications with no extension capabilities costs around 1500.

1.3 Project Description:

Fig 1.1 Block Diagram of Complete system

The above figure illustrates the block diagram of our project. Here the entire project is
divides into two main modules:
1. Transducer and Signal Conditioner Module
2. Data Acquisition Module
In this project, the transducer and signal conditioner module generates an electric pulse
corresponding to a single heart pulse using a transducer. As the signal generated is of very low
amplitude, it is highly prone to interference. So proper amplification of the signal is required.
Once the signal is properly conditioned and amplified. It is passed to the second module.
Data acquisition module work on digital data and performs various operations to generate
information from the received signal. Once, this module receives the electric pulses, this module
count the pulses over a period of one minute and then send a signal to display unit to display the
result.

1.4 Component Description:


There are a number of components used in this project and they are as follows:
1. Micro controller-AT89S52
2. LCD Display
3. Push switches
4. LDR
5. LED
6. Resistor Pack (10k)
7. Potentiometer-50K
8. Transistors-BC547
9. Capacitors-15pF, 33pF, 104pF, 10uF, 1000uF
10. Resistors-1K, 8.2K, 10K, 330K
11. Voltage regulator-7805
12. Transformer (12V)
13. Diodes IN4001, IN4007
14. Crystal (12MHz)
15. Operational Amplifiers (LM324N)
.

1.5 Circuit diagram:

Fig 1.2 Circuit Diagram

2.Hardware Design
2.1 Introduction:
Portable-Cardio Monitor is a low cost, low power consumption and portable heart rate
measurement system which provide an inexpensive solution to heart patients for constant
monitoring. To simplify the designing and development of the project, the entire project is
divides into two main modules:
1. Transducer and Signal Conditioner Module
2. Data Acquisition Module
In this project, the transducer and signal conditioner module generates an electric pulse
corresponding to a single heart pulse using a transducer. As the signal generated is of very low
amplitude, it is highly prone to interference. So proper amplification of the signal is required.
Once the signal is properly conditioned and amplified. It is passed to the second module.
Data acquisition module work on digital data and performs various operations to generate
information from the received signal. Once, this module receives the electric pulses, this module
count the pulses over a period of one minute and then send a signal to display unit to display the
result.

2.2 Transducer and Signal Conditioner Module:


2.2.1 Transducer Unit:
In this project, we monitor the heart beat by pulse oximetry technique. Here, we use innovative
technique to measure the heart beat measurement. This is achieving by pulse oximetry logic. We
use this technique to get the pulse from body and to amplify the signal and display this data on
the LCD .We use this technique in the exercise machines, where measurement of the heart beat
is very much important for controlling the speed of tread mill automatically.
A pulse oximeter is a particularly convenient noninvasive measurement instrument.
Typically it has a pair of small light-emitting diodes (LEDs) facing a photodiode through a

translucent part of the patient's body, usually a fingertip or an earlobe. One LED is red, with
wavelength of 660 nm, and the other is infrared, 905, 910, or 940 nm. Absorption at these
wavelengths differs significantly between ox hemoglobin and its deoxygenated form; therefore,
the oxy/deoxyhemoglobin ratio can be calculated from the ratio of the absorption of the red and
infrared light. The absorbance of oxyhemoglobin and deoxyhemoglobin is the same (isosbestic
point) for the wavelengths of 590 and 805 nm; earlier oximeters used these wavelengths for
correction for hemoglobin concentration.
The monitored signal bounces in time with the heart beat because the arterial blood
vessels expand and contract with each heartbeat. By examining only the varying part of the
absorption spectrum (essentially, subtracting minimum absorption from peak absorption), a
monitor can ignore other tissues or nail polish

[3]

and discern only the absorption caused by

arterial blood. Thus, detecting a pulse is essential to the operation of a pulse oximeter and it will
not function if there is none. Infra red led and photodiode is placed inside the tube for better
result. As we insert the finger in the tube, then light is crossed through the finger and focus on
the photodiode. Photodiode resistance is to change as per the light on the photodiode is to be
change. So in this way an electric impulse is generated according to human pulse. This electric
impulse is synthesized and used by other units.

Fig 2.1 Figure Illustrating Pulse oximeter

2.2.2 Signal amplification & Conditioning Unit:


The Transducer unit generates electric impulse corresponding to each heart beat, but the
signal generated is weak enough that it can be easily attenuated and cannot be directly used for
processing. So the signal needs amplification and conditioning for processing.
For this purpose we have used different stages of amplifiers to make it suitable for
processing. We have used highly sensitive low noise operational amplifiers LM324 and LM358
for this purpose. The LM324 series consists of four independent, high gain, internally frequency
compensated operational amplifiers which were designed specifically to operate from a single
power supply over a wide range of voltages. Operation from split power supplies is also possible
and the low power supply current drain is independent of the magnitude of the power supply
voltage. Application areas include transducer amplifiers, DC gain blocks and all the conventional
op amp circuits which now can be more easily implemented in single power supply systems. For
example, the LM124 series can be directly operated off of the standard a 5V power supply
voltage which is used in digital systems and will easily provide the required interface electronics
without requiring the additional 15V power supplies.

Fig 2.2 Internal Structure of LM324

The signals received from sensing electrodes amplified by 1000 times (60dB) of voltage
with the operational amplifier LM324 with two stages. It is 100 times at the first stage (40dB)
and 10 times (20dB) at the next stage. The circuit this time works with the single power supply
of +5 VDC. Therefore, for the positive input of the operational amplifiers, the half of the power
supply voltage is applied as the bias voltage. Then the alternating current signal can be amplified
on 4.5V central voltage. When using the operational amplifier with the negative feedback, the
voltage of the positive input terminal and the voltage of the negative input terminal become
equal approximately. This is called virtual grounding. So, by this bias voltage, the side of the
positive and the side of the negative of the alternating current signal can be equally amplified.
When not using this bias voltage, the distortion causes the alternating current signal. This
technique is often used when using the operational amplifier which needs two kinds of powers in
the single power.

Fig 2.3 Circuit Diagram of Transducer & Signal Conditioning Unit

2.3 Data Acquisition Module:


Transducer & Signal conditioning unit receives amplifies and condition the signal and
passes the signal to DAQ module. DAQ module is essentially a digital module which works on
digital data. So this module receives data from previous module and processes the data to
produce meaningful information.
Depending on functions this module can be further divided into smaller units:
1. Processing Unit
2. Display Unit

2.3.1 Processing Unit:


Processing Unit acts as the brain of overall project which is responsible for user
interaction. User interacts with the processing unit to control the device. Processing unit is also
responsible for all logical data manipulation required to produce result.
To minimize the cost without compromising on quality and efficiency of the device,
Atmel AT89C51 microcontroller is used to work as processing device.
2.3.1.1 Atmel AT89C51:
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K
bytes of Flash Programmable and Erasable Read Only Memory (PEROM). The device is
manufactured using Atmels high density nonvolatile memory technology and is compatible with
the industry standard MCS-51 instruction set and pinout. The on-chip Flash allows the
program memory to be reprogrammed in-system or by a conventional nonvolatile memory
programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel
AT89C51 is a powerful microcomputer which provides a highly flexible and cost effective
solution to many embedded control applications. The AT89C51 provides the following standard
features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, five

vector two-level interrupt architecture, a full duplex serial port, and on-chip oscillator and clock
circuitry.
In addition, the AT89C51 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.
2.3.1.2 Architecture of 8051 family

Fig 2.4 Block Diagram of 8051 microcontroller

The basic architecture of 8051 family of microcontroller provides following features:


Compatible with MCS-51 Products
4K Bytes of In-System Reprogrammable Flash Memory
Endurance: 1,000 Write/Erase Cycles
Fully Static Operation: 0 Hz to 24 MHz
Three-Level Program Memory Lock
128 x 8-Bit Internal RAM
32 Programmable I/O Lines
Two 16-Bit Timer/Counters
Six Interrupt Sources
Programmable Serial Channel
Low Power Idle and Power Down Modes

2.3.1.3 Functional Description of 8051

Fig 2.5 Pin Diagram of 8051

VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port each pin can sink eight
TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance
inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during
accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0
also receives the code bytes during Flash programming, and outputs the code bytes during
program verification.
External pull-ups are required during program verification.

Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can
sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the
low-order address bytes during Flash programming and verification.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-

order address byte during fetches from external program memory and during accesses to
external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application it
uses strong internal pull-ups when emitting 1s. During accesses to external data memory that
uses 8-bit addresses (MOVX @ RI); Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some control signals during
Flash programming and verification.
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being
pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions
of various special features of the AT89C51 as listed below:
Port 3 also receives some control signals for Flash programming and verification.
RST
Reset input. A high on this pin for two machine cycles while the oscillator is running resets
the device.
ALE/PROG
Address Latch Enable output pulse for latching the low byte of the address during accesses to
external memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator
frequency, and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation
can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only
during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the
ALE-disable bit has no effect if the microcontroller is in external execution mode.

PSEN
Program Store Enable is the read strobe to external program memory.
Port Pin Alternate Functions
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
When the AT89C51 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each access
to external data memory.

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

Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be
configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz crystal or
ceramic resonator may be used. To drive the device from an external clock source, XTAL2
should be left unconnected while XTAL1 is driven as shown in Figure 2.There are no

requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.

Fig 2.6 Setup for Crystal Oscillator


Idle Mode
In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active. The
mode is invoked by software. The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode. The idle mode can be terminated by any enabled
Interrupt or by hardware reset. It should be noted that when idle is terminated by a hard
Hardware reset, the device normally resumes program execution, from where it left off, up to
two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits
access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the
possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction
following the one that invokes Idle should not be one that writes to a port pin or to external
memory.

Status of External Pins during Idle and Power down Modes


Mode Program Memory ALE PSEN PORT0 PORT1 PORT2 PORT3
Idle Internal 1 Data
Idle External 1 Float Data Address Data
Power down Internal 0 Data
Power down External 0 Float Data
Power down Mode
In the power down mode the oscillator is stopped, and the instruction that invokes power down is
the last instruction executed. The on-chip RAM and Special Function Registers retain their
values until the power down mode is terminated. The only exit from power down is a hardware
reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not be
activated before VCC is restored to its normal operating level and must be held active long
enough to allow the oscillator to restart and stabilize.
Programming the Flash
The AT89C51 is normally shipped with the on-chip Flash memory array in the erased state (that
is, contents = FFH) and ready to be programmed. The programming interface accepts either a
high-voltage (12-volt) or a low-voltage (VCC) program enable signal. The low voltage
programming mode provides a convenient way to program the AT89C51 inside the users
system, while the high-voltage programming mode is compatible with conventional third party
Flash or EPROM programmers. The AT89C51 is shipped with either the high-voltage or lowvoltage programming mode enabled. The respective top-side marking and device signature codes
are listed in the following table. The AT89C51 code memory array is programmed byte-by byte
In either programming mode. To program any nonblank byte in the on-chip Flash Memory, the
entire memory must be erased using the Chip Erase Mode.
Programming Algorithm:

Before programming the AT89C51, the address, data and control signals should be set up
according to the Flash programming mode table and Figures 3 and 4. To program the AT89C51,
take the following steps.
1. Input the desired memory location on the address lines.
2. Input the appropriate data byte on the data lines.
3. Activate the correct combination of control signals.
4. Raise EA/VPP to 12V for the high-voltage programming mode.
5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-write
cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through 5, changing
the address and data for the entire array or until the end of the object file is reached.
Data Polling:
The AT89C51 features Data Polling to indicate the end of a write cycle. During a write cycle, an
attempted read of the last byte written will result in the complement of the written datum on
PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next
cycle may begin. Data Polling may begin any time after a write cycle has been initiated.
Ready/Busy:
The progress of byte programming can also be monitored by the RDY/BSY output signal. P3.4
is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high
again when programming is done to indicate READY.
Program Verify:
If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read
back via the address and data lines for verification. The lock bits cannot be verified directly.
Verification of the lock bits is achieved by observing that their features are enabled.

Chip Erase:
The entire Flash array is erased electrically by using the proper combination of control signals
and by holding ALE/PROG low for 10 ms. The code array is written with all 1s. The chip
erase operation must be executed before the code memory can be re-programmed.
Reading the Signature Bytes:
The signature bytes are read by the same procedure as a normal verification of locations 030H,
031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned are
as follows.
(030H) = 1EH indicates manufactured by Atmel
(031H) = 51H indicates 89C51
(032H) = FFH indicates 12V programming
(032H) = 05H indicates 5V programming
Programming Interface
Every code byte in the Flash array can be written and the entire array can be erased by using the
appropriate combination of control signals. The write operation cycle is self timed and once
initiated, will automatically time itself to completion. All major programming vendors offer
worldwide support for the Atmel microcontroller series. Please contact your local programming
vendor for the appropriate software revision.

2.3.2 Display Unit


We have used 16x2 LCD display for displaying the value of measured distance. The detail of the
LCD is given in separate document.

LCD DETAIL:
An 8051 program must interact with the outside world using input and output devices that
communicate directly with a human being. One of the most common devices attached to an 8051
is an LCD display. Some of the most common LCDs connected to the 8051 are 16x2 and 20x2
displays. This means 16 characters per line by 2 lines and 20 characters per line by 2 lines,
respectively.
Fortunately, a very popular standard exists which allows us to communicate with the vast
majority of LCDs regardless of their manufacturer. The standard is referred to as HD44780U,
which refers to the controller chip which receives data from an external source (in this case, the
8051) and communicates directly with the LCD.
44780 BACKGROUND:
The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the data bus. The
user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus. If a 4-bit
data bus is used, the LCD will require a total of 7 data lines (3 control lines plus the 4 lines for
the data bus). If an 8-bit data bus is used, the LCD will require a total of 11 data lines (3 control
lines plus the 8 lines for the data bus).
The three control lines are referred to as EN, RS, and RW.
The EN line is called "Enable." This control line is used to tell the LCD that you are sending it
data. To send data to the LCD, your program should first set this line high (1) and then set the
other two control lines and/or put data on the data bus. When the other lines are completely

ready, bring EN low (0) again. The 1-0 transition tells the 44780 to take the data currently found
on the other control lines and on the data bus and to treat it as a command.
The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1),
the data being sent is text data which should be displayed on the screen. For example, to display
the letter "T" on the screen you would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively querying (or
reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are
write commands--so RW will almost always be low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by the
user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4,
DB5, DB6, and DB7.

Fig 2.6 LCD display interfacing

3. Software Design
3.1 Introduction
While developing any embedded project, developer have to face strict momory
constraints. So in order to maximize the performance and reduce the power consumption
developer need to devise an efficient algorithm that uses minimum CPU and memory resources,
which decreases both system cost and power consumption. So Software design is a very
important phase of project development which helps in optimization of resources required.

3.2 Flowchart:
The overall functional flow of our project can be described by following flowchart:

Fig 4.1 Flowchart of Project

3.3 Source Code:


3.3.1 MAIN.C
#include<reg51.h>
#include<lcd.h>
sbit buzzer=P3^7;
sbit gled= P2^3;
sbit rled= P2^4;
sbit swtch=P3^2;
void timerdelay(unsigned char time)
{
unsigned char i,j;
for(i=0;i<time;i++)
{
for(j=0;j<20;j++)
{
TL1=0xFE;
TH1=0xA5;
TR1=1;
while(TF1==0);
TR1=0;
TF1=0;
}
}
}
void external0()
{

interrupt 0

//Loop with 500ms delay

unsigned char pulse,tpulse;


unsigned char x,d1,d2,d3;
unsigned char u,t,h;
IE=0x00;
rled=1;
gled=1;
lcdcmd(0x01);
lcdcmd(0x80);
lcdprint(" CALCULATING ");
lcdcmd(0xc0);
lcdprint(" PLEASE WAIT ");
TH0=0x00;
TL0=0x00;
TR0=1;
timerdelay(40);
pulse=TL0;
TR0=0;
TF0=0;
tpulse=pulse * 3;
x=tpulse / 10;
d1=tpulse%10;
d2=x % 10;
d3=x / 10;
u= 0x30 | d1;
t= 0x30 | d2;
h= 0x30 | d3;
lcdcmd(0x01);
lcdcmd(0x80);
lcdprint("PULSE COUNT:");
lcdcmd(0x8C);

lcddata(h);
lcdcmd(0x8d);
lcddata(t);
lcdcmd(0x8e);
lcddata(u);
if(tpulse>0x6E)
{
lcdcmd(0xc0);
lcdprint("--->HIGH PULSE ");
rled=0;
buzzer=1;
}
if(tpulse<0x37)
{
lcdcmd(0xc0);
lcdprint("---> LOW PULSE ");
rled=0;
buzzer=1;
}
if(tpulse>0x37 & tpulse<0x6E)
{
lcdcmd(0xc0);
lcdprint("--->NORMAL PULSE");
gled=0;
}
IE=0x81;
}

void main()
{
P0=0x00;
P1=0x00;
P2=0x00;
P=0x00;
buzzer=1;
T0=1;
rled=1;
gled=1;
swtch=1;
TMOD=0x16;
IE=0x81;
lcdcmd(0x38);
lcdcmd(0x0E);
lcdcmd(0x01);
lcdcmd(0x06);
lcdcmd(0x80);
lcdprint("PORTABLE CARDIO");
lcdcmd(0xc0);
lcdprint("

MONITOR

");

timerdelay(10);
lcdcmd(0x01);
lcdcmd(0x80);
lcdprint("

AIT

");

lcdcmd(0xC0);
lcdprint("BTECH MAJOR PROJ");
timerdelay(10);
lcdcmd(0x01);
lcdcmd(0x80);

lcdprint(" PRESS START TO ");


lcdcmd(0xc0);
lcdprint("BEGIN DIAGNOSIS:");
delay(250);
while(1);
}
3.3.2 LCD.H
#include<reg51.h>
//sfr lcd = 0x80;
sbit RS= P2^7;
sbit RW= P2^6;
sbit E= P2^5;
void delay(unsigned char);
void lcdcmd(unsigned char value)
{
P0=value;
RS=0;
RW=0;
E=1;
delay(1);
E=0;
return;
}
void lcddata(unsigned char value)
{
P0=value;

RS=1;
RW=0;
E=1;
delay(1);
E=0;
return;
}
void lcdprint(char *str)

reentrant

{
unsigned int i=0;
for(;str[i]!=0;i++)
lcddata(str[i]);
}
void delay(unsigned char time)
{
unsigned int i,j;
for(i=0;i<time;i++)
for(j=0;j<1275;j++);
}
3.3.3 REG51.H
#ifndef __REG51_H__
#define __REG51_H__
/* BYTE Register */
sfr P0 = 0x80;
sfr P1 = 0x90;
sfr P2 = 0xA0;

sfr P3 = 0xB0;
sfr PSW = 0xD0;
sfr ACC = 0xE0;
sfr B

= 0xF0;

sfr SP = 0x81;
sfr DPL = 0x82;
sfr DPH = 0x83;
sfr PCON = 0x87;
sfr TCON = 0x88;
sfr TMOD = 0x89;
sfr TL0 = 0x8A;
sfr TL1 = 0x8B;
sfr TH0 = 0x8C;
sfr TH1 = 0x8D;
sfr IE = 0xA8;
sfr IP = 0xB8;
sfr SCON = 0x98;
sfr SBUF = 0x99;

/* BIT Register */
/* PSW */
sbit CY = 0xD7;
sbit AC = 0xD6;
sbit F0 = 0xD5;
sbit RS1 = 0xD4;
sbit RS0 = 0xD3;
sbit OV = 0xD2;
sbit P = 0xD0;
/* TCON */

sbit TF1 = 0x8F;


sbit TR1 = 0x8E;
sbit TF0 = 0x8D;
sbit TR0 = 0x8C;
sbit IE1 = 0x8B;
sbit IT1 = 0x8A;
sbit IE0 = 0x89;
sbit IT0 = 0x88;
/* IE */
sbit EA = 0xAF;
sbit ES = 0xAC;
sbit ET1 = 0xAB;
sbit EX1 = 0xAA;
sbit ET0 = 0xA9;
sbit EX0 = 0xA8;
/* IP */
sbit PS = 0xBC;
sbit PT1 = 0xBB;
sbit PX1 = 0xBA;
sbit PT0 = 0xB9;
sbit PX0 = 0xB8;
/* P3 */
sbit RD = 0xB7;
sbit WR = 0xB6;
sbit T1 = 0xB5;
sbit T0 = 0xB4;
sbit INT1 = 0xB3;
sbit INT0 = 0xB2;

sbit TXD = 0xB1;


sbit RXD = 0xB0;
/* SCON */
sbit SM0 = 0x9F;
sbit SM1 = 0x9E;
sbit SM2 = 0x9D;
sbit REN = 0x9C;
sbit TB8 = 0x9B;
sbit RB8 = 0x9A;
sbit TI = 0x99;
sbit RI = 0x98;
#endif

4. Conclusion
This project was developed to provide an inexpensive, low power consumption and
portable heart rate monitoring system to the patients. This project was developed for poor
patients suffering from cardio-vascular diseases, who requires constant cardiac monitoring in
order to avoid emergencies and save lives.
Any embedded project is judged on three parameters i.e. Space, Cost and power
consumption. So, our project Portable Cardio-Monitor was designed and developed to
minimize all these constraints.
4.1 Cost Analysis:
. The building cost of the proposed device is around 400. One similar basic device from
Cosy Communications with no extension capabilities costs around 1500. If produced on large
quantity the cost can be reduced to around 200.
4.2 Space Analysis:
Our project required a chip space of around 10cm 2, But if modern techniques and
methodologies and system is developed on a double sided chip, the chip size can be reduced as
small as 2.5cm2.
4.3 Power Consumption Analysis:
Our project prototype runs on AC power, but on further development the same project
can be designed to run on 4 AAA batteries which can run the device for upto 500 measurements.
So our project Portable Cardio-Monitor is an inexpensive, portable device which if developed
using modern techniques can be used as domestic solution for heart monitoring, which can help
lowering the mortality rate due to cardio-vascular diseases.

5. References

1.
2.
3.
4.
5.

Heart rate measurement from the finger using a low-cost microcontroller,


Dogan Ibrahim
"Pulse Rate Measurement". Healthwise. WebMD. Retrieved 14 March 2011.
"www.meddean.luc.edu". Retrieved 2009-05-20.
Atwal, S; Porter, J; MacDonald, P (2002).
"Cardiovascular effects of strenuous exercise in adult recreational hockey: The Hockey
Heart Study". Tanaka, Hirofumi; Monahan, Kevin D; Seals, Douglas R (2001). "Agepredicted maximal heart rate revisited". Journal of the American College of

6.

Cardiology 37 (1): 1536.


Ronald L.; Goslin, Brian R.; Olson, Ronald E.; McDonald, Audry; Russi, Gary D.;
Moudgil, Virinder K. (2007). "Longitudinal Modeling of the Relationship between Age
and Maximal Heart Rate". Medicine & Science in Sports & Exercise 39 (5): 8229.

5.Appendices

Potrebbero piacerti anche