Introduction: Wearable Beating Heart LED Box

Picture of Wearable Beating Heart LED Box

Wearable Beating Heart LED Box

https://www.behance.net/gallery/53247375/Wearable-...

// Title: DATT 2000 Foundations Project - Heart

// Name: Dale Rosen

// Date: October 8th, 2015

// Description: This arduino project simulates a heartbeat at three different speeds to represent walking, jogging and running.

The small box "pumps" off of your chest via the servo motor attached to the back of the box.

// Instructions: Rotate the potentiometer counterclockwise to speed up. Rotate the potentiometer clockwise to slow down.

Step 1: Schematic

Picture of Schematic

Heart Rate Sensor ( Not Included )

Step 2: Simulate

Picture of Simulate

// Description: This arduino project simulates a heartbeat at three different speeds to represent walking, jogging and running.

// Instructions: Rotate the potentiometer counterclockwise to speed up. Rotate the potentiometer clockwise to slow down.

Step 3: Code

Picture of Code

// Title: DATT 2000 Foundations Project - Heart

// Name: Dale Rosen

// Date: October 8th, 2015

// Description: This arduino project simulates a heartbeat at three different speeds to represent walking, jogging and running.

// Instructions: Rotate the potentiometer counterclockwise to speed up. Rotate the potentiometer clockwise to slow down.

#include

// variable section Servo myservo; // create servo object to control a servo int pos = 0; // variable to store the servo position int ledPin = 13; // pin 13 for the LED int sensorPin = A0; // pin A0 for the POT int sensorValue = 0; // variable to store the value coming from the POT

void setup() { // pin section myservo.attach(9); // attaches the servo on pin 9 to the servo object pinMode(ledPin, OUTPUT); // initialize digital pin 13 as an output. pinMode(sensorPin, INPUT); // initialize analog pin A0 as an input. sensorValue = analogRead(sensorPin); // value of LDR }

void loop(){ while(sensorValue < 200){ // 78 BPM sensorValue = analogRead(sensorPin); // value of LDR digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) for(pos = 90; pos >= 0; pos -= 20) // goes from 90 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(20); // waits 10ms for the servo to reach the position } for(pos = 0; pos <=90; pos += 20) // goes from 0 degrees to 90 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(20); // waits 20ms for the servo to reach the position } digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(400); // wait for a 4/10th of a second digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) for(pos = 90; pos >= 0; pos -= 30) // goes from 90 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(30); // waits30ms for the servo to reach the position } for(pos = 0; pos <=90; pos += 30) // goes from 0 degrees to 90 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(30); // waits 30ms for the servo to reach the position } digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(200); // wait for a 2/10th of a second digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) for(pos = 90; pos >= 0; pos -= 30) // goes from 90 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(30); // waits 30ms for the servo to reach the position } for(pos = 0; pos <=90; pos += 30) // goes from 0 degrees to 90 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(30); // waits 30ms for the servo to reach the position } digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }

while(((sensorValue >= 200) && (sensorValue <= 500))){ // 102 BPM sensorValue = analogRead(sensorPin); // value of LDR digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) for(pos = 90; pos >= 0; pos -= 15) // goes from 90 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for(pos = 0; pos <=90; pos += 15) // goes from 0 degrees to 90 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(300); // wait for 3/10th of a second digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) for(pos = 90; pos >= 0; pos -= 22.5) // goes from 90 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(22.5); // waits 30ms for the servo to reach the position } for(pos = 0; pos <=90; pos += 22.5) // goes from 0 degrees to 90 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(22.5); // waits 22.5ms for the servo to reach the position } digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(150); // wait for 1.5/10th of a second digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) for(pos = 90; pos >= 0; pos -= 22.5) // goes from 90 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(22.5); // waits 22.5ms for the servo to reach the position } for(pos = 0; pos <=90; pos += 22.5) // goes from 0 degrees to 90 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(22.5); // waits 22.5ms for the servo to reach the position } digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(750); // waits for a 3/4 of a second }

while(sensorValue > 500){ // 129 BPM sensorValue = analogRead(sensorPin); // value of LDR digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) for(pos = 90; pos >= 0; pos -= 10) // goes from 90 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(10); // waits 10ms for the servo to reach the position } for(pos = 0; pos <=90; pos += 10) // goes from 0 degrees to 90 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(10); // waits 10ms for the servo to reach the position } digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(200); // wait for a 5th of a second digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) for(pos = 90; pos >= 0; pos -= 15) // goes from 90 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for(pos = 0; pos <=90; pos += 15) // goes from 0 degrees to 90 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(100); // wait for a tenth of a second digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) for(pos = 90; pos >= 0; pos -= 15) // goes from 90 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for(pos = 0; pos <=90; pos += 15) // goes from 0 degrees to 90 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(500); // wait for a half second }

}

Step 4: Photos + Video

Picture of Photos + Video

The video is available online here: https://www.behance.net/gallery/53247375/Wearable-LED-Beating-Heart-Project

You can hear the servo motor moving in the video

Comments

kksjunior (author)2017-10-04

I would love to see the video of it in action but i can't download the file you've attached!

DMWR (author)kksjunior2017-10-05

The video is available online here: https://www.behance.net/gallery/53247375/Wearable-LED-Beating-Heart-Project

You can hear the servo motor moving in the video

ahmet_024102 (author)2017-10-05

video not work

DMWR (author)ahmet_0241022017-10-05

The video is available online here: https://www.behance.net/gallery/53247375/Wearable-LED-Beating-Heart-Project

You can hear the servo motor moving in the video

Swansong (author)2017-10-04

That's a cute idea :)

About This Instructable

389views

3favorites

License:

Bio: Rosedale Designs
More by DMWR:Wearable Beating Heart LED BoxNeckCrusher ( Guitar Mounted Effect Pedal )Hexagonal Folding Table
Add instructable to: