Measure resistance and temperature with a sound card
Measure resistance and use free software to convert to temperature.
Zoltan Gingl and Peter Kocsis, University of Szeged, Szeged, Hungary; Edited by Martin Rowe and Fran Granville -- EDN, May 26, 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:

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 2K with a 10-kΩ thermistor at room temperature. Accuracy degrades to 3 to 5K over the thermistor’s operating temperature.
| Read More Design Ideas |
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
(Universal Serial Bus) sound card to
spare and protect your PC sound card’s
inputs.You can add second and third thermistors to your system by adding an external resistor divider (Figure 2). This approach 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 (Reference 2).
|
References |
|
Talkback
-
In order to overcome the output and input impedances of the sound card speaker out and microphone input circuits, simply get a dual op-amp with unity gain set-ups. The first op-amp presents high impedance to the speaker out (so it doesn't load it down); the second presents low impedance to the microphone input (so it doesn't get loaded down). I've used this years ago while sweeping the frequency to do a filter analyzer/capacitor meter.
Les Hammer - 2011-30-6 13:25:19 PDT -
Mr. Erickson,
The link above to the "2 pound RLC meter" gives somewhat more detail about how the Java code works. Also there are some good online Java tutorials. Try searching "java tutorial".
Like you, I'm new at Java but hopefully not to old to learn :-) so I downloaded and ran the code for the 2 pound RLC meter and it seems to work as claimed. I can hear the tones through headphones but I have not yet built the hardware interface (op amps) for actually implementing the RLC meter. It is self calibrating and seems to zero itself to compensate for stray L and C, even without the hardware.
Hank Basse - 2011-7-6 09:53:08 PDT -
Nice idea to use the sound card as a "network analyzer". I would benefit from a description of how the software works to interface with the sound card.
I have no experience with Java and so would benefit from a description of which development environment was used and where to find it and the necessary instructions for installing it. With out such instructions I despair that I could find a way to open and run the Java program, much less modify it. For a 52 year old physicist an explanation of the Java component of this project would be most useful.
Forrest Erickson
F. Erickson - 2011-7-6 06:18:09 PDT -
This would indeed work as described, but there is a challenge, which is that the input impedance of sound cards is not consistent. The result is that calibration would be different for each instance of this method. That is not a large problem, just a challenge that must not be ignored.
William Ketel. - 2011-31-5 15:52:21 PDT






















