Design Ideas: May 9, 1996
An ordinary transistor can serve as an uncalibrated
temperature sensor
(Figure
1) for an accurate, PC-compatible thermometer. Unadjusted accuracy is more
than 0.5°:C over the -50 to +50°C range, and the only limitation on
resolution is the time devoted to measurement acquisition. For example, 0.1°:C
resolution requires less than 1 sec. The thermometer derives all its power from
the RS-232C COM port. Therefore, a laptop computer running a simple data-logging
program yields an inexpensive, portable temperature-logging system.
The key to the thermometer's accuracy is the way the circuit uses the temperature-sensing transistor, Q1. Op amp IC1 drives Q1's emitter voltage to force the transistor to sink the current from the R1 to R2 current source. As IC2A toggles, it generates a square wave at Q1's emitter, with a peak-to-peak amplitude given by:
where TQ is the absolute temperature (in Kelvin) of Q1.
This amplitude varies from 46.11 mV at -50°:C to 66.77 mV at +50°:C for virtually any npn silicon transistor. Accuracy depends only on the tolerance of the nominal 10-to-1 R1/R2 ratio. Temperature-to-digital conversion involves a voltage-to-frequency-ratio scheme: Difference amplifier IC3 compares the square wave from Q1's emitter to the signal developed across R3 by switches IC2A and IC2B, acting concurrently with R4, R5, and the 2.500V reference IC4 develops. IC3 amplifies the difference with a gain of 250 and applies the result to synchronous rectifier IC2C.
The rectification action pumps charge into integrator IC5. IC5's output connects to comparator IC6, which closes the voltage-to-frequency feedback loop to IC2B. Conversion timing comes from the PC's transmission of strings of CHR$(07) characters over the RS-232C interface, which is formatted for 9600 baud, 1 stop bit, 5 data bits, and no parity). The arrival of each character initiates a sequence of actions, among which are the connection of R2 to 2.500V by IC2A and the connection of the right end of C1 to ground by IC2C. IC6 simultaneously compares the output of IC5 to a threshold voltage near 1V.
If IC5's output is more positive than the threshold, IC6's output goes positive, connecting the right end of R5 to ground. If IC5's output is less positive than the threshold, IC6's output stays negative and causes R5 to remain connected to 2.500V. In the former case, C1 charges negative, and the CHR$(07) character echoes back to the receive side of the COM port. In the latter case, C1 charges positive, and no character echoes. Thus, the feedback loop constantly drives IC5 toward the threshold and echoes a character to the PC each time a negative C1 charge condition requires it.
As a result, the fraction of transmitted characters that echo back to the COM port varies linearly with temperature from 0% at - 50°C to 100% at +50°C. So, for example, to perform a measurement with 0.1°C resolution, the PC would transmit 1000 characters over 0.73 sec, tally the number of echoed characters, subtract 500, and divide by 10. (DI #1860)