Skip Navigation

www.wimb.net - iButton Reader

iButton Reader While I was searching in one of my junk boxes, I saw an old battery; at least it looked like a battery. After a close examination it turned out to be an "iButton" type number: DS1990A-F4, made by Dallas.

After reading the PDF manuals on Internet, I decided to make a small interface with a Delphi program to see if the iButton was still readable. Well, it works!

Scan of the iButton

The iButton

An iButtonTM is a chip housed in a stainless steel enclosure. The electrical interface is reduced to the absolute minimum, i.e., a single data line plus a ground reference. The energy needed for operation is "stolen" from the data line ("parasitic power"). The logical function of the DS1990A is a simple serial number. This globally unique registration number is common to all iButtons.

For read operations all devices are satisfied with a 5kOhm pull-up resistor to supply energy and to terminate the 1-Wire bus.

Main Screen of the iButton Reader

Main Screen

The program uses a single screen. See the description below.



Menu - Exit :

To stop the program.

Menu - RS232 :

Comport select. The Baudrate is set internal. Changing start and stop bits may disturb the functioning of the program.

Menu - Help :

The help file with about the same content as this page.

DTR/CTS

Here the two output pins on the RS232 connector can be switched on and off.

Reset

To send the reset pulse and to detect the presence of the iButton. The received field shows the response. Without an iButton detected, it will show $F0, when the iButton sends a response, it will be $E0 because the 0 is made longer by the iButton.

Read Button

The hexadecimal command $33 is send and the response is shown in the edit box.

Statusbar

Shows the RS232 settings, the available ComPorts and can you connect to www.wimb.net.

Adapter Construction

Component side of the Adapter

To adapt the RS232 signal levels to the 1-Wire bus you need a small adapter. See the images below. It's built on a small part of a prototyping board that is hold by the connector pins. Most parts are SMD, but there are also a few discrete resistors.

The board has also a LED that is controlled by Pin 4 and Pin 7 of the RS232 connector. This LED has no use for the 1-Wire adapter, but it shows that the adapter is controlled by the program.

More about the construction, including the diagram can be found in the electronics section.

The principal routines

The program uses a few special routines for the communication with the iButton.

SendResetClick(Sender: TObject);

This sends a reset pulse to activate the "iButton". When an "iButton" is powered on then it will generate a pulse direct after the reset.

ReadBytesFrom_1_Wire(cmd: byte; nbr: integer);

This send a command byte (cmd) and then is pulls out the specified number of bytes (nbr)

SendByteTo_1_Wire(b : byte; del: integer);

To send bit by bit a one byte command.



Timing

All timing can be found in the datasheets and on the Maxim / Dallas website. The main problem I had was that I did not direct understand that the "iButton" does not send any data; the data has to be pulled out bit by bit. During a "one", the iButton does nothing. During a zero, it holds the dataline low for some microseconds. To read 64 bytes, you have to send 64 one's and then the iButton modifies these one's to zero's

Detect

Reset pulse from the adapter with the response of the iButton The reset or detect pulse is to see if an iButton is present. Without an iButton the pulse is 530µS long. When the iButton is connected, then this iButton makes the line low for 120µS after the line was put back high by the adapter.

The photo shows the detect pulse with the response from the iButton.

Data Read Request

Data read pulses without response With the "Send$33" button the serial number of the iButton is read. The photo on the right shows 2 of the 64 pulses with a width of 18µS.

Clicking on a photo brings up a popup window with a larger photo that contains the timing information.

Reading Data

Data read pulses with iButton response With the iButton connected the pulses sent by the adapter are kept low by the iButton for about 14 µS. The pulse time then changes from 18µS to 32µS.

The photo shows the one normal read pulse and one that is kept low by the iButton.

Installation

The program file and the help file can be copied to any convenient place on a Windows computer. When you want to compile the source code then for the RS232 communication the TComPort component is needed.

TComPort

ComPortComdataPacketComComboBoxComRadioGroupComLedComTerminal

This Program uses the excellent TComPort component made by Dejan Crnila. The ComPort component can be found at http://sourceforge.net/projects/comport/

Program DownloadSource Code DownloadHelp Files DownloadNo Data Files
PID: 2029 CLT: 0.003 LMD: 2013-Aug-17

Updated 2007 Oct. 09