USB Reprogrammable iButton door lock

iButtons are small button like casings that communicate with only 2 wires. They are incredibly robust and all have a unique serial number which is hardware written into the device and never repeated. They are cheap (about 1 Pound / 1,50 Euro/ $2)

This serial number allows the keys to be truly unique and thus are effectively secure. I have seen them used:
>as the till logon device at bars
>in securicor money cases
>computer logins
>as secure dongles used with expensive software.
>…as door locks!

The problem with using them for the beginner, is that you have to be able to program hardware to read them and if you loose the key, the locking device is useless!

This Instructable shows you how to build a lock, and a USB programmer that enables you to write new keys to the lock in seconds, without dismantling the unit. Making the lock completely secure and updatable for up to 80 keys at a time. The lock can work on between 5-30V AC or DC and so is incredibly flexible; designed to work on the same voltage as your electronic door release – you can buy the cheapest or most expensive one you find, Fail-Locked or Fail-Unlocked, AC or DC, 12V or 24V.USB Reprogrammable iButton door lock

What you will need:
>Components (see next)
>PIC programmer
>Electronic door release.
>PCB making equipment (if you want to make it look puurdy)

This is an old instructable that I haven’t uploaded for some reason. If you have trouble building it, email me and I will happily help – however, I can’t guarantee I’ve made it as simple as possible – sorry – hopefully it’ll give inspiration if nothing else.

Step 1: The Process

Firstly you’ll need to decide which type of lock you need.

FAIL SAFE/UNLOCKED remain open when the unit looses power. This would generally be used if the door nbeeds to be accessable in the event of a power failure – e.g Fire

FAIL SECURE/LOCKED remain locked unless power is applied to the lock. These would be more appropriate when using a traditional door entry system, having the door traditionally locked at all times, unless power is applied.

Below is a flow chart to show how the device operates.
Simply, if you enter a key, the microprocessor firsts checks to see if it’s a programming key, or it’s an access key.

If it’s an [iButton] access key, the microprocessor checks against the list of known keys stored in it’s EEPROM (memory), if it finds it, it lets you in. Otherwise it will send a red-light to say that no access is granted.

If it’s a reprogrammable key of any type (e.g. an iButton with a new list of keys to store on the internal EEPROM). It will check if the ibutton is allowed to re-program the internal EEPROM but checking it’s authentication code. (This is programmed into the iButton by the USB programmer and this you can’t change – see last page for info).
If the iButton is allowed to program the internal EEPROM, the LED will flash Green/Orange and then microprocessor will pull all the key-codes off the iButton and store them to it’s internal EEPROM. This will cause the LED to flicker and could take up to 20 seconds – do not remove the key while this is happening. The LEDS will then pulse green to indicate the programming is over – now remove the iButton.

Step 2: The components

OK so the instructable is pretty easy, i give you the schematic, parts list, hex file, and you build it – simple!
I’m going to give the parts list and the Rapid Electronics ( ) part number so you can source your own supplier – although rapid is pretty good!
Heres the parts listDoor Lock

1x Bridge Rectifier (rapid# 47-3202)
1x 5v 7805 voltage regulator (rapid# 47-3313)
1x SIL relay (rapid# 60-0670)
1x 100uf cap (rapid# 10-3260)
1x 470uf cap (rapid# 11-0275)
1x 220f cap (rapid# 11-0260)
2x 1k resistor
1x 4k7 resistor
1x 16f628 PIC micro
1x 24LC04 4k eeprom (rapid# 22-0170)
1x 8pin dil holder
1x 18pin dil holder
1x DPDT mini switch (rapid# 76-0220)
1x 3pin header (rapid# 22-0515)
1x jumper (rapid# 77-0237)
2x 2pin terminal block (rapid# 21-1700)
1x Electronic release ( )
1x iButton probe with BiColour LED (MBL)(part# hc00039 )
1-80x DS1990A iButtons ( )

The USB programmer

1x 18f2550 PIC micro
1x 20MHz XTAL
2x 22pf caps (ceramic disc)
1x 220nf cap
1x 1k res
1x LED (any colour)
1x USB B-socket
1x iButton holder probe DS1402 (any will do) ( )
1x DS1973 iButton ( )

Some of the iButton hardware or buttons may be obtained free by ordering samples from (direct from maxim).USB Reprogrammable iButton door lock schematic

Step 3: Schematic and PCB for lock

Below is the schematic, the PCB and the final example photo of the lock. For a printable PCB layout, see downloads.
For a high res version of the Schematic, click the i and download the file (14kb).

PCB layouts are available on the download page.

Step 4: Schematic, PCB and photo of the programmer

below is the schematic, example PCB and photo of the final produced PCB of the USB programmer

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Follow Us: