You are on page 1of 4

A MICROCONTROLLER-BASEDPORTABLE ELECTROCARDIOGRAPH SYSTEM

J.J.Segura-Jucirez,D. Cuesta-Frau and LSamblas-Pena Department of Computer Science, Polytechnic University of Valencia (EPSA), Alcoi, Spain, EU
ABSTRACT
The ambulatory acquisition and monitorization of electrocardiograms (ECG) under not controlled conditions, is a practice of paramount importance in cardilogy diagnosis nowadays. The ECGs are acquired while patients develop their normal life, using a portable device. The storage capacity of such devices usually ranges from 24 to 48 hours. The systems used to perform this task are the so-called Holter systems. In this paper we describe a low cost single channel Holter system, based on a microcontroller, to register the ECG signal continuosly during up to 48 hours. This microcontroller system runs off batteries, and includes many peripherals such as a display, keyboard, serial interface, solid-state memory, and some electronic circuits.

Figure 1. Main blocks of the system. For the sake of simplicity, some block interconnections have been omitted.
plex and time consuming tasks are usually carried out offline, in a personal computer. Moreover, the sampling frequency required to obtain a good quality ECG is fairly low, of some 100Hz. Therefore, the microcontrollercan devote more time to the rest of tasks, such as error generation, memory card operations, etc. The organization of this paper is as follows. In the next section, Methodology, all the stages of the process will be described Acquisition, probe, amplifier, analog to digital conversion, processing, storage, visualization, serial interface, and power source. In the last section, Conclusion, we will summarize the main points of this paper and the future work.

