Do Not Disturb

Made by Ammani Nair

Found in Home Hack

One of my roommates meditates for a cumulative time of 2-3 hours a day. Being the talkative person that I am, I would disturb her often; always unsure if she was in the zone. To give her some peace, I plan to insert a pressure sensor in/under her meditation mat which will send a signal online where I can check if she’s free or not. Another output could be a WIFI compatible light on her door which would light up whenever she's meditating.

0

Goal

My primary goal was to make a device which my roommate would find useful and learn how to use the Particle Photon. 

0

Intention

One of my roommates meditates for a cumulative time of 2-3 hours a day. Being the talkative person that I am, I would disturb her often; always unsure if she was in the zone. To give her some peace, I plan to place a pressure sensor in/under her meditation mat which will let me know when she's meditating. If ever I need to speak with her, I can send an sms to know if she's in the zone. 

0

Process

The first step was to configure the sensor. I used a simple circuit with a led attached to verify if the sensor and the related code worked. I then went on the check the values I was receiving to set a threshold for the device. The next step involved setting up the IFTTT connection and writing code specifically for it.  My initial code was incorrect as I had not created a separate function to publish the event. On correcting the code, I got the desired result. I set up publish and subscribe event and added a button which would switch the device on and off.

0

Parts

Square FSR sensor

LED light

Push Button

10kOhm resistor

1kOhm resistor

Wiring

0
int pressPin = A0;
int pressRead = 0;
int ledPin   = D0;
bool ledState = FALSE;
int btn = D2;
int btnState = LOW;
bool toggle = false;
int currentButtonState = HIGH;
unsigned long lastPublishTime=60000;
void setup()
{
  pinMode(ledPin, OUTPUT);
  pinMode(btn, INPUT_PULLUP);
  Particle.variable("press", &pressRead, INT);
  Particle.variable("button", &currentButtonState, INT);
  digitalWrite(ledPin, LOW);
  Particle.subscribe( "busyornot" , callingMedidate );
}

void loop()
{
  TurnOn();
}
void TurnOn()
{
  int currentButtonState = digitalRead(btn);
  if( currentButtonState == LOW && btnState != currentButtonState )
  {
    toggle = !toggle;
  	digitalWrite(ledPin, toggle);
  }
  btnState = currentButtonState;
}
void callingMedidate(const char *event, const char *data)
{
    meditate();
}

void meditate()
{
  if (toggle == TRUE)
  {
  pressRead = analogRead(pressPin);
  if (millis()-lastPublishTime>10000)
    { if (pressRead > 1500)
        {
        Particle.publish("busy");
        lastPublishTime = millis();
        }
      else
        {
        Particle.publish("free");
        lastPublishTime = millis();
        }
    }
  }
  else
  {
  Particle.publish("noton");
  }
}
Click to Expand
0

Outcome

A user can send an sms saying #free to a specified number and the device is programmed to provide 3 response; if the device is switched off, if she's free and if she's meditating. 

0

Reflection

Having never worked on IoT products before, it was exciting to understand how the various sensors work. The tutorials on the DioT Lab website were very useful and easy to understand.  The next step was to change the led to an RGB led which would turn a certain colour to signify if it was on and a different colour for when she is meditating. I would like to further enhance this device by connecting it to a light on her door and others in her room. The door light would signal to us that she is busy and the light's inside would dim to suit the environment she would like while meditating.

0
Do not disturb
glitch0it - https://youtu.be/Vo3b7AP0xrA
0
x
Share this Project

Found In
Courses

49-713 Designing for the Internet of Things

· 26 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


Focused on
Skills
Tools
About

One of my roommates meditates for a cumulative time of 2-3 hours a day. Being the talkative person that I am, I would disturb her often; always unsure if she was in the zone. To give her some peace, I plan to insert a pressure sensor in/under her meditation mat which will send a signal online where I can check if she’s free or not. Another output could be a WIFI compatible light on her door which would light up whenever she's meditating.

Created

January 26th, 2017