Atrial Fibrillation Monitor

A pulse sensor with the ability to keep track of a person's pulse while notifying them if there is an irregularity.



STEM vid with edits.mp4

Description

Why an Atrial Fibrillation Monitor? (Problem)

Many people who have heart problems such as atrial fibrillation can experience a heartbeat irregularity and not be aware of it.

Those who experience heart arrhythmia called atrial fibrillation can increase their risk of other heart-related problems; such as stroke. During an AFib episode, the heart’s chambers lose their rhythm and beat irregularly. Treatment is necessary, but sometimes people don’t even know they are experiencing an episode.


The Solution

The solution to this problem will be a pulse sensor that detects the beats per minute and whenever this number exceeds a given range, a buzzer will sound. The range has the ability to switch if the person wants to do something more athletic that may naturally increase their heartbeat. The device notifies the victim and anyone near the victim that there is an irregularity in the heartbeat. Sometimes people think their AFib episodes are over, but this device can give them assurance and can warn if they need further treatment.


Abstract

Atrial Fibrillation is a heart arrhythmia that results in an attack in which the heart’s chambers beat irregularly. It can lead to a number of health problems and can go unnoticed. The A-Fib monitor that we created will contain a pulse sensor that will detect if the heart is beating abnormally. If that happens a buzzer will sound. The monitor detects irregularities because it has a set range that is considered healthy. There is a switch that sets the device in exercise mode or normal mode. Exercise mode has a wider range, since the heart rate increases when doing physical activity, to allow for more precise results when in normal mode. The monitor also contains a simulation mode. It consists of a potentiometer and switch. The switch dictates if it’s if simulation or active mode and the potentiometer acts in place of the pulse sensor. This way, the device's full potential is shown. We were successful in creating this device and it works as expected. Now, with this device, people who suffer from Atrial Fibrillation can rest assured that if they experience an attack they will be notified and can consult their doctors. In the future we hope to take the necessary parts of the arduino and make this pulse monitor in the form of a customizable bracelet for kid with A-fib so that they can feel comfortable around others while wearing an unusual device on their wrist.

Background Research

The Need (Who/When)

Atrial Fibrillation is a heart arrhythmia that causes an irregularity in the heartbeat. It can lead to stroke, blood clots, heart failure, and other heart-related diseases. Some people can sense when they are experiencing an AFib episode; although, many people don’t realize or show any symptoms. 2.7 million Americans live with Afib and 15-20% of people who have strokes have AFib. Not knowing that one is experiencing AFib attacks can prevent him or her from receiving treatment and the help that is needed.


The Science of Atrial Fibrillation (How)

Asking a Professional

We spoke to Dr. Milton Reitman, a Cardiologist from New York, about Atrial Fibrillation. His responses were the following:

Facts:

  • During an AFib attack, the heart doesn't beat efficiently and doctors describe it looking like "a bag of worms".

  • AFib tends to return. When medications are prescribed, they are used for the rest of one's life.

  • When you experience an attack it's important to go to the doctor as soon as possible.

  • When someone has AFib sometimes they can feel it when their heart beats irregularly like a thumping in the chest. However other times they may not feel it.

Effects of Atrial Fibrillation:

  • Your heart could beat so fast or irregularly that you could faint.

  • When people have AFib, the blood doesn't go through the heart as smoothly as in normal people. Therefore, blood clots can occur in the heart and they can travel to the brain and block the flow of blood to the brain and cause a stroke.

  • You can experience a heart attack; although it's not very common.

Treatments:

  • There are medications that can convert the AFib to normal sinus rhythm.

  • Blood thinners in people who have Atrial Fibrillation can help to prevent stroke.

  • Some people train themselves to cough really hard to make the heart beat at its normal rhythm.

  • There is a new procedure, called an Ablation, where a catheter is inserted through a vein in the body into the heart and the abnormal pathways that conduct the electrical impulses are cut using heat so that only the normal pathways remain.

  • Some people pass out when experiencing an attack and require cardioversion (which is a defibullator).

Why is our device helpful:

  • As mentioned before, victims can pass out when experiencing an attack and require cardioversion. Since our project sounds when someone has an attack, if the victim is alone, people in nearby rooms or areas can be alerted and provide aid.

  • After the procedure Ablation, it is still possible to have an AFib attack. Therefore, our device can be used to see if a patient has fully recovered.

Market Research

Competitors / Existing Products

The smartphone app, FibriCheck® can diagnose AFib, but it must be prescribed by a doctor. There are other apps that detect irregularities, such as Kardiaband, but they only work if attached to an apple watch (which is very expensive.) Other devices are not connected to the apple watch. AfibAlert, is a device that senses an irregularity in the heart rate after holding your thumb to it for forty-five seconds. However, this device only monitors one’s heart rate at that specific time. The Qardiocore is a heart monitor that connects to one's phone, but requires that person to look back at the recorded data every so often and is not very appealing to children.

Design and Methodology

Construction

