Home > Projects > Home Automation Projects > The iButton garage-door opener using an Arduino

The iButton garage-door opener using an Arduino

Summary of The iButton garage-door opener using an Arduino


This article details a DIY project creating an iButton garage door opener and logger using an Arduino. The system integrates three main components: an iButton reader to trigger the door, a clock mechanism for tracking entry times, and an LCD display to show user data. The author describes sourcing cheap parts, wiring the 1-Wire communication protocol, and safely interfacing the Arduino with the garage door's 21V DC circuit via a relay and transistor.

Parts used in the iButton Garage Door Opener:

  • 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
  • wire
  • PCB

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.

Arduino iButton garage-door opener
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.

Step 1: You will need

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

Step 2: IButton opening the door

Start playing with it
So I bought the parts. Now I had to find out how the things work. Trough the Arduino-site (www.arduino.cc) I found the “Fridzing” drawing on http://tushev.org/articles/electronics/42-how-it-works-ds18b20-and-arduino. I also found the 1-Wire library there. 1-Wire is the name of the communication method used by the iButtons.
With this drawing and the library it was easy to wire everything and get it running.

How to wire up
According to the schematics, I took my Arduino, a breadboard, the iButton reader, a 2,2 kOhms resistor, three wires and a LED.
I wired it a little bit different than the drawing. My iButton reader had only two wires.

  • a wire from 5V on the Arduino to the + lane on the breadboard
  • the resistor from the + lane to the first lane on the breadboard
  • a wire from the first lane (where also the resistor is) to pin 2 on the Arduino
  • the grey wire of the iButton reader to the first lane of the breadboard
  • the black wire of the iButton reader to the – lane of the breadboard
  • a wire from the – lane to the GND of the Arduino
  • put the LED with the long leg (anode) in pin 13 of the Arduino and the short leg (cathode) in GND

Now I run the sketch (code) like shown in iButton.pde and entered the code like it is shown in small letters on the iButton.

To be able to run this sketch, I first have to download the library from the site shown above and put this in the [library] folder in the [Arduino] folder. If you don’t have a [library] folder in your [arduino] folder, you should make one. Next you have to restart the Arduino program for it to know the new library is there. (trust me, if you don’t restart the program, you can try, and try, and try, but it will not work)

If I put the right iButton in the reader, the LED will light up for a short moment. If I put in the wrong iButton the LED won’t light up.
The first part is working now. If I connect pin 13 to a relays in stead of a LED and I connect that relays to the button that open my garage door, my garage door will probably open.

Step 3: The garage door

Before I went any further I first wanted to check wether the button opening my garage really worked by just connecting two wires. To be sure that I didn’t kill myself, I first measured how much volts are going trough the button. I simply removed the button from the wall and put my multimeter on the two screws on the back. I had a reading of 21 V DC, so that might bite, but probably won’t kill me if I accidentally touch it.
Now I simply connected the two screws with a piece of wire and the door opened.

Arduino iButton garage-door opener circuit

Adding the relay

My theory worked so now it was time to add the relay to my design. On the “Fritzing” drawing you can see how I did that.
I moved the iButton to port 12 to make more room on the Arduino to ad the clock and the LCD later on.
The Arduino will switch the transistor (I used a BC338 that I had laying around, but any 5V NPN general purpose will probably do) and the transistor will switch the relay. The green wires going from the relay will be connected to the screws on the back of the button that opens the garage.
The diode should be there to help the relay. (I’m not sure why anymore, but just put it there, the relay will live longer)

Major Components in Project
  • iButton(s)
  • iButton reader
  • Arduino
  • LCD-display with HD44780 controller
  • NPN transistor

 

For more detail: The iButton garage-door opener using an Arduino

Quick Solutions to Questions related to iButton Garage Door Opener:

  • How do I connect the iButton reader to the Arduino?
    Connect a wire from 5V to the breadboard positive lane, place a 2.2k resistor between that lane and the first lane, connect pin 2 to that first lane, attach the grey reader wire to the first lane, and connect the black reader wire to the negative lane and GND.
  • What happens if I insert the wrong iButton into the reader?
    If you put in the wrong iButton, the LED connected to pin 13 will not light up.
  • Does the Arduino directly control the garage door motor?
    No, the Arduino switches an NPN transistor which then switches a relay; the relay connects to the screws on the back of the existing wall button to open the door.
  • Why is a 1N4001 diode included in the circuit?
    The diode is placed near the relay to help it and ensure the relay lives longer, though the specific electrical reason is noted as uncertain by the author.
  • Can I use any NPN transistor for this project?
    The author used a BC338 but states that any 5V NPN general purpose transistor will probably work.
  • What voltage does the garage door button operate at?
    The author measured the button circuit and found it operates at 21 V DC.
  • Where should I store the required library files?
    You must download the 1-Wire library and place it in the [library] folder inside your [arduino] folder.
  • Do I need to restart the Arduino software after adding a library?
    Yes, you must restart the Arduino program for it to recognize the new library, otherwise the code will not work.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top