1. INTRODUCTION
Electrocardiography is a non-invasive technique to ascertain the state of the heart, based on the electrical potential generated by it and measured on the body surface using, in its basic configuration, two electrodes and a galvanometer. This technique is widely known and nearly a century old already. Nevertheless, in the last decades mainly, due to the availability of powerful and low cost computers, electrocardiography has witnessed the development of new systems and applications, such as the ambulatory acquisition of ECGs using the so-called Holter systems [l]. These systems are used to register the signal during a long period of time, between 24 and 48 hours, in order to detect some heart malfunctions difficult to find using a simple electrocardiogram. In this paper we present the development of a complete Holler system based on microcontroller. ?he circuit uses standard integrated circuits and components, and therefore, it is a low cost set easy to build. It can be used in clinical practice, since it fulfils all the required specifications, and in microcontroller and electronics teaching purposes, as it covers a wide range of topics related to microcontrollers and signal conditioning. Many other similar circuits have been repotted so far in the technical literature, as those described in [Z],[31, and [41, hut, as far as we know, none of them describes a portable and affordable device with the performance of a commercial Holter. Computational power of a simple microcontroller is enough to implement a Holter system, since the most com-

2. METHODOLOGY
The system description will he performed according to the logical order of the stages. We will first address the acquisition stage, follow the signal path through the probe, amplifier and analog to digital converter, and finish with the data storage in memory and the power source. Fig. 1 is a schematic diagram of the system main blocks.

2.1. Acquisition
The ECG signal acquisition is obviously the first stage of the process. Three electrodes are used, placed at different points on the patients body surface. The exact position depends on the type of analysis required or the lead desired. Two of the electrodes are the differential input, and the third is used to reduce the noise due to the power line

0-7803-8163-7/03/$17.00 0 2003 IEEE

ICECS-2003

922

interference, and to provide a return way for the polarization currents [51.

2.2. Probe
The probe is the electrical connection between the electrodes and the amplifier, the system input. It consists of three wires, which are shielded and twined in order to reduce as much as possible the induced electrical noise. In the amplifier end, the probe has a shielded tripolar connector and a fastening system to prevent the accidental uncouple due to sudden jerks or patient movement during their usual activities. The probe shield is connected to the common mode voltage of the differential amplifier through a voltage follower, which derives the interference currents induced in h i s connection allows us to the wire towards ground. T reduce the parasitic capacitance that appears between the wires and the ground when it is connected to ground, and therefore avoids input impedance reduction.

..
Figure 2. Differential instrumentation amplifier.
environment. The last stage with the OA(U1D) is an inverter amplifier. The third electrode impedance is reduced using this configuration, and a high impedance is applied to prevent the ground-fault h,uard. Nevertheless, electrical shock is very unlikely since the system only mns off batteries.

2.4. A/D Conversion


Once the ECG signal has been amplified and filtered, it must be digitized. The analog to digital converter utilised is the AD7888 [SI. This converter has 12 bits of resolution, and 8 input ports, although in this application only two are used. The amplifier is software controlled and the conversion takes place during the error calculation of each memory sector. Each sample converted is stored in the corresponding memory area, which, after completing a whole data page, will be written in memory alongside error calculations computed in parallel with the analog to digital conversion. The AD7888 is capable of a 125KSPS rate. The input track and hold acquires a signal in 50011sand this circuit operates with a power supply voltage from 2.7 V to 5.25 V. CMOS construction ensures low power dissipation, tipically 2mW for normal operation and 3pW in power-down mode. The DC accuracy of th,: AD7888 is tipicaly 1 LSB of integral nonlinearity, -U+] .5 LSB differential nonlinearity, and an offset error of & 6 LSB. Communication with the AD converter is perfomed through the SPI port of the microcontroller, and by means of an enable signal also controlled by the processor. Am other converter input is used to measure the power source voltage and thus monitorize the battery charge level. This level can also be checked by the user using the interactive menu shown on the display. All its features regarding the low power consumption, power source voltage requirements, control, and communications, make it a very suitable choice for this application.

2.3. Amplifier
The first block of the system is the differential instrumentation amplifier. Since the level of the electrocardiograph signal is only of some p V , it is necessary to amplify it to match the levels of the analog to digital converter, avoiding saturation either in the amplifier or the converter. A precise amplifier has been designed with very low polarisation currents and small offset voltages to fulfil these requirements. A high common mode rejection of around 120dB is also achieved. This amplifier includes a high pass filter, formed by a quadruple precision operational amplifier, to filter out the base line wandering. The amplifier also creates a virtual ground, applies the common mode voltage to the probe shield, and reduces the third electrode impedance to minimize the power line interference. This amplifier satisfies the American Heart Association specifications about the bandwidth of the amplifier, O.lHz-Il"z, in order not to lose i m p o m t information of the signal. This margin is the minimum required to avoid a distortion greater than 10% in the signals. In Fig. 2, the different electrocardiographic amplifier stages are shown. It is basicaly composed of a first stage of an instrumentation amplifier and four more stages based on different configurations using operational amplifiers. Following the probe connected to the human body surface, it can be noticed that the derivation enters directly to the instrumentation amplifier, and then the baseline wander is filtered out using an operational amplifier with adjustable gain. The rest of the stages are support stages for the previous ones with the following rationale: the operational amplifier AO(U1C) is used to create a virtual ground with a voltage level half that of the power supply. The stage with the OA(U1A) is a voltage follower whose ouput is connected to the probe shield. Therefore, the loses due to parasitic capacitances are reduced, and moreover, the lead is protected against the electrical noise of the circuit

2.5. Processing
This is the most important stage of the system. On one hand, it is devoted to interact with the user through a navigating menu shown on the I.CD display. On the other hand, it stores the data obtained from the analog to digital converter in memory, using a suitahle format in order to be read by the operating system properly. It also has the

923

serial port control through which data can be transmitted in real time if desired. The LCD control where the interactive menu is shown is included. The display contrast level can be adjusted by means of a microcontroller pin. It also controls the calendar and power failure protection circuit which will be described in section 2.9. The user can also interact with the system using a simple keyboard. The CPU of the system is the ATMEL microcontroller T89C51RC2 [IO], compatible with the Intel family of microcontrollers MCS5 l . This microcontroller has embedded peripherals such as: Two timers of 16 hits. One UART with the possibility of using masks A watchdog clock. Six bidirectional parallel ports. Power saving modes, A matrix of programmable counters. A keyboard interface.

F-rlP# .>rn"/.UC
*S"CUI

p,*r
1

Figure 3. Schematic diagram of the memory card. In this device, a SmartMedia memory card is used.

The parallel pan, aw used to chaw data amung thv periphcralr. sXcsDt the LCD the S , , , d v d i n card. which are memory mapped. The microcontroller ports 0 and 2 are used as data and addresses ports respectively, for the devices directly memory mapped. Port 1 is used for communications through the integrated SPI interface, which can be put in shutdown mode to reduce the power consumption. Port 3 hits are used for different tasks: serial communications through the embedded UART, write and read signals of the memory mapped devices, external interrupts, some other peripherals control, etc. The system is programmed to perform a wide range of operations such as memory card formatting, activate power saving functions, sample frequency adjustment, acquire and store the electrocardiographic signal, data and time set, alarms programming, LCD contrast adjustment, etc. Programming language used has been C. The computational burden of the microcontroller is mainly due to the error calculations. This process takes around 2 seconds for each sector, which is a delay unaccetably large for the sampling process. In order to obtain a uniform sampling, the data acquisition is embedded in the error calculation algorithm. Regarding the memory card, the control is canied out on a hardware level by means of the ports, as mentioned before. The software to control this card checks if the card inserted is valid, and its capacity, whether it is formatted or not, the free memory available, writes the data files, etc. This p a t is transparent to the user.
2.6. Storage

crihed, as well as the data format needed to assure compatibility. The memory capacities available cover a fairly wide range, from 2MB to 128MB, and they can he powered using two voltages: 5 and 3.3 volts. This card model is cheaper and easier to use than others with similar performance, and the reliability of the data storage is very high, making it appropriate for this medical application. In Fig 3 the schematic of this card is depicted. The system prrvcntsthc uscrIromutiliJing invalidcard\. For instance, i f it is detscvd that the card intormatim system (CIS) is damaged or missing, a warning message will be issued. On the other band, if the blocks are present, but the format is invalid, another warning will be shown. The system suppolts all the cards powered with 3.3 volts, which are the ones with the highest capacities, whereas those powered with 5 volts are of low capacity and not supported.

2.7. Visualization For menu visualization, warning messages, process information, etc, the system has a E D . It is controlled through ports 4 and 5. The display has a character matrix of 2 rows per 16 columns, whose size is 84x44 mm. The display data bus width can be configured to work with 4 or 8 bits. This feature allows the display to be used either with 8 or 4 bit microcontrollers. Asserting its busy line, the data flow can be controlled.

2.8. Serial Interface


The microcontroller can share data with a personal computer through a RS-232 serial interface or directly by means of the memory card, which is the usual case. Nevertheless, in order to have the possibility of real time data transmission, this serial interface has been added to the system. In Fig. 4 a visualization example is shown. The serial interface needs 3.3 volts, with a consumption of 1.3mA during normal operating mode, and 0.01pA in shutdown mode. The connector is a typical male DB9 for printed circuits.

The storage system chosen for this device is a solid state memory, based on the SmartMedia model [9], whose format is regulated by the SSFDC [ I I , 121, where the operation, hardware and software of this kind of cards is des-

924

Acknowledgment
The authors would like to thank the department of cardiology of the Verge dels Lliris :Hospital of Alcoi (Spain) for their clinical tests and advice. The authors also wish to acknowledge the support of the INNOVA project, of the Polytechnic University of Valencia (Spain).
4. REFERENCES

[I] N.J. Holter, New methods for heart studies, Science,


Figure 4. ECG data visualization and editing in a personal
computer.
no. 134, pp. 1214,1961.

2.9. Power Source

[2] E. Jovanov et al., Real Time Holter Monitoring of Biomedical Signals, DSP Technology and Education Conference. DSPS-99, Houston, Texas (USA), August 4-6, 1999. [3] Massachusetts Institute of Technology, Bioelectronics Project Laboratory, Illectrocardiogram Amplifier, November 2002. [4] C.M. Tenedero, M.A.D. Raya, L.G. Sison, Design and implementation of a single-channel ECG a n plifier with DSP post-processing in Matlab, Third National Electronics a i d Engineering Conference, Philippines, November 27-29,2002. [SI Jose M. Ferrero Corral, Bioelectrdnica, senyales bioelictricas (in Spanish). Valencia: SPUPV, 1994. [6] S. Franco, Design with operational amplifiers and analog integrated circuiis, McGraw-Hill, New York, 1997. [7] Berson A.S., Lau F.Y., Wojick J.M., Pipberger H.V., Distortions in infant electrocardiograms caused by inadecuate high-frecuency response. American Heat7 J o u m l , no.93, pp. 730-734, 1977. [SI AD7888 Analog Devices, 2.7 to 5.25, Micmpowe6 8-Channel, IZSKSPS, 12-Bit ADC datasheet, www.analog.com

This portable Holter system tuns off two AA batteries serial connected, which can he rechargeables, yielding a voltage of 3V. Since the system needs 3.3 volts, the voltage must be increased. Moreover, due to the fact that the hatteries voltage is not constant with the use, an extra protection against voltage level drops is needed, using a control loop. This two objectives are achieved using the circuits M A X 8 5 6 [I41 and DS1305 [151. The integrated circuit M A X 8 5 6 is a step-up DC-DC converter used to increase the power source voltage. This circuit also has a control loop to keep the ouput voltage at the level desired. This level is indicated by an input of the circuit, with two possibilities, 3.3 volts in case it its connected to Vcc, or 5 volts if connected to ground. There is also an internal circuit to assert a signal in case the output falls below the desired level. This signal is used to request an intermpt. The integrated circuit DS1305 consists of a calendar, two programmable alarms (for only once, every day, every hour, every minute), communications using port SPI and 96 bytes of non-volatile RAM. One of the main features of this circuit is that it can switch the power source to an auxiliary battery in case of power failure. This battery can he rechargeable or not. In the first case, it can he recharged in the circuit itself. When the power level goes under the level of the auxiliary battery, this circuit COMEISthe auxiliary battery to the system and asserts a signal. This is implemented in order to have an non-intemptable power system in the circuit. If the batteries are about to be exhausted, the system raises an alarm to wam the user. After ten minutes, if the batteries have not been replaced, the data is stored in the memory card, and the whole system shuts down.

[9] Samsung Electronics, SrlanMedia Format Intmduction, Memory Product & Technology Division, 1999.
[IO] T89C5 IRB21RC2 Atmal Micmcontrollerdatasheet , www.atmel.com

[l 11 SmartMedia, Logical Amur Specifications, Technical committee of the SSFDC Forum, 1999.

[I21 SmarlMedia, Physical F o m t Specifications, Technical committee of the SSFDC Forum, 1998.
[I31 MAX749 MAXIM Digitally adjustable LCD bias supply datasheet, wwwmaxim-ic.com [I41 MAX8561859 MAXIM Step-up DC-DC converters datasheet, wwwmaxim-ic.com

3. CONCLUSION
In this paper, a low cost, microcontroller-based Holler system has been presented. Unlike other similar circuits described in the technical literature, this system is fully portable, and only uses standard components easily available. Nevertheless, the performance qualities of the system are comparable to those available in professional systems.

[I51 DS1305 MAXIM Serial Alarm Real-lime Clock datasheet, www.maxim-ic.com

925

You might also like