The monitor consists of a pulse sensor, buzzer, and switch. The device uses a buzzer that will sound if the heartbeat BPM exceeds the set range and notifies anyone near the victim that they had an irregularity in their heartbeat.

In order to exhibit the full potential of the device, we added a simulation mode which required another switch and a potentiometer. In this case, the switch dictates whether the device is in simulation or active mode and the potentiometer acts in place of the pulse sensor. Also, the buzzer acts according to the potentiometer instead of the pulse sensor.

Since this is only a prototype, our main objective was to create a functioning device. However the project is intended to be much smaller and attached to a bracelet.

System Flow Chart / Operation:

Schematic and Code

Picture of the Virtual Prototype (it takes a while for the Tinkercad to load):

Simulation: scroll down and click on "Start Simulation". Then you can move the value of the potentiometer and switch to see how the buzzer reacts in different scenarios. This simulation exhibits how the switch that dictates normal and exercise mode works.

Click to see code

// Jamie Kurzer and Johnathan Lev-Tov

// Atrial Fibrillation monitor

/* This code will use a potentiometer and its range to represent a

pulse sensor and a person's heartbeat. The code creates a

threshold for the values of the potentiometer representing the

normal range of heartbeats per minute and if the value of the

potentiometer goes above or below this set range of numbers the

buzzer will sound. However, if the person wants to do some

exercise or anything that will naturally increase their heartbeat,

they can press the switch to increase the numbers for the range

and if the value of the potentiometer deviates from this range the

buzzer will sound.

*/

#define USE_ARDUINO_INTERRUPTS true// Set-up low-level interrupts for most acurate BPM math.

#include <PulseSensorPlayground.h> // Includes the PulseSensorPlayground Library.

// Variables

void simulation(); // declares the loop

void heartBeat(); // declares the loop


const int PulseWire = A1;// PulseSensor PURPLE WIRE connected to ANALOG PIN 0

int Threshold = 550;// Determine which Signal to "count as a beat" and which to ignore.

// Use the "Getting Started Project" to fine-tune Threshold Value beyond default setting.

// Otherwise leave the default "550" value.

PulseSensorPlayground pulseSensor;// Creates an instance of the PulseSensorPlayground object called "pulseSensor"

// variables

int potPin = A0;// sets the potentiometer to A0

int buzzer = 8; // sets buzzer to D8

int switchRange = 3; // sets switch to D3

int demoSwitch = 6; // sets the second switch to D6


// placeholders

int buzzerState; // variable that indicates whether the buzzer is on or off

int SwitchIsPressed; // variable that indicates whether the switch had been pressed

int potVal; // variable that serves as a placeholder for the value of the potentiometer

int myBPM; // the number of beats per minute



void setup()// initiates the code that will run once

{

Serial.begin(9600); // initiates the serial monitor

pinMode(buzzer, OUTPUT); // sets the buzzer as an output

pinMode(switchRange, INPUT_PULLUP); // sets the switch as an input

pinMode(potPin, INPUT); // sets the potentiometer as an input

pinMode(demoSwitch,INPUT_PULLUP);

pulseSensor.analogInput(PulseWire);

pulseSensor.setThreshold(Threshold);

// Double-check the "pulseSensor" object was created and "began" seeing a signal.

if (pulseSensor.begin()) {

// Serial.println("We created a pulseSensor Object !"); //This prints one time at Arduino power-up, or on Arduino reset.

}

}

void loop() // initiates the loop of code that will repeat endlessly

{

myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our pulseSensor object that returns BPM as an "int".

// "myBPM" hold this BPM value now.

buzzerState = 0; // sets the buzzer off (so that it doesn't sound)

SwitchIsPressed = digitalRead(switchRange); // sets the placeholder SwitchIsPressed to read the variable switchRange

potVal = analogRead(potPin); // sets the placeholder potVal to read the value of the variable potPin

if(digitalRead(demoSwitch) == 0)

{

simulation(); // will go to the simulation loop

}

else

{

heartBeat(); // will go to the heartBeat loop

}

}

void simulation() // simulation loop

{

if (SwitchIsPressed == 1 && (potVal < 300 || potVal > 800)){ // makes a range of values for the potentiometer when the switch is pressed

buzzerState =1; // turns the buzzer on

}

if (SwitchIsPressed == 0 && (potVal < 300 || potVal > 950)){// makes a different range of values for the potentiometer when the switch isn't pressed

buzzerState =1; // turns the buzzer on

}

// makes sure that the computer reads 1 as HIGH and 0 as LOW

if (buzzerState == 1){ // if buzzer = 1 (turns it on)

tone(8,300); // turns the buzzer on

}

else{

buzzerState = 0; // buzzer = 0 (turns it off)

noTone(8); // turns the buzzer off

}

// prints the value of the variables with delays so that the coder can read the values on the serial monitor

Serial.println("Potentiometer Value is: "); // prints the words "Amount is" on the serial monitor of potVal

Serial.println(potVal); // prints the value of the variable potVal (the value of the potentiometer) on the serial monitor

Serial.println("Heartbeat is: "); // prints the words "Amount is" on the serial monitor

Serial.println(myBPM); // prints the BPM the pulse sensor is recieving

delay(1000); // delays the code for 3 seconds

Serial.println("Is exercise mode on?: "); // serial monitor prints the phrase, "Is exercise mode on?"

Serial.println(SwitchIsPressed); // prints (a 1 or 0) whether or not the switch is pressed on the serial monitor. 1 means yes

delay(1000); // delays the code for 3 seconds

Serial.println("Buzzer on/off: "); // prints the words "Buzzer on/off" on the serial monitor

Serial.println(buzzerState); // prints (a 1 or a 0) whether the buzzer is on or off on the serial monitor. 1 means it is buzzing

}

