Occupied

Made by Benjamin Hecht

Occupied I have two roommates, one of which lives on the opposite side of the apartment from our bathroom. As a result, there are times when he takes his 45 second trek to the bathroom just to learn that it is occupied. This device will be able to detect if the bathroom is available or not. I plan on putting sensors in the bathroom that detect if the door is closed, the light is on, or if there's moisture in the air. This'll be connected to an LED light that I will place near his bedroom.

Created: January 25th, 2018

0

Problem Statement:

One of my roommates lives on the opposite side of the apartment from our bathroom. As a result, there are times when he takes his 45 second, slow morning trek to the bathroom and will find out that it is occupied. At this point he can either wait around for it to be free or go back to his room and try again later.

I choose this roommate because I've seen him race towards the bathroom in the hopes that it is unoccupied, so that he can start his morning routine.

0

Goal:

I'm trying to make a solution that can easily integrate into his life, that will casually let him know whether or not the bathroom is occupied or free. This is all in the efforts of saving my roommate time.

0

Process:

To get started, I researched similar products and stumbled across the Occupus, which aimed to bring and improve the technology found with airplane restrooms, into the home or office.

Through this I discovered that I would need to use a photocell sensor, to detect light, and a hall effect sensor to detect if the door was closed. I then conducted more research and discovered helpful tutorials on the functionality of these two sensors. I originally wanted to include a temperature sensor to see whether or not the person in the bathroom is showering, but I ultimately decided that, that would have been too much of an undertaking for this project.

Once I scrapped the temperature sensor, I created two separate code files, one which tested the hall effect sensor, and one which tested the light sensor. After I got each individual sensor working, I created a third file to combine the code of both so that they could work in tandem with one another. Following this, I used IFTTT to take the input of when the Light Sensor and Hall Effect Sensor were HIGH, and if their previous state was LOW. If this was the case, IFTTT would send an email to me that said "The Bathroom is Occupied!"


0

Outcome:


Parts Needed:

1 LED light - This will indicate whether or not the bathroom is occupied

Particle and breadboard

Battery

Mini Photocell - To detect if the light in the bathroom is on

Hall effect sensor + Magnet - To detect if the door is open or closed

7 Wires

2 Resistors


0
int lightPin = D5;
int hallPin = D3;
int ledPin = D0;
int lightState = 0;
int previousLight = 0;
int hallState = 0;
int previousHall = 0;

void setup(){
  pinMode(lightPin, INPUT);
  pinMode(hallPin, INPUT);
  pinMode(ledPin, OUTPUT);
  Particle.variable("lightState", lightState);
  Particle.variable("hallState", hallState);

}

void loop(){
  lightState = digitalRead(lightPin);
  hallState = digitalRead(hallPin);

  if(lightState == HIGH && hallState == HIGH)
    {
      digitalWrite(ledPin, 1); //light and hall are same
      if(previousLight == LOW || previousHall == LOW)
        {
          Particle.publish("bathroomState", "Occupied");
        }
    }
  else{
    digitalWrite(ledPin, 0);
  }

  previousLight = lightState;
  previousHall = hallState;
}
Click to Expand
0
Home Hack Prototype Usage
0
Occupied Home Hack
Ben H - https://youtu.be/IuCfPZeB6Rs
0

Reflection:

The project got to almost exactly where I wanted it to be. If I were to continue with it, I would find a way to properly integrate it into my bathroom, which would give me a more in depth prototype. I would also use a different sensor for the door, as the hall effect sensor would sometimes enter a "toggle mode" which would require the magnet to touch the sensor again before it would shut off (rather than turn off/to LOW when the magnet would leave the vicinity of the sensor)

x
Share this Project

Courses

49313 Designing for the Internet of Things (Undergrad)

· 22 members

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


About

Occupied

I have two roommates, one of which lives on the opposite side of the apartment from our bathroom. As a result, there are times when he takes his 45 second trek to the bathroom just to learn that it is occupied. This device will be able to detect if the bathroom is available or not. I plan on putting sensors in the bathroom that detect if the door is closed, the light is on, or if there's moisture in the air. This'll be connected to an LED light that I will place near his bedroom.