MobileLiquorLock

From Hack Manhattan Wiki

Mobile Unlock Mechanism

Purpose

This prototype platform was built to test how functional a locking mechanism would be using smartphones as a key. The reader is an standard iPhone 4s and is connected to an arduino circuit to control the solenoid lock.

Current features:

  • QR Code based authentication.
  • Server side entry logging

Future features:

  • OTA unlocking from web page
  • Access denial


Components

  • iPhone 4s: the brains of the device. Reads incoming codes, checked if code is valid, outputs audio signal
  • Arduino: solenoid controller: receives audio signal and unlocks solenoid for a few seconds.


Circuit Diagram

Lock Controller

int analogPin = 6;     // read audio pin out (middle terminal) connected to analog pin 3

int ledPin = 2;

int val = 0;           // variable to store the value read


void setup() {
  Serial.begin(9600);          //  setup serial

  pinMode(ledPin, OUTPUT);  // set solenoid control pin
}

void loop(){

  val = analogRead(analogPin);    // read the input pin
  digitalWrite(ledPin, LOW);        // lock at every cycle
            // debug value
  //if val is above 1, open lock
  if(val>20) {
    Serial.print("HIT ");
    Serial.println(val);
    //open
    Serial.println("holding for 3 seconds");
    digitalWrite(ledPin, HIGH);   // unlock
    delay(3500);                   ///wait for 3 seconds
 
  }

}

Android APK download

Android APK download[1]

References

http://bildr.org/2012/03/rfp30n06le-arduino/


https://discussions.apple.com/docs/DOC-3511