1-Wire
   HOME

TheInfoList



OR:

1-Wire is a
wired Wired may refer to: Arts, entertainment, and media Music * ''Wired'' (Jeff Beck album), 1976 * ''Wired'' (Hugh Cornwell album), 1993 * ''Wired'' (Mallory Knox album), 2017 * "Wired", a song by Prism from their album '' Beat Street'' * "Wired ...
half-duplex A duplex communication system is a point-to-point system composed of two or more connected parties or devices that can communicate with one another in both directions. Duplex systems are employed in many communications networks, either to allow ...
serial
bus A bus (contracted from omnibus, with variants multibus, motorbus, autobus, etc.) is a motor vehicle that carries significantly more passengers than an average car or van, but fewer than the average rail transport. It is most commonly used ...
designed by Dallas Semiconductor that provides low-speed (16.3 kbit/s)
data communication Data communication, including data transmission and data reception, is the transfer of data, transmitted and received over a point-to-point or point-to-multipoint communication channel. Examples of such channels are copper wires, optic ...
and supply voltage over a single conductor. 1-Wire is similar in concept to I2C, but with lower data rates and longer range. It is typically used to communicate with small inexpensive devices such as digital
thermometer A thermometer is a device that measures temperature (the hotness or coldness of an object) or temperature gradient (the rates of change of temperature in space). A thermometer has two important elements: (1) a temperature sensor (e.g. the bulb ...
s and weather instruments. A network of 1-Wire devices with an associated
master Master, master's or masters may refer to: Ranks or titles In education: *Master (college), head of a college *Master's degree, a postgraduate or sometimes undergraduate degree in the specified discipline *Schoolmaster or master, presiding office ...
device is called a MicroLAN. The protocol is also used in small 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 In electrical engineering, a capacitor is a device that stores electrical energy by accumulating electric charges on two closely spaced surfaces that are insulated from each other. The capacitor was originally known as the condenser, a term st ...
(~800 pF) 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 circuit An integrated circuit (IC), also known as a microchip or simply chip, is a set of electronic circuits, consisting of various electronic components (such as transistors, resistors, and capacitors) and their interconnections. These components a ...
s, a
TO-92 The TO-92 is a widely used style of semiconductor package mainly used for transistors. The case is often made of epoxy or plastic, and offers compact size at a very low cost. History and origin The JEDEC TO-92 descriptor is derived from the ori ...
-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 connector A modular connector is a type of electrical connector for cords and cables of electronic devices and appliances, such as in computer networking, telecommunication equipment, and audio headsets. Modular connectors were originally developed fo ...
s 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 Temperature is a physical quantity that quantitatively expresses the attribute of hotness or coldness. Temperature is measurement, measured with a thermometer. It reflects the average kinetic energy of the vibrating and colliding atoms making ...
loggers, timers,
voltage Voltage, also known as (electrical) potential difference, electric pressure, or electric tension, is the difference in electric potential between two points. In a Electrostatics, static electric field, it corresponds to the Work (electrical), ...
and current sensors, battery monitors, and
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembe ...
. These can be connected to a PC using a bus converter.
USB Universal Serial Bus (USB) is an industry standard, developed by USB Implementers Forum (USB-IF), for digital data transmission and power delivery between many types of electronics. It specifies the architecture, in particular the physical ...
,
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such as a compu ...
serial, and
parallel port In computing, a parallel port is a type of interface found on early computers ( personal and otherwise) for connecting peripherals. The name refers to the way the data is sent; parallel ports send multiple bits of data at once (paralle ...
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. 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 Public transport in Istanbul comprises a bus network, various Rail transport, rail systems, funiculars, and sea, maritime services to serve the more than 15 million inhabitants of the city spread over an area of . History Public road transpor ...
.


Power supplies

Apple
MagSafe MagSafe is a series of proprietary magnetically attached power connectors developed by Apple Inc. for Mac laptops. Apple also uses the MagSafe name for MagSafe Attach, a wireless power transfer and accessory-attachment feature for the iPhone ...
- 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 diode A light-emitting diode (LED) is a semiconductor device that emits light when current flows through it. Electrons in the semiconductor recombine with electron holes, releasing energy in the form of photons. The color of the light (corre ...
s in the connector. Genuine
Dell Dell Inc. is an American technology company that develops, sells, repairs, and supports personal computers (PCs), Server (computing), servers, data storage devices, network switches, software, computer peripherals including printers and webcam ...
laptop power supplies use the 1-Wire protocol to send data via the third wire to the
laptop computer A laptop computer or notebook computer, also known as a laptop or notebook, is a small, portable personal computer (PC). Laptops typically have a Clamshell design, clamshell form factor (design), form factor with a flat-panel computer scree ...
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 Master, master's or masters may refer to: Ranks or titles In education: *Master (college), head of a college *Master's degree, a postgraduate or sometimes undergraduate degree in the specified discipline *Schoolmaster or master, presiding office ...
in overall charge, which may be a
personal computer A personal computer, commonly referred to as PC or computer, is a computer designed for individual use. It is typically used for tasks such as Word processor, word processing, web browser, internet browsing, email, multimedia playback, and PC ...
or a
microcontroller A microcontroller (MC, uC, or μC) or microcontroller unit (MCU) is a small computer on a single integrated circuit. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable input/output peripherals. Pro ...
. 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 In electronic logic circuits, a pull-up resistor (PU) or pull-down resistor (PD) is a resistor used to ensure a known state for a signal. More specifically, a pull-up resistor or pull-down resistor ensures that a wire will have a high logic lev ...
. 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. A short 1-Wire bus can be driven from a single digital I/O pin on a microcontroller. A
universal asynchronous receiver-transmitter A universal asynchronous receiver-transmitter (UART ) is a peripheral device for asynchronous serial communication in which the data format and transmission speeds are configurable. It sends data bits one by one, from the least significant to ...
(UART) can also be used. Specific 1-Wire driver and
bridge A bridge is a structure built to Span (engineering), span a physical obstacle (such as a body of water, valley, road, or railway) without blocking the path underneath. It is constructed for the purpose of providing passage over the obstacle, whi ...
chips are available.
Universal Serial Bus Universal Serial Bus (USB) is an industry standard, developed by USB Implementers Forum (USB-IF), for digital data transmission and power delivery between many types of electronics. It specifies the architecture, in particular the physical ...
"bridge" chips are also available. Bridge chips are particularly useful to drive cables longer than 100 m. Up to 300-meter
twisted pair Twisted pair cabling is a type of communications cable in which two conductors of a single circuit are twisted together for the purposes of improving electromagnetic compatibility. Compared to a single conductor or an untwisted balanced ...
s, ''i.e.'', telephone cables, have been tested by the manufacturer. These extreme lengths require adjustments to the pull-up resistances from . The master starts a transmission with a ''reset'' pulse, which pulls the wire to 0 volts for at least 480 
μs A microsecond is a unit of time in the International System of Units (SI) equal to one millionth (0.000001 or 10−6 or ) of a second. Its symbol is μs, sometimes simplified to us when Unicode is not available. A microsecond is to one second, ...
. This resets every slave device on the bus. After that, any slave device, if present, shows that it exists with a "presence" pulse: it holds the bus low for at least 60 μs after the master releases the bus. To send a
binary number A binary number is a number expressed in the Radix, base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" (zero) and "1" (one). A ''binary number'' may ...
"1", the bus master sends a very brief () low pulse. To send a binary number "0", the master sends a 60 μs low pulse. The falling (negative) edge of the pulse is used to start a
monostable multivibrator A multivibrator is an electronic circuit used to implement a variety of simple two-state devices such as relaxation oscillators, timers, latches and flip-flops. The first multivibrator circuit, the astable multivibrator oscillator, was invented ...
in the slave device. The multivibrator in the slave reads the data line about 30 μs after the falling edge. The slave's internal timer is an inexpensive analog timer. It has analog tolerances that affect its timing accuracy. Therefore, the pulses are calculated to be within margins. Therefore, the "0" pulses have to be 60 μs long, and the "1" pulses can't be longer than 15 μs. When receiving data, the master sends a pulse to start each bit. If the transmitting slave unit wants to send a "1", it does nothing, and the bus goes to the pulled-up voltage. If the transmitting slave wants to send a "0", it pulls the data line to ground for . The basic sequence is a reset pulse followed by an eight-bit command, and then data are sent or received in groups of eight bits. When a sequence of data is being transferred, errors can be detected with an eight-bit CRC (weak data protection). Many devices can share the same bus. Each device on the bus has a 64-bit serial number, of which eight bits are used as a checksum, thus allowing a "universe" of 256 (over 7.2 × 1016) unique device identities. The
least significant byte In computing, bit numbering is the convention used to identify the bit positions in a binary number. Bit significance and indexing In computing, the least significant bit (LSb) is the bit position in a binary integer representing the lowes ...
of the serial number is an eight-bit number that tells the type of the device. The
most significant byte In computing, bit numbering is the convention used to identify the bit positions in a binary numeral system, binary number. Bit significance and indexing In computing, the least significant bit (LSb) is the bit position in a Binary numeral sy ...
is a standard (for the 1-Wire bus) eight-bit CRC. There are several standard broadcast commands, as well as commands used to address a particular device. The master can send a selection command, then the address of a particular device. The next command is executed only by the addressed device. The 1-Wire bus enumeration protocol, like other singulation protocols, is an algorithm the master uses to read the address of every device on the bus. Since the address includes the device type and a CRC, recovering the roster of addresses also produces a reliable inventory of the devices on the bus. To find the devices, the master broadcasts an
enumeration An enumeration is a complete, ordered listing of all the items in a collection. The term is commonly used in mathematics and computer science to refer to a listing of all of the element (mathematics), elements of a Set (mathematics), set. The pre ...
command, and then an address, "listening" after each bit of an address. If a slave's address matches all the address bits sent so far, it returns a 0. The master uses this simple behavior to search systematically for valid sequences of address bits. The process is much faster than a brute force search of all possible 56-bit numbers, because as soon as an invalid bit is detected, all subsequent address bits are known to be invalid. The 56-bit address space is searched as a binary tree, allowing up to 75 devices to be found per second. The order in which device addresses are discovered by this enumeration protocol is deterministic and depends only on the device type and serial number. Bit-reversing these 56 bits yields the order of discovery for devices using Maxim's published algorithm (algorithm defined in Application Note 187). 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''. 081218 maxim-ic.com


ROM family codes

Every 1-Wire device’s 64-bit ROM ID ends with an 8-bit family code. In most cases this byte is assigned to a single part number, so reading it from the bus is usually enough to identify the device—for example, 0x10 (DS18S20 thermometer), 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 A field-programmable gate array (FPGA) is a type of configurable integrated circuit that can be repeatedly programmed after manufacturing. FPGAs are a subset of logic devices referred to as programmable logic devices (PLDs). They consist of a ...
, which was the master for the communication with a DS2432 (
EEPROM EEPROM or E2PROM (electrically erasable programmable read-only memory) is a type of non-volatile memory. It is used in computers, usually integrated in microcontrollers such as smart cards and remote keyless systems, or as a separate chip d ...
) 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.


Development tools

When developing and/or troubleshooting the 1-Wire bus, examination of hardware signals can be very important.
Logic analyzer A logic analyzer is an electronic instrument that captures and displays multiple logic signals from a digital system or digital circuit. A logic analyzer may convert the capture into timing diagrams, protocol decodes, state machine traces, op ...
s 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 single-wire transmission line (or single wire method) is a method of transmitting electrical power or signals using only a ''single'' electrical conductor. This is in contrast to the usual use of a pair of wires providing a complete circuit, or a ...
, a technique for electric power transmission with only "1 wire" without a ground return wire path *
Touch memory Touch Memory (or contact memory) is an electronic identification device packaged in a coin-shaped stainless steel container. Touch memory is accessed when a touch probe comes into contact with a memory button. Read and/or write operations betwe ...


References


External links


1-Wire DeviceAccessing, Reading, and Writing to 1-Wire devices using a UARTUsing a UART to Implement a 1-Wire Bus MasteriButtoniButtonLinkGuidelines for Reliable Long Line 1-Wire NetworksChoosing the Right 1-Wire Master for Embedded ApplicationsOWFS — 1-Wire file system for LinuxGetting 1-Wire sensors working in Linux using OWFS
using Lazarus, "the free Delphi". {{Automation protocols Serial buses