Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Page 1 of 2 1 2 >
Topic Options
#194212 - 18/12/2003 18:48 D-I-Y room temperature sensor circuit for PC
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
I'd like to put together a project for sensing the temperature of the room. I'll bet it can be done with a few inexpensive components and a bit of VB code, but I'm not sure where to start.

Here is the basic concept...

- I have a server room here at work.

- The server room has its own air conditioning unit.

- The air conditioning unit sometimes will not come back on after a power outage. The servers are on UPS's, but the air conditioner uses too much juice to put on a UPS.

- I simply need to enter the server room and press one of the buttons on the control panel to make the AC start working again.

- I have had trouble with getting the building owners to fix the AC so that it works properly. They have sent techs in, several times, to fix the problem. They have not been able to do so. And moreso, they are unable to reproduce the problem when they deliberately cut power to the AC unit.

- I have resigned myself to the fact that it's not going to get fixed, and that it's not going to get replaced either, without a serious amount of corporate red tape.

- I want to add a cheap circuit to the parallel port or serial port of one of the 24/7 computers that live in that room. The circuit would sense the ambient temperature in the room.

- I want to be able to write a VB program that will run on the computer 24/7, and give me the temperature reading. When the temperature rises above a designated threshold, it will send an email to a designated set of addresses.

Writing the VB code to send the email isn't a problem, just the part that reads the temp value will depend on whatever D-I-Y circuit is created. I've got no idea how something like that would be done.

There's a lot of temp sensors to be found in Google, but they are either very expensive integrated-web-server boxes, or they are designed to interface with an X-10 system. Either way, they're more money than I want to spend. I'm sure it could be done for ten bucks in Radio Shack parts which I'd happily pay out of my own pocket if it could make me sleep better.

Does anyone know of an existing D-I-Y project which can do this?
_________________________
Tony Fabris

Top
#194213 - 18/12/2003 18:54 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
You can use Dallas Semiconductor/Maxim one wire thermistor chips. They're pretty easy to use and interface to. I've not bought this kit or anything else from them but it looks like it would do exactly what you want. And it's reasonably cheap for the adapter. You'll need to buy more of the thermistor chips yourself but Digikey should have it.


Edited by tman (18/12/2003 18:56)

Top
#194214 - 18/12/2003 18:59 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
g_attrill
old hand

Registered: 14/04/2002
Posts: 1172
Loc: Hants, UK
I used to do temperature sensing on my BBC Micro. They were neat in that they had an analogue joystick port and you could put a thermistor straight on it and you were away.

Anyway, here's three different ideas:

http://www.ugcs.caltech.edu/~dstaff/sysmeter.html
http://www.zejn.si/~natan/electro/tempmeter/
http://www.cesko.host.sk/GamePortTemp_eng.htm (same as my BBC Micro experiments)

Gareth

Top
#194215 - 18/12/2003 19:01 Re: D-I-Y room temperature sensor circuit for PC [Re: tman]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Looks like it's the sort of thing I'm talking about. A bit more expensive that I expected, but certainly I'm not going to quibble for $25.00. Can't tell if their $25.00 kit contains everything I need or not, though?
_________________________
Tony Fabris

Top
#194216 - 18/12/2003 19:17 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
It's a kit so you'll need to solder it yourself. I'm guessing you'll need some veroboard/stripboard as well. There should be similar kits out there which come with a PCB and are preassembled.

You can actually bitbang the 1-wire protocol using a parallel port and a couple components but it'd be much harder for you to interface.

The only problem with using the 1-wire chips is that they're quite expensive. Around $4-$5 each.

Top
#194217 - 18/12/2003 19:21 Re: D-I-Y room temperature sensor circuit for PC [Re: g_attrill]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Of course, the game port! An analog sensor. I think at least one of the PCs in the room has a game port on its sound card.

Plug any temp sensor into the right pins of the game port and you're there. Then it's just a question of reading the value and writing the code.
_________________________
Tony Fabris

Top
#194218 - 18/12/2003 19:30 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
dalewoodian
stranger

Registered: 10/06/2002
Posts: 37
Loc: Meridian MS
You might want to check this site. It also has a utility to measure and log temps.

http://www.geocities.com/kiwi_36_nz/tlog/tlog.htm
_________________________
Dalewoodian

Top
#194219 - 18/12/2003 19:37 Re: D-I-Y room temperature sensor circuit for PC [Re: dalewoodian]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Cool! Super simple interface (one chip plugs straight into parallel port). Although its software can't be run in Windows, though.

