Home » Misc Projects » 1-Wire Sensors

Misc Projects : 1-Wire Sensors

Using the Maxim/Dallas Semiconductor 1-wire sensors for systems and environmental monitoring.

I've found the Maxim/Dallas 1-Wire products to be extremely useful for systems and environmental monitoring. A variety of devices are available to digitally measure temperature, voltage, counts, and current, as well as to control switches. They are particularly convenient in that a 1-wire bus generally requires only a single twisted-pair, providing both data and power. Devices are connected in parallel and are uniquely addressable. For disconnected temperature measurement, the iButton Thermocron devices are programmable, self-powered loggers in a durable stainless steel package.

Computer Interface

Serial, parallel, and USB computer interface adapters are available. I currently use the serial DS9097U. A few other third-party products such as The Link are also available. I use cat-5 cable with RJ45 ends for physical connections to a few patch panels. To avoid a variety of bus errors, branch lengths should be kept to a minimum, though relatively small(<30m, ~50 devices) star networks work well for me.

On the software side, the OWFS project implements a hierarchical filesystem using the Linux FUSE kernel interface. In simple terms, this facilitates simple browsing of the network structure and device access with standard command-line tools. Perhaps most importantly, this general interface handles concurrent access and writing by a variety of scripts. Logging and graphing page generation such as my Machine Status is accomplished with regular logging to postgres database backend and periodic page generation. I'm happy to share this infrastructure. Drop me an email... Everything is written in Python.

Components

Temperature

Sealed Inline DS18B20 Themometer Construction
Most 1-Wire temperature sensors, such as the DS18B20 are available as a TO-92 package, making them ideal for direct attachment to component surfaces with thermal epoxy. These are rated from -55C to +125C, with +/-0.5C accuracy between -10C and +85C. Additionally, they happen to fit perfectly within 1/4" flexible copper tubing, facilitating immersion in pressurized water lines. This results great isolation from ambient temperatures. I seal the end of a short length of tube with a minimal amount of solder, directly connect the sensor to a twisted pair or more durable wire, place a drop of thermal grease on the chip, and insert fully into the tubing. I then hold the assembly in place with epoxy and heat-shrink. Finally, the tube may be installed using a 1/4" compression fitting.
Final Installation of Inline DS18B20

For dry measurements, I solder a small 2mm molex plug to the end of a cat-5 cable. See Mouser parts 538-51110-0450. The sensor may then be trimmed and inserted, to be held with heat shrink. This avoids the need for any additional electrical insulation. Note that for non-parasitic devices, it is generally necessary to connect the ground and power chip leads. I solder a short bridge to the base of the chip package. See the Water Cooling Gallery for further installation examples.

Flow Measurement

The DS2423 is a two-channel counter. I use this to count pulses from a paddlewheel flow meter, further described on my Water Cooling page. I use a small transistor circuit to amplify the meter pulses sufficiently for measurement. I use a diode and small capacitor for parasitic power from the 1-Wire bus. Other flowmeters integrate such a transistor to generate a square wave which could be counted directly.

PIO Communication with MicroChip PICs

The DS2408 is an 8-channel switch. I use this chip for PIO communication of color data to a 16F88 PIC for my LED Water Lamp With the DS9097U (not in overdrive), I am able to achieve approximately 30 bytes/sec. I currently use four bytes to transmit 24-bit RGB colors, resulting in somewhere around 7 colors/sec. With interpolation on the PIC to smooth color changes, this interface is fast enough for smooth, rapid color changes. See the LED Water Lamp page for further details.



Created: 08 Jul 2005
Last Modified: 17 Nov 2009