Skip to content

12. Skin Electronics

Research

In the realm of skin electronics I'm most excited by the opportunity for health related devices. However, I personally see a lot of the "health" related devices that are mass marketed to everyone (I don't include disability specific devices that are recommended by doctors) that give the illusion of being more connected to your health. I personally am very critical of the sleep monitor as I have seen many of my friends use this as an authority. For example, a good friend of mine complained about her sleeping habits for almost a year, staying up too late, being tired all day. However after getting an apple watch she can see her sleep data and now she feels motivated because she wants to get a good score and enjoys the gameification. While this may have a good outcome for her, I personally believe this makes us more disconnected from our bodies because even for basic actions we are no longer the authority of our bodies, we look to the outside. For more complex things I appreciate the opinions of an outside source (e.g., vaginal infections, see below), but I think it's important to use technology as a tool to help us learn to understand our body more, not to delegate all the tracking to an outside party.

get inspired!

Check out and research alumni pages to betetr understand how to document and get inspired

References & Inspiration

Giulia Tomasello

I was really inspired this week by the project of Giulia Tomasello. Luckily just a few days after learning about her I met her at an E-Textiles working session over the weekend and got to spend the weekend discussing health care, women's bodies and the role of technology. Her project Alma Futura, created underwear with a "non-invasive wearable device use e-textiles with specialized coatings to monitor vaginal discharge."

What I love about her work is that it is not only a device that gives you tools to take control of your own health, but it is also about bringing women's health into conversation. As someone who didn't know vaginal discharge was normal until a very late age, this is very important to me! Pairing technology with workshops to discover your body and education is exactly the way I believe technolgoy should be used. A tool to learn more about ourselves, not less. I find this refusal to let technology be the sole authority inpsiring.

ADD PHOTOS

describe what you see in this image describe what you see in this image


Tools

Process and workflow

My project for this week is to make something specific to my own health.

I have some disc / chronic pain issues and my body is very reactive to "bad positions". In the past after spending an afternoon cutting a pattern with my head looking down the whole time, the following day I couldn't turn my head to the side without excruciating pain, my doctor thinks there was some damage to my disc given the weight load to my neck when tilted forward is much higher.

describe what you see in this image


Source

My attempt at a solution was to buy this neck pillow that inflates and thus pushes my neck up and forces it straight. It's a really nice feeling, but incredibly inconvenient for working on anything because there are times when you have to tilt your head down. describe what you see in this image


So I wanted to create something that sits on the back of my neck, something stuck with something like kinetape (a sticky bandage like material) that can detect pressure (Straight neck = No pressure, Bent neck = pressure) and create an output

describe what you see in this image


I haven't made the output yet, but I'm imagining a necklace of lights.

This project has 3 parts:

  1. Pressure sensor
  2. Actuator
  3. Arduino code

1. Pressure Sensor