Keep these suggestions coming, this is exactly the sorts of things I was looking for. I'm sifting through them until the perfect one appears.
_________________________
Tony Fabris

Top
#194220 - 18/12/2003 19:37 Re: D-I-Y room temperature sensor circuit for PC [Re: dalewoodian]
dalewoodian
stranger

Registered: 10/06/2002
Posts: 37
Loc: Meridian MS
Well that last link is a dos only but here is the link to a windows program with alot of info
WinThermo 1.0
http://idd0097z.eresmas.net/teameuphoria/
_________________________
Dalewoodian

Top
#194221 - 18/12/2003 19:44 Re: D-I-Y room temperature sensor circuit for PC [Re: dalewoodian]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
That one looks really cool, and can even run under NT with the right driver. No source code, though. Perhaps I could talk to the authors...
_________________________
Tony Fabris

Top
#194222 - 18/12/2003 19:55 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
Rod
journeyman

Registered: 04/05/2000
Posts: 84
Loc: Australia
Andy is using this in his "server room".

Top
#194223 - 18/12/2003 20:05 Re: D-I-Y room temperature sensor circuit for PC [Re: tman]
Folsom
member

Registered: 12/08/2001
Posts: 175
Loc: Atlanta
I don't know if I would use a 1 wire bus part. I would rather use a SMBus part so you could bit bang it using serial flow control lines. SMBus has very low timing constraints compared to 1 wire bus.

Link to various SMBus parts from Maxim

Some of them have local measurements, so you don't have to have external thermistors added (MAX6648 for example).

You probably won't have to pay for them if you can get free samples (1-2 parts).

If you had a SMBus header on the motherboard, you could possibly just plug it in without much of an adapter board. You would need some wire, a couple of pull up resistors, and a VCC bypass cap. This is potentially how I am going to connect my Nixie computer display (if I ever get started on it!).

Top
#194224 - 18/12/2003 20:13 Re: D-I-Y room temperature sensor circuit for PC [Re: Folsom]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
True. SMBus/I2C has quite a large frequency range. The advantage of the 1-wire parts is that you can actually do it with 2 wires only and that would supply power and carry data. It's a bit slower when using parasitic power though.

The SMBus is quite important for the operation of your computer so don't fry it! At a minimum, the clock generator and RAM SPD EEPROMs are wired into it.

If you do use the SMBus then remember that most true SMBus interfaces don't like you hanging I2C devices off them. An example would be the Intel PIIX4 chipset. A lot of other chipsets implement the SMBus as an I2C bus so don't care. If you've got a I2C bus then your choice of chips is greatly increased.

Top
#194225 - 18/12/2003 20:50 Re: D-I-Y room temperature sensor circuit for PC [Re: tman]
Folsom
member

Registered: 12/08/2001
Posts: 175
Loc: Atlanta
If Tony connected the part using the SMBus, then he could possibly use motherboard monitor to read the temperatures. It looks like the MAX6654 is supported by motherboard monitor.

Otherwise, it would be safer to just drive it from the serial port. It is pretty trivial to set the flow control pin from VB to bit bang the data. A transistor would be needed to mux the data to read the ACK, though. Power could come by feeding off the keyboard connector.

Top
#194226 - 18/12/2003 20:54 Re: D-I-Y room temperature sensor circuit for PC [Re: Folsom]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
You could probably power it off the DTR pin as the power requirements of that chip is low. It'd save you having to mess about with two plugs.

If you don't have a SMBus header on the motherboard you can tap it off a DIMM but this is a little risky.

Top
#194227 - 19/12/2003 02:15 Re: D-I-Y room temperature sensor circuit for PC [Re: Rod]
andy
carpal tunnel

