CSE 466 Lab 9-- Final Project:
Improving the Electrocardiograph

Introduction

In this lab you'll use the basic recorder you built in Lab 8. Don't proceed until that lab is finished and working correctly..

Objectives

In this lab, you will add performance improvements and new features:

Suggested Reading and Resources

Material on detection algorithms

To Do:

NOTE: Read through the entire lab so you know what is coming, and you can plan accordingly.

Understand that you should do as much as you and your partner can, but the final work you demo and hand in should be working and polished. This is an open-ended project; nobody is expected to implement all of what is suggested here.

...in other words, ...surprise me...!!!

I. Add some digital filtering to clean up your signal

Copy your code from Lab 8 to a new sketch called HeartMonitor.ino. Add some digital filtering to your code to smooth and clean your signal. See the lecture notes on Digital Filtering for notes on filter characteristics and bandwidths.
Note: This processing should be added before the data is written to the display or to the file on the SD card.

A lowpass Butterworth 4-pole IIR filter, an FIR lowpass filter or a moving-average filter are possible choices. Experiment with filter orders, lengths and frequencies to find the optimum compromise between useful information and noise elimination.
A good tool is the Interactive Filter Design Tool-   IIR and FIR with C code shown above.

II. Add a Heart Rate display to your Display and File

Implement a QRS detection algorithm of your choice, derive the Heart Rate and and display it, in Beat-per-Minute (BPM). In your code comments, include a brief explanation of how your algorithm works. See the references above, particularly the paper Real Time ECG Feature Extraction, and the lecture slides on QRS detection. Accurate detection of the R-peak of the QRS complex is crucial to the success of additional detection algorithms.

Notes:

III. Add some additional Analysis Routines

Implement as many detectors as you can to identify several types of heart Arrhythmia:

For information about these see the lecture notes and the paper Real Time ECG Feature Extraction.

You should display your results on screen, and write your results to the file on the SD card.
An display example which you can modify is shown in Figure 13 of the above paper:
fig 13
Tailor your display to fit the information you detect.

IV. Add User Interface Features

  1. A second button will allow you to scroll your display data left and right after capture.
  2. Add the ability to recall a previous file from the SD card and display it.
  3. Display the heart rate (BPM)via bluetooth on your phone, sending the data in a new GATT Service. See:
    https://learn.adafruit.com/introducing-the-adafruit-bluefruit-spi-breakout/heartratemonitor

Deliverables


Project Grading Notes:

50 points is a 4.0; you can get up to 63 points possible

Demo: 1 pt each

  1. _____Successful Demo of basic ECG display, smooth and appropriately filtered
  2. _____Heart Rate measurement, correctly detected
  3. _____file-writing     
  4. _____Bradycardia
  5. _____Tachycardia
  6. _____Premature Ventricular Contraction (PVC) (algorithm explained in Theory of Operation)
  7. _____Premature Atrial Contraction (PAC) (algorithm explained in Theory of Operation)
  8. _____File browser capability and recall from SD card
  9. _____Ability to scroll through a recalled file
  10. _____Arrhythmia detection information written to file and displayed
  11. _____Neat wiring
  12. _____2X-Bluetooth connection for HR as in IV.3 above

Code: 1 pt each

  1. _____Clear comments
  2. _____Short interrupt service routines (ISR), no screen, card, or debug writing
  3. _____3X-PDB triggering ADC conversion, no AnalogRead() used.

Theory-of-operation document:
  1. _____Understandable.
  2. _____Additional points for an outstanding implementation (up to 3)

Total:_________x3 = ______________

Final Projects demo and turn-in: Friday, December 11, 2015, 12:30-2:30, in CSE003