Home>Characterization Test Center>Test How-To

# Measure resistance and temperature with a sound card

Zoltan Gingl and Peter Kocsis, University of Szeged, Szeged, Hungary- September 1, 2011

Unless you add a measurement instrument to your computer, you have only the sound card as an analog I/O port. You can use the sound card to digitize AC analog voltages but only within a limited range. You can, however, add some signal processing and measure a wider variety of signals, even those that produce DC or low-frequency outputs. For example, you can directly connect a thermistor to make a sound-card thermometer to monitor or record the temperature on PCBs (printed-circuit boards), circuits, heat sinks, and more.

Thermistors are popular temperature sensors because they allow easy detection of changes in resistance. Once you measure a thermistor’s resistance, you can apply the following equation to find the temperature:

where RT is the thermistor resistance and TO is the temperature in Kelvins at which the thermistor’s resistance is RO. You can find the value of β in a thermistor’s data sheet.

 FIGURE 1. The internal microphone bias resistor and the externally connected thermistor form a voltage divider.
Figure 1 shows the easiest way to interface a thermistor to a sound card. The microphone input has an internal bias resistor, R, with a typical value of 2 to 5 kΩ. A DC bias voltage drives this resistor. The bias resistor connects the thermistor between the line or the headphone output and the microphone input, which forms a voltage divider with the internal bias resistor. Those components are all the circuit needs. Note that some microphone inputs may have different internal connections, so check yours before use.

You also need a sinusoidal signal because the sound card’s inputs are AC-coupled. The sound card’s audio output can produce an AC voltage at the microphone input, whose amplitude is proportional to R/(R+RT). You can do a simple calibration to find the output signal’s amplitude and the value of R by replacing RT with known values, such as 0 and 10 kΩ.

A sound card’s measurement accuracy is worse than what you could achieve using a commercial data-acquisition card, but this ratiometric arrangement and calibration keep errors to approximately 1% for resistor values of 1 to 100 kΩ. Even without temperature calibration, you should get temperature errors of 1 to 2 K with a 10-kΩ thermistor at room temperature. Accuracy degrades to 3 to 5 K over the thermistor’s operating temperature.

You can download simple, free, and open-source software in Java that you can use as a simple ohmmeter, thermometer, or chart recorder under Windows or Linux. You can download a Java executable or the Java source code (Ref. 1).

 FIGURE 2. You can add second and third thermistors to your system by adding an external resistor divider.
You should consider adding protection to the sound card’s audio I/O ports by inserting series resistors. Typically, a few kilohms is all the circuit needs. You can also use an inexpensive USB sound card to spare and protect your PC sound card’s inputs.

You can add second and third thermistors by adding an external resistor divider (Figure 2). This lets you use both audio channels and a third thermistor at the microphone input. In addition to using thermistors, you can use the sound card with other resistive sensors, such as photoresistors or potentiometric displacement sensors. You can even connect capacitive sensors if you add some more components and signal processing (Ref. 2). T&MW

REFERENCES

1. Gingl, Z., and P. Kocsis, “Sound-card thermometer/ohmmeter.” www.noise.physx.u-szeged.hu/edudev/thermometer.

2. Klaper, M., and H. Mathis, “2-Pound RLC Meter: impedance measurement using a sound card,” Elektor, June 2008, p. 64. bit.ly/l2lyzl.

This article originally appeared in the May 26, 2011, issue of EDN.