ECG Device & App - Easy to Build in Less Than 1 Hour

by ecgsmartapp in Circuits > Arduino

2395 Views, 8 Favorites, 0 Comments

ECG Device & App - Easy to Build in Less Than 1 Hour

ECG instructables.jpg

The ECG device can be built easily (in less than 1 hour) and only a very basic electronics skills are needed.The simple circuit design and layout are a good compromise for having both a low cost and good performance. It is based on few boards to be connected together:

•ECG module AD8232 (Module Single-Lead, Heart Rate Monitor Front End)

•Arduino Nano board

•HC-05 (or HC-06) Bluetooth module

Few connections are needed (connector cables and/or soldering).

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).

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 following paragraphs for more details.

Hardware

ecgblocksscheme.png
device picture.jpg

Device hardware can be easily obtained by assembling the three needed modules (ECG module AD8232, Arduino Nano board and HC-05 or HC-06 Bluetooth module) how described in the reported schematics.

Connections can be made by soldering wires directly to the boards or using connector cables with female headers. The battery supplies the Arduino board; HC-06 (or HC-05) module is supplied by the Arduino 5 V voltage output while AD8232 module is supplied by the Arduino 3.3 V voltage output.

Beside the main connections, further steps are described in the following steps regarding:
- additional RLD resistor for safety issue

- alternative “home made” electrodes cable

- switch and box

Replacing RLD Resistor for Safety Issue

AD8232 smd.png

For safety issue, RLD output is connected to the electrode through a protection resistor. Off the shelf AD8232 modules usually uses a 360 kOhm resistor in series with the RLD output since its supply is 3.3V. Even if the AD8232 module is powered by the Arduino at 3.3 V, in the worst-case failure, the battery voltage value should be considered. So for example, if a 9V battery is used, to keep the RLD current limit lower than 10 uA, a resistor higher than 900 kOhm is needed (current = voltage / resistance). So, the 360 kOhm resistor needs to be replaced by a 1MOhm. This operation is the only one requiring some soldering skill since such resistors (SMD) are very small.

​An Alternative to Replacing the RLD Resistor for Safety Issue

RLD1.png
RLD2.jpg

An alternative to replacing the RLD resistor on the AD8232 board could
be adding in series a common through hole resistor (e.g. 680 kOhm in case of a 9V battery) to the SMD 360 kOhm resistor of the AD8232 board (the sum will be 690 kOhm for 6V battery or 1040 kOhm for 9V battery). An easy way to achieve this is placing such resistor between the RL pin of the AD8232 board and the RL electrode; however, in this case it is not possible to use the AD8232 plug-in connector, but it is needed to use the electrodes pins.

Alternative “home Made” Electrodes Cable

home made electrodes.png

Off the shelf AD8232 modules usually includes the electrodes cable that can be plugged in the boards directly through the dedicated connector. However, it is possible to make a customized electrodes cable and to connect it to the dedicated pins of AD8332. The cable can be realized by using a coaxial cable (better if shielded, to reduce external noise), alligator clip, heat shrink tubing and female header connectors.

Switch and Box

open box.png
closed box.png

A switch can be placed through the battery cable (positive terminal) to turn on/off the device. Instead of using an additional LED to check if the device is turned on, it is possible to use the LED of the HC-06 module (or the other boards) that is ON when the board is powered. Some holes are needed on the box: one for the switch, one for the electrodes cable and one for the LED.

Note About Power Supply and Other Arduino Boards

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

The ECG device can work also with different Arduino boards. Arduino Nano and Arduino UNO were tested. Other boards can be used (such as Arduino Micro, Arduino Mega, ect.) however the provided Arduino sketch file needs modifications according to the board features.

The ECG device can work also with the HC-05 module instead of HC-06 one.

SOFTWARE: Arduino Programming

Arduino sketch files can be uploaded on the Arduino board easily by installing the Arduino Software IDE (free download from the Arduino official web site) and following the tutorial available on Arduino official web site. A single sketch file (“ECG_SmartApp_skecht_arduino.ino”) for both Arduino Nano and Arduino UNO is provided (the sketch was tested with both the boards). The same sketch should work also with Arduino Micro (this board was not tested). For other Arduino board the sketch file may need changes.

SOFTWARE: Installing the ECG SmartApp

ecg_web.png

EcgSmartApp is available only for Android (at least Android 6 or higher).

To install the App, copy the provided apk file “ECG_SmartApp.apk” on the smartphone memory, open it and follow the instruction by accepting the permissions. Before installing, it may be needed to change the smartphone setting by allowing installation of app from unknown sources (tick the box of “Unknown sources” option of the “Security” menu).

To connect the ECG device with the HC-06 (or HC-05) Bluetooth Module, 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 close the App, enable the Bluetooth connection manually on your device and open the App again

- check if the battery is discharged

- 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)

It may happen a Bluetooth connection issue for some Android One devices and in rare cases also for Android 10. Try another Android 10 device or use a device with an android version lower than Android 10.

User Manual and Assembly Manual

The attached pdf files inlcudes:

- a complete and detailed guide to use and build the device

- hardware specification

- software features

- troubleshooting

- further info

Troubleshooting

The mobile App does not connect to the ECG device:

a) The battery may be discharged

b) Try to close the App, enable manually the Bluetooth connection on the smartphone and run the App again

c) In case of Android 10 or higher, try to close the App, enable both the Bluetooth connection and device Location on the smartphone, run the App again.

d) Try to enable manually the STORAGE pemission (and LOCATION permission for Android 10 or higher) in the App info menu or mobile setting and run the App again

e) It may happen a Bluetooth connection issue for some Android One devices and in rare cases also for Android 10. Try another Android 10 device or use a device with an android version lower than Android 10.

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.

Noisy ECG signal:

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).

Problem for sharing ECG recording files by pressing the "share button":

it may happen in few cases. Try to share/send/copy the ECG recording files manually from the device storage (see the App Info section to find out the ECG recording folder path).

Contacts

Author website (for further downloads, App previous versions, etc.):

http://www.ecgsmartapp.altervista.org/index.html

ecgsmartapp@gmail.com