Finn Dochhan

UX, Web & Grafik Design

Heartwear

The idea was to visualize the heartbeat of a person with electroluminescent wire. The person puts on a flexible belt with the metal front (diaphragm) of a stethoscope attached to it. There is a microphone built into the stethoscope that recognizes the heartbeat. The microphone is connected to the Arduino board which powers a heart-shaped electroluminescent wire.

Basic Idea & Concept

With every heartbeat the wire is lightened up for a few milliseconds. The heart-shaped wire can be easily attached to a shirt with the use of plastic clips. It is connected to the Arduino board by using 1m cable. The Arduino board is powered by a 9V battery. It is placed in a plastic (or thin wooden) case which can be attached to a trouser pocket by using a (metal or plastic) clip.

Heartwear

The Project Name

I named the project Heartwear which is close to the pronunciation of hardware and refers to the fact that we were using hardware parts in this course. The combination of heart (heartbeat and shape of a heart with wire) and wear (on a shirt) is a wordplay.

Biofeedback

This term describes the phenomenon which occurs when the organism is giving feedback to itself e.g. when someone is listening to his own breath for a period of time and the intervals between the breaths are then get- ting shorter or longer. So the feedback can have effects on the functions of the body. In my project this had to be considered. The vi- sualization of someones own heartbeat can have an effect on its frequency but should normally be harmless if you do it for a short time. It is not a medically proved statement but I strongly recommend not to view or hear your own heartbeat over a period longer than a few seconds or a minute especially if there are discrepancies with your heart! Biofeedback is also used as a therapy method for medical purposes.

Parts

The basic parts for my setup contains the Arduino Uno prototyping platform powered by a 9V battery and some cables to connect it and the other parts.

Base Platform: Arduino Uno powered by a 9V battery

For the heartbeat recognition I decided to use some parts of a stethoscope (MDF Instruments Rappaport 767 Sprague) combined with a microphone which is placed at the end of the stethoscope‘s tube inside the so called flexible ‘olive’ which is normally plugged into the ear.

MDF Instruments Rappaport 767 Sprague Stethoscope

 

For a good noise transmission the signal from the microphone has to be amplified. I use the Breakout Board for Electret Microphone from Sparkfun because the microphone isdirectly attached to a preamp which works from 2.7 up to 5.5V. So it can be powered by my 9V battery as well. The advantage of the Breakout Board is of course its small size. Apart from that it has the optimal values for my project (see below).

Breakout Board for Electret Microphone from Sparkfun

Mic inside of stethoscope 'olive'

For the Arduino and the battery I built a small wooden case which can easily be attached to a waistbelt.

Wooden case

Overview

The visualization of the heart itself is done by so called electroluminescent wire. “Electroluminescence (EL) is an optical phenomenon and electrical phenomenon in which a material emits light in response to the passage of an electric current or to a strong electric field.” (Source: http://en.wikipedia.org/wiki/Electroluminescence). The wire needs an inverter or driver module which transforms the DC voltage to an appropriate AC Voltage. The vendor of the cable which I have chosen supplied me with a 1m cyan colored cable with 2.3mm diameter and a 3V input/130Veff@425Hz EL output inverter.

Basic Circuit

Basic circuit

Basic circuit

Note: LED is replaced by inverter with EL wire and batteries by a 9V block. Mic has no wires but is directly attached to preamp.

Heartbeat Recognition

Anatomy of a heartbeat: The red area (peak) has to be recognized by the microphone

The sound recognition works as follows. At a specific sound level captured by the microphone the EL wire has to be powered. The first step was to test the output of the microphone. For the time my Arduino is connected to the PC I run an oscilloscope program in Pro- cessing to control my noise recognition.

Oscilloscope program in Processing to control noise recognition

Thanks to the worldwide Arduino community I found out how to create an Arduino program which lights up my EL wire when the recognized sound reaches a specific predefined peak level. For my purpose the sound level has to be the actual peak of a heartbeat.

To get the frequency of this part I took a recorded heartbeat and did a frequency analysis. It shows that the highest peak lies around a value of 100-120Hz. My microphone can cover this frequency.

Heartbeat frequency analysis

My first attempt to detach the microphone and put it into the metal head of the stethoscope did not succeed. There were too many disturbing sounds because of the missing shielding of the wires.

So I decided to leave the microphone onto its board and plug the microphone into one of the flexible olives of the stethoscope. A positive effect of doing this was also a better recognition of the heartbeat and less disturbing sounds because experiments made by stethoscope manufacturers have proved that the flexible tube connected to the metal head of the stethoscope amplifies the low heartbeat noise.

Code Arduino

#define ANALOG_IN 0
#define PEAK 3.0
#define CONVERGE 10
// Define PIN 13 for LED
int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
unsigned char duty;
unsigned char avg;
unsigned char result;
signed char diff;
int val = analogRead(ANALOG_IN);
result = val;

// Find the difference and converge the average
diff = result ­ avg;
avg += diff / CONVERGE;
// Determine if it’s a peak
if( result > avg * PEAK ) duty = (100*result)/avg;
else
duty = 0;
if (duty != 0 ) {
digitalWrite(ledPin, LOW);
}
else {
digitalWrite(ledPin, HIGH);
//Add a delay to make the wire lighting visible
delay(10);
}
}

Code Processing

/*
* Oscilloscope
* Gives a visual rendering of analog pin 0 in realtime. *
* This project is part of Accrochages
* See http://accrochages.drone.ws *
* (c) 2008 Sofian Audry (info@sofianaudry.com) *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import processing.serial.*;
Serial port; // Create object from Serial class
int val; // Data received from the serial port
int[] values;
void setup()
{
size(640, 480);
// Open the port that the board is connected to and use the same speed (9600 bps) port = new Serial(this, Serial.list()
[0], 9600);
values = new int[width];
smooth();
}
int getY(int val) {
return (int)(val / 1023.0f * height) ­ 1;
}
void draw()
{
while (port.available() >= 3) {
if (port.read() == 0xff) {
val = (port.read() << 8) | (port.read());
}
}
for (int i=0; i values[i] = values[i+1];
values[width­1] = val;
background(0);
stroke(255);
for (int x=1; x }
}