GETTING REAL: PLANNING VS LIFE

During Week 3 of Sprint 1 I realized that my whole planning was much more ambitious than I would ever achieve. One of the main reasons for this issue is the fact that on this week I was still struggling to finish the documentation for the Assignments, which is very time consuming if one wishes to make it well. Also, let's be real: In my SCRUM deliverables, I wanted to create 3 different functioning prototypes, one for each 3 week long sprints. According to my abilities and life that was not achievable. On Feb 8 we also had Mid Term Review with Neil Gershenfeld, which meant making a presentation + realizing that indeed my project plan needed some narrowing down.

INSPIRATION

This week, the inspiration is heart rate sensors. I've been trying to create one from scratch while waiting for the one we ordered. I've looked at a variety of different sensors and products in the market and it's interesting how many different options there are (collage of heart sensor products). 

 

HEART BEAT SENSORS.jpg

OBJECTIVES & PLAN

  • Make an IR Heart Rate Sensor
  • Make poster for Mid Term Review
  • Mid Term Review
S1:W3_notebook sketches.jpg

MAKE AN IR HEART RATE SENSOR

I wanted to experiment with an optical heart rate sensor, since I had already played with an ECG sensor in Week ?? 

The optical heart sensor from Arduino we ordered would be arriving in a long time, so I decided to try and make one of my own with this tutorial from Make. it looked fairly easy so I decided to give it a try.

INGREDIENTS

  • 24AWG 4 Solid Conductor Intercom
  • LM324 Quad Op Amp , 14-pin DIP
  • NPN Small Signal Transistor, 2N3904
  • USB A/B cable 
  • Multipurpose PC Board with 417 Holes
  • 0.1μF Ceramic Disc Capacitor (2) 
  • 1.0 μF Tantalum Capacitor, 35V 20% (2)
  • Carbon film resistors, 1/8 W: 470K, 68K (2), 39K, 8.2K, 1.8K, 1K, 220Ω
  • CNY 70 Reflective Optical Sensor
  • Arduino Uno 
  • Jumbo Adhesive-Backed Cable Clip
S1:W3_Resistors.jpg

PROCEDURE

First thing I had to source all the material. At the Fablab we didn't have exactly the resistors required, so I sourced the ones that I would be able to use in series, so they wold add up to the desired resistance. Once I did that, I used a breadboard to make my circuit.

S1:W3_Circuit WIP1.jpg
S1:W3_Circuit WIP2.jpg
S1:W3_Circuit done.jpg

We already had an CNY 70, which is a Reflective Optical Sensor with Transistor Output, so used that instead of the Infrared LED Emitter and Detector. I made the circuit and then went on Arduino to upload the code provided by the tutorial to read the values. In order to be able to visualize the heart rate, I also opened Processing and added the code to be able to visualize the live graph. All the code can be found at this Github repository.

S1:W3_Arduino + Processing.png

Arduino Code

/*
this goes on your Arduin
for use with Processing example IRPulseSensor
*/
// holds temp vals
void setup() {
Serial.begin(9600);
}

void loop() {
Serial.println(analogRead(0));
}

Processing Code

// Based on examples from Arduino's Graphing Tutorial and OscP5 documentation

import processing.serial.*;
Serial myPort; // The serial port
int xPos = 1; // horizontal position of the graph
float oldHeartrateHeight = 0; // for storing the previous reading

void setup () {

// set the window size:
size(600, 400);
frameRate(25);

// List available serial ports.
println(Serial.list());

// Setup which serial port to use.
// This line might change for different computers.
myPort = new Serial(this, Serial.list()[1], 9600);

// set inital background:
background(0);
}

void draw () {
}

void serialEvent (Serial myPort) {

// read the string from the serial port.
String inString = myPort.readStringUntil('\n');
if (inString != null) {

// trim off any whitespace:
inString = trim(inString);
// convert to an int

println(inString);

int currentHeartrate = int(inString);

// draw the Heartrate BPM Graph.
float heartrateHeight = map(currentHeartrate, 0, 1023, 0, height);
stroke(0,255,0);
line(xPos - 1, height - oldHeartrateHeight, xPos, height - heartrateHeight);
oldHeartrateHeight = heartrateHeight;
// at the edge of the screen, go back to the beginning:

if (xPos >= width) {
xPos = 0;
background(0);

} else {
// increment the horizontal position:
xPos++;
}
}
}

RESULTS & REFLECTIONS

    Here are some of the results for the heart rate sensor. I pressed my finger on the IR sensor steadily for a while and observed how the graph behaved. Initially the graph that was appearing on Processing's monitor was very small and didn't seem to respond very well. It looked very noisy and wasn't consistent with the expectations. After a second test, the graph started behaving in a much more acceptable way, but still wasn't showing the same graph as the tutorial said it would. After a third test, the graph became very tight again, and looked quite noisy, but in a more predictable way which looked more in sync with the heat beat.  I concluded that the circuit might not be stable enough on the breadboard and that it might need to be soldered to see if the data would become cleaner then.

    Test 1 - Heart rate graph is noisy and doesn't show the data accurately

    Test 1 - Heart rate graph is noisy and doesn't show the data accurately

    Test 2 - Data is cleaner and heart rate appears better

    Test 2 - Data is cleaner and heart rate appears better

    Test 3 - Data is noisy again but in a different way

    Test 3 - Data is noisy again but in a different way

     

    CREATE THE PRESENTATION FOR MID TERM REVIEW + mid term review

    INGREDIENTS

    • Illustrator
    • Photos

    PROCEDURE

    On February 8, 2018 we had our Mid Term Review with Neil Gershenfeld giving us his time for feedback on our work. In order to get the review done smoothly, each of us had to prepare a poster of our Project with our name,  the lab you are attending the course with and picture of your current prototype state or your composition of proposal. My project was still at a design stage, with a few prototyping trials on sensors and actuators, so I made a poster showing the vision for what I was going to get done by end of March.

    On the day of the presentation, I got the opportunity to present it to Neil and the rest of the students for 3 minutes. Neil's feedback was that my project was too complex for the amount of time I had to complete it. In his view, there were two projects nested inside my project and i should choose one in order to finish the course:

    • heart rate sensing and capturing
    • actuator part of the vibrating massage + LEDs

    RESULTS & REFLECTIONS

    Preparing the poster was an occasion for me to iterate the interaction I wanted the garment to have, and an opportunity to get something nice and visual out, so that I could visualize my design in a more defined way. It was also an opportunity for me to decide to go from 7 sensors + actuators to 4 considering the complexity of the circuit and the affordances of a Lilypad in terms of PWM pins. 

    Regarding the experience of the feedback with Neil, it was great to be able to see what the other Fablabs were up to and get inspired by their energy and creativity. Neil's feedback was very on point, but the time management of the feedback was not ideal because of the amount of students and  the hard deadline after 2 hours. When it was my turn to get feedback, he was already in a rush so i felt I couldn't get as much depth as i would have liked. Yet, life goes on and I decided to focus on the actuator part of the top, leaving the heart rate sensing to the next version.

    S1:W3_Final Project Slide.png
    S1:W3_neil.jpg
    S1:W3_anastasia.jpg