thumb|right|350px|An in a plastic fob, as used for Istanbul [[Akbil (smart ticket)|Akbil smart ticket]]
thumb|right|200px|A Java ring with an embedded
1-Wire is a wired half-duplex serial bus designed by Dallas Semiconductor that provides low-speed (standard 16.3 kbit/s; "overdrive" at 10×) data communication and supply voltage over a single conductor.
1-Wire is similar in concept to I<sup>2</sup>C, but with lower data rates and longer range. It is typically used to communicate with small inexpensive devices such as digital thermometers and weather instruments. A network of 1-Wire devices with an associated master device is called a MicroLAN. The protocol is also used in small, 16 mm electronic keys known as a Dallas key or .
One distinctive feature of the bus is the possibility of using only two conductors — data and ground. To accomplish this, 1-Wire devices integrate a small capacitor (~800pF) to store charge, which powers the device during periods when the data line is active.
Usage example
1-Wire devices are available in different packages: integrated circuits, a TO-92-style package (as typically used for transistors), and a portable form called an or Dallas key which is a small stainless-steel package that resembles a watch battery. Manufacturers also produce devices more complex than a single component that use the 1-Wire bus to communicate.
1-Wire devices can fit in different places in a system. It might be one of many components on a circuit board within a product. It also might be a single component within a device such as a temperature probe. It could be attached to a device being monitored. Some laboratory systems connect to 1-Wire devices using cables with modular connectors or CAT-5 cable. In such systems, RJ11 (6P2C or 6P4C modular plugs, commonly used for telephones) are popular.
Systems of sensors and actuators can be built by wiring together many 1-Wire components. Each 1-Wire component contains all of the logic needed to operate on the 1-Wire bus. Examples include temperature loggers, timers, voltage and current sensors, battery monitors, and memory. These can be connected to a PC using a bus converter. USB, RS-232 serial, and parallel port interfaces are popular solutions for connecting a MicroLan to the host PC. 1-Wire devices can also be interfaced directly to microcontrollers from various vendors.
are connected to 1-Wire bus systems by means of sockets with contacts that touch the "lid" and "base" of the canister. Alternatively, the connection can be semi-permanent with a socket into which the clips, but from which it is easily removed.
<!--The Java Ring is a ring-mounted with a Java virtual machine that is compatible with the specification. These were given to attendees of the 1998 JavaOne conference.-->
<!--I feel that this was only kinda relevant to the article, and them being handed out at a Java conference was likely not so-->
Each 1-Wire chip has a unique identifier code. This feature makes the chips, especially , suitable electronic keys. Some uses include locks, burglar alarms, computer systems, manufacturer-approved accessories, time clocks and courier and maintenance keys for smart safes.
have been used as Akbil smart tickets for the public transport in Istanbul. They can also run smartcard programs such as Java Card 2.0, as exemplified by the "Java Ring" of 1998.
Power supplies
Apple MagSafe- and MagSafe-2-connector–equipped power supplies, displays, and Mac laptops use the 1-Wire protocol to send and receive data to and from the connected Mac laptop, via the middle pin of the connector. Data include power supply model, wattage, and serial number; and laptop commands to send full power, and illuminate the red or green light-emitting diodes in the connector.
Dell laptop power supplies use the 1-Wire protocol to send data via the third wire to the laptop computer about power, current and voltage ratings. The laptop will then refuse charging if the adapter does not meet requirements.
Communication protocol
In any MicroLan, there is always one master in overall charge, which may be a personal computer or a microcontroller. The master initiates activity on the bus, simplifying the avoidance of collisions on the bus. Protocols are built into the master's software to detect collisions. After a collision, the master retries the required communication.
A 1-Wire network is a single open drain wire with a single pull-up resistor. The pull-up resistor pulls the wire up to 3 or 5 volts. The master device and all the slaves each have a single open-drain connection to drive the wire, and a way to sense the state of the wire. Despite the "1-Wire" name, all devices must also have a second conductor for a ground connection to permit a return current to flow through the data wire. Communication occurs when a master or slave briefly pulls the bus low, i.e., connects the pull-up resistor to ground through its output MOSFET. The data wire is high when idle, and so it can also power a limited number of slave devices. Data rates of 16.3 kbit/s can be achieved. There is also an overdrive mode that speeds up the communication by a factor of 10. Specific 1-Wire driver and bridge chips are available. Universal Serial Bus "bridge" chips are also available. Bridge chips are particularly useful to drive cables longer than 100 m. Up to 300-meter twisted pairs, i.e., telephone cables, have been tested by the manufacturer. These extreme lengths require adjustments to the pull-up resistances from .). The search algorithm can be implemented in an alternative form, initially searching paths with address bits equal to 1, rather than 0. In this case, inverting the 56 address bits and then reversing them yields the order of discovery.
The location of devices on the bus is sometimes significant. For these situations, a microcontroller can use several pins, or the manufacturer has a 1-Wire device that can switch the bus off or pass it on. Software can therefore explore sequential bus domains. 0x01 (DS2401 silicon serial number), or 0x2D (DS2431 1 kbit EEPROM).
Various people have created online databases of family codes from the broad range of 1-Wire memory, authenticator, ID, and battery-monitor devices.
Example communication with a device
The following signals were generated by an FPGA, which was the master for the communication with a DS2432 (1 kbit EEPROM with SHA-1 Engine) chip, and measured with a logic analyzer. A logic high on the 1-Wire output, means the output of the FPGA is in tri-state mode and the 1-Wire device can pull the bus low. A low means the FPGA pulls down the bus. The 1-Wire input is the measured bus signal. On input sample time high, the FPGA samples the input for detecting the device response and receiving bits.
File:1-Wire-Protocol.png
Development tools
When developing and/or troubleshooting the 1-Wire bus, examination of hardware signals can be very important. Logic analyzers and bus analyzers are tools that collect, analyze, decode, and store signals to simplify viewing the high-speed waveforms.
See also
- SDI-12, a single data wire communications scheme
- Single-wire transmission line, a technique for electric power transmission with only "1 wire" without a ground return wire path
- Touch memory
References
External links
- 1-Wire Device
- Accessing, Reading, and Writing to 1-Wire devices using a UART
- Using a UART to Implement a 1-Wire Bus Master
- iButton, iButtonLink
- Guidelines for Reliable Long Line 1-Wire Networks
- Choosing the Right 1-Wire Master for Embedded Applications
- OWFS — 1-Wire file system for Linux
- Guides to working with 1-Wire, for programmers and engineers
- Getting 1-Wire sensors working in Linux using OWFS
- 1-wire Arduino tutorial
- Guide to writing software for 1-Wire/ MicroLan using Lazarus, "the free Delphi".
