Rachel Fagan
Published © GPL3+

Glow Pillow with Force Sensing Resistor

Create a pressure-sensitive light-up pillow with an embedded soft circuit.

IntermediateFull instructions provided7 hours3,242
Glow Pillow with Force Sensing Resistor

Things used in this project

Hardware components

Arduino LilyPad USB
Arduino LilyPad USB
×1
LilyPad LED Blue (5pcs)
SparkFun LilyPad LED Blue (5pcs)
I only used two blue LEDs in my pattern.
×1
LilyPad LED Yellow (5pcs)
SparkFun LilyPad LED Yellow (5pcs)
I only used two yellow LEDs in my pattern.
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Adafruit Square Force Sensing Resistor
×1
Battery, 3.7 V
Battery, 3.7 V
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Glow Pillow Schematics

Add as many LEDs as you would like to your series!

Code

Glow Pillow Code

Arduino
The series of LEDs glow according to the force sensing resistor.
int sensorPressure = A9;


int bargraphLED[6] = {4,5,6,7};


void setup()
{
  int x;


  pinMode(sensorPressure, INPUT);


  for (x = 0; x <= 5; x++)
  {
    pinMode(bargraphLED[x], OUTPUT);
  

  }


  Serial.begin(9600);
}

void loop()
{
  int sensorValue;


  sensorValue = analogRead(sensorPressure);

  Serial.print("sensor value: ");
  Serial.println(map(sensorValue,0,1023,0,2000));


  barGraph(sensorValue);
}


void barGraph(int value)
{


  int x;


  for (x=0; x <= 5; x++)
  {
    if (value > (x*170) )
    {
      digitalWrite(bargraphLED[x],HIGH);
    }
    else
    {
      digitalWrite(bargraphLED[x],LOW);
    }    
  }
}

Credits

Rachel Fagan
1 project • 1 follower
Contact

Comments

Please log in or sign up to comment.