Connected Distance

Made by ssakhalk

Found in Home Hack

Long distance relationships can be tough. Especially when its 7965 miles with a 10.5 hour time difference. This device makes an attempt to bridge this gap. It consists of a frame with every end user that lights up and signals the user at the other end indicating your presence in the space, when it detects motion. It is also connected to IFTTT- Location so that it can detect location change and update it on the frame via a pointing pin.

0

Problem Statement:

Long distance relationships can be tough. Especially when its 7965 miles with a 10.5 hour time difference. This device makes an attempt to bridge this gap by a pseudo physical engagement to let your loved ones know that you're thinking about them. 

0

 Goal:

What long distance relationships lack is the partly the physical presence of your partner. They can text, FaceTime etc., but one is always conscious in their interactions as one wouldn't want to disturb them. They aren't with you, but they might be thinking about you. This ambient device aims to put a smile on your face when you know your loves one has gotten home from a long day and is free to communicate, or is still at school but thinking about you. 

0

Process: 

As I don't come from anywhere close to a coding background, it was very difficult to decipher anything or to even hack (knew a complete different definition of hacking). Initially I wanted to use two particle boards, which wasn't available, hence had to settle for an alternate option which I thought of about maybe two days ago. I was certain that it would involve a physical engagement and hence I used the servo that can be manipulated remotely via IFTTT (#SMS) to point towards the location of one partner. Although I was able to hack the code mostly, I didn't understand jack (maybe partly still don't), but it's been a very steep learning curve. It has been a FAST process to get here including feeling (sad, stressed, emotional, stupid, jealous, borderline bi-polar) moments. 

0

Components use:

1 Breadboard

1 Particle Photon  

1 PIR Sensor 

1 LED

 1 1kOhm Resistor

1 Servo

3 male-female jumper wires

9 male-male jumper wires 

1 USB Cable

1 Laptop

Many patience 

0

Outcome: 

Connected distance is an uncomplicated and value-added device that works on two levels. The first part of it is the PIR motion sensor that detects your presence in the room, lights up the led and sends out a message via IFTTT to your partner. The second part of it is controlled remotely by your partner. The servo can be manipulated to two positions [multiple positions can be added. Also, IFTTT allows only 100 messages per month :( ], via text messaging. If your partner is at #school, they can simply send out a message to IFTTT as #school, this will rotate the servo to an angle of 180 °. Similarly, when ones location is #work, the servo rotates to an angle of 90 ° (this is a desired value and is subject to change as per input). 

Sources:

http://diotlabs.daraghbyrne.me/7-communicating-events/pir/

http://diotlabs.daraghbyrne.me/6-controlling-outputs/servo/

http://diotlabs.daraghbyrne.me/7-communicating-events/doorbell/

http://diotlabs.daraghbyrne.me/8-ifttt/



0
int inputPin = D0;              // choose the input pin (for PIR sensor)
int ledPin = D1;                // LED Pin
int pirState = LOW;             // we start, assuming no motion detected
int val = 0;                    // variable for reading the pin status


int calibrateTime = 5000;      // wait for the thingy to calibrate

int servoPin = A4;
Servo myServo;
int servoPos = 0;

void setup()
{
  pinMode( ledPin, OUTPUT );
  pinMode(inputPin, INPUT);     // declare sensor as input

  // attaches the servo on the A7 pin to the servo object
    myServo.attach( A4 );

    //Register our Particle to control the servo
    Particle.function("servo", servoControl);

   // Keep a cloud variable for the current position
   Particle.variable(  "servoPos" , &servoPos , INT );

}

void loop()
{

  // if the sensor is calibrated
  if ( calibrated() )
  {
  // get the data from the sensor
    readTheSensor();

    // report it out, if the state has changed
    reportTheData();
  }
}

int servoControl(String command)
{
    // Convert
   int newPos = command.toInt();
   // Make sure it is in the right range
   // And set the position
   servoPos = constrain( newPos, 0 , 180);

   // Set the servo
   myServo.write( servoPos );

   // done
   return 1;
}


void readTheSensor() {
  val = digitalRead(inputPin);
}

bool calibrated() {
  return millis() - calibrateTime > 0;
}

void reportTheData() {

  // if the sensor reads high
  // or there is now motion
  if (val == HIGH) {

    // the current state is no motion
    // i.e. it's just changed
    // announce this change by publishing an eent
    if (pirState == LOW) {
      // we have just turned on
      Particle.publish("designingiot/s15/motion");
      // Update the current state
      pirState = HIGH;
      setLED( pirState );
      Particle.publish("I_get_home","Cominghome");
    }
  } else {
    if (pirState == HIGH) {
      // we have just turned of
      // Update the current state
      pirState = LOW;
      setLED( pirState );
    }
  }
}

void setLED( int state )
{
  digitalWrite( ledPin, state );
}
Click to Expand
0
ConnectedDistance
Surabhi Sakhalkar - https://youtu.be/hvBAaQW17po
0

Reflection:

From pulling an all-nighter to still not being able to submit on time, has been an excruciating but exciting process. Now that I look back there were many ways to do or undo the entire process, or add components to make it multi-dimensional, but to even come to the realization of recognizing it or thinking about it in the future prospects has made it easier to cope up with the fast pace of learning (along with extremely talented and competitive peers). 

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
About

Long distance relationships can be tough. Especially when its 7965 miles with a 10.5 hour time difference. This device makes an attempt to bridge this gap. It consists of a frame with every end user that lights up and signals the user at the other end indicating your presence in the space, when it detects motion. It is also connected to IFTTT- Location so that it can detect location change and update it on the frame via a pointing pin.

Created

January 25th, 2017