The iButton garage-door opener (Arduino) by kenyer
Featured

I've made an iButton garagedoor opener and logger.

On a Dutch (kind of) eBay (www.marktplaats.nl) I found some iButtons and readers very cheap. I had no idea what to do with them, but I bought them anyway.
My garage opens with a push on a button, so it must be possible to get that working with the iButton.
I also found some really cheap (0,50 euro) displays, so it would be nice if I also can make a screen to show me who entered when.
The project is now existing in three parts:

  1. The iButton opening the door
  2. A clock keeping track of times and dates
  3. A screen showing the information
So to keep things understandable I try first to figure out the three parts separately.
 
Remove these adsRemove these ads by Signing Up

Step 1: You will need

P1020534.JPG
Parts
  • iButton(s)
  • iButton reader
  • Arduino
  • 2 push buttons
  • power supply
  • 2 10 kOhms resistors
  • 220 Ohms resistor
  • 2,2 kOhms resistor
  • 10 kOhms potmeter
  • LCD-display with HD44780 controller
  • NPN transistor
  • relais
  • 1N4001 diode
  • some wire
  • PCB

Tools
  • soldering iron
  • solder
  • snips
  • breadboard
  • computer with Arduino software
  • a LED

tatulea says: Apr 18, 2013. 12:20 PM
Can you simplify it? I want to see just the code that give me iButton.
tatulea says: Apr 18, 2013. 6:37 AM
Which part of this code I need to copy in my sketch for i can read the iButton?
kenyer (author) says: Apr 18, 2013. 8:52 AM
This should do the job:

#include <OneWire.h>

OneWire  ds(12);
byte addr[8];
int but[6] = {0,149,107,48,13,0};
String keyStatus="";

void setup(void) {
  Serial.begin(9600);
  pinMode(13, OUTPUT);
 
}

void loop(void) {
  getKeyCode();

Serial.println("");
  if(keyStatus=="ok"){
      byte i;
      for( i = 5; i >0; i--) {
           Serial.print(" : ");
           Serial.print(addr[i], DEC);
          
      }
      if(addr[1] == but[1] && addr[2] == but[2] && addr[3] == but[3] && addr[4] == but[4]){
      digitalWrite(13, HIGH);
      delay(500);
      digitalWrite(13, LOW);}
      else {digitalWrite(13, LOW);}
  }
  else if (keyStatus!="") { Serial.print(keyStatus);}
 
  delay(1000);
}

void getKeyCode(){
  byte present = 0;
  byte data[12];
  keyStatus="";
 
  if ( !ds.search(addr)) {
      ds.reset_search();
      return;
  }

  if ( OneWire::crc8( addr, 7) != addr[7]) {
      keyStatus="CRC invalid";
      return;
  }
 
  if ( addr[0] != 0x01) {
      keyStatus="not DS1990A";
      return;
  }
  keyStatus="ok";
  ds.reset();
}

tatulea says: Apr 15, 2013. 9:38 AM
What iButton reader you used?
kenyer (author) says: Apr 15, 2013. 10:11 AM
The reader is a really simple thing. It is just one wire touching the side and one the front of the ibutton. There are no electronics or anything in the reader.
techxpert says: Sep 23, 2011. 4:29 PM
one question what's a ibutton
kenyer (author) says: Sep 24, 2011. 12:40 AM
Hi, A iButton is a kind of electronic key, that looks like a button-battery. You can see them in the picture above. Every iButton has an unique number that is written in a chip inside. The communication with the iButton goes trough the 1-Wire protocol and uses, you guessed it, only one wire. See also the site off the manufacturer: Maxim
techxpert says: May 13, 2012. 4:38 PM
thanks :)
alahamm says: Feb 1, 2012. 6:22 PM
Nice job! Sure wish I had all those tools, but I´ll settle for a translator.
nolte919 says: Jan 18, 2012. 4:11 PM
Where oh where did you find LCD displays for less than a buck??
kenyer (author) says: Jan 18, 2012. 11:39 PM
On "www.marktplaats.nl" that's a Dutch kind of Ebay. I was really lucky with them.
Cello62 says: Sep 21, 2011. 4:45 AM
Nice project and a very good instructables.
jam BD says: Sep 20, 2011. 2:21 PM
Amazing project... Nice integration and great 'ible
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!