Silicon ChipThe iButton – A Hard “Nut” To Crack - October 2005 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Valve amplifiers and self-delusion
  4. Feature: Google Earth by Ross Tester
  5. Review: NetComm NP210: Ethernet Over Power by Ross Tester
  6. Project: Dead Simple USB Breakout “Box” by Stan Swan
  7. Project: Studio Series Stereo Preamplifier by Peter Smith
  8. Project: Video Reading Aid For Vision Impaired People by Jim Rowe
  9. Project: Simple Alcohol Level Meter by John Clarke
  10. Project: Ceiling Fan Timer by John Clarke
  11. Feature: The iButton – A Hard “Nut” To Crack by Clive Seager
  12. Feature: The DS1921 iButton Datalogger by Clive Seager
  13. Salvage It: A $5 2-channel vibration sensor by Julian Edgar
  14. Book Store
  15. Vintage Radio: The Harbros 12/54B transceiver by Rodney Champness
  16. Advertising Index
  17. Outer Back Cover

This is only a preview of the October 2005 issue of Silicon Chip.

You can view 41 of the 112 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Studio Series Stereo Preamplifier":
  • 4-Output Universal Regulator PCB [18105151] (AUD $5.00)
  • PCB pattern for the Studio Series Preamplifier power supply (PDF download) [01109052] (Free)
  • Studio Series Stereo Preamplifier main PCB [01109051] (AUD $20.00)
  • Studio Series Stereo Preamplifier Main PCB pattern (PDF download) [01109051] (Free)
Articles in this series:
  • Studio Series Stereo Preamplifier (October 2005)
  • Studio Series Stereo Preamplifier (October 2005)
  • Studio Series Stereo Headphone Amplifier (November 2005)
  • Studio Series Stereo Headphone Amplifier (November 2005)
  • Studio Series Remote Control Module (April 2006)
  • Studio Series Remote Control Module (April 2006)
Items relevant to "Video Reading Aid For Vision Impaired People":
  • Video Reading Aid PCB pattern (PDF download) [02110051] (Free)
  • Video Reading Aid front panel artwork (PDF download) (Free)
Items relevant to "Simple Alcohol Level Meter":
  • Bilge Sniffer/Alcohol Meter PCB [05109051] (AUD $10.00)
  • RBT BAC Checker/Bilge Sniffer PCB pattern (PDF download) [05109051] (Free)
Items relevant to "Ceiling Fan Timer":
  • PIC16F88 firmware and source code for the Fan Timer [fantimer.hex] (Software, Free)
  • Fan Timer PCB pattern (PDF download) [10110051] (Free)
  • Fan Timer front panel artwork (PDF download) (Free)
Items relevant to "The iButton – A Hard “Nut” To Crack":
  • PICAXE-08M BASIC source code for the iButton reader (Software, Free)

Purchase a printed copy of this issue for $10.00.

