Parallel port provides high-resolution temperature sensing

Posted on Mar 22, 2013

The Dallas Semiconductor ( DS1722 digital thermometer allows measurement resolution as fine as 0.0625°C in digital form and with linear response. The accuracy specification is only 2°C, but you can improve this figure by careful calibration. Moreover, the accuracy spec is unimportant in applications in which you measure only changes in temperature or in which you must closely maintain a noncritical temperature. The measurement range is –55 to +120°C, the part can use either three-wire or SPI interface, and the cost is approximately $1. The eight-pin part is available in SO or µSOP packaging and in large quantities as a flip-chip measuring only about 1 mm sq. In this application, the chip attaches directly to the PC's parallel port through a male DB-25 connector. Because the device draws a maximum of 0.5 mA, the port can supply the power, and its supply range tolerates variations in voltage levels that may exist on varying ports. The chip is in SPI mode with the SCK clock signal supplied by the PC; in this way, data-transfer timing is noncritical.

Parallel port provides high-resolution temperature sensing
Click here to download the full size of the above Circuit.

A simple Turbo C program (Listing 1) running in DOS mode effects the data-transfer cycle in the PC, whereas the transfer is automatic in the chip upon reception of SCK. The routine reads a low byte and a signed high byte and creates a floating-point value by simply adding the low byte, divided by 256, to the high byte. In the highest resolution mode, which this design uses, a data read can occur only every 1.2 sec, and you should adjust the timing loops accordingly. You may also need to adjust the settling time, DELTIME, depending on the speed of the PC you use. The sample program prints the bytes transferred as well as the temperature, and you can easily modify it. The data sheet explains the use of the configuration register and changes to make if you need a higher data rate with lower resolution. Click here to download Listing 1. The data transfer takes place beginning with the write of an address byte to the chip's SDI in the order A7 to A0 (high bit to low bit). If A7 is high, a write takes place; otherwise, a read occurs. For a write, D7 to D0 route to the chip's SDI. For a read, D7 to D0 are available on the chip's SDO. The program always uses both SDI and SDO and ignores whichever it doesn't need. For example, data goes to the chip's SDI even during a read, but the chip ignores this data. Each byte transfers as 8 bits, and each transfer involves the following steps: The PC raises D1/SCK and...

Leave Comment

characters left:

New Circuits



Popular Circuits

Motion-detection Digital Camera circuit
Bipolar dc-dc converter requires no inductor
Regulated Dual Power Supply Circuit Using Regulator IC
homemade Geiger counter with UGP interface
Optical Theremin