IN STUDIO ;)

Made by Keegan Dsouza

IN STUDIO ;) is a system which alerts the user about space/ lab / studio availability from their friends, team mates , classmates or research partners based on lights switched on or off in all the rooms in the Space / Lab / Studio

Created: January 29th, 2016

0

IN STUDIO ;) is a system which alerts the user if their friends, team mates , classmates or research partners  have arrived at the common studio , lab or work space . The sensor can be incorporated within a residential or commercial space. It uses a Particle Photon , Breadboard , Led indicator bulb , Resistors , Photo Diode and jumper cables . When the light is switched on in a given space post sunset where the apparatus is set,  the photo diode in IN STUDIO  is calibrated to gage the frequency of light emitted and accordingly makes a decision based on the pre set metrics to conclude if the light is switched on and sends a customizable text alert to the user . The online Particle Photon Dashboard also gives users time log details .  



Problem Statement: As researchers we do not always know which particular rooms are vacant or occupied in a common studio . 

Goal: The idea is to incorporate a sensor in every room of a common space such as the Studio space shared by the Integrated Innovation Institute Students at CMU , based on the lights being switched on or off it would indicate if the room is in use at that particular time period. 



Reflection: The internet of things has immense potential and unlimited combinations of possibilities, As a an Industrial Designer and Product / Service Innovator it was a good learning experience to understand the problems that exist and how can IOT bridge the gap . It was interesting to understand the inner workings of Electronic Components along with the particle photon . Writing code in particle  and trying to understand the language a machine understands to execute certain operations was an exciting experience.    

0
int ledPin = D0;

int photoresistor = A0; // This is where your photoresistor is plugged in. The other side goes to the "power" pin (below).

int intactValue; // This is the average value that the photoresistor reads when the beam is intact.
int brokenValue; // This is the average value that the photoresistor reads when the beam is broken.
int beamThreshold; // This is a value halfway between ledOnValue and ledOffValue, above which we will assume the led is on and below which we will assume it is off.

bool beamBroken = false; // This flag will be used to mark if we have a new status or now. We will use it in the loop.



void setup() {

    pinMode( ledPin , OUTPUT ) ;
    blinkLEDs();
    
    takeInitialReadings();
}

void loop() {



  if (analogRead(photoresistor)>beamThreshold) {

    /* If you are above the threshold, we'll assume the beam is intact.
    If the beam was intact before, though, we don't need to change anything.
    We'll use the beamBroken flag to help us find this out.
    This flag monitors the current status of the beam.
    After the beam is broken, it is set TRUE
    and when the beam reconnects it is set to FALSE.
    */

    if (beamBroken==true) {
        // If the beam was broken before, then this is a new status.
        // We will send a publish to the cloud and turn the LED on.

        // Send a publish to your devices...
        Particle.publish("beamStatus","intact",60,PRIVATE);
        // And flash the on-board LED on and off.
        digitalWrite(ledPin,HIGH);
        delay(500);
        digitalWrite(ledPin,LOW);

        // Finally, set the flag to reflect the current status of the beam.
        beamBroken=false;
    }
    else {
        // Otherwise, this isn't a new status, and we don't have to do anything.
    }
  }

  else {
      // If you are below the threshold, the beam is probably broken.
      if (beamBroken==false) {

        // Send a publish...
        Particle.publish("beamStatus","broken",60,PRIVATE);
        // And flash the on-board LED on and off.
        digitalWrite(ledPin,HIGH);
        delay(500);
        digitalWrite(ledPin,LOW);

        // Finally, set the flag to reflect the current status of the beam.
        beamBroken=true;
      }
      else {
          // Otherwise, this isn't a new status, and we don't have to do anything.
      }
  }    



}

void takeInitialReadings()
{
    // Now we'll take some readings...
  int on_1 = analogRead(photoresistor); // read photoresistor
  delay(200); // wait 200 milliseconds
  int on_2 = analogRead(photoresistor); // read photoresistor
  delay(300); // wait 300 milliseconds

 // ...And we will take two more readings.
  int off_1 = analogRead(photoresistor); // read photoresistor
  delay(200); // wait 200 milliseconds
  int off_2 = analogRead(photoresistor); // read photoresistor
  delay(1000); // wait 1 second
  
    // Now we average the "on" and "off" values to get an idea of what the resistance will be when the LED is on and off
  intactValue = (on_1+on_2)/2;
  brokenValue = (off_1+off_2)/2;

  // Let's also calculate the value between ledOn and ledOff, above which we will assume the led is on and below which we assume the led is off.
  beamThreshold = (intactValue+brokenValue)/2;
    
}


void blinkLEDs()
{
    digitalWrite( ledPin, HIGH );
    delay( 500 );
    digitalWrite( ledPin, LOW );
    delay( 500 );

}
Click to Expand
0

Credits : Coding assistance for IN STUDIO : Professor Daragh Byrne 

 IOT and Coding Techniques : Professor Daragh Byrne and Steffen Kiefer 

( Via Hackster.com Instructables )


x
Share this Project

Courses

49-713 Designing for the Internet of Things

· 4 members

This course charts the emergence of the now "connected world" to explore the possibilities for future products and connected spaces.


About

IN STUDIO ;) is a system which alerts the user about space/ lab / studio availability from their friends, team mates , classmates or research partners based on lights switched on or off in all the rooms in the Space / Lab / Studio