It is becoming more and more common for studios to have shared spaces that are not permanently controlled by any one person or group. This can make having a meeting or a place to work unexpectedly difficult, because a student doesn’t know before they arrive if space is available and formal scheduling of spaces is rarely done. Occupancy addresses this issue by making the current as well as historic occupancy level of a space known along with the noise level.

Created: March 2nd, 2015

0

Occupancy Status Concept: 

It is becoming increasingly common for studios to have shared spaces that are not permanently controlled by any one person or group. This can make having a group meeting or a place to work in silence unexpectedly difficult, because a student doesn’t know before they arrive if space is available or how noisy it might be. Formal scheduling and reservation of spaces is rarely done, and this issue can be especially problematic on campuses where students live off-campus and have longer commutes. The resOURce occupancy monitoring system addresses this issue by making the current as well as predictive occupancy and noise levels of a space known via smartphone. Students can quickly check the status of their studio via their phones before making the journey to find a place to study.  

Technical Description: 

Two break beam sensors are incorporated into each pathway or doorway.

Depending on which beam is broken first, an occupant is either added or subtracted from the system.

Adding one occupant to a smaller conference room subtracts one occupant from the main meeting area, ensuring continuity of tracking occupancy.

Integrated microphones measure relative noise level within the space and let the user know if ambient noise is high, medium, or low. 

Bill of Materials

2 - 5V laser

2 - 3.7V Li-Polymer battery

2 - 1K Ohm resistor

1 - Microphone

2 - Photoresistor

1 - Spark Core

0
//Laser variables
int laserOne = 0;
int laserTwo = 0;
int photoOne = A1;
int photoTwo = A0;
int threshPin = D0;
int thresh = 500;
int photo1;
int photo2;
int occupancy = 0;
long interval = 1000;
long previousMillis = 0;
bool in = FALSE;
bool out = FALSE;
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;
int noise;
int micPin = D0;
double volts;

void setup(){

  pinMode (photoOne, INPUT);
  pinMode (photoTwo, INPUT);
  pinMode (micPin, INPUT);
  Spark.variable("Occupancy", &occupancy, INT);
  Spark.variable("Sample", &sample, INT);
  Spark.variable("Noise", &volts, DOUBLE);
}

void loop (){

   unsigned long startMillis= millis();  // Start of sample window
   unsigned int peakToPeak = 0;   // peak-to-peak level

   unsigned int signalMax = 0;
   unsigned int signalMin = 1024;

   unsigned long currentMillis = millis();

   // collect data for 50 mS
   while (millis() - startMillis < sampleWindow)
   {
      sample = analogRead(micPin);
      if (sample < 2000)  // toss out spurious readings
      {
         if (sample > signalMax)
         {
            signalMax = sample;  // save just the max levels
         }
         else if (sample < signalMin)
         {
            signalMin = sample;  // save just the min levels
         }
      }
   }
   peakToPeak = signalMax - signalMin;  // max - min = peak-peak amplitude
   volts = (peakToPeak * 3.3) / 1024;  // convert to volts


  photo1 = analogRead(photoOne);
  photo2 = analogRead(photoTwo);

  if(photo1 <= thresh && photo2 > thresh && in == FALSE && out == FALSE) {
    in = TRUE;
    out = FALSE;
  }

  if(photo2 <= thresh && photo1 > thresh && in == FALSE && out == FALSE) {
    out = TRUE;
    in = FALSE;
  }

  if(in == true && currentMillis - previousMillis < interval) {
    if(photo2 < thresh){
        occupancy++;
        in = FALSE;
        delay(1000);
    }
  }

  else if(out == true && currentMillis - previousMillis < interval) {
    if(photo1 < thresh){
        occupancy--;
        out = FALSE;
        delay(1000);
    }
  }

  else if(currentMillis - previousMillis >= interval) {
    in = FALSE;
    out = FALSE;
    previousMillis = currentMillis;
  }


  if(occupancy < 0){
      occupancy = 0;
  }
}
Click to Expand
0

Next steps:

If given more development time, the Occupancy system could benefit from a few additional features to make it a more well-rounded, value-adding system for studios: 

Collect data for predictive values: aggregate occupancy and noise data so that the app could provide predictive information in order for students to be able to better plan their days. 

Room reservation system interface: give students the ability to book a meeting room via the app (and have some kind of status indicator built into rooms so that those present would know the reservation schedule. 

Determine optimal packaging for use in doorframe: our prototype is subtle, however there are potentially better, smaller ways to embed the sensors in a doorframe for longterm viability 

Incorporate ability to measure how long a room has been occupied: this could be used to provide even more refined data so that users could know if a room has been occupied for 1.5 hours, the users might leave soon, versus if a room has been occupied for a few minutes (and the users might just be setting up to stay a while).  

x
Share this Project


About

It is becoming more and more common for studios to have shared spaces that are not permanently controlled by any one person or group. This can make having a meeting or a place to work unexpectedly difficult, because a student doesn’t know before they arrive if space is available and formal scheduling of spaces is rarely done. Occupancy addresses this issue by making the current as well as historic occupancy level of a space known along with the noise level.