SmartThings Door Lock

My latest creation is an internet-of-things door lock. The package actuators the deadbolt using a servo and determines if the door is shut or not using a reed switch. There is also a motion sensor that can determine if someone is approaching the door. The lock builds on the SmartThings platform using their Arduino Shield. With it I can control the lock over the Internet using the SmartThings app. What do you think?!

Links

  • Source: https://github.com/joshvillbrandt/SmartThings-Lock

3 thoughts on “SmartThings Door Lock

    1. Hi! The servo is the Hextronik HX5010. I was using this servo to turn the deadbolt lock and the servo was suitable for this purpose. I do not think that this servo would be sufficient to turn the door knob itself.

      Hope that helps!

  1. Dear josh

    My Name is Emil im from Germany so my englisch is not the best.
    Can you help me by mine projekt?
    I build a box with an Arduino nano,a servo and a RC522 Card Reader.
    I will build a reed switch in it but i dont now how i can Programm it?
    When i close the box the reed switch should move the servo.
    The idee is from this video; https://www.youtube.com/watch?v=rK55jsfwRws&t=323s
    But the boy in the video build the box with an ESP8266.
    I build it whit an arduino nano.
    I hope you help me.

    Here is the Code from the box witch i bulid:

    #include
    #include
    #include
    #include
    #define SS_PIN 10
    #define RST_PIN 9
    #define LED_G 5 //define green LED pin
    #define LED_R 4 //define red LED

    LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3,POSITIVE);
    MFRC522 mfrc522(SS_PIN, RST_PIN);
    Servo Servomotor; //define servo name
    void setup()
    {

    lcd.begin(16,2);
    lcd.setCursor(0,0);
    lcd.print(“Put the card on”);
    lcd.setCursor(0,1);
    lcd.print(“the Reader”);

    Serial.begin(9600);
    SPI.begin();
    mfrc522.PCD_Init();
    Servomotor.attach(3); //servo pin
    Servomotor.write(0);//servo start position
    pinMode(LED_G, OUTPUT);
    pinMode(LED_R, OUTPUT);
    Serial.println(“Put your card to the reader…”);
    Serial.println();

    }
    void loop()
    {
    // Look for new cards
    if ( ! mfrc522.PICC_IsNewCardPresent())
    {
    return;
    }
    // Select one of the cards
    if ( ! mfrc522.PICC_ReadCardSerial())
    {
    return;
    }
    //Show UID on serial monitor
    Serial.print(“UID tag :”);
    String content= “”;
    byte letter;
    for (byte i = 0; i < mfrc522.uid.size; i++)
    {
    Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
    Serial.print(mfrc522.uid.uidByte[i], HEX);
    content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte[i], HEX));
    }
    Serial.println();
    Serial.print("Message : ");
    content.toUpperCase();
    if (content.substring(1) == "79 38 BF A2") //change here the UID of the card/cards that you want to give access
    {
    Serial.println("Authorized access");
    Serial.println();
    delay(500);
    digitalWrite(LED_G, HIGH);

    Servomotor.write(0);
    delay(5000);
    Servomotor.write(90);
    digitalWrite(LED_G, LOW);
    }
    else {
    Serial.println(" Access denied");
    digitalWrite(LED_R, HIGH);
    delay(2000);
    digitalWrite(LED_R, LOW);

    }
    }

Leave a Reply

Your email address will not be published. Required fields are marked *