Introduction: How to Build an Electrocardiogram (ECG)

About: "Guitar, Gadgets, Gravity My Three G(uru)'s in Life." I'm a high school senior who's passionate about science (and applying concepts to build new things). I run a YouTube Channel called 'Scientify I…

This tutorial will take you through the steps of building a 3-point electrocardiogram using an Arduino.

Before you begin, here’s a little info about ECGs:
An ECG detects your heart's electrical rhythm and graphs them out. This graph is called a tracing and it consists of several waves that recur with each heartbeat, about 60 to 100 times per minute. The wave pattern is used to diagnose various heart conditions. Ideally, the wave pattern should be a recurring one (sample output attached later). A typical ECG machine is bulky and expensive. For developing countries like India which have a high incidence of cardio-vascular diseases, a low-cost portable ECG machine is a boon to make medical facilities accessible in far flung rural areas.

Supplies

  1. Arduino Uno / Nano
  2. Male to female jumper wires (5)
  3. AD8232 module
  4. 3 electrodes (pad with cable to attach to AD8232 module)

Step 1: Building the Circuit

Solder pins/wires into the 6 holes (GND to SDN) of the AD8232 IC.

Make the following connections: (Format: Arduino Connection — AD8232)

  1. GND — GND
  2. 3.3V — 3.3V
  3. A0 — OUTPUT
  4. ~11 — LO-
  5. ~10 — LO+

~ denotes a PWM/analog pin

Use the attached images as guides to make the connections and to see an example of the final product.

Note: The SDN pin is not used in this tutorial. Connecting this pin to ground or "LOW" on a digital pin will power down the chip. This is useful for low power applications.

Step 2: Placement of Sensor Pads / Electrodes

Placement of sensor pads (Format: Cable Color — Signal):

  1. Red — Right Arm (RA)
  2. Yellow — Left Arm (LA)
  3. Green — Right Leg (RL)

For the exact placement of sensor pads on skin, have a look at the image attached in this section.

Make sure you clean your skin (with sanitiser perhaps) before attaching the sensor pads.

Also, the closer to the heart the pads are, the better the measurement. Two methods of connecting the pads are given in the image to this section.

Step 3: Program - Arduino IDE

Please find an attached file containing the code. If for some reason you can't download the file, then here's the code typed out:

void setup() {

// initialize the serial communication:

Serial.begin(9600);

pinMode(10, INPUT); // Setup for leads off detection LO +

pinMode(11, INPUT); // Setup for leads off detection LO -

}

void loop() {

if((digitalRead(10) == 1)||(digitalRead(11) == 1)){

Serial.println('!');

}

else{

// send the value of analog input 0:

Serial.println(analogRead(A0));

}

//Wait for a bit to keep serial data from saturating

delay(1);

}

Step 4: Uploading the Code to Your Arduino Board

  1. Connect your Arduino to your laptop/computer
  2. Choose your Arduino board (Tools —> Board)
  3. Choose device port where you’ve attached the Arduino (Tools —> Port)
  4. Compile and upload the code. Then open up the serial plotter (Tools —> Serial Plotter)

Step 5: Sample Output

Notice the graph is consistent in the image (the waveform is repeating). This means we’re all good.

Thank you!

If you’re looking for an even cooler project, check out my other intractable on how to make rover controlled by hand gestures. Yes, hand gestures! Check it out here: Tele-Operated Rover (Beware! It’s also more challenging) Don’t forget to subscribe to my YouTube channel Scientify Inc. My goal is to make science easy and interesting for everyone.

@Scientify Inc.

Please share your comments below. I'd love to hear about your experience while trying out the project! I'll try to reply to all queries within 24 hours.


Social:

YouTube: Scientify Inc.

YouTube: Scientify हिंदी

Instagram

Instructables

LinkedIn

Arduino Contest 2020

Participated in the
Arduino Contest 2020