o t t u B i Drop it, step on it, scratch it . . . the iButton is a hard ‘nut’ to crack! The iButton family of devices feature silicon chips armoured within 16mm stainless steel cans. Here we describe the basics of these unique devices and then show you how to build a simple PICAXE-based project to read their serial numbers! By Clive Seager* T HE iBUTTON FAMILY consists of over 20 different products, including devices that contain memory, temperature sensors, data loggers and even Java computers. Every iButton produced (to date over 100 million) has a unique silicon serial number. This feature makes the iButton ideal for use in automatic identification systems. In fact, the simplest member of the family, the DS1990A Serial Number iButton, is designed specifically for identification tasks. Like all devices, An assembled PICAXE iButton reader board, complete with iButton probe & piezo sounder. Although not visible here, the probe has an LED in its centre for visibility at night. its 64-bit serial number is guaranteed to be unique and therefore traceable. iButton serial numbers are also laser engraved on the outsides of the cans so that human eyes can read them! Owing to the small size and robust nature of the iButton package, it can travel with a person or object to provide many useful functions, including access control, environmental monitoring and data storage. The stainless steel button is durable enough to be worn everyday on an accessory like a ring, key fob, wallet, watch, metal card or badge. It is also water resistant and so can be worn while washing or swimming. The information in an iButton can be accessed by tapping it against a simple dual-contact metal probe connected to an electronic reader circuit. This type of metal probe is much cheaper and more durable than a magnetic swipe or “smart-card” reader and the iButton itself can have a much larger memory capacity. iButton technology is also cheaper than radio frequency style ID cards (RFID). Inside an iButton The electronics inside an iButton connects to the outside world via the base and lid of the metal can, which are electrically isolated from one another by a polypropylene grommet. When an iButton is momentarily touched against a probe, the side makes a ground connection and the lid (face) makes a power/data connection. In a fraction of a second, the iButton accumulates sufficient energy from the reader to power its circuits. It then communicates with the reader over the * About the author: Clive Seager is the Technical Director of Revolution Education Ltd, the developers of the PICAXE system. 86  Silicon Chip siliconchip.com.au n o Fig.1: here’s the circuit diagram for the reader. The data line from the iButton probe is connected to input 4 of the PICAXE microcontroller (IC1), with power to the probe provided by a 4.7kW pull-up resistor. The transistor (TR1) can be used to drive an external relay when a valid iButton serial number is detected. same connection, providing its serial number and more, depending on the type of device. For obvious reasons, Dallas refers to this ultra-simple power and data connection method as a “1-Wire” interface. The relatively complex communications protocol used over the interface is known as the 1-Wire protocol. Communications speed is 16kbps in “standard” mode and 142kbps in “overdrive mode”. The iButton can transmit a surprisingly amount of information in a relatively short time. In fact, it is almost impossible to tap an iButton against a probe quicker than the time required by the iButton to transmit its serial number. This makes the iButton an ideal device for applications such as locks where operation must appear to be virtually instantaneous. As the 1-Wire interface provides power to the iButton, most devices siliconchip.com.au Here’s what’s inside an iButton can! do not require an internal battery. Together with their robust steel casing, this makes for a product with a very long life span. PICAXE iButton reader Due to the complexity of the 1-Wire protocol, iButton readers are typically microcontroller based and this is where our PICAXE project for this month comes in. Using the PICAXE BASIC command readowsn (for read The kit includes one DS1990A iButton and a plastic fob which are easily snapped together. October 2005  87 Fig.2: use this diagram as a guide when assembling the reader. Don’t forget to install a wire link between the two “+” holes at J1 and double-check the orientation of IC1, D1, TR1 and the battery leads. Par t s Lis t For iButton Reader 1 AXE109 PC board 1 3.5mm stereo socket (CT1) 3 2-way terminal blocks (CT2CT4) 1 4-pin 2.54mm-pitch SIL header 1 8-pin IC socket 1 100nF polyester capacitor 1 piezo sounder 1 battery clip 1 3 x AA battery holder 1 plastic iButton holder 1 DS9092L iButton probe with LED Semiconductors 1 PICAXE-08M (IC1) 1 1N4001 diode (D1) 1 BC548 transistor (Q1) 1 DS1990A Serial Number iButton Resistors (0.25W 5%) 2 10kW 1 4.7kW 1 330W 1 1kW 1 22kW Also required (not in kit) PICAXE Programming Editor software (v4.1.0 or later) PICAXE download cable (part no. AXE026) 3 x AA alkaline cells Here’s what the assembled PC board look like. As shown, the C2 component position on the board is left vacant. one-wire serial number), users can read the unique serial number from an iButton with the aid of a very simple circuit and without detailed technical knowledge of the protocol. The circuit for the PICAXE-08M iButton reader appears in Fig.1. As shown, the circuit could be used to drive a solenoid type lock (via a relay) but is probably more suitable for use as a building block within more complex circuits. PICAXE enthusiasts will find the circuit quite straightforward. The 1-Wire bus from the iButton probe connects to input 4, with power to the bus provided by the 4.7kW resistor to 4.5V. An optional external push-button switch can be connected to input 3 to allow for manual activation in a door lock application. A transistor (TR1) driven from output 1 provides an open-collector output that can be used to drive an external relay. Diode D1 across the output terminals limits the back-EMF spike generated during relay switching. As mentioned, the relay could be used to power a solenoid type door lock. Alternatively, the transistor output could be used to trigger a circuit of your own creation. All that remains to be mentioned are the piezo sounder and LED outputs, which are connected to output 2 and output 0, respectively. Note that the LED is incorporated in the centre of the iButton probe housing (supplied in the kit) to provide an aiming point during night-time use. As with most PICAXE projects, the circuit must be powered from a 4.5V battery pack or regulated 5V DC supply. Assembling the reader The simplicity of this design makes for a very simple PC board layout with few parts, so assembly is very straightforward. Using the overlay diagram in Fig.2 as a guide, begin by installing the resistors, diode (D1) and IC socket for the PICAXE-08M (IC1). Take particular care that the notch in the IC socket matches that shown on the diagram. This will be used as a guide when plugging in the PICAXE chip, which also has a notch on one end. Also note that the cathode (banded) end of the diode (D1) must iBUTTON Obtaining Kits & Software The design copyright for this project is owned by Revolution Education Ltd. Complete kits (part no. AXE109) for this project are available from authorised PICAXE distributors – see www.picaxe. com.au or phone Microzed on (02) 4351 0886. The PICAXE Programming Editor software can be downloaded free of charge from www.picaxe.co.uk or ordered on CD (part no. BAS805). 88  Silicon Chip CONNECTING WIRES TO READER WOODEN OR MOULDED PLASTIC BASE TWO PAPER CLIPS BENT TO MAKE THE CONTACTS Fig.3: it’s easy to make your own probe for experimental purposes using a pair of paper clip “contacts” anchored to a wooden or epoxy resin base. siliconchip.com.au iButton At The Big Idea Exhibition An iButton can be attached to a plastic card and used for access control instead of magnetic stripe technology. There’s no traditional key slot in this door handle – just a probe to accept an iButton for user identification! be oriented as shown. Use one of the resistor lead off-cuts to make a link (J1) between the two pads marked “+”. Following that, install the 100nF capacitor and transistor TR1, noting that the flat side of the transistor must face the capacitor. All of the connectors (CT1-CT4) can go in next. You may find that the kit includes one 2-way and one 4-way screw-terminal block. The 4-way terminal block is easily converted into two 2-way blocks simply by snapping (or sliding) it apart! Push the stereo socket (CT1) down firmly so that it snaps into place before soldering. The final step is to install a 4-way single-in-line (SIL) header strip for connection to the iButton probe. This is probably supplied in a 10-way strip in the kit but is easily cut down to the correct length with a sharp knife or side cutters. The battery clip and piezo sounder can now be connected to the board. It is crucial that the battery leads are connected around the right way; otherwise, the PICAXE chip will be destroyed at power up! To reiterate, siliconchip.com.au Mechanisms exhibit at The Big Idea exhibition (photograph © Revolution Education Ltd 2000). T   he Big Idea is a permanent £13 million ($A31 million) technology millennium exhibition, located on the site of Alfred Nobel’s dynamite factory in Ardeer, Scotland. It is essentially a giant inventors’ workshop, with a large number of hands-on exhibits explaining the principle themes of technology and invention to children. The Big Idea uses a custom iButton tracking system developed by The visitor's iButton tag activates Revolution Education Ltd. On entry to the various exhibits. (photograph the exhibition, each visitor is given an © Revolution Education Ltd 2000) iButton tag housed in a plastic key fob. At the same time, the visitor’s name and postcode is entered into the computer system, along with their unique iButton serial number. As the visitor moves around the exhibition, the iButton tag is used to activate the various exhibits. At the interactive computer screens, the visitor is welcomed by name when the iButton is touched, whereas at the physical exhibits, the iButton activates the exhibit and sets a timeout period. One of the many unique features of The Big Idea is that each visitor is given an inventor’s pack to build and take away. These packs are dispensed by a vending machine, once again triggered with the touch of an iButton. Each time a visitor’s iButton is used, the time and location are logged by a computer system. This is used to create a personal “certificate of achievements”, which is available for collection at the end of the day. October 2005  89 Listing 1 main: let b6 = 0 low 0 low 1 loop: toggle 0 if pin3 = 0 then open pause 250 readowsn 4 if b6 <> 0 then test goto loop 'reset family code to 0 'LED off 'output off 'LED on or off 'switch pushed? ‘wait 'read serial number on input4 'ibutton detected ' iButton detected so check serial number, ' if wrong number then jump back to start test: sound 2,(50,50) high 0 if b13 <> $FA then main if b12 <> $00 then main if b11 <> $00 then main if b10 <> $0B then main if b9 <> $23 then main if b8 <> $A1 then main if b7 <> $00 then main if b6 <> $01 then main Above & below: iButtons can be attached to almost anything given the appropriate holder. 'beep 'probe LED on 'modify all of these 'to match your unique 'iButton serial number! ' Everything is OK so switch output on for 5 secs open: sound 2,(100,50) high 1 high 2 pause 5000 goto main 'beep 'LED on 'output on 'wait 5 seconds the red wire from the clip goes to ‘V+” and the black wire to “0V”. As you can see from the diagram and photos, the piezo leads can be threaded through the adjacent corner hole before soldering to provide strain relief. PICAXE program The BASIC program in Listing 1 shows how easy it is to read an iButton serial number using the PICAXE08M. When a valid serial number is returned by the readowsn command, it is compared with a predefined 16-digit (8-byte) number. If the numbers match, the transistor is switched on for five seconds and the piezo generates a two-tone sound. If not, a single tone is generated instead and the program loops back to the start. 90  Silicon Chip Finally, the toggle command is used to flash the LED in the centre of the iButton probe, allowing you to find it in the dark of night! Note that you must alter the serial number values where indicated to match the unique code that is laser engraved in “2-12-2” format on the face of your iButton. For example, the iButton used with the program in Listing 1 would be engraved like this: FA   01 00000B23A100 Each unique code uses the hexadecimal digits 0-9 and A-F. Do not confuse D with 0 or B with 8! Making your own probe As described earlier, the two connections necessary for iButton operation (power/data and ground) are made with a purpose-built probe. Although off-the-shelf probes are readily available, it’s a relatively simple matter to make your own for experimental purposes. As shown in Fig.3, a pair of paper clip “contacts” could be anchored to a base such as wood or epoxy, for example. However, if you have a serious application in mind, you will probably want to purchase the kit for this project as it includes a professional quality probe with an embedded LED (see photo). Want more information? The iButton is an interesting lowcost technology that can be incorporated into numerous projects. By modifying the circuit provided, the iButton can become the “key” to many exciting projects! Detailed information about the iButton range is available from the Dallas Semiconductor/Maxim website SC at www.iButton.com siliconchip.com.au