Blog entry 008 is not working… so here is 009

I installed electronic lock with Dallas (Maxim) i-Button chips. It was very simple, low security version of electronic lock as it uses DS1990A chips as the keys. Original lock was made using PIC mcu (the smallest available) and 24C16 serial eprom to store key numbers. I programmed the lock and read chip contents. I found same numbers in eprom as numbers engraved on key. After reading the datasheet I discovered that these chips are not good for real security keys as they don’t have any security features. It is simple serial rom with CRC, and only nice feature that it is using one wire for data and power transfer.

I decided to make few experiments with these i-button chips and to write so software for AVR. The problem is, that there are lots of software for 1 wire protocol, but most of software is based on commercial AVR C compiller with build in 1 wire functions. I am using free GNU C compiler and I need to find software for all 1 wire stuff. I spent few hours searching internet and at last I found it.

The hardware is very simple- I used my AVR USB board with LCD module. I connected i-Button to my “firmware” jumper. The only modification is 4.7K pull-up resistor.

i-button avr

The LCD module is displaying various information about connected i-Button. Top left corner is status. Possible information: OPEN, SHORT, OK and ERROR. Top-right is CRC read from chip. In source there is CRC recalculation routine to check it (untested). Bottom left: device family id. And last and longest number is 48bit device serial number. Same as number on the metal can of the chip.

i-button avr

Source code:

There are more functions in source code. I am using only minimal set of possible features.

Now you can build your own security lock, the only problem is, that Dallas ID chips are not secure. I think it is possible to build emulator for Dallas i-button chip and program other serial number. Dallas is not responsible for this as this chip is not intended to use as the key:

The DS1990A Serial Number iButton is a rugged data carrier that serves as an electronic registration number for automatic identification.
…allowing the DS1990A to be used easily by human operators. Accessories permit the DS1990A iButton to be mounted on almost any object, including containers, pallets, and bags.

I think that this “commercial” lock is cheap alternative for very low security door lock.

About Administrator

I am owner of this site.
This entry was posted in Anything, MCU and tagged , . Bookmark the permalink.

4 Responses to ATMEGA USB 009

  1. Patrick McGoldrick says:

    I have one of those ibutton keys for my Condo. Could you tell me what hardware I need to buy to wire up your example?

    I just want to play. I have a CS degree and ususally run linux. So anything special I need to know about configuring GCC?

  2. All hardware is described in previous posts. Check this:

    All you need is some MCU form Atmel’s 8 bit AVR range, any industry standard alphanumeric LCD and few external pasive components.

    The software is straight out of the box. For windows it is winavr package and for Linux (I am using Debian) is and few other from same source.

  3. AYOUB says:


    Can i have the diagram and the hex files for this project i have the same one for my homework please

  4. Check this:

    i-button is connected to PB3. Add some pull-up. BTW, it is mentioned in source file about connection.

    #define OW_PIN PB3
    #define OW_IN PINB
    #define OW_OUT PORTB
    #define OW_DDR DDRB

    more info on original, Lithuanian page:

    Also, sorry no hex file as… you must do it by yourself, also, I am to lazy recompile it, 5 years passed from the posting of the message.

Leave a Reply

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