[nSLUG] External temperature sensor (Gerald)

Dop Ganger nslug at fop.ns.ca
Tue Dec 11 15:07:03 AST 2007


On Mon, 10 Dec 2007, Mike Spencer wrote:

> I've been irritated for years that there was no similar, easy-to-use,
> analog-to-digital port on a PC.  The joystick article seems to suggest
> that there's a way to do this kind of thing after all without getting
> onto the GPI Bus.

It's not quite so simple. There's a bit of fiddling involved; from memory, 
I had to read the port, wait for 10ms (ish?), and then loop reading and 
waiting until the value changed and then the differential of the two 
values was the analogue value being read. Once you've cobbled together a 
routine to do that things are good to go. My only caveat is the Creative 
Soundblaster PCI joystick ports were somewhat uncooperative. As Daniel 
noted a thermistor is non-linear, I think I took around 20 readings to get 
a reasonable level to alert on (this was for a server room to alert on 
overheating).

If you want to do a similar thing on the digital side the parallel port 
works well. I helped build a two-person roller race setup using a magnet 
and reed switch using two lines off a parallel port which did the trick 
quite nicely for next to no outlay - though it was a pain hacking off the 
end of an old printer cable and tracing each piece of wire because I was 
too cheap to buy a plug and hood...

Cheers... Dop.



More information about the nSLUG mailing list