Low Cost Non-İnvasive Portable Monitor Platform for Cardiac Biopotential and Transthoracic Impedance Measurements

Purpose Simultaneous monitoring of ECG and thoracic electrical bioimpedance (TEB) is important in evaluating cardiovascular performance. TEB is a non-invasive technique based on measuring the impedance value that changes in the chest area depending on the heartbeat. Within the framework of this study, it can be used in home monitoring and biotelemetry applications to measure thoracic electrical bioimpedance (TEB), ECG and ICG. Methods Within the scope of this study, a four-electrode TEB measurement system was designed and built using the Raspberry Pi single board computer and its original monitor, ESP32 and EVAL-ADAS1000SDZ evaluation board. With the designed system, ECG and thoracic impedance measurements at 50 kHz current frequency were taken as real-time over a single channel. Delta_Z and ICG signals were created from thoracic impedance values with the developed software.


Introduction
Cardiovascular disease is the leading cause of death worldwide. Development of diagnostic techniques for early detection of cardiovascular diseases increases the survival rate [1]. In addition, the continuous and non-invasive measurement of vital signs can be an invaluable tool for physicians who can make timely decisions and make better choices when long-term patient data are available, prevent disease and reduce the costs of healthcare while improving quality of life [2,3].
Electrical impedance is the measurement of the voltage change caused by a safe amount of current injected into the tissue via electrodes. The impedance of the tissue is determined depending on the current injected into the tissue and the measured voltage [4]. Bioimpedance analysis is a non-invasive and inexpensive technique that provides information about the general condition of the body [5]. Thoracic electrical bioimpedance (TEB) uses for cardiac output (CO) [6], stroke volume (SV) [6,7], measuring respiratory function [8,9] and electrocardiography [10]. Impedance cardiography (ICG) examines impedance changes in a person's chest cavity caused by the change in the amount of blood that occurs during the heart cycle [11]. With ICG, hemodynamic parameters such as SV, CO, PEP, LVET and systolic time intervals of the person are measured [12,13]. The ICG signal evaluated together with the ECG provides information about the person's cardiovascular status. In this way, both the electrical and mechanical activity of the heart are measured [14].
A tetrapolar electrode con guration is generally used during electrical bioimpedance measurements.
While measuring thoracic impedance, a high frequency (20-100 kHz), low amplitude (1-5 mA), electric current is sent through the chest with a pair of electrodes [13]. There are also studies in the literature using current values at µA level [12,15,16]. The voltage change caused by this current is detected with a different pair of electrodes and the thoracic impedance value is obtained depending on the ohm law [2,17,18]. The thoracic impedance (Z) consists of a resistor component ranging from 15-45 Ω and an imaginary component with a phase angle of about 10 °. The change in the blood volume in the chest and heart area causes a change in thoracic impedance (Z). The rst derivative (dZ / dt) of impedance change values taken with more than one measurement over time forms the ICG wave [10,12]. The ICG signal recorded with the ECG is used to determine hemodynamic parameters and systolic time intervals [10,18,19].
There are systems that allow simultaneous acquisition of TEB signal and cardiac activity [6,12,15,16,20]. Systems that allow these signals to be obtained over a single channel are very limited [2,21]. In this study, the EVAL-ADAS1000SDZ evaluation board was used for thoracic impedance (TEB) and ECG measurement, the measurements were taken with ESP32 and transferred to RASPBERRY Pi and the results were presented to the user on the RASPBERRY Pi original screen. Thanks to this portable and compact system, four-electrode impedance measurement was taken simultaneously with ECG measurement from a single lead, and the results obtained were evaluated for impedance plethysmography applications such as impedance pneumography (IP) and Impedance Cardiography (ICG). With the design, ECG and TEB measurements were recorded, the resulting signal was processed to obtain respiratory, TEB and cardiac signals, and the usability of the design for ICG applications was discussed.

Material & Methods
The prototype consists of a single board computer (Raspberry Pi), a microcontroller (ESP32) that can transfer data over Bluetooth, and an EVAL-ADAS1000SDZ Evaluation Board. Signals obtained with Raspberry Pi are displayed on the its original screen. The system is powered by a 2.4 A power bank ( Figure 1).