void heartBeat() // heartBeat loop

{

if (SwitchIsPressed == 1 && (myBPM < 70 || myBPM > 100)){ // makes a range of values for the heartbeat when the switch is pressed (the range represents a regular heartbeat)

buzzerState = 1; // turns the buzzer on

}

if (SwitchIsPressed == 0 && (myBPM < 70 || myBPM > 120)){// makes a different range of values for the heartbeat when the switch isn't pressed (this range represents a heartbeat that is elevated for example when exercising)

buzzerState = 1; // turns the buzzer on

}

// makes sure that the computer reads 1 as HIGH and 0 as LOW

if (buzzerState == 1){ // if buzzer = 1 (turns it on)

tone(8,300); // turns the buzzer on

}

else{

buzzerState = 0; // buzzer = 0 (turns it off)

noTone(8); // turns the buzzer off

}

// prints the value of the variables with delays so that the coder can read the values on the serial monitor

Serial.println("Heartbeat is "); // prints the words "Amount is" on the serial monitor

Serial.println(myBPM);

delay(1000); // delays the code for 3 seconds

Serial.println("Is exercise mode on?: "); // the serial monitor will print the phrase, "Is exercise mode on?"

Serial.println(SwitchIsPressed); // prints (a 1 or 0) whether or not the switch is pressed on the serial monitor. 1 means yes

delay(1000); // delays the code for 3 seconds

Serial.println("Buzzer on/off"); // prints the words "Buzzer on/off" on the serial monitor

Serial.println(buzzerState); // prints (a 1 or a 0) whether the buzzer is on or off on the serial monitor. 1 means it is buzzing

}

Discussion

Process / Procedure

Research was interesting as none of us had first hand experience of being in a situation where our heart was at risk. We interviewed our teacher's friend that has a child who deals with this problem to get more information on how it can take a toll on a person along with some problems that they encounter daily. After going through some ideas like a device attached to a shirt (near the heart) or a head type of device to control seizures, we decided to make a pulse monitor with a range (everyone's may be slightly different) and began researching and building the prototype. We interviewed a professional in the field (as seen at the tome of the webpage) to talk about the device and some general knowledge about the condition.

Reflections

We had a hard time with the pulse sensor library and creating multiple loop functions. At first, it was difficult to make the pulse sensor communicate with the other components; but with the help of CIJE engineers at the provided office hours, we figured it out. Furthermore, in order to create a simulation mode and an active mode, we needed to create two loop functions using a switch to switch between both functions. This proved to be a challenge, but we managed to overcome it.

Highlights

One unique aspect of the device is its ability to change ranges. This means the range that doesn't cause alarm can be altered. While on exercise mode, the range increases so the device will not beep if the heart rate increases; which commonly happens when one is exercising. This prevents false alarms and allows for a more precise range when not exercising. In addition, it was an amazing experience to be able to meet with the CIJE engineers and get professional help with coding our idea to its full potential. Furthermore, one of the best experiences was being able to come up with an idea, that at one point we may have considered impossible, and be able to create a working prototype after debugging and trouble shooting small problems with the code.

Future Work / Improvements

We would improve the design by making the entire device smaller and attach it to a customizable bracelet so it would be kid friendly and not embarrassing to wear (and the pulse would be read from the wrist). Also, we could create another circuit to communicate with this one. The new circuit would have an RF Transceiver, GPS, and buzzer. It would be used to alert emergency contacts, even if they are far away, that the victim is experiencing a heart arrhythmia and give them the location of the victim.

Peer Editing

We shared our webpage with fellow students and teachers to get constructive criticism in hopes of improving and changing things that we may have not seen. An english teacher at our school showed us some grammatical mistakes which we fixed. She also mentioned that she didn't know the final idea would be a bracelet and advised us to explain that at the top of the webpage. We took all of her comments into account and added details about the final idea at the top of the webpage, the abstract, and construction portion. In addition, Dwayne, a CIJE official that met with us during class periods provided us with many pointers to improve, but the most influential advise was to change our flowchart by making it more detailed and easy to follow. Furthermore, students also commented on our project. With the information they provided, we added more pictures and details to the video.

Finished Product:

Team

Johnathan Lev-Tov

Sheck Hillel Community School

Coder

Jamie Kurzer

Sheck Hillel Community School

Designer