ECG Smart App User Manual

June 6, 2024
ECG

ECG Smart App User Manual

Introduction

The ECG SmartApp device can be built easily ( in less than 1 hour by following the assembly manual) and only a very basic electronics skills are needed. It is a low cost device to record, process and store ECG signals. The device is battery powered and consists of a front-end circuit (ECG module AD8232) to acquire the ECG signals (limb leads only) through common electrodes and an Arduino board to digitalize the analog signal and transmit it to an Android smartphone via Bluetooth protocol. The related App visualizes the ECG signal in real time and gives the possibility to filter, make measurements and store the signal in a file.

Figure 1

No software programming knowledge is required since all you need is to install the App by opening the apk file from an Android smartphone and to upload the provided Arduino sketch on the Arduino board (this can be done easily by using the Arduino Software IDE and one of the many tutorials available on the web).

The simple circuit design and layout are a good compromise for having both a low cost (few components) and good performance.
By excluding the Smartphone and disposable parts (electrodes and batteries), the device whole cost is between 20 and 25 Euros (25-30 US dollars).

Warnings and safety issues

This project is NOT a medical device and is not intended to be used as a medical device to diagnose or treat any conditions.

The authors cannot be responsible for any harm caused by using any of the circuits or procedures described on this manual. The authors do not claim any of the circuits or procedures are safe. Use at your own risk. It is imperative that anyone who wants to build this device have a good understanding of using electricity in a safe and controlled manner.

The ECG device is electrically connected to a person and only low voltage batteries must be used for safety precautions and to prevent damage to the device.

DO NOT use any AC power supply, any transformer or any other voltage supply to avoid serious injury and electrical shock to yourself or others. DO NOT connect any AC-line powered instrumentation or device to the ECG device here proposed.
Placement of the electrodes on the body, provides an excellent path for current flow. When the body is connected to any electronic device, you must be very careful since it can cause a serious and even fatal electric shock.

Use ONLY battery (max voltage supply: 9V).

AD8232 uses a Right Leg Driver (RLD) to reduce common-mode interference. As specified in the AD8232 component datasheet, “Note that when using this amplifier to drive an electrode, there should be a resistor in series with the output to limit the current to be always less than 10uA even in fault conditions”. Off the shelf AD8232 modules usually uses a 360 kOhm resistor in series with the RLD output since its supply is 3.3V. To power the Arduino Nano board at least a 6V battery is needed (7V is the value recommended by Arduino), so to keep the RLD current limit lower than 10 uA, a higher resistor is needed. See assembly manual for more details.

Start with ECG SmartApp

  • Be sure that the battery (max voltage supply: 9V) connected to the device is charged
  • Clean the skin before placing electrodes 1
  • Place the electrodes 2 according to the table below:

Figure 2

  • Power on the ECG device by using the switch
  • Run the App on the smartphone
  • Press the button “Connect” to connect the smartphone to the ECG device (you need to turn on the ECG device and grant the permission to access Bluetooth/Location) and wait for the discovery of the HC-06 (or HC-05) Bluetooth Module of the ECG device. Pairing code or password may be asked in case of the first Bluetooth connection with the module: enter “1234”. If the App does not find the Bluetooth Module, try to pair the smartphone with the HC-06 (or HC-05) Bluetooth Module by using the smartphone Bluetooth Setting (pairing code “1234”); this operation is needed only once (first connection). If the App does not connect to the HC-06 (or HC-05) Bluetooth Module, try to close the App and open it again leaving the Bluetooth connection turned ON on your mobile.

1 Dry dead skin layer (usually present of the surface of out body) and possible air gaps between the skin and the electrodes do not facilitate the ECG signal transmission to the electrodes. So, a moist condition between the electrode and the skin is needed. The skin needs to be cleaned (tissue cloth soaked with alcohol or at least water) before placing the electrode gel pads (disposable).

2 In case of a non-disposable electrodes, electrode conductive gel (available commercially) should be used between the skin and the metal electrode or at least a pad of cloth tissue soaked in tap water or in saline solution.

  • When the connection is established, the ECG signal will appear on the screen; in case of LI (default lead is LI, to change lead please go to the “Setting + Help” paragraph) the heart rate (HR) will be estimated in real time. The signal will be updated every 3 seconds
  • To apply a digital filter, press “Filter” button and choose a filter from the list. By default, a low pass filter @ 40 Hz and a notch filter (according to the preferences saved in the Setting) are applied.

Settings

  • Press the button “Set + Help.” to open the setting/help page
  • Press “Open User Manual (Help.pdf)” to open this document. If an error occurs, the file can be opened manually from the local EcgSmartApp Data folder of the mobile device
  • Select the ECG lead (LI is default)
  • Select the notch filter frequency (according to the interference frequency: 50 or 60 Hz)
  • Select the file saving option to save the ECG signal filtered or unfiltered on the file
  • Press the button “Save settings” to save the preferences

Gain value can be changed in case of hardware modification or personalization of the ECG device.