Adjusting the EVAL-ADAS1000SDZ Evaluation Board for ECG and Thoracic Bioimpedance Measurement
ADAS1000, developed by Analog Devices, is a 5-channel ECG device that can also detect breathing and pulse [22]. Since the ADAS1000 eval board contains two ADAS1000 chips (master and slave), it can measure 10-channel ECG [23]. Slave device can be disabled depending on the user's request. ADAS1000's signal collection channels can be switched on or off depending on the user's request. It offers a variety of con guration options for the preferred application, where the input structure includes a differential ampli er.
ADAS1000 eval board keeps the lead 1, lead 2 and lead 3 data in the register addresses speci ed on the data sheet in its memory. Other ECG connections (aVR, aVL, aVF, V1 and V2) can be calculated by the user from the data in leads 1, 2 and 3 [22]. ADAS1000 measures thoracic electrical bioimpedance with respiratory detection function. With the ADAS1000 eval board, impedance can be performed with a bipolar or tetrapolar system. An external instrumentation ampli er and op-amp can be used with the ADAS1000 to further improve thoracic impedance measurement performance [23]. The thoracic impedance measurement is located in one of the leads (lead I, lead II, or lead III) or in an external path through a pair of special pins (EXT_RESP_LA, EXT_RESP_RA, or EXT_RESP_LL).
It can be used as electrode input for respiration thanks to its switching circuit, which includes 5 ECG channels on ADAS1000. In this way, four-electrode measurement can be taken with ADAS1000 [22]. Figure 2 shows the switching circuit and the EXTENDSW control register.
ADAS1000 uses 32 bit data format in its memory (for 2 and 16 kHz data rate). The data received within the frame of this data are placed according to the format given in Figure 3 and the addresses speci ed and read by reaching these addresses. Data that are not required can be removed from the frame [22].
The excitation current value for the impedance signal is given on the data sheet as 64 µA pp , 32 µA pp , 16 µA pp or 8 µA pp . The frequency of the current can be determined from the values given in the data sheet (from 46.5 kHz to 64 kHz) [22] .
An external op-amp and instrumentation ampli er on the ADAS1000 eval board is used in the fourelectrode system. Con gurations are set by jumpers as speci ed in the user manual. The con guration is shown in Figure 4. The RESPCTL memory of the ADAS1000 eval board must be set as indicated in ADAS1000 eval board user guide [23].
In this con guration, RA and LA leads are used to inject current into the thorax area, and voltage variation is detected through EXT-RESP_RA and EXT-RESP_LA paths. The voltage change from the electrodes is sent to the receiver pins of the instrumentation ampli er, minimizing the common mode signals.

Architecture of the System
In this study, as mentioned before tetrapolar electrode con guration was used for TEB measurements. In order to correlate it with the TEB measurements taken, the ECG signal was taken over the ADAS 1000 eval board using a single lead. SPI communication has been performed between ADAS1000 eval board and ESP32. ECG data and thoracic impedance measurements at a frequency of 50 kHz and a current value of 64 µA pp were taken in real time with the ADAS1000 eval board over ESP32 and sent to the Raspberry Pi via bluetooth. Thoracic impedance, ECG, Delta_Z and dZ / dt signals were created using the python software development program in the Raspberry Pi, and the signals were processed. For the graphical user interface (GUI) development Qt dersigner is used. Results are shown on raspberry pi original screen.
The whole system is powered by a power supply that connects to the Raspberry Pi with a 2.4 A output.
During the measurement, 5 ends of 10 connected ECG cables and Ag / AgCl ECG electrodes were used. The Sramek con guration is used for electrode connection.
With the prototype, measurements were taken from healthy volunteers for 5 seconds. The age group of volunteers is 20-45. They consist of male and female volunteers between 150-180 cm in height and 50-85 kg in weight. All subjects gave their informed consent for inclusion before they participated in the study.
In addition, the approval of the Scienti c Research and Publication Ethics Board of Başkent University Science and Engineering Sciences was obtained in order to conduct the research.

Software Development
The con guration given in Figure 4 is set on the ADAS1000 eval board and the eval board has been communicated with the ESP32. Arduino ide has been used for programming the ESP32. With the software developed; REPCTL, EXTENDSW, ECGCTL, FRMCTL memory values are calculated according to the information given in the data sheet and added to the ADAS1000 register addresses. The 32-bit dataframe given in Figure 3 is used in the ESP32 software. On this format, only the memory addresses required for this study (0x40 (header), 0x11 (Lead 1 / LA), 0x12 (Lead 2 / LL), 0x13 (Lead 3 / RA) and 0x1B (RESPM)) were taken. The data are printed on the serial monitor of the Arduino ide by specifying the memory addresses at the beginning in the hexadecimal number system. While measuring with ADAS1000, a data rate of 2 kHz has been selected in accordance with the values given on the data plate.
Since this data rate may disrupt the synchronization of the ESP32, it was preferred to take a measurement in 4 data frames and the data was printed on the serial screen in this format. The data on the serial monitor of Arduino ide was sent to Raspberry Pi via bluetooth and subjected to the software developed by Python.
The data sent by ESP 32 was separated according to memory addresses in software and an excel le was created for rawdata. The excel le created is shown in Figure 5. The rst columns show the register addresses in the ADAS1000 eval board, the other columns show the hexadecimal equivalents of the measurements taken for the data in these addresses. This data was transferred to arrays according to register addresses via software and 3 * 8 bits of data were obtained for each measurement. Bitwise process was applied to these data, and a single decimal value recorded at the register address for each measurement was obtained against 3 hexadecimal values. Arrays with decimal values were converted into voltage data in the light of the information given in Table 43 and Table 45 in ADAS1000 datasheet. 500 Hz data rate format is used in measurements taken with ESP32. Measurements are taken every 2 ms within the frame of this data rate. According to this, time axis was created in Python and ECG and respiration graphics were drawn in real time according to this time axis (Figure 6). 64 µApp value was chosen as the ADAS1000 excitation current in accordance with the values given in the datasheet. This value complies with the safe value speci ed in the IEC 60601 standard for patient safety.
The thoracic impedance value was obtained by using Ohm's law with the measured amplitude and used excitation current values. In the TEB signal received with the developed system, there is a baseline drift depending on the EMG signals. With the software, this baseline drift was destroyed and the Delta_Z signal was created.
The rst derivative of the Delta_Z signal gives the ICG signal. The frequency range of the ICG signal is 0.8-20 Hz. There are also breathing (0.04 -2 Hz) and motion artifacts (0.1 -10 Hz) in this band range [23]. Muscle activity was eliminated by passing the Delta_Z signal through a band-pass lter in the 0.7-7 Hz range. The rst derivative of impedance change against time was taken, then the ICG signal was obtained by passing through a 16 Hz low-pass lter. The obtained signals are displayed on the user interface prepared with QT Designer.

