9. Wearables¶
Exploration¶
This week's assingment is for exploring wearable devices, both design and fabrication. This kind of devices are integrated with the body as functional objects. It is not just to wear something, the wearables listen to the body, translate gestures or postures into data, responses or experiences.
Wearables don't control the body, they accompany it, to wear technology is to accept that the body also thinks, the skin is an interface, and movement becomes a language.
This week i will be designing a portable object, that interacts with the body integrating: * Sensors that measure data like temperature, flexing, pressure, proximity, or even angle. * Actuators that gives us a signal like light, sound, vibration, or haptic responses.
The electronic part must also keep a good relationship between the shape, the body position, and behavior of the system, but the non-electronic part must focus on ergonomics, confortability and natural movement.
References & Inspiration¶
This work sits in the intersection of experimental fashion, interactive art, body interfaces design and even soft tech. I think the easiest example of wearable technology would be smartwatches, that can measure heart rate, distances through GPS, and some even blood pressure.
But for this week's project, the inspiration was found in the product Upright, which is a necklace that measures posture and corrects it through vibrations and a mobile app.
Materials and tools¶
The materials and tools we need for this assignment are the following:
- XIAO RP2040 Microcontroller
- MPU-6050 Accelerometer module
- Thin copper wire for connections
- Lilypad buzzer module
- Lilypad LED module
Process and workflow¶
The initial idea is some sort of wearable that either vibrates, plays an annoying sound on a buzzer, and/or turns a bright LED when your back is not in the most optimal position. How will I manage to do that? First things first.
Concept and sketches¶
I want it to look something like this
The way we can measure the slouching angle is with a accelerometer module that measures the angle in rotation and pitch, then we send that information to the XIAO RP2040, then it is translated and compared to control angles, for example good posture vs. bad posture, so depending on this values, the buzzer/vibration/LEDs turn on or off.
I will be using the MPU-6050 accelerometer+gyroscope module, that communicates with the microcontroller through a serial protocol called I2C, used mostly for communication between periferals and microcontrollers.
So the connections would be something like this:
The code is a bit complex because of the communication protocol, but it looks like this:
#include <Wire.h> //This part includes the libraries for both the I2C communication,
#include <MPU6050.h> //and the MPU-6050 Module
MPU6050 mpu;
const int ledPin = D1;
const int buzzerPin = D2; //Here we define the pins for the LED and Buzzer.
float ax, ay, az; //This are the variables for the angles in X, Y and Z axii
float pitch; //The "float" means it's a number with decimal point.
const float badPostureThreshold = 15.0; // Here we define the degrees of the bad posture threshold.
void setup() {
Serial.begin(115200); //Here the serial communication starts so we can check it on
Wire.begin(); //the serial monitor.
pinMode(ledPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
mpu.initialize();
if (!mpu.testConnection()) {
Serial.println("MPU6050 no conectado"); //Over here we have an "error" message in case the module
while (1); //is not detected.
}
Serial.println("MPU6050 listo"); //Here is the message if the module is detected.
}
void loop() {
int16_t ax_raw, ay_raw, az_raw; //We start recieving input from the module on the axii.
mpu.getAcceleration(&ax_raw, &ay_raw, &az_raw);
ax = ax_raw / 16384.0; //This factor converts the raw data into °degrees
ay = ay_raw / 16384.0;
az = az_raw / 16384.0;
pitch = atan2(ax, sqrt(ay * ay + az * az)) * 180 / PI; //This operation calculates the pitch.
Serial.print("Pitch: ");
Serial.println(pitch);
if (abs(pitch) > badPostureThreshold) { //This compares the reading with the threshold and turns
digitalWrite(ledPin, HIGH);
tone(buzzerPin, 1200); //The buzzer and LED on, or off deppending on the value.
} else { //The 1200 is the frecuency of the buzzer.
digitalWrite(ledPin, LOW);
noTone(buzzerPin);
}
delay(100); //We use delays for making the microcontroller wait a bit(100ms)
} //before the next reading.
First I threaded and routed the copper wire through the cloth piece, in this case i'm using denim. Then i followed the schematic and optimized the routes. Remember to Label all the terminals because it gets chaotic with this amount of conections (4 routes for data, 1 for voltage and 3 for GND).
What went right?¶
The communication protocol is very straightforward and not a lot of tweaks were to be done for it to work propperly.
What went wrong?¶
On the E-Textiles assignment I used conductive thread for stitching the piece, which was useful but very difficult to use as it untangles and frayes very quickly, I almost didn't have time to record the video because of these issues, so this time I used thin copper wire to avoid it.
Adjustments¶
The calibration of the different pitch and angles is very counterintuitive, and i'm almost certain there must be a better way, i'm still looking for it.
Conclusion¶
This assignment helped me integrate the electronics into something that actually works and is useful, not just the proof-of-concept.
Voilá! it works!











