Abstract: This article presents an overview of 1-Wire® technology and describes, in particular, its networking and measurement/sensing abilities, including measuring events, voltages, current, temperature, position, etc. The 1-Wire chips presented herein enable the construction of sensors that measure a host of environmental parameters on a single twisted-pair cable. Examples include humidity, barometric pressure, wind direction, solar radiance, and temperature through a thermocouple. The following 1-Wire chips are used for the above sensing circuits: DS2409, DS2406, DS2423, DS2438, DS2450, and the DS2760.
Dallas Semiconductor/Maxim provides a technology called 1-Wire, that uses a single wire (plus ground) to accomplish both communication and power transmission. A single bus master can feed multiple slaves over a single twisted-pair cable. An important aspect of this technology is that every slave has a globally unique digital address. This article discusses the protocol and introduces a variety of applications.
What is the 1-Wire Net?
The 1-Wire net is a low-cost bus based on a PC or microcontroller communicating digitally over twisted-pair cable with 1-Wire components. The network is defined with an open-drain (wired-AND) master/slave multidrop architecture that uses a resistor pull-up to a nominal 5V supply at the master. A 1-Wire net-based system consists of three main elements: 1) a bus master with controlling software such as the TMEX iButton® viewer; 2) wiring and associated connectors; and 3) 1-Wire devices. The system permits tight control because no node is authorized to speak unless requested by the master, and no communication is allowed between slaves except through the master.
The 1-Wire protocol uses conventional CMOS/TTL logic levels with operation specified over a supply voltage range of 2.8V to 6V. Both master and slaves are configured as transceivers permitting bit sequential data to flow in either direction, but only one direction at a time, with data read and written least significant bit (LSB) first. An economical DS9097U COM port adapter interfaces the RS-232 to the net. A DS2480 serial 1-Wire line driver chip is also available to generate the proper signals and programmable waveforms that maximize performance.
Data on the 1-Wire net is transferred by time slots. For example, to write a logic one to a slave, the master pulls the bus low for 15µs or less. To write a logic zero, the master pulls the bus low for at least 60µs to provide timing margin for worst-case conditions. A system clock is not required, as each 1-Wire part is self-clocked by its own internal oscillator synchronized to the falling edge of the master. Power for chip operation is derived from the bus during idle communication periods when the DATA line is at 5V by including a half-wave rectifier on each slave.
Whenever the data line is pulled high, the diode in the half-wave rectifier turns on and charges an on-chip capacitor. When the voltage on the net drops below the voltage on the capacitor, the diode is reverse biased, which isolates the charge. The resulting charge provides the energy source to power the slave during the intervals when the net is pulled low. The amount of charge lost during these periods is replenished when the data line returns high. This concept of "stealing" power from the net using a half-wave rectifier is referred to as "parasite power"."
When communicating, the master resets the network by holding the bus low for at least 480µs, releasing it, and then looking for a responding presence pulse from a slave connected to the line. If a presence pulse is detected, it then accesses the slave by calling its address, controlling the information transfer by generating time slots and examining the response from the slave. Once this handshake is successful, the master issues necessary device-specific commands and performs any needed data transfers between it and the slave. The master can select a single slave from many on the net because of its unique digital address.
A Unique Address for Every Part?
Within each 1-Wire slave is stored a lasered ROM section with its own guaranteed unique, 64-bit serial number that acts as its node address. This globally unique address is composed of eight bytes divided into three main sections. Starting with the LSB, the first byte stores the 8-bit family codes that identify the device type. The next six bytes store a customizable 48-bit individual address. The last byte, the most significant byte (MSB), contains a cyclic redundancy check (CRC) with a value based on the data contained in the first seven bytes. This allows the master to determine if an address was read without error. With a 248 serial number pool, conflicting or duplicate node addresses on the net are never a problem.
Because 1-Wire devices can be formatted with a file directory like a floppy disk, files can be randomly accessed and changed without disturbing other records. Information is read or written when the master addresses a device connected to the bus, or an iButton is touched to a probe somewhere along the 1-Wire net. The inclusion of up to 64k of memory in 1-Wire chips allows standard information such as employee name, ID number, and security level to be stored within the device. Maximum data security can be provided by 1-Wire chip implementation of the US government-certified Secure Hash Algorithm (SHA-1).
Historically, the 1-Wire net was envisioned as a single twisted pair routed throughout the area of interest with 1-Wire slaves daisy-chained where needed. However, if the network is heavily loaded, it may be preferable or even necessary to separate the bus into sections. This has the added benefit of providing information about the physical location of a 1-Wire device on the bus, which facilitates troubleshooting. By using one section as the main "trunk" and adding or removing segment "branches" with a DS2409 as needed, a true 1-Wire net is created. This also reduces the load seen by the bus master to that of the trunk and those segments connected to it by activated DS2409s.
Consequently, the DS2409 MicroLAN coupler is a key component for creating complex 1-Wire nets. It contains MAIN and AUX transmission-gate outputs and an open-drain output transistor (CONT), each of which can be remotely controlled by the bus master. A simple 1-Wire branch with DS2430 EEPROM connected to label the node provides tagging information specific to that particular node such as location and function. The LED attached to the CONT output provides visual indication of the specific branch being addressed and can be blinked by software for extra visual impact.
General-Purpose 1-Wire Net Example
Combining the DS2409 with its DS2406 low-side cousin builds a general-purpose 1-Wire net. Figure 1 shows two DS2409s used to select an arbitrary row, while one DS2406 dual low-side switch is used to select an arbitrary column. As shown, they form a simple 2 x 2 array with LEDs to visually indicate the specific intersection addressed by the bus master. The array can be easily expanded in either the X or Y direction by the addition of more DS2409s and/or DS2406s. In this manner an M by N array of arbitrary size may be implemented, limited only by net loading.
Figure 1. Two DS2409s and a DS2406 help form a general-purpose 1-Wire net with visual indicators.
In operation, the master selects both the AUX output of the DS2409 that controls the row of interest and the column output of the corresponding DS2406 intersecting that row at the required position. For example, if the AUX output of the top DS2409 and the B output of the DS2406 are both turned on, the position in the upper right-hand corner of Figure 1 is selected (as highlighted with heavy lines). This connects the iButton probe at the intersection of the selected row and column to the master so the serial number of the 1-Wire device (if any) at that point can be read. To indicate which intersection is addressed, the master switches the selected DS2409 from its AUX output to its main output. By default this causes the CONT pin to turn on, grounding the gate of the associated PMOS transistor and turning it on. With the pass transistor on, power is supplied to the LED at the selected intersection and turns it on. If desired, the DS2409 can be switched repeatedly between main and AUX outputs causing the LED to blink for greater visual effect. If the main outputs of all DS2409s are turned on, the LEDs in the entire column of the selected DS2406 turn on. Alternately, if the outputs of all DS2406s are turned on, the LEDs in the entire row of the selected DS2409 turn on. Consequently, turning on all column and row switches illuminates the entire array, which serves as a convenient test to verify that the system is fully functional. While a DS9092 iButton probe is shown in the example, solder-mount 1-Wire devices could be used as well.
Addressable Digital Instruments
In addition to the DS2406 and DS2409 1-Wire control chips, several digital functions such as temperature sensors and analog-to-digital converters (ADCs) are available. These ICs measure a wide variety of physical properties over the 1-Wire net. A distinct advantage of 1-Wire instruments is that all communicate using 1-Wire protocol regardless of the particular property (for example, voltage, current, and resistance) being measured. Other methods employ a variety of signal-conditioning circuitry such as instrumentation amplifiers and voltage-to-frequency converters, which out of necessity makes their outputs different and often requires separate cables for each sensor.
The unique ID address of each device is the key for the bus master to interpret what parameter a particular 1-Wire instrument is measuring. Several examples of 1-Wire instrumentation for environmental measurement are presented later in this article. Note that all circuit examples use a BAT54S dual Schottky diode and input capacitor to provide a local source of power. The remaining Schottky diode in the package is connected across DATA and GND and provides circuit protection by restricting signal excursions that go below ground to approximately -0.4V. Without this diode, negative signal excursions on the bus in excess of 0.6V forward bias the parasitic substrate diode and interfere with chip function.
Our first example uses the DS2423 counter, which has inputs that respond to logic-level changes or switch closures. This makes it suitable to implement a variety of tally or rate sensors. A circuit example using magnetically actuated reed switches is shown in Figure 2. In the circuit, an external 1MΩ pull-down resistor is used from the inputs to ground to prevent generating spurious counts during turn-on and to minimize noise pick-up. With lithium backup, this circuit is used to build a 1-Wire rain gauge and a hub-mounted wheel odometer. In those applications, a small permanent magnet moves past the reed switch each time a tipping bucket fills and empties or the wheel rotates one full turn, respectively. This momentarily closes the reed switch, incrementing the counter to indicate 0.01in of rain fall or one revolution. The circuit is also used in a 1-Wire weather station to measure wind speed.
Figure 2. The basic DS2423 counter circuit uses a reed switch as an input.
Measuring Humidity on the 1-Wire Net
Humidity is an important factor in many manufacturing operations and also affects personal comfort. With the proper sensing element, it can be measured over the 1-Wire net. The sensing element specified here develops a linear voltage versus relative humidity (RH) output that is ratiometric to supply voltage. That is, when the supply voltage varies, the sensor output voltage follows in direct proportion. This requires measuring both the voltage across the sensor element and its output voltage. In addition, calculating true RH requires knowing the temperature at the sensing element. Because it contains all the necessary functions for calculating, the DS2438 with its two ADCs and a temperature sensor makes an ideal choice for constructing a humidity sensor. In Figure 3, the analog output of the HIH-3610 humidity-sensing element is converted to digital by the main ADC input of a DS2438. The bus master first has U1, the DS2438, report the supply voltage level on its VDD pin, which is also the supply-voltage for U2, the sensing element. Next, the master has U1 read the output voltage of U2 and reports local temperature from its on-chip sensor. Finally, the master calculates true RH from the three parameters supplied by U1.
Figure 3. A DS2438 with parasite power is ideal to construct a humidity sensor.
Measuring Barometric Pressure on the 1-Wire Net
Barometric pressure is another important meteorological parameter that can be measured over a 1-Wire net using the DS2438. By selecting a ratiometric pressure sensor that contains comprehensive on-chip signal-conditioning circuitry, the circuit is very straightforward. You must know both the output voltage representing atmospheric pressure and the supply voltage across the element to accurately calculate barometric pressure. Because the MPXA4115 pressure sensor can require as much as 10mA at 5V, an external power source is needed. Note that external power should also be connected to the DS2438's power pin. This allows the DS2438 to measure the supply voltage applied to the pressure-sensing element. Flexible tubing can be routed to sample the outside air pressure and avoid unwanted pressure changes (noise) caused by doors and windows opening and closing or elevators moving inside the building.
Measuring Wind Direction on the 1-Wire Net
The original 1-Wire weather station used DS2401s to label each of the eight magnetic reed switches in its wind direction sensor, as shown in Figure 4. A single DS2450 quad ADC can perform the same function with five resistors. As the wind rotates the wind vane, a magnet mounted on a tracking rotor opens and closes one (or two) of the reed switches. When a reed switch closes, it changes the voltages seen at the input pins of U1, the DS2450. For example, if the magnet is in a position to close S1 (north), the voltage seen on pin 7 changes from VCC to 1/2VCC, or approximately from 5V to 2.5V. Since all 16 wind vane positions produce unique 4-bit signals from the ADC, it is only necessary to indicate north, or specify which direction the wind vane is currently pointing to initialize the sensor.
Because two reed switches are closed when the magnet is midway between them, just eight reed switches indicate 16 compass points. Referring to the schematic and position 2 in Table 1, which lists the voltages seen at the ADC inputs for all 16 cardinal points. Observe that when S1 and S2 are closed 3.3V is applied to ADC inputs B and C. This occurs because the parallel combination of pullup resistors R2 and R3 act as a single resistor half their value connected in series with R1 to form a voltage divider with 0.66VCC across R1. Note that this condition occurs twice more at switch positions 4 and 16 generating 3.3V at those cardinal points also.
Table 1. Wind Vane Position vs. the Voltage at the Four DS2450 ADC Inputs
Cardinal Points
Voltage Input
at D(V)
Voltage Input
at C(V)
Voltage Input
at B(V)
Voltage Input
at A(V)
1
5
2.5
5
5
2
5
3.3
3.3
5
3
5
5
2.5
5
4
5
5
3.3
3.3
5
5
5
5
2.5
6
0
5
5
2.5
7
0
5
5
5
8
0
0
5
5
9
5
0
5
5
10
5
0
0
5
11
5
5
0
5
12
5
5
0
0
13
5
5
5
0
14
2.5
5
5
0
15
2.5
5
5
5
16
3.3
3.3
5
5
Measuring Solar Radiance on the 1-Wire Net
The amount of sunlight and its duration are additional parameters easily measured with 1-Wire sensors. The amount is a measure of air and sky conditions, while duration is related to the equinoxes and the length of the day. Although the mechanical and optical implementations tend to be complex, the electronics can be easily created using a DS2438. Figure 5 illustrates a solar-radiance sensor built using a sense resistor connected in series with a photodiode. Light striking the photodiode generates photocurrents that develop a voltage across the sense resistor that is read by the ADC. Optical filters can be added to control both the wavelength and optical bandpass to which the sensor responds.
Figure 5. The amount of sunlight available can be easily measured with a photodiode and a DS2438.
Measuring a Thermocouple on the 1-Wire Net
One can also measure extreme temperatures using conventional thermocouples (TC) that are directly digitized at the cold junction using a DS2760 multifunction 1-Wire chip. The twisted-pair cable of the 1-Wire net covers the distance between the TC and bus master, effectively replacing the expensive TC extension cable normally used. Because of its unique ID address, multiple smart TCs can be arbitrarily placed where needed along the net, greatly minimizing the positioning and cost of an installation. With an LSB of 15.625µV, the chip can directly digitize the millivolt-level output produced between the hot and cold junctions of the typical TC as its on-chip temperature sensor continuously monitors the temperature at the cold junction of the TC. It contains user-accessible memory for storage of sensor-specific data such as TC type, location, and the date it was placed into service. This information minimizes the probability of error due to the mislabeling of sensors. Thus, a DS2760 can be used with any TC type because the bus master's calculations are based on the stored data and the temperature of the cold junction, as reported by the on-chip temperature sensor. Figure 6 illustrates both the simplicity and ease with which a DS2760 can be used to convert a standard thermocouple into a smart sensor with multidrop capability. Adding R1 allows VDD to be measured, which is useful in troubleshooting to verify that the voltage available on the 1-Wire net is within acceptable limits.
Figure 6. A DS2760 can convert a conventional TC into a smart sensor with multidrop capability.
Summary
1-Wire technology made possible the combination of electronic communication and instrumentation based on positive identification of individual nodes on a single self-powered net. Continued development of the technology has increased the array of 1-Wire chips able to interface with the environment, measuring events, voltage, current, temperature, position, etc. In turn, these chips enabled the construction of sensors that measure a host of environmental parameters on a single twisted-pair cable as described within this article.
Including ROM, EPROM, and EEPROM in 1-Wire slaves in a stainless-steel case called an iButton further enabled a personal electronic authentication. Personal and data security advanced with the creation of SHA-1-based 1-Wire chips in iButtons for use with monetary transactions. Whether housed in an armored stainless-steel iButton or standard IC packages, 1-Wire communication uses a noncritical two-contact interface. 1-Wire technology is now used for transportation tokens, identification badges, entry security, and after-market control. New applications are continually being added. Visit www.ibutton.com/solutions to learn more about commercial ventures using 1-Wire technology.
1-Wire is a registered trademark of Maxim Integrated Products, Inc. iButton is a registered trademark of Maxim Integrated Products, Inc.
의견을 보내주세요! 위 내용이 도움이 되셨나요? 여러분의 의견을 기다립니다 — Maxim은 보내주신 정정이나 제안사항을 반영하고 있습니다.
이 페이지를 평가하고 의견을 보내주십시오.