How to Configure iButtons - lab


iButtons are connected in Colleen Burge's lab.

Step-by-step guide

  1. Introduction

    The OneWireViewer software was originally written to demonstrate the usefulness and effectiveness of the 1-Wire® application program interface (API) for Java®. The software can exercise most iButton® and 1-Wire devices through USB and serial (COM) port adapters. It is available for 32-bit and 64-bit versions of Windows® 7, Windows Server 2008, Windows Vista®, and Windows XP® (service pack 2 and greater).

    Thanks to the logger iButton devices, the OneWireViewer has gained popularity with researchers. A user interface that exercises a wide variety of iButton and 1-Wire devices is less intuitive for users focused on setting up a logger and retrieving data after a couple of weeks or months. When the OneWireViewer encounters an abnormal situation, such as logger end-of-life, finding and interpreting the error messages can be a challenge. This document explains how to find and understand error messages, and how to distinguish between a device error (e.g., caused by a drained battery) and an operator error (e.g., a software password not set). It also describes how to test for a bad battery before starting a mission, verify whether a mission was started successfully, and keep track of the logger's battery energy. The second half of this document addresses software aspects, including determining the version of the OneWireViewer and the underlying 1-Wire drivers, initial software installation, software upgrade and uninstallation, as well as changing communication ports and 1-Wire adapters.

    Types of iButton and 1-Wire Devices

    There are three types of 1-Wire products: iButton devices with a battery (loggers, NV SRAM memories, and real-time clocks (RTCs)), iButton devices without a battery (sensors, EPROMs, and EEPROMs), and 1-Wire chips (various functions with and without memory). All 1-Wire devices have a 64-bit ROM ID with built-in 8-bit cyclic redundancy check (CRC). The memory and/or control functions (everything besides the ROM function commands) can—but need not—implement schemes to safeguard data against communication errors. As Table 1 shows, the vast majority of 1-Wire devices have built-in CRC support. The presence or absence of safeguards, like CRCs, affects the OneWireViewer's abilities to detect and deal with abnormal situations when communicating with 1-Wire devices.

    Table 1. 1-Wire Devices Supported by the OneWireViewer 

    Device TypeMemory and/or Control Functions CRC Support
    Yes*No
    iButtons with Built-In BatteryDS1921 series, DS1922 series, DS1923** (Loggers)DS1904 (RTC), DS1992DS1993DS1995DS1996 (Memories)
    iButtons without BatteryDS1920 (8-bit CRC), DS1972DS1973DS1977DS1982 (8-bit CRC), DS1985DS1971
    1-Wire ChipsDS18S20 (8-bit CRC), DS1822 (8-bit CRC), DS18B20 (8-bit CRC), DS2406DS2408DS2422DS2431DS24B33DS2438 (8-bit CRC), DS2450DS2502 (8-bit CRC), DS2505DS28E04DS28EA00 (8-bit CRC), DS28EC20DS2413DS2415DS2417DS2430ADS2762

    *CRC-16 unless otherwise noted.
    **Limited support: humidity readings are not compensated for temperature nor corrected for saturation drift.

    Failure Mechanisms

    Despite their solid appearance, iButton devices are not hermetically sealed. In particular, iButton loggers are often inadvertently exposed to moisture, from condensing water from the air, from rain when the device is underground, or from water when the device is submerged. As the temperature cycles, the iButton product can actually "pump in" moisture.

    Once inside the iButton, water creates a conductive path that, over time, drains the battery. The chemical reaction between water and metal on the iButton circuit board leads to corrosion. This can cause a short between the data lid and GND, or break the path from the data lid to the chip and back to GND.

    If connected to the 1-Wire bus,
    • A device with a broken communication path does not cause any errors. The OneWireViewer will simply not find it.
    • A device with an internal short does not generate errors either. It will make all other devices disappear from the OneWireViewer's device list.
    • An iButton with a drained battery but without a short between the data lid and GND will cause a variety of error messages in the OneWireViewer. The error message depends largely on the presence or absence of CRC support.

    How Errors Are Displayed

    The OneWireViewer has two ways of notifying users about errors. The most obvious place is at the bottom of the OneWireViewer's main window (Figure 1). The less obvious place is in the error log window (Figure 2).

    Figure 1. The most obvious place for error messages is at the bottom of the main window.
    Figure 1. The most obvious place for error messages is at the bottom of the main window.

    Figure 2. The same error description in the error log file.
    Figure 2. The same error description in the error log file.

    To open the error log window, click on the View menu, and select Show Message Log, as indicated in Figure 1. Then, in the message log window, click on Level to verify that Information is check-marked.

    Typical Error Messages

    When accessing devices without CRC support, the OneWireViewer verifies the success of a write operation by reading back after write. If the data read back does not match the data written, the typical error message ends with Read back of scratchpad had incorrect data or Read back verify had incorrect data. The beginning of the message explains when the error (also referred to as the "exception") occurred.

    There are two categories of devices with CRC support: those with password security (logger iButtons of the DS1922 series, DS1923, and DS1977) and those without password security (logger iButtons of the DS1921 series, other iButtons without battery, and 1-Wire chips). In either case, the OneWireViewer determines the success of a read or write operation by reading the CRC that the 1-Wire device generates during the memory/control function command flow.

    For devices without password security, the error message ends with Invalid CRC16 read from device. The beginning of the message typically (but not always) explains when the error or exception occurred. For devices with password security, the error signaling is more complex. The message ending could be Invalid CRC16 read from device when accessing the unprotected scratchpad or Invalid CRC16 read from device. Password may be incorrect when accessing other memory areas or Invalid CRC16 read from device. Password may be incorrect or a sample may be in progress when accessing the data log memory of a logger iButton of the DS1922 series or the DS1923.