Recording ECG signal

  • Insert the file name (the app suggests a file name based on the current date and time; if the user records more ECG signals in the same session without changing the file name, a progressive index is added at the end of the file name to avoid overwriting the previous recording)
  • Press “Rec.” button to start recording the ECG signal
  • Press “Stop” button to stop the recording
  • Each ECG signal will be stored in a txt file inside the folder “ECG_Files” placed in the local app data folder of the smartphone memory (e.g. …\Android\data\com.example.ecgsmartapp\files\ECG_Files). ECG signal can be stored filtered or unfiltered according to the preferences saved in the setting
  • Press “Resume” button to visualize again the ECG signal acquired in run time
  • To record a new ECG signal, repeat the previous steps

An ECG file contain the series of the samples (sampling frequency: 600 Hz) of the ECG signal amplitude in mV

Opening and analyze an ECG file

  • Press “Open” button: a list of the files stored in the “ECG_Files” folder will appear
  • Choose the ECG file to be visualized

The first part of the ECG file will be displayed (10 seconds) with no grid.

The user can scroll manually on the display to visualize any time interval of the ECG signal. To zoom in or zoom out the user can press on the magnifying glass icons (right corner at the bottom of the graph) or use the pinch zoom directly on the smartphone display.

Time axis, voltage axis and the standard ECG grid will automatically appear when a time interval lower than 5 seconds will be visualized (by zooming in). Voltage axis (y-axis) values are in mV while time-axis (x-axis) values are in seconds.

To apply a digital filter, press “Filter” button and choose a filter from the list. By default, a low pass filter @ 40 Hz, a filter to remove the wandering line and a notch filter (according to the preferences saved in the setting) are applied. The graph title displays:

  • the file name
  • the applied digital filter (low and/or high pass filter)
  • the label “wandering baseline removed” if the wandering baseline filter is applied
  • the applied notch filter (50 or 60 Hz)

The user can make measurements (time interval or amplitude) through a caliper tool between two points of the graph by using the “Get Pt1” and “Get Pt2” buttons. To choose the first point (Pt1) the user can press “Get Pt1” and select manually a point of the ECG signal by clicking directly on the graph: a red point will appear on the ECG blue signal; if the user misses the ECG curve, no point will be selected and the “no point selected” string will appear: the user has to repeat the selection. The same procedure is needed to choose the second point (Pt2). In this way the differences (Pt2 – Pt1) of the time values in ms (dX) and the amplitude values in mV (dY) will be displayed. The user can adjust the point position by pressing the corresponding backwards and forwards buttons that replaced the “Get Pt1” and “Get Pt2” button (once the corresponding point is selected).
The “Clear” button clears the selected points.

The user can adjust the ECG signal gain by using the “+” button (to enlarge) and “-“ button (to reduce); maximum gain: 5.0 and minimum gain: 0.5

Figure 6

Filters menu

  • NO digital Filter: remove all applied digital filters
  • Remove wandering baseline: apply a particular processing to remove the wandering of the baseline. In case of a signal very noisy, the processing may fail
  • High pass ‘x’ Hz: apply an IIR high pass filter according to the specified cut off frequency ‘x’
  • Low pass ‘x’ Hz: apply an IIR low pass filter according to the specified cut off frequency ‘x’
  • 50 Hz removal ON (notch+LowPass 25 Hz): apply a very stable FIR filter that is both a notch at 50 Hz and a Low Pass at around 25 Hz (pay attention that the signal can become too much smoothed)
  • 60 Hz removal ON (notch+LowPass 25 Hz): apply a very stable FIR filter that is both a notch at 60 Hz and a Low Pass at around 25 Hz (pay attention that the signal can become too much smoothed)
  • 50 Hz removal ON: apply a recursive notch filter at 50 Hz
  • 60 Hz removal ON: apply a recursive notch filter at 60 Hz
  • 50/60 Hz removal OFF: remove the applied notch filter

Note:

  • only one notch filter can be used at a time; only the last selected one will be applied
  • only one low pass filter can be used at a time; only the last selected one will be applied
  • only one high filter can be used at a time; only the last selected one will be applied
  • “50 Hz removal ON (notch+LowPass 25 Hz)” gives better results (than “50 Hz removal ON”) since it is used a filter more stable and with a higher attenuation of the interference frequency; however, it has also a low pass behavior that may be unwanted (the upper frequency of the band could be too low)
  • “60 Hz removal ON (notch+LowPass 25 Hz)” gives better results (than “60 Hz removal ON”) since it is used a filter more stable and with a higher attenuation of the interference frequency; however, it has also a low pass behavior that may be unwanted (the upper frequency of the band could be too low)

Troubleshooting

The mobile App does not connect to the ECG device:

  • try to close the App and open it again leaving the Bluetooth connection turned ON on the mobile
  • the battery may be discharged

