Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
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.
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.
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.
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.
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]
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.
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.
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
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.
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.
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.
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:
interrupt 0
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);
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 */
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.
6.
5.Appendices