Introduction: Wearable - Final Project

INTRODUCTION

In this project we had the task of making a functional wearable prototype based on a cyborg functions. Did you know that your heart synchronizes with the BPM of music? You can try to control your mood through music, but what if we let technology help us calm down? We just need some components, an Arduino and your headphones. Let's innovate!

Project by Marc Vila, Guillermo Stauffacher and Pau Carcellé

Step 1: Materials and Components

Construction materials:

- 3d printed wristband

- M3 screws (x8)

- M3 nuts (x12)

- Fanny pack

Electronic materials:

-Heart Rate Sensor BPM

- Buttons (x2)

- Potentiometer

- LCD C 1602 MODULE

- MODULE DFPLAYER MINI MP3

- 3.5mm Jack Stereo TRRS HEADSET

- MicroSD Card

- Arduino Uno Plate

- Welder

- Bakelite plate

Step 2: Design a Wristband

First we make several sketches to organize the different components in the wristband.

With the clear idea, we took measurements of the three arms of the members of the group, then we made the average to find the optimal measure for the design. Finally we design the product with a 3d program and print it with a 3D printer.

You can download the .STL files here.

Step 3: Electronic Connections

We continue doing the necessary checks of our 3d design, we made a first assembly of all the components in the prototype to see that the measurements were corrects.

To connect all the components to the Arduino board, we made different connections from the components using 0,5 meters cables, in this way we reduce the visibility of the board and we organize the prototype better.

Step 4: The Code

This project is a cyborg prototype. Obviously we haven’t introduced the components under the skin, so we have simulated it with a bracelet as an orthosis (external device applied to the body to modify the functional aspects).

Our code takes the user's keystrokes and shows them using the LCD screen. In addition to the BPM, the screen shows the desired intensity so that the user can compare it with his heart rate. There are many situations where it is interesting to increase or reduce your own BPM. For example, endurance athletes must control the pulsations so as not to tire excessively. An everyday example would be to want to sleep or calm down in a nervous situation. It could also be applied as a therapeutic method for people with autism to reduce the stress they feel. Next to the screen are two buttons to control the wanted intensity and increase or decrease the heart rate. Depending on the intensity, a previously studied type of music is played. There are studies that show that music can alter BPM. According to Beats per Minute of the song, the human body mimics and matches those BPM.

int SetResUp = 11; // pin 10 of Arduino with intensity increase button.
int SetResDown = 12; // pin 11 of Arduino with intensity decrease button

int ResButtonCounter = 0;// times counter that increases or decrease the resistance setting, initial value of 0 int ResButtonUpState = 0; // current state of the intensity increase button int ResButtonDownState = 0; // current state of the intensity decrease button int lastResButtonUpState = 0; // last state of the intensity increase button int lastResButtonDownState = 0; // last state of the intensity decrease button

int pulsePin = 0; // Pulse Sensor connected to port A0 // These variables are volatile because they are used during the interrupt routine in the second tab. volatile int BPM; // Beats per minute volatile int Signal; // Pulse sensor data input volatile int IBI = 600; // Pulse time volatile boolean Pulse = false; // True when the pulse wave is high, false when it is Low volatile boolean QS = false;

# define Start_Byte 0x7E # define Version_Byte 0xFF # define Command_Length 0x06 # define End_Byte 0xEF # define Acknowledge 0x00 //Returns info with command 0x41 [0x01: info, 0x00: no info]

//PANTALLA #include // Upload the library for the functions of the LCD screen #include #include

LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // Declare the ports where the LCD is connected

//LECTOR #include #include // Upload the library for the functions of the module dfplayer mini MP3.

char serialData; int nsong; int v;

SoftwareSerial comm(9,10); // Declare the ports where the DFPlayer is connected DFRobotDFPlayerMini mp3;

void setup() { Serial.begin(9600); pinMode(SetResUp, INPUT); pinMode(SetResDown, INPUT);

//Define the dimensions of the LCD (16x2) lcd.begin(16, 2); //We select in which column and in which line the text begins to show //LECTOR comm.begin(9600);

mp3.begin(comm); //Component starts serialData = (char)((' ')); mp3.start(); Serial.println("Play"); // Play a song mp3.volume(25); //Define volume }

void loop() { if (digitalRead(11) == LOW){ mp3.next(); //If the button is pressed, the song passes } if (digitalRead(12) == LOW){ mp3.previous(); //If the button is pressed, the previous song } //if (SetResUp && SetResDown == LOW) {

int pulso = analogRead(A0); //Read the value of the heart rate monitor connected to Analog port A0

Serial.println(pulso/6); if (QS == true) { // Flag of Quantified Self is true like the arduino search the BPM QS = false; // Reset the flag of Quantified Self }

lcd.setCursor(0, 0); //Show the desired text lcd.print("BPM:"); lcd.setCursor(0, 1); //Show the desired text lcd.print("INT:"); lcd.setCursor(5, 0); //Show the desired text lcd.print(pulso); lcd.setCursor(5, 1); //Show the desired text lcd.print(ResButtonCounter); delay(50); lcd.clear(); ResButtonUpState = digitalRead(SetResUp); ResButtonDownState = digitalRead(SetResDown);

// compare TempButtonState with its previous state

if (ResButtonUpState != lastResButtonUpState && ResButtonUpState == LOW) { // if the last state changed, increase the counter

ResButtonCounter++; }

// save the current state as the last state, // for the next time the loop is executed lastResButtonUpState = ResButtonUpState;

// compare the state of the button (increase or decrease) with the last state

if (ResButtonDownState != lastResButtonDownState && ResButtonDownState == LOW) {

// if the last state changed, decrement the counter

ResButtonCounter--; }

// save the current state as the last state, // for the next time the loop is executed lastResButtonDownState = ResButtonDownState; { Serial.println(ResButtonCounter);

if (ResButtonCounter >= 10) { ResButtonCounter = 10; }

if (ResButtonCounter < 1) { ResButtonCounter = 1; }

}

}

Step 5: Total Assembly

With the code programmed correctly and the two parts of our prototype already assembled. We put all the components in place and join it with tape to fix it to the bracelet. The components that are in the bracelet are the Heart Rate Sensor BPM, the two buttons, potentiometer and the LCD Screen, each one in its respective hole previously designed in the 3D file. With the first part done, we focus on the protoboard, each connector on the correct pin of the Arduino board. Finally, with the verified operation of each component, we put it in the fanny pack to hide the wires.

Step 6: Video

Step 7: Conclusion

The most interesting thing about this project is learning about mimicking the human body unconsciously with music. This opens the door to many options for future projects. I think this is a complete project, we have quite a variety of components with a worked code. If we start again we would think about other component alternatives or buy them of better quality. We have had a lot of problems with broken cables and weldings, they are small and very delicate (especially the BPM). On the other hand you must be careful when connecting the components, they have many outputs and it is easy to make mistakes.

It is a very enriching project in which we have touched on a wide variety of Arduino hardware and software options.