Okay, I did it. All done. Works.
Interestingly, I did not use any pre-made solution. All of the other solutions used some kind of IC with timing data to send the temperature reading as a set of pulses. Even the one that used the joystick port did so by sending timed pulses to the joystick buttons, instead of being resistance measured on the X/Y axes.
But reading about the joystick port gave me the idea: Cheap $2.00 thermistors on one of the joystick port axes, write a quick bit of VB code to read the value, and you've got it.
Here is a picture of the final assembly. You will see that I have two thermistors, more on the reason for that below. They are crimped to some serial port pins I bought and plugged into the X and Y axis sensor pins for the joystick port (1-3 and 6-8). Total cost of thermistors and pins: About 6 bucks. And that's just because I had to buy an entire serial port assembly to get the pins.
Also note the audio plug coming out of the sound card. This server computer has a soundcard only because it's the device that supplies the on-hold music for our telephone system. We kept going through CD players... turns out that WinAmp on a Win98 box is more reliable. Who'd have thunk it?
Anyway, the things I learned from this:
1. In order for Windows to recognize that a joystick is present, it must be getting some kind of a reading on both the X and Y axis of the joystick, otherwise it thinks it's unplugged. Hence two thermistors. I only use the value for one of the two.
2. Even if the Device Manager says that the joystick
port is working, Windows won't actually return the values on that port until you've actually added a specific joystick in the
windows control panel.
3. Thermistors are going to return different values, you can't expect them to all be the same. In this case, the X and Y values were wildly different, even though they are reading the same temp.
4. If all you care about is a single temp threshold (in my case the threshold is "server room is hotter than I'd like it to be"), you don't need complex code to calibrate exact sensor temps. All I did was turn off the AC in the server room, then watch the axis value change. When I felt it was warm enough in there that I'd get nervous, I noted the value. My program merely sends email when that threshold is busted.
5. The value returned from the Windows joystick function goes
down as the temperature goes
up. Important to keep in mind when you're putting those pesky greater-than and less-than signs in your code...
My code currently keeps a record of the last X readings in log file on a shared folder on the main file server. X can be changed on the fly by editing the first line of that log file (for now, X is 20). I can also change the threshold value itself by editing that same log file. So I can disable the emails on the fly remotely simply by changing the threshold.
It samples the temperature about once per minute. If the last ten minutes of readings all bust the threshold, it sends an email to three addresses: My work email, my home email, and my cell phone. It will continue to do so every ten minutes until I do something about it. This repetition is important, because my corporate SMTP server is sketchy about sending emails.
Anyway, thanks everyone for your help and suggestions in this thread. I can now go on xmas vacation and not worry about the AC in the server room.