ECG Logger - a Wearable Cardiac Monitor for Long-Term Data Acquisition and Analysis

Introduction: ECG Logger - a Wearable Cardiac Monitor for Long-Term Data Acquisition and Analysis

Status : 1.6.0 Stable, 3.2.x beta

Latest version : 3.2.x (Dec. 2021)

First release : Oct 2017

Difficulty : Medium

Prerequisite : Arduino, Programming, Hardware building

Documentation : Read the Help available from the ECG Logger Viewer application software

Support : Forum only, no PM


New V3 Version

The 3.1.0 version includes a Hardware improvement with a RTC module and a Buzzer for the user interface. Now the Holter device can be run without the need to connect the device to a PC before use. The ECG Logger Viewer application since V3.1 provides a HRV (Heat Rate Variability) distribution chart.


ECG Logger is a Wearable Cardiac Monitor for Long-Term Data Acquisition and Analysis. The ECG Logger Project is aimed for providing a very low-cost (~35$) open-source (GPL3 license) hardware device and freeware (CC-BY-NC-NA license) application software for a Rhythmic Holter. The hardware has been made very simple and is based on an “Arduino Nano” with two companion boards for the SD card and the instrumentation differential amplifier. It helps monitoring arrhythmia syndromes such as bradycardia, tachycardia, extra-systoles, pause or flutter.

In no case it can be use to replace a professional medical examination.

ECG Logger Viewer is the companion software for reading ECG data from the ECG Logger device

.

=>Safety rules related to electrical devices must be complied and no connection direct or indirect* shall be made between the Holter device and appliances connected to mains (* e.g. when the device is connected to the USB port of a PC powered from the mains).

.

DISCLAIMER: *** RISK OF ELECTRICAL SHOCKS AND DEATH ***

Persons unskilled, not familiar or unaware of electrical risks are discouraged to get involved. 
This project is provided for training/education and in no case for commercial purposes or medical diagnostics. 
Use of this project information is under the ENTIRE and SOLE RESPONSIBILITY of the USERS. 
It has not been approved for any kind of applications.

.

Note : HEX is the setup executable file to be renamed.

Step 1: ECG Logger - a Holter Device

Short description

ECG Logger make available a complete solution including a pocket-size ECG recorder hardware device with embedded firmware. The ECG signal is recorded onto a SD card memory at high frequency (250Hz sampling rate). The device is backed by the recent technology offering more freedom and accuracy for up to 24 hours continuous recording.

The system is based on an “Arduino Nano” microcontroller, an AD8232 Heart Rate Monitor amplifier board and a SPI SD card module with absolute minimum extra components

Features

  • Stable and reliable recorder, based on state-of-the-art and most recent technology
  • Anti-jamming and anti-shock
  • Small in size
  • Waveform record and event marking
  • Accurate start time record and sampled data
  • Built-in SD card for storage (can be plug-in and pull-out)
  • No need to compress original data, thanks to the large storage capability
  • Faster USB 2.0 interface
  • Record waveform details based on high precision and sampling frequency
  • Record the state of pacemaker using higher sampling frequency.
  • Automatic R-R peaks detection using Pan-Tompkins.
  • International standard of 3 leads. Record up to 24-hour of ECG signal.
  • Very simple and ergonomic user interface

IMPORTANT:
This project is Open-Source licensed for educational purposes only and none of its components can be used or reused for commercial purposes or applications.

USB driver must be installed on the computer prior to Holter (Arduino Nano) connection. Some Arduino use the FTDI chipset whereas some Chinese products require the CH340 chipset. The corresponding driver must be downloaded and installed on the computer. Click Start >> Control Panel >> Device Manager, and in the device list look for Com Ports (e.g. USB-SERIAL CH340).

Specifications

  • Number of Channels: 1
  • Lead:standard 3-lead
  • Sampling Rate: 250 Hz
  • Sampling Accuracy: 10-bit / 8-bit selectable
  • Recording Time: up to 24 Hours
  • Time accuracy: +/- 1 minute per day
  • Interface: USB 2.0 (230 kbauds)
  • Scale Voltage: 1 mV ±5%
  • Sensitivity valve: ≤20μV
  • Lowest voltage signal: 50 μ Vpp
  • Input Impedance: ≥ 1GΩ
  • Input circuit bias current: ≤ 0.1 μA
  • Noise level: ≤ 10 μ Vpp (0.1 Hz to 40 Hz)
  • Common-Mode Rejection Ratio: >= 60 dB (DC to 60Hz)
  • Electrode offset rejection: ± 300 mV
  • Voltage tolerance: ± 500 mV
  • Time constant: > 3.2 s (0.3Hz)
  • Frequency response: 0.05 ~ 125 Hz
  • Filter: AC, EMG, Drift Filter, RFI
  • Complex QRS detection: Pan & Tompkins algorithm
  • Safety Human Body Model: 8 kV ESD (HBM)

