Server room overheat alarm

Server room overheat alarm

The cold season is almost over, very soon Summer weather will be here, and what's gonna happen ? You know it too well: your server room air-conditioning's gonna fail. Indeed, experience shows that the probability to see the server room AC fail with Summer days is directly proportional to the money the management intended to save by choosing the cheapest contractor. Unfortunately, we won't be able to fix your air conditioning, but we can help you to manage the crisis.

What should you do when the server room AC breaks down? Well, obviously you need to call the contractor, then you need to go to the server room and force a clean shutdown of all non critical servers. This way you can prevent the room from heating too fast and keep the critical servers up a long as possible...

But, to do that, you need to be informed of the AC failure soon enough. Most serious air-conditioning systems have a failure alarm, but it has to be configured properly. In my previous job, we used to know that when security called for a supposed uninterruptible power supply failure, it meant that AC had stopped. We never found out how the UPS was supposed to signal a failure (true story, I swear...)

So the AC will fail, there is no doubt about that. You only want to be warned soon enough. Such an overheat alarm is very easy to build with a Yocto-Temperature, a Yocto-PowerRelay and an emergency rotating light. Actually the relay and the rotating light are not mandatory: they are just here to make this post a bit more fun :-)

What you need...
What you need...

The DIY part takes 15 minutes top. We need to open the rotating light, install the Yocto-PowerRelay into the light body, wire it to the power. That's it: we now have a USB emergency rotating light, neat, huh ?

The relay is installed in the rotating light
The relay is installed in the rotating light

OK, done.
OK, done.

The programming part is trivial, here is a short PHP script which switches on the light and sends a mail when the temperature rises above a predefined threshold.



yDisableExceptions(); // I like to handle errors myself :-)

if  (yRegisterHub("",$errmsg)<>YAPI_SUCCESS)
  Die("yRegisterHub failed : $errmsg");
$LightRelay = yFirstRelay();
$TempSensor = yFirstTemperature();

if (is_null($LightRelay)) die("Relay not found");
if (is_null($TempSensor)) die("Temperature sensor not found");

$safeState = true;

while (true)
 {   $temp = $TempSensor->get_currentValue();
     Printf("$temp ░C\n");
     if (($temp>=DANGEROUSVALUE) && $safeState)
       { $safeState =false;
              'Server room overheat',
              "Warning:  temperature in server room is $temp ░C",
              'From:' . "\r\n" );
     if (($temp<=SAFEVALUE) && !$safeState)
       { $safeState =true;

Here it is at work:


You don't have to plug the Yocto-Temperature and the rotating light on the same machine, since all Yoctopuce USB modules are also accessible through TCP, you can have the light in your office.

You're all set! When the server room air conditioning breaks down again, you should be warned soon enough. You can also improve this script to make sure that non-critical servers are shut down automatically in case of AC failure, but this is your business...

Add a comment No comment yet
Back to blog

Yoctopuce, get your stuff connected.