ECG Using Intel Edison and Plotly

by ShreyasUpasane-DIGIT in Circuits > Wearables

3940 Views, 29 Favorites, 0 Comments

ECG Using Intel Edison and Plotly

BeFunky Collage.jpg

Electrocardiography is used to help diagnose various heart conditions. Heart rate monitor measures the electrical activity of the heart. This electrical activity can be charted as an ECG or Electrocardiogram.

NOTE: This device is not intended to diagnose or treat any conditions.

With the use of Intel Edison as our IoT device, we will connect a heart rate monitor sensor on Arduino shield of Edison and will measure the electrical activity of the heart in real time! We will then use Plotly (https://plot.ly) to chart our ECG on graphs.

This autonomous combination of hardware, software and networking is now being referred to as IoT (Inter-Operability of Things).

This article assumes you have experience uploading code using Arduino IDE and login to the Edison board using putty.

Hardware Components We Will Use in Our Demo

dc-200_1.jpg
VUPN6982.jpg
getimage.jpeg
Ad8232_headers.jpg
112027_c6973a6b-6477-4ce0-af45-2dd6cff62a64.jpg

  • Intel Edison
  • AD8232 Heart Rate Monitor (Link)
  • ECG Electrodes
  • USB cables
  • Jumper wires

Software We Will Write

  • A sketch program running on Edison Arduino shield

You can download the code samples here.

Build the System

Untitled Sketch 2_bb.png
body.png

Connect the AD8232 Sensor to Edison as shown above.

Board Label Pin Function Arduino Connection

GND Ground GND

3.3v 3.3v Power Supply 3.3v

OUTPUT Output Signal A0

LO- Leads-off Detect - 11

LO+ Leads-off Detect + 10

SDN Shutdown Not used

Connect the ECG Pads to the audio jack of AD8232 Sensor and attach the pads on body as shown.

Connect the IntelĀ® Edison Board to Your Computer for Development

Follow this guide to install Arduino IDE for Edison.

https://software.intel.com/en-us/get-started-arduino-install

1. Connect the micro usb cable to edison OTG connector.

2. Connect the micro usb cable to edison serial port connector.

3. SW1 position towards micro usb connector.

Upload the Sketch on Arduino Edison and Using Plotly

93.jpeg

After installing Arduino for Edison and making proper connections with the computer, upload the sketch provided.

1. Sign up to plotly: https://plot.ly.

2. Load up the plotlytry.ino file in Arduino IDE. Fill in your plotly username, API key, stream tokens, and filename. You can find your API key and stream tokens here: https://plot.ly/settings. It'll look something like:

char *tokens[] = {"ab4kf5nfdn","kdf5bn4dbn"};

plotly graph("anna.lyst","ab4kftunvd", tokens, "arduino graph");

3. Upload the program.

4. Open up your Serial Monitor. You'll see an output like:

... Attempting to connect to WPA network...

... Connected to network

... Attempting to connect to plotly's REST servers

... Connected to plotly's REST servers

... Sending HTTP Post to plotly

... Sent message, plotly's response:

... A-ok from plotly, All Streams Go!

... View your streaming plot here: https://plot.ly/~streaming-demos/6

... Connecting to plotly's streaming servers...

... Connected to plotly's streaming servers

... Initializing stream

... Done initializing, ready to stream!

5. Grab the URL that was printed out, view your graph in your browser, and celebrate! The graph and data is saved in your plotly account, so you can view it in your plotly file list here: https://plot.ly/plot. You can view, edit, and share your graphs while data is streaming to them in real-time. Everybody that views the graph will see the exact same data at the same time (try it out yourself: open your graph in two different browser windows).

Summary

You can then embed your application directly within an end product and create an E-health device. The real-world application of these principles is just as easy as what you saw. The task complexity is limited only by how much arduino code you are willing to write. Edison seamlessly manage all of the processing handling intricacy in the middle.