Results
In this study, a portable, small size, cheap and medically safe prototype was created. With this prototype, ECG measurements were taken over a single lead, and the 4-electrode method was used for the thoracic bioimpedance measurements.
The developed software captured ECG, respiration and TEB signals and plotted them in real time. The captured signals can be stored on the Raspbery Pi SD card and shared with the user when needed.
Measurements were taken for 5 seconds from healthy volunteers. Thoracic impedance taken from the volunteer in Figure 7; Delta_Z, ICG and ECG signals are shown in Figure 8.

Discussion
Thoracic impedance value is stated to be in the range of 15-45 Ω in the literature [25]. ADAS1000 eval board measured the thoracic impedance value as approximately 1000 times higher than stated in the literature. Tissue impedance (50-700 Ω) is considered to be hematocrit impedance and impedance of extravascular lung water, parallel to the measured impedance value [20]. In addition, the impedance of the measured cable is added on the thoracic impedance. The impedance of the cable being measured is typically 1 kΩ to 10 kΩ, for some cables it can be larger [26,27]. Since there is no standard value for the impedance of the cable, its effect on the thoracic impedance value is not clear. External capacitor and ampli er are used for thoracic impedance measurement with ADAS1000 [22,23]. It is thought that the impedance value is also affected by the value of external capacitors.
It is stated in the literature that there is a 0.1 -0.2 change between the maximum and minimum values in chest impedance depending on the blood ow [20,28]. It was seen that the ΔZ signal obtained within the scope of the study was suitable for the value stated in the literature.
The rst derivative of the cardiac impedance signal obtained from the thoracic impedance signal was evaluated by an algorithm used to determine the peak value on software. In the literature the value of the max point of dZ / dt is 0.8 -3.5 Ω/sec [25]. Although it is thought that the impedance value has an effect on the results (Figure 7), the results are in accordance with the values stated in the literature.
The standard position for ICG measurements is on the back. During the measurement, the volunteer person is in a sitting position. This may cause the received impedance value to increase and the maximum value of the ICG signal to decrease. Heart rate is higher in the supine position [29].
In this article, the effect of ECG on the impedance signal has been investigated. As a result, it was determined that the cardiac cycle can be determined with each period of the ICG signal. Therefore, pulse information can be obtained by counting the periods of the ICG signal.
The prototype is realized with ready-made components costing about $ 300. The system is powered by a 10000 mAh LiPo battery. This battery can keep the system active for about 10 hours. In addition, if there is no need for real-time monitoring of ECG, respiration and ICG, the wireless interface can be completely removed and the resulting signal samples can be stored in an SD memory for later access. This extends the battery life.

Conclusions
In this article, an easy-to-use system has been developed that can detect respiratory ECG and TEB and ICG measurements and can be used in home care patients and clinics.
With the prototype, a successful result has been obtained in receiving the thoracic impedance signal. The designed system was able to distinguish small impedance uctuations related to cardiac activity. In order to increase the success of the system, the impedances added to the thoracic impedance value should be determined together with their values and a calibration procedure should be established.
After the determination of the thoracic impedance value clearly; The SV value can be calculated from the dZ / dt signal using the Kubicek method. In addition, the calculation of the characteristic periods of the ICG signal by pinpointing with the obtained signal is the subject of the future study.
The developed system must be subjected to improvements to ensure that physiological data are followed correctly. The design can be used as a portable device when improvements are made. In this way, it can be used in home care patients or wearable technologies.
In addition, since the developed system can detect ECG and respiratory signals, the use of Covid+ patients to determine respiratory and heart rate parameters during home quarantine is considered as a future study.
The results show how Raspberry Pi and ESP32 can be used with ready-made chips for prototyping to support engineers in engineering education and research groups.

Ethical Statement
All subjects gave their informed consent for inclusion before they participated in the study. In addition, the approval of the Scienti c Research and Publication Ethics Board of Başkent University Science and Engineering Sciences was obtained in order to conduct the research.  Alternative use of ADAS1000 respiration paths, and extended switch for repiration inputs register (EXTENDSW) [22]   Bioimpedance measurement system using tetrapolar con guration [23]     Delta_Z, ICG and ECG signals obtained by the designed system