MATLAB Answers

How do i plot ECG sensor data from arduino to ECG graph using matlab?

84 views (last 30 days)
Sai Pavan Nunna
Sai Pavan Nunna on 20 Feb 2019
Commented: Ahmar Riaz on 8 Feb 2020
Can anyone share with the code on how to plot ECG sensor data into ECG graph using Matlab visualization in Thingspeak. I am able to do using Processing IDE.I want to do the same in Thingspeak.
Teh processing code is https://github.com/sparkfun/AD8232_Heart_Rate_Monitor. I want the equivalent matlab code. I am not able to get the equivalent.
Please someone help me.
  2 Comments
Sai Pavan Nunna
Sai Pavan Nunna on 20 Feb 2019
Yes, I am using Arduino Uno. I am not able to send ECG data to Thingspeak.please help me.

Sign in to comment.

Answers (2)

Madhu Govindarajan
Madhu Govindarajan on 22 Feb 2019
You can search through the MATLAB File Exchange to see if there are pre-existing libraries that you can use. If not, you will have to first write the MATLAB Code equivalent of the arduino sketches yourself to bring in the ECG data to MATLAB or write custom add-on libraries to bring this in using existing arduino libraries (https://www.mathworks.com/help/supportpkg/arduinoio/ug/custom-arduino-add-on-device-library-and-code.html).
I would recommend posting the code you want converted here in MATLAB answers and ask for help, as some experts might be able to help you with that. Once you have the code to bring in the data to MATLAB, then it should be easy to send data to ThingSpeak.
  2 Comments

Sign in to comment.


Madhu Govindarajan
Madhu Govindarajan on 25 Feb 2019
Here are my thoughts on this topic and unfortunately I am not a subject matter expert on this.
This video shows how we built a heart rate detector using Arduino and MATLAB to analyze ECG data. When you bring in ECG data as an analog voltage into an Arduino, usually you need a high sample rate (in our case 200 Hz) to be able to see the P wave QRS complex and T wave. When you have a code running on Arduino and send data serially over to MATLAB it is difficult to achieve those speeds reliably (best we got was around 60 Hz).
This is why we chose the Simulink Support package for Arduino workflow. As shown in the video, you can bring in Analog voltage data at 200 Hz and then use ThingSpeak blocks to log data to the cloud.
HTH,
Madhu

Communities

More Answers in the  ThingSpeak Community

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!