Highlights

Showing posts with label Week 5. Show all posts

Tutorial: Making the ECG

By : x
This is our custom built heart beat monitor. It uses a Infra-Red(IR) emitter and detector to detect heart beat. The concept is to detect a change in Infra Red detected by the IR detector with each pulse. You can see the two led at the left corner of the circuit board. The darker one is the emitter and the transparent one is the detector. Both placed in a foam to minimize the ambient infra red detection.
The electrical signal needs to be amplified so we are using Op-Amp 741 and then its output is filtered using three stage filters to minimize the noise. This signal is then fed into a single analog input in the Arduino.

The Arduino board is programmed to read the analog data and perform a serial output every 15ms. A Processing code is written on a PC to receive this data. The Prrocessing code contains a serial listener which get the data sent by the Arduino through the serial port. This data is then plotted on to the screen. For plotting a black screen is drawn and a line is made connecting adjacent data point as they come to give a running graph.

Tag : , , ,

ECG: Circuit

By : Lam Ho Wang

ECG: Circuit


Required Components:
  • Infrared emitter and detector
  • 1 x 15ohm, 1 x 10kohm, 2x 100ohm, 1x 1kihm resistors
  • 1 x 1uF, 2x 100uF, 1x 10uF capacitor
  • 1 x 741 Op-Amp

The Design has 4 sections, the IR emitter, IR detector, OPAMP, and fitter

IR Emitter  

The group used a 15ohm resistor, to obtain a bright IR source without burning the emitter.

IR detector 

The group use a IR detector to detector the IR reflect from the user body, with some tests the group found that fingers will give the best signal. 
The group used a 10 kohm resistor, to prevent burning the IR detector
The group has tried not using any resistor and 15 ohm resistor, which end up burning the IR detector.

OPAPM

The signal received from the IR detector is too low for observe and calculation, so an amplify is needed for a readable signal. 
The group used LM741 signal amplify from the ECE lab

Filtering 

The signal received after amplify has a lot of noise that makes the data inaccurate, so a RC filter is designed to reduce the noise after amplify. 
Tag : , , ,

ECG: Coding

By : Noctis King

The program of collection and graphing data

    This program ran on the Arduino and used to collect and graphing the heart rate data and calculated the BPM (heart rate/minute).
    There were three parts of this program: the collecting part, graphing part and calculating part. The collecting part was the most important part in these parts, because the data which collected from this part was necessary from next two part.
    The program would use the ECG which connected on the Arduino to detect the heart beat from the user. The user can set the different port if they wanted to change the port of ECG;
    After the program got the real-time data, it would start the graphing and calculating.
    In the graphing part, the program would group the heart beat on a new window.
    In the calculating part, the program would find out the data of changing and judging them weather a heart beat and counted the number of heart beat to calculated the BPM.

import processing.serial.*;

Serial myPort; 
int val, screen_increment, old_x=0, old_y=0;  
String inString;  
int lf = 10; 
double bpm,t,lbpm;
int lval=510;
void setup() 
{

  size(displayWidth-100, 1000);  //set the size of window
  
  String portName = Serial.list()[0]; //the port of input
  println(Serial.list());
  
  myPort = new Serial(this, portName, 115200);
  myPort.bufferUntil(lf);
  background(0,0,0);//the color of background of window
}

void draw()
{

}

void serialEvent(Serial myPort) { 

  inString = myPort.readString();
  inString = trim(inString);
  val = int(inString);//get the value of rate
  strokeWeight(5);
  stroke(255, 255, 255);
  println(val);
  
  line(old_x, old_y, screen_increment, 1000-val); //graph the hate rate
  
  old_x = screen_increment;
  old_y = 1000-val;
  
  screen_increment=screen_increment+2;
  if(screen_increment>(displayWidth-100))
  {
    background(0,0,0); 
    screen_increment=-50; 
  old_x = -50;
  old_y = 0;
  }
  if(val-lval>7) //calculate the BPM
  {
    t=t+1;
    lval=val;
  }
  if(val<lval)
  {
    lval=val;
    t=t+1;
  }
  if(val-lval>5)
  {
    bpm=60/(0.015*t);
    t=0;
  }
  
  if (bpm<130 && lbpm-bpm<40)
  {
  text(bpm+ "                                      BPM",600,200);
  //println(bpm);
  lbpm=bpm;
  }
}



UPDATE- Week 5

By : x

We are currently working on connecting all the parts of the ECG to breadboard. The circuit has been fully connected and we are seeing good results with signals. The custom designed ECG needed a lot of fine tuning with Op-Amp amplification and filtering techniques. This website http://www.kevindarrah.com/ was a big help. We also looked into other algorithms and one by http://pulsesensor.com/ works well. Combining these we were able get stable signals. Processing 2 was used to program a serial port listener which recieved data from the designed sensor and displayed a moving graph.

ACTIVITIES:

  • Click here to view building your own ECG tutorial by Ashish
  • Click here to view the circuit diagram and explanation by Marco
  • Click here to view the algorithm and code for Arduino and Processing by Nero


NEXT WEEK:
  • More work on signal processing
  • Work on Bluetooth connection
  • Work on Android Programming


- Copyright © 2013 Group 106-11 - Date A Live - Powered by Blogger - Designed by Johanes Djogan -