Project showcase
Foursquare ultrasonic checkin

Foursquare ultrasonic checkin © MIT

You can check in to home / office or even your grandma's house by simply walking in front of an ultrasonic sensor.

  • 544 views
  • 0 comments
  • 1 respect

Components and supplies

About this project


Code

Arduino CodeC/C++
the ultrasonic used is connected using 4 wire jumpers not the traditional ping sensor.
#define CUSTOM_SETTINGS
#define INCLUDE_FOURSQUARE_SHIELD

#include <OneSheeld.h>

const int echoPin1 = 2;
const int trigPin1 = 4;


void setup() {
  OneSheeld.begin();
  pinMode(trigPin1, OUTPUT);
  pinMode(echoPin1, INPUT);
}

void loop()
{
 long duration1, distance1;

  digitalWrite(trigPin1, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin1, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin1, LOW);

  duration1 = pulseIn(echoPin1, HIGH);
  // convert the time into a distance1
  distance1 = duration1 / 29 / 2;

  if(distance1 <= 5 && distance1 > 0)
  {
    /* Check-in at Integreight. */
    Foursquare.checkIn("511759f2e4b0b0ae6ed91067","Back to work!");
  }
  OneSheeld.delay(2000);
}

Schematics

Circuit diagram
it's ok to connect ultrasonic sensor at any pins but you must change them in code.
Untitled%20Sketch.fzz

Comments

Similar projects you might like

LCD display distance of an ultrasonic sensor

Project tutorial by adam johns

  • 5,938 views
  • 0 comments
  • 8 respects

Noise Level Notification Alert

Project showcase by 1Sheeld

  • 1,269 views
  • 0 comments
  • 5 respects

Skype Mobile

Project tutorial by Guest

  • 1,015 views
  • 0 comments
  • 3 respects

Bitcoin Email notifier

Project showcase by Guest

  • 648 views
  • 1 comment
  • 1 respect

Capture Photos with one Click

Project showcase by tesla nerd

  • 3,171 views
  • 0 comments
  • 7 respects

Burglar Surveillance Camera

Project showcase by 1Sheeld

  • 3,075 views
  • 3 comments
  • 5 respects
Add projectSign up / Login