TM #129 Serial Measurement Kit (8-pin DIP) - $19.95


The TM #129 is a low cost kit consisting of a programmed Microchip PIC12F683 or similar, five resistors and a single DS1820 temperature measurement device. The kit does not include a PCB. However, even a three web finger person like myself can put a single 8-pin DIP and resonator on a small piece of perf board. The source code for the PIC processor is not provided and the PIC is code protected.

The TM #129 Kit permits any processor having a serial COM Port, notably a PC, to perform measurements using any combination of the following Dallas 1-wire devices.

Note that up to 16 Dallas devices in any combination may be accommodated on each of two twisted pair runs. Thus, on one run, one might have eight temperature sensors, a DS2450 quad A/D and a DS2438 temperature sensor and A/D. On the second run, one might have several additional temperature sensors and perhaps two DS2423 dual counters.

The amount of cable associated with each run should be limited to a toal of 200 feet. Note that for the DS18S20, DS18B20, DS18B20-PAR and DS1822, only the signal lead and ground need to run to each device. That is, temperature sensors are operated in the parasitic mode. For the DS2438, DS2450 and DS2423, a source of +5 VDC must be provided. This may be run from the controller or it may be supplied locally.

Note that the kit includes one DS18x20 type device. I have additional DS18S20, DS18B20 and DS18B20-PAR temperature devices and I also have the DS2438, DS2423 and DS2450.

Detailed Description

When the GO input to the PIC momentarily goes high, the PIC proceeds to find the devices and make measurements. The PIC determines the first address of a Dallas device on twisted pair run 0, performs the appropropriate measurements and returns the result using 9600 baud serial. It then continues to determine the second address on run 0, performs the appropriate measurement and sends the result and this process continues until no additional devices are found on run 0. This process is then repeated on the second twisted pair run.

Note that a complete measurement sequence is initiated by bringing the GO input momentarily high. The may be the PC sending any character. If the GO input is tied high (or left open) the PIC continually performs measurment sequences.

Temperature measurements require nominally one second. Other measurements require nominally 100 ms.

A result of a typical measurement sequence;

   00 20 29AE 3.862 0.062 0.060 0.061
   01 10 6A0B 24.12
   02 10 9DD7 24.12
   03 28 DB9C 24.12
   04 22 5BFC 24.43
   05 26 09CE 23.81 0.17 5.03
   06 1D C827 00000000 00000000
   10 20 C9AE 3.781 0.065 0.066 0.066
   11 10 6ABBB 35.56
   15 26 09CE 33.93 0.11 4.95
   16 1D C827 00000003 0000001C

On Run 0 (first digit) the processor found a DS2450 (code 20), two DS18S20s (code 10) and one DS18B20 (code 28) and one DS1822 (code 22), one DS2438 (code 26) and one DS2423 (code 1D). The device code is followed by a 16-bit serial number expressed in hexadecimal. For the DS2450, note the four voltages, for the DS18S20, DS18B20 and DS1822, note the temperatures in degrees C, for the DS2438, note the temperature followed by the two voltages and for the DS2423, note the values of the two 32-bit counters in hexadecimal.

On Run 1, the processor found another DS2450 (code 20) a DS18S20 (code 10), a DS2438 (code 26) and another DS2423 dual counter (code 1D).

(The order in which devices are found is a bit like an telephone directory arranged with the last names spelled in reverse. Thus, 0x20 is 0010_0000, 0x10 is 0001_0000 and 0x28 is 0010_1000. Reversed, these are 0000_0100, 0000_0010 and 0001_0100. Thus, 0x20 is found before 0x10.)

Note that fields are delimited by single spaces and the line is terminated by a new line consisting a CR and LF.

Field three is a unique 16-bit identifier for the device. Note that the actual Dallas ID consists of 48-bits and in the above, only 16 are being used. However, the sixteen bits provides for 65,535 combinations and I seriously doubt anyone will find a duplication in their system.

The abbreviated serial numbers of the devices are provided to permit the user to ascertain which sensor is which. Note that the device number D is simply a running number beginning at 0 which is assigned as each device is found using a binary search on each of the twisted pair runs.

Thus, 0 on Dallas Run 0 might correspond to a DS1820 in your PC, 1 to the living room, 2 to the freezer. Assume you then add one on a cold water pipe in the basement. You may well find 0 is still your PC, but 1 is now the water pipe, 2 is the living room and 3 in the freezer.

However, note that once a system is in place, 0 will always be the PC, 1 the water pipe, etc. But if your cat pulls off the sensor in the living room, 2 will then be the freezer.

The serial RS232 interface is 9600 baud inverted. The intent is that the PIC may be directly interfaced with a PC COM port with no intermediate level shifter other than a series 22K resistor and a shunt 10K resistor. I have used this appraoch in the past, the very popular BX24 (Basic Stamp Super Clone) and the PICAXE use this approach and I have yet to see a complaint.

The maximum current drain of the PIC and all of the DS1820's is 3.0 mA. This offers the possibility of powering the circuitry from the COM port and the kit includes a 78L05 regulator and associated capacitors.

The $19.95 kit includes the programmed PIC16F83 8-pin DIP, one DS1820 and five resistors, a 78L05 regulator and associated capacitors, the Morgan Logic Probe for debugging, wire for bread boarding and documentation.

A sample application. This was provided by a satisfied customer in New Jersey using a similar design. Note that the 7805 regulator is to the rear, the logic probe in the middle and the PIC in the front.

Interfacing with a UNIX Workstation/a> by Ottmar Klaas at RPI.