Added by Darren Kitchen on September 15, 2010

This week we’re breaking out the breadboard for an oldschool Hak5 mod — the Internet enabled garage door opener. Because when it comes to garage entry, what could be easier than writing an Android app to access a home Apache server, hitting a PHP script that interfaces with a USB Teensy over serial, activating relays connected to a remote. Duh.

Download HD Download MP4 Download XviD Download WMV

Garage Door Opener

void setup()
{
  Serial.begin(9600); // USB is always 12 Mbit/sec
  pinMode(17,OUTPUT); //Door
  pinMode(18,OUTPUT); //Gate
}

void loop()
{
   char c = Serial.read();
   
  if(c == '0')
  {
    //open door
    Serial.println("Open Door and Gate");
    openDoor(18,1000);
    openDoor(17,1000);
  }
  if(c == '1')
  {
    //open door
    openDoor(17,1000);
  }
  if(c == '2')
  {
    //open gate
    openDoor(18,1000);
  }
}

void openDoor(int pin,int d){
  digitalWrite(pin, HIGH);
  delay(d);
  //stop opening doors
  digitalWrite(pin, LOW);
}

If you want to know the latest on Hak5 be sure to follow us on Twitter or Facebook.

Also, now is also a great time to grab some swag from the HakShop – including the new airport friendly WiFi Pineapple with free world-wide shipping.

And finally if you’d like to suggest a topic for a future show feel free to hit up feedback@hak5.org

Category:

Episodes, Season 8

Tags:

android, apache, arduino, class, Code, dev, garage door, Hack, Hak.5, Mod, PHP, program, relay, remote, sdk, serial, teensy, USB

Leave a Reply Cancel reply

spacer spacer spacer

Enter your WordPress.com blog URL


.wordpress.com

Proceed