I first tried to make a pressure sensor using this instructable. As I write this I realize why it didn't work. I used velostat instead of conductive fabric. So I try again later! It didn't make any connection at all (obviously because I didn't follow the isntructions correctly), but when it does connect, it should increase the current as the pressure is added.

2. Actuator

I also haven't had the chance to do this yet, but I'm imagining something simple like a necklace of LEDs connected together. My desired output is to communicate with the user (me) that I'm in a bad position. So I'm not forced into a certain position like above, I am just gently reminded when I'm in a bad position.

So I want the actuator to act as follows:

  • When in a "good position" (i.e., low pressure on sensor) --> no light
  • When in a "bad posiiton" for more than x consecutive seconds (potentially 4 seconds, but I will test this) --> Slow blinking light
  • When in a "bad position for more than y consecutive seconds (thinking 8 seconds, to be tested) --> Fast blinking

This way, if I'm in a bad position for a few seconds because I need to look down I can do so without any annoyance. And if I'm consistently in a bad position I am first warned and then "demanded" to stop.

This can also be used when using your phone. Lots of times when we are putting ourselves in bad positions!

3. Arduino Code

This is the part I spent the longest on. And when I finally got close, but kept having an error I reached out to a software engineer friend, who just sent me a link where he copied and pasted the question I sent him into ChatGPT and told me I was wasting my time if I didn't use ChatGPT to help me. So lesson learned! ChatGPT explained very well and I was able to fix my error.

The core of the code I took from here and I just changed some variables add the max function and changed the input / output.

What the code does is:

  1. Use a circular buffer (i.e., a list that continues to take inputs, but also deletes old inputs in order to keep a constant length and not take too much memory) to store sensor values

  2. Stores the last 8 values. The value read is the sensor into A5 read every 0.1 seconds (This part I'm not so sure about, how does the output blinking times impact this time?)

  3. Then I read the last 8 values and found the maximum value, and I read the last 4 values and found the maximum value

  4. Then I evaluated sensor values. I decided that the threshold between pressure / no pressue is 150. For now this makes sense, but I will need to reevaluate when I build the final sensor.

describe what you see in this image describe what you see in this image describe what you see in this image


Code

// Source code: https://www.luisllamas.es/en/circular-buffer-arduino/

const int circularBufferLength = 8; //Seconds before fast blinking
int circularBuffer[circularBufferLength];
int circularBufferIndex = 0;
int sensorThresholdValue = 150; // Threshold between "good neck position" and "bad neck position"
int numSecondsWarning = 4; //Seconds before slow blink


void appendToBuffer(int value)
{
  circularBuffer[circularBufferIndex] = value;
  circularBufferIndex++;
  if (circularBufferIndex >= circularBufferLength) circularBufferIndex = 0;
}

void getFromBuffer(int* out, int outLength)
{
  int readIndex = (circularBufferIndex - outLength + circularBufferLength) % circularBufferLength;
  for (int iCount = 0; iCount < outLength; iCount++)
  {
    if (readIndex >= circularBufferLength) readIndex = 0;
    out[iCount] = circularBuffer[readIndex];
    readIndex++;
  }
}

//Sophia





//Internet
void getFromBufferInvert(int* out, int outLength)
{
  int readIndex = circularBufferIndex - 1;
  for (int iCount = 0; iCount < outLength; iCount++)
  {
    if (readIndex < 0) readIndex = circularBufferLength - 1;
    out[iCount] = circularBuffer[readIndex];
    readIndex--;
  }
}

//Sophia
int findMax(int* x, int length)
{
  int maxNum=0;

  for (int iCount = 0; iCount < length; iCount++)
  {
    if (maxNum<x[iCount]){
      maxNum=x[iCount];
    }

  }
  return maxNum;
}

//Sophia End





void printArray(int* x, int length)
{
  for (int iCount = 0; iCount < length; iCount++)
  {
    Serial.print(x[iCount]);
    Serial.print(',');
  }
  Serial.println();
}

void setup()
{
  Serial.begin(9600);
  pinMode(9 , OUTPUT);
  pinMode(A5, INPUT);
/*
  Serial.println("Store 0 - 12");
  for (int iCount = 0; iCount <= 12; iCount++)
  {
    appendToBuffer(iCount);
    printArray(circularBuffer, circularBufferLength);
  }
*/

}

void loop()
{

  int analog_sensor_value = 0;
  analog_sensor_value = analogRead(A5);
  //Serial.println("Analog Sensor Value");
  Serial.println(analog_sensor_value);
  delay(100);



  appendToBuffer(analog_sensor_value); //add value to list


  int data[numSecondsWarning]; //define range
  int M = sizeof(data) / sizeof(int);
  getFromBuffer(data, M);

  int maxRange = findMax(data, M );

  int dataAll[circularBufferLength]; //define range //the problem is here
  int MA = sizeof(dataAll) / sizeof(int); //the problem is here
  getFromBuffer(dataAll, MA);

  int maxAll = findMax(dataAll, MA);

  //later add a larger range to include all but this is ok for now
  /*
  Serial.println("max All");
  Serial.println(maxAll);
  Serial.println("max Range");
  Serial.println(maxRange);

  printArray(data, M);
  printArray(dataAll, MA);
  */


  if (maxAll < sensorThresholdValue) {
    digitalWrite(9, HIGH);
    delay(100); //milliseconds
    digitalWrite(9, LOW);
    delay(100); 


    // how to make the time the same but not continue on if reading changes
    Serial.println("this is running 1");

  } else if (maxRange < sensorThresholdValue) {
    digitalWrite(9, HIGH);
    delay(1000); //milliseconds
    digitalWrite(9, LOW);
    delay(1000); 
    Serial.println("this is running 2");



  } else {
    digitalWrite(9, LOW);
    delay(2000); 

  }



}