Bluetooth Pairing code

  • if asked, enter “1234”, if the App does not find the Bluetooth Module, try to pair the smartphone with the HC-06 (or HC-05) Bluetooth Module by using the smartphone Bluetooth Setting (pairing code “1234”); this operation is needed only once (first connection)

ECG signal noisy

  • the battery may be discharged
  • if using a 6V battery, try to use a higher voltage battery as 9V (use ONLY battery – max voltage supply: 9V).

SPECIFICATIONS

Hardware Specifications

  • Max Input signal amplitude (peak-to-peak): around 3 mV 3
  • Voltage supply: USE ONLY BATTERIES
  • Min Voltage supply: 6V (e.g. 4 x 1.5V batteries) 4
  • Max Voltage supply: 9V (e.g. 6 x 1.5V or 1 x 9V batteries)
  • Sampling frequency: 600 Hz
  • Frequency Bandwidth @ – 3dB (Hardware): 0.5 Hz – 40 Hz 5
  • Amplification (Hardware_Gain): 1100 6
  • Resolution: 3.3V / ( 1024 x Hardware_Gain )
  • Number of ECG channels: 1
  • ECG Leads: limb leads LI, LII and LIII
  • Number of electrodes: 3
  • Smartphone connection: via Bluetooth

Note about power supply

The device must be powered only by batteries and the voltage value must be between 6 and 9 V. The minimum voltage supply recommended for the Arduino Nano is 7 V however if the batteries are full charged, the device is able to work fine at 6 V (e.g. 4 x 1.5 V AA batteries full charged or 5 x 1.2 V AA rechargeable batteries full charged). If operating at 6 V, the acquired ECG signal may become quite noisy when the batteries becomes to discharge. Using voltage value higher than 6 V (e.g. a 9 V battery) can avoid this issue.

3 Max Input signal amplitude depends on the hardware gain and it is related to the AD8232 module specifications.

4 Input voltage limit of Arduino Board is 6V while recommended input voltage is at least 7V; see the paragraph: “Note about power supply”

5 Hardware frequency band depends on the hardware configuration of the AD8232 module. Off the shelf AD8232 module has usually a 0.5 – 40 Hz frequency band.

6 Hardware Gain depends on the hardware configuration of the AD8232 module. Off the shelf AD8232 module has usually a gain of 1100.

Software Specifications

  • ECG visualization during the recording (time window: 3 seconds)
  • Heart Rate estimation (only for LI)
  • Sampling frequency: 600 Hz
  • ECG signal recording and saving into a .txt file (filtered or unfiltered signals can be saved in the txt file according to the setting) inside the folder “ECG_Files” placed in the local app data folder of the smartphone memory (e.g. …\Android\data\com.example.ecgsmartapp\files\ECG_Files). ECG signal can be stored filtered or unfiltered according to the preferences saved in the setting
  • Data (samples) are saved in the .txt file as values in mV at 600 Hz (value of 16 digit)
  • Saved file visualization with zoom option, grid, gain adjusting (from “x 0.5” to “x 5”) and two points selection (to measure time distance and amplitude difference)
  • Smartphone display: the App layout adjusts for different display size; however for a better visualization, it is recommended minimum a 5.2’’ display.

Digital filtering:

  • High pass filtering @ 0.1 , 0.15 , 0.25 , 0.5 7
  • Low pas filtering @ 25, 35, 40 Hz 8 (@ 100 and 150 Hz are disabled since in case they do not make sense in a hardware configuration of 40 Hz max frequency)
  • Notch filtering to remove the powerline interference @ 50 or 60 Hz 9
  • wandering baseline removal 10

7 Apply an IIR high pass filter according to the specified cut off frequency (Direct Form II Second-Order-Section; Order: 4; Sections: 2; Design Method: Butterworth; cut off frequency attenuation: – 3dB)

8 Apply a IIR low pass filter according to the specified cut off frequency (Direct Form II Second-Order-Section; Order: 4; Sections: 2; Design Method: Butterworth; cut off frequency attenuation: – 3dB)

9 “50 Hz removal ON (notch+LowPass 25 Hz)” apply a moving average filter (FIR Low Pass; order: 12th) that has a zero at 50 Hz (attenuation: < -70 dB) and a cut of frequency at 23 Hz (attenuation: – 3dB); “60 Hz removal ON (notch+LowPass 25 Hz): apply a moving average filter (FIR Low Pass; order: 10th) that has a zero at 60 Hz (attenuation: < -70 dB) and a cut of frequency at 27 Hz (attenuation: – 3dB)” ; “50 Hz removal ON: apply a recursive notch filter at 50 Hz (IIR filter; order: 2nd)” ; “60 Hz removal ON: apply a recursive notch filter at 60 Hz (IIR filter; order: 2nd)”

10 A digital signal processing is applied to detect the series of Q points of the ECG waves; a linear interpolation is made between two consecutive Q points to have an estimation of the wandering baseline that is subtracted from the ECG signal (before any high pass filtering action).

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

ECG User Manuals

Related Manuals