Low Cost Electrocardiography Monitoring System using Microcontroller A project report submitted in partial fulfillment of the requirement for the award of the degree of BACHELOR OF ENGINEERING IN ELECTRONICS AND INSTRUMENTATION Submitted by Pradeep Kumar Terli V.S.Satya Praveen T.Anil Kumar Under the esteemed guidance of Mrs.P.Indira,M.E., Assistant Professor Dept. of Electronics and Instrumentation Engineering
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Low Cost Electrocardiography Monitoring System using Microcontroller
A project report submitted in partial fulfillment of the requirement for theaward of the degree of
BACHELOR OF ENGINEERINGIN
ELECTRONICS AND INSTRUMENTATION
Submitted by
Pradeep Kumar Terli V.S.Satya Praveen
T.Anil Kumar
Under the esteemed guidance of
Mrs.P.Indira,M.E.,Assistant Professor
Dept. of Electronics and Instrumentation Engineering
DEPARTMENT OF ELECTRONICS AND INSTRUMENTATION ENGINEERINGGITAM INSTITUTE OF TECHNOLOGY
(Autonomous) GITAM UNIVERSITY
Visakhapatnam-45
2010-2011DECLARATION
This is to certify that Report entitled “Low Cost Electrocardiography Monitoring System Using
Microcontroller” which is submitted by me in partial fulfillment of the requirement for the award
of Bachelors degree in Electronics and Instrumentation Engineering, GITAM Institute of
Technology , GITAM University comprises only my original work and due acknowledgement
has been made in the text to all other material used.
Date: Name of student
(signature)
APPROVED BY
Name & Designation of the Project Guide
(signature)
CERTIFICATE
This is to certify that report entitled “Measurment of Temperature using Thermocouple with the
help of Microcontroller” which is submitted by BATCH 6 in partial fulfillment of the
requirement for the award of degree B.Tech in Electronics & Instrumentation Engineering to
Department of Electronics & Instrumentation Engineering, GITAM Institute of
Technology is a record of the candidate own work carried out by him under my supervision. The
matter embodied in this thesis is original and has not been submitted for the award of any other
degree.
Date: Name & Desigantion of the Project Guide
(signature)
(signature) (signature)
Name and Designation Head of the Department
Project Coordinator
Electrocardiograph ( ECG )
Electrocardiography (ECG, or EKG [from the German Elektrokardiogramm]) is a transthoracic
interpretation of the electrical activity of the heart over timecaptured and externally recorded by
skin electrodes.[1] It is a noninvasiverecording produced by an electrocardiographic device.
The ECG works mostly by detecting and amplifying the tiny electrical changes on the skin that
are caused when the heart muscle "depolarises" during each heart beat. At rest, each heart muscle
cell has a charge across its outer wall, or cell membrane. Reducing this charge towards zero is
called de-polarisation, which activates the mechanisms in the cell that cause it to contract.
During each heartbeat a healthy heart will have an orderly progression of a wave of
depolarisation that is triggered by the cells in the sinoatrial node, spreads out through the atrium,
passes through "intrinsic conduction pathways" and then spreads all over the ventricles. This is
detected as tiny rises and falls in the voltage between two electrodes placed either side of the
heart which is displayed as a wavy line either on a screen or on paper. This display indicates the
overall rhythm of the heart and weaknesses in different parts of the heart muscle.
This circuit takes in the noise contaminated signal and an adaptive output signal from the
ATmega32 and sums them to remove the contamination. The overall output is then fed back to
the ATmega32 as an error reference signal through a RC lowpass to prevent aliasing.
AC Transformer Input Converter
We used an AC transformer to adaptively cancel "real" 60 Hz noise in from the 120 V
powerlines (the standard voltage and frequency of powerlines across the U.S.). In order to obtain
an reference voltage suitable for the ATmega32, we used the following circuit. The AC
transformer takes in a 56 V peak-to-peak signal (18 V RMS) and converts it to a 1.6 V peak-to-
peak, 1.8 V DC offset. We are using a 2.56 V reference voltage on the ATmega32 ADC.
RC Filter
The RC lowpass to filter the PWM out from the ATmega32 was made of a 20k Ohm resistor and
a 0.04 uF capacitor so that it has a cutoff frequency of about 230 Hz. Because are resistors and
capacitors are only valid to 5% and because the RC doesn't have the steepest cutoff, the cutoff
frequency is appropriate for the function.
ATMEGA32 PROGRAM FOR FILTERING
/* * Captures a reference signal (60Hz) from A.0, an error signal in * A.1, and adaptively generate an output to B.3 that minimizes the * correlation between input and error. * * By Robert Ochshorn and Kyle Wesson */
//output rate select/* #define OUT_CLK_OVR_8 /\* output with clock speed over 8 *\/ *//* #define OUT_CLK_OVR_64 /\* output with clock speed over 64 *\/ */#define OUT_FULL_CLK /* output with full clock speed */
//input rate select
/* #define IN_CLK_OVR_8 /\* output with clock speed over 8 *\/ */#define IN_CLK_OVR_64 /* output with clock speed over 64 *//* #define IN_FULL_CLK /\* output with full clock speed *\/ */
/* the increment shift determines what to divide the difference between previous output and next desired output in order to interpolate towards the desired output.*/
//outputsigned long accumulator; /* 16:16 fixed-point...the integer value is what we send to OCR0 */signed int increment; /* 0:16 fixed-pi */
signed long prev_out; /* previous output value */signed long out; /* next output value desired */
//inputunsigned char input[FILTER_LENGTH*STEP_SIZE]; /* reference input sampled as an 8:0 char. TODO: 10-bit a/d? */unsigned char* input_next; /* pointer to the next open spot in the input array */unsigned char* input_ptr; /* "disposable" pointer for use in loops */
//filtersigned long w[FILTER_LENGTH]; /* filter weights in 16:16 fixed point */
signed long safe_w[FILTER_LENGTH]; /* a safe way to restore our weights */
#define SAFE_W_RESET 10000unsigned int safe_w_time;
unsigned long err_mu; /* fixed-point error*mu */
#define MU 2 /* convergence rate */#define MU_SHIFT 0; /* Sets a threshold for error of magnitude of error that will cause weights to be updated (0-8) */
#define THRESHOLD 12 /* 16-X*/
char shift;
char error, error_cutoff; /* the captured error value and the cutoff between positive and negative, respectively. */
//fixed point math/* These defines allow 16:16 fixed point math */#define multFix80(a,b) (((a*((signed long)b)))) /* multiply fixed by 8:0 char */#define int2fix(a) (((signed long)(a))<<16) /* Convert char to fix. a is a char */#define fix2int(a) ((signed int)((a)>>16)) /* Convert fix to char. a is an int */#define float2fix(a) ((signed long)((a)*65536.0)) /* Convert float to fix. a is a float */#define fix2float(a) ((float)(a)/65536.0) /* Convert fix to float. a is an int */
#define LED_TIME_RESET 250 /* blink an LED every x times through the timer loop */