Using Joystick Ports to Measure Case Temperature? 47
cheros asks: "Due to lack of options I had to stick one of my machines in a spot where I'm worried it might get hot, so I am looking for a low cost way to monitor environment temperature. As it's a humble 486 it doesn't have sensors, but it DOES have a joystick port. I'm merely looking for one of 'OK', 'Warm', 'Hot', or 'Get the fire extinguisher!' style status info so I'm not too bothered about granularity. If I remember correctly, a joystick port gives me 2 channels to fool with. I was wondering if anyone has already been playing with the idea to use an NTC (temperature sensitive resistor), and if they got anywhere. In my case it's a matter of scanning the port every so often and sending an SMS email if the situation warrants attention. As a matter of fact, the joystick port also has a couple of switch lines as well - there's all sorts of fun to be had. The last time I've coded was in 6303 assembler on Psion Organisers, so don't expect too much of me in the way of coding skills - it'll take me a while to get up to speed in Perl. Yes, I run Linux [it's a 486 - what did you expect? XP? ;-)]"
sms? (Score:2, Insightful)
486? Heat? (Score:3, Insightful)
Only Vaguely Related, but Cool... (Score:3, Interesting)
Hooking an Arcade Star Wars Flight Yoke to a PC [speedhost.com]
What a cool joystick port hack--it uses all the original electronics from a circa 1984 Star Wars or RotJ controller, except for a change of POTS. Better than any cheesy gaming steering wheel.
Netsaints good. (Score:4, Informative)
They have a cool hack premade for what you need
http://www.netsaint.org/docs/hacks/hltherm.php [netsaint.org]
Joystick ports are ancient ! (Score:3, Informative)
Your biggest problem is going to be getting thermisters in the right resistance and wattage range. IIRC, most thermisters are in the 10-100k range, and aren't good for many volts [Watts]. Self-heating!
As another poster has commented, why are you worried? A 486 certainly only needs a passive heatsink (if that) and you could probably lose the PSU fan without overheating if the Linux box is fairly idle due to idle-at-HLT powersavings.
Re:Joystick ports are ancient ! (Score:2)
So, for 5 volts over a 10k thermister, you get 0.0025W. Over a 100k resistor, you'll get 0.00025W. Hardly enough to toast any parts, but ideally you want no self-heating (which means power=0).
But, as long as you're not measuring the ambient temperature in the middle of a block of styrofoam, you won't really need to worry about selfheating - if you're in a good airflow or well connected to a mass of metal, any extra selfheating power will be disipated - there's not much temperature difference between a processor operating at 10 W and 10.00025 W.
Re:Joystick ports are ancient ! (Score:2, Informative)
Joystick pots are usually around 50K, no you do not remember correctly. And joysticks are not processor-intensive, the A/D conversion simply puts the value on the bus where it can be retrieved. Yes, the joystick port uses charge times to determine the analog value; this is used in hundreds of embedded devices to do simple A/D conversions. It's perfectly acceptable for a joystick application. In fact, I'd bet most USB joysticks do this, anyway. I've programmed USB devices and the timed-charge method is used all over the place where cost is an issue.
There is no problem getting the right thermistors. They are available in practically any reasonable resistance range necessary. Not to mention that 5 volts is about the maximum you'll see in a joystick port, and if you're running enough power to heat the thermistor, something's wrong.
While you are a moron when it comes to electronics, I agree that a 486 probably doesn't have to worry about heating. Unless it's a late-model DX4.
Re:Joystick ports are ancient ! (Score:1)
I measured a joystick -- 1.6k at one end, 10k center, 90k at the other. I also found a reference to 250k.
One-shots are cheap for A/D. But they are slow and have considerable latency. USB will not help this.
A one-shot may be fast enough if you have nothing else to do. Else it needs a dedicated counting circuit. The original PC used the CPU! reading port 201h. This cost CPU cycles that can be used for other things (redraw). Perhaps current Southbridge chips have this counting circuit.
Thank you for the reassurances on thermisters. I've always had trouble finding them. Do you know a good source, perhaps for 20 ohm 1/4W that would be good for fan speed control?
I think that joysticks are a good gaming I/O device. Unfortunately, the original PC architecture had a very cheap Game Port. Had it had an interrupt-driven port like a Mouse Port (RS232 or PS/2), then the joystick would have had better "action" (responsiveness) and the PC would be a more competitive gaming platform. Yes, consoles are attractive for more than their "action" -- they are cheaper, simpler devices.
Barking up wrong tree (Score:3, Informative)
Probably the easiest thing you can do is just attatch a heatsink and fan with some thermal compound, and maybe get one of those ball-bearing fans that fits into a PCI slot if you want some extra cooling. That alone should remove any worries you need to have about overheating the computer, so you won't even need a heat sensor.
It has a joystick port? (Score:1)
What about my 466? It DOES have a power supply...
;)
What do I expect? (Score:1)
[sigh] ever tried google?... (Score:1, Informative)
[sigh] ever try reading the submission? (Score:1)
Your link says:
1. Requirements
Microsoft Windows 95,98, 2000, Possibly ME. XP home, XP Pro
But thanks for playing!
Re:[sigh] ever try reading the submission? (Score:1)
for the H/W! (ffs. I do have other things to do besides making helpful suggestions)
Re:[sigh] ever try reading the submission? (Score:1)
Done it! (Score:3, Informative)
You could always try to hack the kernel's joystick driver to do this... aim for more accuracy.
I don't have the program I wrote anymore (sorry!) because it was an a very old boxen that has since been replaced, but I remember it was fairly short.
Don't go analog... (Score:2)
Get some (up to eight) LM78 chips which you can (usually) connect directly to your parallel port. (use the i2c-pport module from linux-i2c or lm-sensors). Then you can use all usual hardware-monitoring programs that exist for linux.
URLS for "Don't go analog..." (Score:2)
lm_sensors lm75 module docs [lm-sensors.nu]
lm75 datasheet from national [national.com]
Why not serial port? (Score:3, Informative)
Re:Why not serial port? (Score:2)
channels (Score:3, Informative)
8-------------------1 / /
s\ l a m e n e s s
ss\ f i l t e r s
ss9\-------------/15
and the pin meanings:
Re:channels (Score:2)
Re:channels (Score:1)
Use one of the axes to cut a hole in the case and let some air out.
Oh Hell (Score:2)
Due to lack of options I had to stick one of my machines in a spot where I'm worried it might get hot
Too many ways to answer...
The WizTemp may be a clue (Score:1)
Alas, the site site says the WizTemp product is no longer available, but you may want to email him to get the details on what he used and how it worked.
Analog input (Score:1)
Two solutions (Score:2)
A much more practical way is to use the Dallas Semiconductor [dalsemi.com] (now bought by Maxim [maxim-ic.com], and not the magazine [maximonline.com])
Dallas has a demo application you can use as an example - a weather station [ibutton.com] and some good application note examples. It uses the DS1820 [maxim-ic.com] or the DS18S20 [maxim-ic.com] and you can get up to 2 free samples of each [maxim-ic.com]. This device is digital, so no calibration is needed for the accuracy you need. They have a lot of other temperature sensors [maxim-ic.com]; some even have alarm outputs, so once you program it, reading only one bit will tell you if the temperature is out of limits. It has a well-written and complete datasheet [maxim-ic.com]. They've got software [ibutton.com] for win32, linux, beos, java, and 8051. If you write your own software or modifiy theirs, you don't really need a serial port adapter; just a wire on the parallel port will do (and it will power the device, too!!)
If anyone's interested, I can dig up some c-code that I used - it works with the parallel port under dos.
Re:Two solutions (Score:1)
If you can find it easily, and if it's not too long, can you post it? Those Dallas Semi products look interesting. I've got an old Pentium Pro system that has some heat issues - it'd be great to be able to remotely check the temperature.
Re:Two solutions - source code (Score:2)
The us_delay function is a hacked-up form of the built-in turbo c library tick_delay function - I'm not sure if it's still copyrighted, so I didn't include it. It may not be that useful because it was custom-tuned to my 486. Yep, I had an oscilliscope available to do the tuning, but there are otherways to tune the loop.
---- file test1821.c
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#include "usdelay.h"
unsigned char outport1=0, outport2=0x0A;
#define lptbase 0x378
// for DS1821
#define DQ_hi() {outport2&=0xF7; outp(lptbase+2,outport2);}
#define DQ_lo() {outport2|=0x08; outp(lptbase+2,outport2);}
#define DQ_in() ((inportb(lptbase+2)&0x08)^0x08)
#define DS1821off() {outport1&=0xFB; outp(lptbase,outport1);}
#define DS1821on() {outport1|=0x04; outp(lptbase,outport1);}
// 1= no presence detect, 0=presence detected
unsigned char reset_onewire(void)
{ unsigned char alone;
disable();
DQ_lo();
us_delay(750);
DQ_hi();
us_delay(100);
alone=DQ_in();
us_delay(380);
enable();
return alone ? 1 : 0;
} / / lameness filter fix
void sendbyte_onewire(unsigned char byte)
{ unsigned char mask=1;
disable();
while (mask)
{ if (mask & byte)
{ DQ_lo();
us_delay(1);
DQ_hi();
us_delay(60);
}
else
{ DQ_lo();
us_delay(60);
DQ_hi();
us_delay(1);
}
mask <<= 1;
}
enable();
} / / lameness filter fix
unsigned char getbyte_onewire(void)
{ unsigned char byte=0;
unsigned char mask=1;
unsigned char bit;
disable();
while (mask)
{ DQ_lo();
us_delay(1);
DQ_hi();
us_delay(12);
bit=DQ_in();
us_delay(45);
if (bit)
byte |= mask;
mask <<= 1;
}
enable();
return byte;
} / / lameness filter fix
unsigned char read_1821(unsigned char cmd)
{ reset_onewire();
sendbyte_onewire(cmd);
return getbyte_onewire();
} / / lameness filter fix
void cmd_1821(unsigned char cmd)
{ reset_onewire();
sendbyte_onewire(cmd);
} / / lameness filter fix
#define readstatus_1821() read_1821(0xAC)
#define readTH_1821() read_1821(0xA1)
#define readTL_1821() read_1821(0xA2)
#define readtemp_1821() read_1821(0xAA)
#define start_1821() cmd_1821(0xEE)
#define stop_1821() cmd_1821(0x22)
void main()
{ int i;
unsigned char s;
printf ("=== DS1821 test ===\n");
DS1821on();
DQ_hi();
delay(100);
i=reset_onewire();
if (i)
printf ("No one-wire devices detected.\n");
else
{ printf ("ALONE=%d\n", i);
printf ("STATUS=0x%02x\n", (unsigned int) readstatus_1821());
i=(int) (char) readTH_1821();
printf (" TH= %6.1føC,%6.1føF\n", i*1.0, i*1.8+32.0);
i=(int) (char) readTL_1821();
printf (" TL= %6.1føC,%6.1føF\n", i*1.0, i*1.8+32.0);
i=(int) (char) readtemp_1821();
printf ("temp= %6.1føC,%6.1føF\n", i*1.0, i*1.8+32.0);
start_1821();
getch();
printf ("STATUS=0x%02x\n", (unsigned int) readstatus_1821());
i=(int) (char) readTH_1821();
printf (" TH= %6.1føC,%6.1føF\n", i*1.0, i*1.8+32.0);
i=(int) (char) readTL_1821();
printf (" TL= %6.1føC,%6.1føF\n", i*1.0, i*1.8+32.0);
i=(int) (char) readtemp_1821();
printf ("temp= %6.1føC,%6.1føF\n", i*1.0, i*1.8+32.0);
while (!kbhit())
{ if ((s=readstatus_1821()) & 0x80)
{ i=(int) (char) readtemp_1821();
printf ("temp= %6.1føC,%6.1føF\n", i*1.0, i*1.8+32.0);
start_1821();
}
}
getch();
}
getch();
DQ_lo();
DS1821off();
} / / lameness filter fix
lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away)
lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away) lamenessfilter doesn't like posts with too few characters per inch. I guess they like obtuse perl programs instead of nicer c programs (flame away)
Re:Two solutions - source code (Score:2, Insightful)
And the funny thing - when I added the above paragraph to the post, it didn't pass the compression test -- but all that repetition I used did pass, and adding the above useful paragraph should have made it better... oh well...
Re:Two solutions - source code (Score:1)
Use a joystick (Score:1)
Re:Use a joystick (Score:2)
Better:
Train a hamster to run in it's wheel when it gets touched by the thermometer's bimetallic element; then connect the wheel to a portable generator, which powers an electric bell. When the bimetallic element moves, it touches the hamster, which then runs in the wheel, which then rings the bell, which alerts you that there's a problem.
If you're gonna do a Rube Goldberg, you should always involve a hamster.
google, google, google (Score:1)
Measure temperature, light, etc with your joystick port
http://www.epanorama.net/documents/joystick/pc_
PC Joystick code (Score:1)
No offense, but it's very obvious you haven't been a geek very long. We've all battled with graphics cards, serial ports, game ports, parallel ports, sound cards....anyways, here's what you need:
Fucking lameness filter....
Heres the link
PCGPE - Joystick [iitb.ac.in]
I've done it. (Score:2)
I currently have my joystick measuring the temperature of my room once a minute. I originally planned to use thermistors, but experiments with a diode turned out to work just fine. Now, I honestly have no clue how it works, because the specific diode I'm using is basically broken (doesn't act like a diode should in a normal circuit), and a normal diode doesn't work in my circuit. So it was just complete luck that it worked out for me (and I *really* don't know why it works...) But it should work theoretically with thermistors in the same way. Essentially, as long as your current varies with temperature, you can measure temperature with it.
The code is amazingly simple. Here's the important part (C, obviously, running on a Linux 2.2 kernel):
"which" is just the channel you want to read.
The tricky part is the calibration. You'll first just hope that your readings scale linearly with temperature, and mess around with an offset and slope until it matches some known readings. If it's not linear, well... But if you just want "Good", "Bad", and "This reading wasn't taken, because the CPU is a puddle of slag", then it's not so bad.
Good luck. It was a fun project for me. I still don't have the calibration worked out quite right, but that's okay. Oh, and I use RRD Tool [ee.ethz.ch] to graph the results. I have pretty, colorful, utterly useless graphs of the temperature of my room. Yay!
And some useful references... (Score:2)
I almost forgot...
A good quick reference [gamesx.com]
A good detailed reference [epanorama.net]
Um...try this place... (Score:1)
Just my 2 cents directing a guy to a place w/ lots of people who do this seemingly daily.