Luna is an intelligent pillow that senses your stress by analyzing
your pulse and helps you relax and even fall asleep by showing you a relaxing
breathing pattern.
Background and user experience
The specific breathing pattern demonstrated by Luna is
called the 4-7-8
breathing technique. Studies found that exercises aimed at controlling
breath movement have a positive impact on heart rate variability, which
correlates with stress (Chandla et al., 2013). Another review found that deep
breathing led to better stress management, decreased fatigue and anxiety (Varvogli& Darviri, 2011). There are various devices available who guide your
breathing through light display like the meditation lamp Breathe and
apps like The
Breathing App.
However, none of these devices register the user’s stress level
and turn off automatically after the stress has subsided. This feature as
implemented in Luna has multiple advantages for the user’s experience with the
product. By using the pulse as indicator for the user’s stress level and varying
the length of the exercise on the pulse, the user gets immediate feedback on how
stressed their body actually is. This can be helpful in making the user aware
of the hidden type of stress that can become chronic. As the user interacts
with Luna as a ritual before going to bed, relaxing and deep breathing will
become easier and the exercises will be shorter, resulting in a feeling of success
and increased control and awareness of the user’s own body.
Electronics
Luna consists of only 5 electronic parts:
- Dimmable, warm white LED strip
- 12V battery (combining 8 1.5V batteries)
- Pulse Sensor SEN-11574
- Arduino Uno
- MOSFET IRF510
Additionally, we used power plugs, wires, a board and solder
to connect all the parts together.
Then, we assembled everything and taped the components to a slim
board to be put inside the pillow. We called it the “backbone”:
Backbone of the pillow
For the code, we used the pulse sensor library called “PulseSensorPlayground”.
The pseudo code looks like this (actual code can be found below):
If the sensor picks up a heart rate of above 60, the
breathing pattern will start. When the pillow lights up, the user should breathe
in. Then, the LEDs stay at their brightest intensity, which means the user has
to hold their breath. When the LEDs fade from bright to dark, the user can
exhale. Once this pattern ends, the sensor will pick up the next heart rate. If
the heart rates drops under 60, the LEDs will fade quickly three times, signalling
the end of the breathing exercise.
Form factor
We decided to use a light, soft beige pillow case. To make
the pillow soft and comfortable enough to fall asleep on, we stuffed it with
polyester between the electronics and the pillow cover, so the user does not feel
the electronics while hugging the pillow and concentrating on relaxing.
Polyester inside the pillow to cover LEDs and backbone
The LEDs shine through the pillow case, making it easy for the users to sense the fading lights even with their eyes closed. We aimed to provide users with a comfortable, fluffy experience fitting to the relaxation experienced through breathing, without the pillow being perceived as “cute” so users with many different characteristics, male, female, old, young people feel invited to use it.
We wanted the heart rate sensor to feel just as comfortable
as the pillow itself rather than clinical, so we sowed a blue fabric over the Velcro
strap that came with the pulse sensor. The sensor is placed in a corner of the
pillow, which makes it comfortable for right and left-handed users to hug the
pillow while laying on their side on a bed.
Conclusion
During this project, we learned some practical lessons on electronics
and material, like how building the circuit on a breadboard first and soldering
only after the circuit is confirmed to work might save valuable time. Moreover,
diffusing LED light with polyester works, however stitching it firmly to the
LEDs and pillow is important and strategic placement rather than quantity of
the filling is crucial.
Finally, what we learned was that even with a basic
understanding of electronics we could still create a compelling first prototype
of a product, that does not only look good but also works based on a fairly
simple code and few electronic parts.
Actual code
#define USE_ARDUINO_INTERRUPTS true // Set-up low-level interrupts for most accurate BPM.
#include <PulseSensorPlayground.h> // Includes the PulseSensorPlayground Library.
// Variables
const int PulseWire = 2; // PulseSensor PURPLE WIRE connected to ANALOG PIN 0
int Threshold = 550; // Determine which Signal to "count as a beat" and which to ignore.
// Use the "Gettting Started Project" to fine-tune Threshold Value beyond default setting.
// Otherwise leave the default "550" value.
int delayEnd= 20;
int delayBTD = 64;
int delayDTB= 40;
int delayB= 1000;
int delayShort = 4;
long previousMillis = 0;
PulseSensorPlayground pulseSensor; // Creates an instance of the PulseSensorPlayground object called "pulseSensor"
int led = 3; // the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is
void setup() {
Serial.begin(9600); // For Serial Monitor
pinMode(led, OUTPUT);
// Configure the PulseSensor object, by assigning our variables to it.
pulseSensor.analogInput(PulseWire);
pulseSensor.setThreshold(Threshold);
// Double-check the "pulseSensor" object was created and "began" seeing a signal.
if (pulseSensor.begin()) {
Serial.println("We created a pulseSensor Object !"); //This prints one time at Arduino power-up, or on Arduino reset.
}
}
void loop() {
int myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our pulseSensor object that returns BPM as an "int".
// "myBPM" hold this BPM value now.
Serial.println("We created a pulseSensor Object !");
if (pulseSensor.sawStartOfBeat()) { // Constantly test to see if "a beat happened".
if (myBPM > 60 && myBPM < 120) {
analogWrite(led, brightness);
while (brightness <240) {
brightness++;
analogWrite(led, brightness);
unsigned long startTime = millis();
unsigned long currentTime = millis();
while(currentTime - startTime < delayDTB) {
// save the last time you blinked the LED
currentTime = millis();
}
}
while (brightness >0) {
// dim bright to dark for 8 seconds
brightness--;
analogWrite(led, brightness);
unsigned long startTime = millis();
unsigned long currentTime = millis();
while(currentTime - startTime < delayBTD) {
// save the last time you blinked the LED
currentTime = millis();
}
}
}
if (myBPM < 60 && myBPM > 40) {
for (int i=0;i<3; i++) {
analogWrite(led, brightness);
while (brightness <240) {
brightness++;
analogWrite(led, brightness);
unsigned long startTime = millis();
unsigned long currentTime = millis();
while(currentTime - startTime < delayShort) {
// save the last time you blinked the LED
currentTime = millis();
}
}
while (brightness >0) {
// dim bright to dark for 8 seconds
brightness--;
analogWrite(led, brightness);
unsigned long startTime = millis();
unsigned long currentTime = millis();
while(currentTime - startTime < delayShort) {
// save the last time you blinked the LED
currentTime = millis();
}
}
}
while(true) {}
}
}
}
No comments:
Post a Comment