Physical Parameters:

  • Type B: internally powered
  • Size (L x W x H) : 100 x 60 x 25 mm
  • Net weight (w/o battery): 65 g
  • Weight with batteries: 111g
  • Total weight: 195 g (incl. carrier/electrodes)
  • Power: 4 x AAA batteries
  • Autonomy: >30 hours with Alkaline batteries

Average consumption:

  • Normal mode: 17 mA (Standby)
  • Sleep mode: 6.2 mA
  • Recording mode: 31 mA (~36 hours - depend on SD Card)

Step 2: ECG Logger Viewer - a Data Analyzer

Short description

ECG Logger Viewer is the Holter device companion application for downloading, analyzing data and managing patients.

  • NEW: Version 2 with drastically improved performances (requires ECG Logger FW v1.6.0+)
  • Heart rate variability processing (HRV)and graph distribution
  • R-peak detection and arrhythmia classification
  • Arrhythmia : Bradycardia, Tachycardia, Extra-systoles, Pauses or Flutter
  • Support ECG analysis for Holter signals, precordial V1 to V6 and Derivations (I,II,III)
  • Detection of ECG artifacts
  • Preview and print of ECG signal and statistics
  • Data export in EDF/BDF formats
  • Interface in English, French and Chinese
  • Automatic firmware update
  • ECG navigation by arrhythmia types or time position
  • IMPORTANT: runs only with the "ECG Logger" Holter device.
  • Requires "ECG Logger" Holter device version 1.6 or above
  • Portable supported from v2.0
  • Full documentation in the Help (Hardware and Software)

SOFTWARE

Software runs under Windows and support 3 different languages. Run the installer and read the Help file.

DOWNLOAD

You can also visit "ECG Logger Viewer" at SF.

Step 3: Building the Device

Short description

HARDWARE

The electronics has been made as simple as possible and does not require a PCB. A simple piece of Veroboard can do the job.

FIRMWARE

You must upload the Arduino Nano with the HEX. The code use 100% of the FLASH memory and new bootloaders could prevent uploading the firmware if there are bigger.

SF is the unique place for "ECG Logger" device Firmware download.

.

Note about HEX file and Arduino bootloader:

The Arduino Nano has a 32K Flash memory and the bootloader uses 2K. From the remaining 30K (30 720 B) of Flash, the firmware uses 30 692 Bytes leaving very few bytes free!

There are two different bootloaders (selectable from Arduino IDE >> Tools >> Processor ):

  • ATmega328P (Old Bootloader) is the "ATmegaBOOT" bootloader and expects the upload communication at 57600 baud.
  • ATmega328P is the "Optiboot" bootloader expects the upload communication at 115200 baud.

Whereas genuine Arduino Nano are provided with the Optiboot bootloader, the chinese versions (using the USB chipset CH341) are loaded with the ATmegaBOOT bootloader. Programming communication speeds is different !

NOTE : The current HEX file have been developed for Arduino with "ATmegaBOOT" bootloader but also runs with the Optiboot too.