Registered: 10/06/1999
Posts: 5916
Loc: Wivenhoe, Essex, UK
I certainly do, works very well. I must get round to wiring up the other three inputs so I can measure the outside temperature and the temperature inside my two servers (which annoyingly both have internal sensors that I can't make use of).

I'm still looking for a cheap ($30 or under) humidty sensor kit though.
_________________________
Remind me to change my signature to something more interesting someday

Top
#194228 - 19/12/2003 08:12 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
Buy an empeg. Install it in the room with ethernet, and always leave it in standby (so it remains at room temperature). Use http to periodically poll /proc/empeg_therm to read the room temperature in degrees C. Problem Solved!

Top
#194229 - 19/12/2003 08:19 Re: D-I-Y room temperature sensor circuit for PC [Re: mlord]
JBjorgen
carpal tunnel

Registered: 19/01/2002
Posts: 3584
Loc: Columbus, OH
he he...I like Mark's solution.
_________________________
~ John

Top
#194230 - 19/12/2003 08:22 Re: D-I-Y room temperature sensor circuit for PC [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Buy an empeg. Install it in the room with ethernet, and always leave it in standby (so it remains at room temperature). Use http to periodically poll /proc/empeg_therm to read the room temperature in degrees C. Problem Solved!
You know, I'm not making much use of my Mark 1...

Of course, if I did that, I'd need a way to get empeg_therm (okay, I could do it from the serial port with a bit of scripting), but then I'd want to use it as the music server for our phone system music-on-hold, thus defeating the leave-in-standby.

As it stands, the PC I'm thinking of using for our thermal sensor is the music-on-hold server... It's the only one running win98 and a lot of those thermal sensor programs won't run on NT variants...
_________________________
Tony Fabris

Top
#194231 - 19/12/2003 10:10 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
jmwking
old hand

Registered: 27/02/2003
Posts: 777
Loc: Washington, DC metro
Argh! Where was this thread two weeks ago? I've been having trouble with our building turning off the water to the cooling towers, which shuts down our server room A/C with high pressure.

Since our A/C can't reset itself, either, I wound up getting one of these for about $200 (not $25, but it did take only 10 minutes to set up). It monitors temperature and a UPS, and sends a message to an internal mailbox, two pagers, and my cell phone if an alarm is triggered.

-jk

Top
#194232 - 19/12/2003 11:45 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
When the temperature rises above a designated threshold, it will send an email to a designated set of addresses.
No. What you want it to do is then send another signal that trips a relay connected to the switch to reset the AC for you.
_________________________
Bitt Faulk

Top
#194233 - 19/12/2003 11:45 Re: D-I-Y room temperature sensor circuit for PC [Re: jmwking]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
I've been having trouble with our building turning off the water to the cooling towers, which shuts down our server room A/C with high pressure.
Wait a second. Maybe that's the problem we're having, and the reason they can't reproduce the problem by shutting off the power to the AC unit itself. Can you describe in more detail exactly what the problem was?
_________________________
Tony Fabris

Top
#194234 - 19/12/2003 11:50 Re: D-I-Y room temperature sensor circuit for PC [Re: wfaulk]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
What you want it to do is then send another signal that trips a relay connected to the switch to reset the AC for you.
Yeah, I'd thought of that, too. And it's certainly an option. But the A/C is controlled by a battery-operated remote with rubber buttons that I don't want to mess up.

And we've already looked into problems with the remote as being the source of the issue, and it's not, as far as we can tell.
_________________________
Tony Fabris

Top
#194235 - 19/12/2003 12:16 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
jmwking
old hand

Registered: 27/02/2003
Posts: 777
Loc: Washington, DC metro
Wait a second. Maybe that's the problem we're having, and the reason they can't reproduce the problem by shutting off the power to the AC unit itself. Can you describe in more detail exactly what the problem was?
Well, our A/C unit is a standard water cooled one, with redundant compressors but a single water supply, alas.

The long answer, as I understand it: the fan blows server room air over coils (think radiator) filled with coolant (they used to use freon, I have no idea what they use now). The compressors pull the heat from the air by vaporizing the coolant. The coolant runs through cooler water, recondensing the coolant for another cycle, and handing the heat off to the water. The now warmer water circulates from our server room to the cooling tower on the roof, with radiators that push the heat into the air, and returning cooler water for another cycle.

When they stop the water circulation, the water sits and gets hot, the coolant can't recondense, and the overload circuits shut the compressors down to keep them from blowing up (or at least leaking all the coolant under extreme pressure).

FWIW, I can almost never get the building to admit to this being the problem, but our A/C unit reports the error so we know that's what happened. We have one building engineer that'll tell us that, yes, their night guy shut it down for half an hour, by mistake... "Sorry."

They're supposed to notify us before any scheduled maintenance on the water system, and any time they have an emergency shutdown. So far, they've never actually notified us, so we got our own monitor. <sigh>

Edit: And we're looking into a secondary A/C unit that is air based, and push the heat into an adjacent storage room on the building's main A/C, but that'll be several thousand bucks, and we move, um, glacially on that sort of purchase.

-jk


Edited by jmwking (19/12/2003 12:19)

Top
#194236 - 19/12/2003 12:33 Re: D-I-Y room temperature sensor circuit for PC [Re: jmwking]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Velly Velly intelestink. I will investigate this as a potential possibility.

If our system runs in a similar fashion, I could see this being the very problem. Our server room AC uses a heat exchanger located on the roof. And based on where we live, it wouldn't surprise me if we lost water pressure when the power to this neighborhood went out. It would make sense that if we lost water pressure, the safety circuits would shut down the heat exchanger on the roof. Which would explain why, when they deliberately killed the power to the heat exchanger and the AC unit, they were unable to reproduce the problem: They still had water pressure.
_________________________
Tony Fabris

Top
#194237 - 19/12/2003 12:42 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
...the A/C is controlled by a battery-operated remote with rubber buttons that I don't want to mess up.

In that case, try using Girder with a UIRT2 or USB-UIRT.
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#194238 - 19/12/2003 12:52 Re: D-I-Y room temperature sensor circuit for PC [Re: genixia]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Not a bad idea, but now getting into the realm of "expense". Remember, I'm going out-of-pocket for something that should really be the company's problem...
_________________________
Tony Fabris

Top
#194239 - 19/12/2003 12:53 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
jmwking
old hand

Registered: 27/02/2003
Posts: 777
Loc: Washington, DC metro
I don't think you lost water pressure, as it's usually a closed loop, but rather water flow.

You said your A/C isn't on a battery or generator, so it should have been off while the water wasn't flowing. Perhaps your A/C restarted as soon as the power came back on, the water didn't start flowing right away, and your compressor kicked out. How the water starts flowing would be a question for your building people. A baseball bat might help you get info from them; I find it's like pulling teeth. It takes less than 3 minutes without water flow for our unit to go into overload protection, so we have a few minute delay on our A/C startup to give the water a chance to get moving.

-jk

Top
#194240 - 19/12/2003 13:10 Re: D-I-Y room temperature sensor circuit for PC [Re: jmwking]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Gotcha. Thanks.
_________________________
Tony Fabris

Top
#194241 - 19/12/2003 14:17 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3996
Loc: Manchester UK
Remember, I'm going out-of-pocket for something that should really be the company's problem...

I used to have that attitude, and I found it got me absolutely nowhere. Nowadays, if it's the companys problem they can pay to fix it.

Maybe that's because I've just been told we're being sold off. Any loyalty I have for my employer has vanished, they don't give a flying fuck about me. Why should I care about them?

I think I need to go for a drive...
_________________________
Cheers,

Andy M

Top
#194242 - 19/12/2003 14:49 Re: D-I-Y room temperature sensor circuit for PC [Re: andym]
g_attrill
old hand

Registered: 14/04/2002
Posts: 1172
Loc: Hants, UK
I think I need to go for a drive...

<joke>

This is a nice place at this time of year...

http://www.multimap.com/map/browse.cgi?X=560000&Y=95000&scale=100000&coordsys=gb

</joke>

Top
#194243 - 19/12/2003 15:06 Re: D-I-Y room temperature sensor circuit for PC [Re: g_attrill]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Yeah, sometimes my company makes me want to drive off a cliff, too.
_________________________
Tony Fabris

Top
#194244 - 19/12/2003 15:37 Re: D-I-Y room temperature sensor circuit for PC [Re: g_attrill]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3996
Loc: Manchester UK
I'm not that upset, if we get bought by microsoft then maybe...
_________________________
Cheers,

Andy M

Top
#194245 - 24/12/2003 15:42 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
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.


Attachments
193906-thermistors.jpg (205 downloads)

_________________________
Tony Fabris

Top
#194246 - 24/12/2003 16:00 Re: D-I-Y room temperature sensor circuit for PC [Re: tfabris]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Now you need to figure out how to plug it into an SNMP agent and log it via MRTG.
_________________________
Bitt Faulk

Top
#194247 - 28/12/2003 05:18 Re: D-I-Y room temperature sensor circuit for PC [Re: wfaulk]
andy
carpal tunnel

Registered: 10/06/1999
Posts: 5916
Loc: Wivenhoe, Essex, UK
Though of course you don't need SNMP with MRTG. You can just as easily output the reading from stdout for MRTG to read.
_________________________
Remind me to change my signature to something more interesting someday

Top
#194248 - 28/12/2003 15:56 Re: D-I-Y room temperature sensor circuit for PC [Re: andy]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Good point. I always think of getting MRTG data from remote computers.
_________________________
Bitt Faulk

Top
Page 1 of 2 1 2 >