Documentation 14

// Progress: Refining p5 and fabrication

This week I continue refining the p5 code to make 2 clocks: one resulted from the heartbeat sensor and the other showing the standard seconds movement. I get the inspiration from Tom’s Decimal Clock. People can press spacebar to show the standard seconds movement. In the end of the experience, people can press “s” to save the image of showing both their heartbeat movement and the standard seconds movement.
fig 14.1 people can save the image to see how their time and the standard time works with each other

Regarding the circuit, I added 2 more LED lights and solder all the lights with longer wires so they can extend to the corners of the installation.
video 14.1 refined p5 and circuit

In terms of fabrication, I wanted to make something more dynamic than a cube so I decided to make a pentagonal prism. Aesthetically I am inspired by Olafur Eliasson and Sarah Sze.  As for the interior, I want to expose the circuits and wiring to the audience, for I think the web-like structure of it can also be a metaphor of today’s informational media world? Anyway I went to Canal Plastics and bought a lot of different acrylic boards and laser cut them on the floor. This was my 1st time laser cutting everything so I was a little stressed but things turns out to be good.

video 14.2 putting the circuit into the prism

In order to inform people this is a project about heartbeat, I added the heartbeat sound whenver there is an increment in the interaction as a signifier for heartbeats. I also want to use 2 lights to create a heart-like shape with the shadows:


link to p5: https://editor.p5js.org/hz1805/sketches/QjxhrLBRt
arduino code: #include <Wire.h>
#include "heartRate.h"
#include "MAX30105.h"
#include <AccelStepper.h>
MAX30105 particleSensor;

const int ledWhite = 7;
const int led2 = 8;
const int led3 = 9;

// const int switchPin = 6;
const int stepsPerRevolution = 60;/
/ long lastBeat = 0;
// long initial_homing = -1;
// int move_finished = 1;

AccelStepper stepper;
// int endPoint = 1024;


void setup() { Serial.begin(9600);
// while(!Serial) {}
//motor stepper.setMaxSpeed(600);
stepper.setAcceleration(1000);
stepper.moveTo(500);
Serial.println("Initializing...");
pinMode(ledWhite, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
// pinMode(switchPin, INPUT);
// Initialize sensor if (!particleSensor.begin(Wire, I2C_SPEED_FAST))
//Use default I2C port, 400kHz speed {
Serial.println("MAX30105 was not found. Please check wiring/power. ");
while (1);
}
//button
// stepper.setCurrentPosition(0);
// stepper.setMaxSpeed(100.0);
// stepper.setAcceleration(100);
// initial_homing = 1;
//Setup to sense a nice looking saw tooth on the plotter byte ledBrightness = 0x1F; //Options: 0=Off to 255=50mA byte sampleAverage = 8;
//Options: 1, 2, 4, 8, 16, 32 byte ledMode = 3;
//Options: 1 = Red only, 2 = Red + IR, 3 = Red + IR + Green int sampleRate = 100; //Options: 50, 100, 200, 400, 800, 1000, 1600, 3200 int pulseWidth = 411; //Options: 69, 118, 215, 411 int adcRange = 4096; //Options: 2048, 4096, 8192, 16384
particleSensor.setup(); //Configure sensor with default settings particleSensor.setPulseAmplitudeRed(0x0A); //Turn Red LED to low to indicate sensor is running particleSensor.setPulseAmplitudeGreen(0); //Turn off Green LED
}
void loop() {
long pulse = particleSensor.getIR();
// Serial.print(pulse);
// return;

while (pulse != 0) {
int pulse2 = particleSensor.getIR();
int pulse3 = particleSensor.getIR();
// Serial.print(pulse); //
Serial.print(","); //
Serial.print(pulse2);
// Serial.print(",");
// Serial.println(pulse3);
Serial.println(pulse2);
if ((pulse3 < pulse2) && (pulse2 > pulse) && pulse2 != 0 && pulse3 != 0 && pulse2 > 100000 && pulse3 > 100000) {
// if (checkForBeat(pulse) == true)
// long delta = millis() - lastBeat;
// lastBeat = millis();
digitalWrite(ledWhite, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
// stepper.moveTo(5000);
stepper.run();
// stepper.runToPosition();
// delay(5);
} else {
digitalWrite(ledWhite, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
// stepper.stop();
// delay(5);
// stepper.moveTo(-500);
// stepper.runToPosition();
}// if (digitalRead(switchPin)== HIGH){ // stepper.moveTo(-stepper.currentPosition());// stepper.setMaxSpeed(3000);// stepper.setAcceleration(500);// if (stepper.distanceToGo() == 0){// stepper.stop();// } // // stepper.setSpeed(300); // // stepper.moveTo(initial_homing);// stepper.run();// // initial_homing ++; // delay(5); // // Serial.print(initial_homing);
// }// else{// stepper.stop(); // } // if ((pulse2 < 5000 && pulse2 > 1000)){ // stepper. // }
// Serial.flush(); // } }

}