Be the First to Share

    Recommendations

    • 3D Printed Student Design Challenge

      3D Printed Student Design Challenge
    • Cookie Speed Challenge

      Cookie Speed Challenge
    • Made with Math Contest

      Made with Math Contest

    10 Comments

    0
    sureshkumar_puthanveetil
    sureshkumar_puthanveetil

    Question 2 months ago

    Adding to my previous comment, there is one more issue. Whenever i press the "Holter Mode" option under Device menu, the following error pops up(see attached image).

    The contents of that error reads as follows
    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.
    ************** Exception Text **************
    System.FormatException: Input string was not in a correct format.
    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
    at System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt)
    at System.Convert.ToDecimal(String value)
    at ECG_Logger_Viewer.frmHolter.FrmHolterLoad(Object sender, EventArgs e)
    at System.Windows.Forms.Form.OnLoad(EventArgs e)
    at System.Windows.Forms.Form.OnCreateControl()
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    at System.Windows.Forms.Control.CreateControl()
    at System.Windows.Forms.Control.WmShowWindow(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.Form.WmShowWindow(Message& m)
    at System.Windows.Forms.Form.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    ECG Logger Viewer
    Assembly Version: 3.1.2.4
    Win32 Version: 3.1.2.4
    CodeBase: file:///C:/Program%20Files%20(x86)/AdNovea/ECG%20Logger%20Viewer/ECG%20Logger%20Viewer.exe
    ----------------------------------------
    System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4360.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4390.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4390.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------
    System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Runtime.Remoting
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
    ----------------------------------------
    System.Windows.Forms.DataVisualization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4200.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.DataVisualization/v4.0_4.0.0.0__31bf3856ad364e35/System.Windows.Forms.DataVisualization.dll
    ----------------------------------------
    ECG Logger Viewer.resources
    Assembly Version: 3.1.2.4
    Win32 Version: 3.1.2.4
    CodeBase: file:///C:/Program%20Files%20(x86)/AdNovea/ECG%20Logger%20Viewer/en-US/ECG%20Logger%20Viewer.resources.DLL
    ----------------------------------------
    Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
    ----------------------------------------
    ECG Logger Viewer.resources
    Assembly Version: 3.1.2.4
    Win32 Version: 3.1.2.4
    CodeBase: file:///C:/Program%20Files%20(x86)/AdNovea/ECG%20Logger%20Viewer/fr-FR/ECG%20Logger%20Viewer.resources.DLL
    ----------------------------------------
    ECG Logger Viewer.resources
    Assembly Version: 3.1.2.4
    Win32 Version: 3.1.2.4
    CodeBase: file:///C:/Program%20Files%20(x86)/AdNovea/ECG%20Logger%20Viewer/zh-TW/ECG%20Logger%20Viewer.resources.DLL
    ----------------------------------------
    System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4270.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
    ----------------------------------------
    System.Management
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
    ----------------------------------------
    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.
    For example:
    <configuration>
    <system.windows.forms jitDebugging="true" />
    </configuration>
    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.

    123.png
    0
    AdNovea
    AdNovea

    Reply 2 months ago

    Dear sureshkumar_puthanveetil,

    Regarding your issue due to the FREE command reading the free space on the SDC, I was not able to reproduce the failure.
    Nevertheless, I changed the way I processed the returned string. I hope this will work with the new version 3.1.2.5_BETA available on source forge.

    Hi,
    Thank you for an excellent project and the steps to recreate it. I was successfully able to make the device and record and visualize the ECG signal. However i have one problem. I am not able to view the "Live Mode". That option under the Device menu remains in a disabled state. If i go to the console and change the mode to "ECG" then I am able to see the live signals there as ADC values but the Live mode in the software is not working. Any help towards solving that is much appreciated. I am using the Firmware V 3.1.3 and the Viewer software V 3.1 Build 2.4.

    Also if there is an option to change the time from UTC to local time, please let me know how it is done. Thank you.

    123.png
    0
    AdNovea
    AdNovea

    Reply 2 months ago

    Dear sureshkumar_puthanveetil,

    Thanks for your message.
    From the screenshot, I can see that your computer is powered from the mains and does not run on battery.
    For security reason, the Live ECG mode remains DISABLED for this configuration.
    To enable the Live ECG mode, you must connect the holter device to a computer powered from battery only.

    About the local time : the holter device run in UTC time (epoch) and the ECG Logger Viewer makes the conversion to local time based on Windows time configuration (timezone and daylight saving). Therefore there is no timezone or daylight saving time parameters.
    To "force" the date-time, you may try entering the corresponding epoch (there are online epoch converters) into the device using the Txxxxxxx command but this will not be permanent and be reset when using the Holter mode dialog box.

    0
    sureshkumar_puthanveetil
    sureshkumar_puthanveetil

    Reply 2 months ago

    Thank you! Solved the problem. It is an excellent project.

    0
    sky-fish
    sky-fish

    Question 8 months ago on Step 3

    I built this ECG on a breadboard. I used a clone nano (old bootloader).
    Problem: When I push the button the serial monitor shows: "Start recording, ERR2"
    The source code is not available so I cannot determine what is causing this error. Any help would be much appreciated.
    thanks

    0
    AdNovea
    AdNovea

    Reply 8 months ago

    ERR0 SD card failed! Check SD,
    reformat SD card



    ERR1 Cannot rename temp file. Extract
    the SD and delete the dataxx.hlr file.
    Clear all files (CLEAR), reformat SD
    card


    ERR2 “createContiguous” function
    failed


    ERR3 “contiguousRange” function
    failed


    ERR4 “cacheClear” function failed


    ERR5 File erase failed


    ERR6 “writeBegin” function failed


    ERR7 Write data sample failed


    ERR8 Missed timer event – sampling
    rate is too high


    ERR9 “writeStop” function failed


    ERR10 Can't truncate file


    ERR11 Can't rename file


    ERR12 More than 100 files already on
    SDC!


    ERR13 Parameters string is invalid. Check the
    PARAMS command syntax.

    There is a problem with the SDC. The speed of the SDC may be too slow or the format is corrupted.
    I guess you already have tried different SDCs? There are big differences between SDCs. Some are really poor and other require lot of current. It could take time -and a bit of luck - to get the right SDC (avoid cheap chinese ones). I use Samsung 2GB SDC.

    Here are the results of some tests I had conducted on SDC :
    Measured overall current along with SD card
    type (recording):
    - —Mobizen
    Micro SD 4GB (46 mA)
    -

    —Samsung 2GB (27 mA) but about 20/25 overruns/min
    -

    —SanDiskUltra 8GB (31 mA and rec. 48.35 mA)
    -

    —SanDisk 4GB class 4 (31 mA)


    —


    SD card stop working
    around 3.8-3.9V

    0
    sky-fish
    sky-fish

    Reply 8 months ago

    THANK YOU 😘

    0
    sky-fish
    sky-fish

    8 months ago

    has anyone built this sucessfully?