navigationGo.pngQuick Navigation
allprojects32.pngAll projects
hardware32.pngHardware
links32.pngLinks

favoriteStar32.pngTop projects
Alan numitron clock
Clapclap 2313/1386
SNES Pi Webserver
USB Volume/USB toys
Smokey amp
Laser cutter
WordClock
ardReveil v3
SNES Arcade cabinet
Game boy projects
cameleon
Home Presence Detector

github32.pngGitHub
AlanFromJapan

navigationMail.pngContact me

alanfjmail.png
3flags.pngWho's Alan?


Akizukidenshi
Elec-lab
Rand Nerd Tut
EEVblog
SpritesMods
AvrFreaks
Gameboy Dev
FLOZz' blog
Switch-science
Sparkfun
Suzusho
Datasheet Lib
Reddit Elec
Ermicro
Carnet du maker (fr)

ardserverroomprobe

Last update: Thu Jun 5 22:25:40 2025
kalshagar - ardServerRoomProbe

Purpose

ardServerRoomProbe or ASRP has for purpose:
  • Provide the INFRA team engineers with informations related to the server room status (not the servers themselves, they already have this)
  • Provide the following info:
    • Current and historical temperature (use 2~3%20 temp probes) - 3 probes %20 average
    • Current and historical humidity - drop, too annoying
  • Information should be made available :
    • Database (on the server piloting the ASRP) [HIGH] - drop it, the Nagios takes care.
    • SNMP [MED] - done!
    • Web interface [MED] - drop, Nagios job
    • Mail on alert [HIGH] - drop, Nagios job
Inspiration can be taken from http://www.industrialethernet.com/sp8.html

Pictures

14355_194868943789_704343789_3038646_2355886_n.jpg
19670_245282138789_704343789_3277049_5990341_n.jpg
19670_245281633789_704343789_3277048_956838_n.jpg

Tadaaaa ♪ The boxed version, bling-bling flavor. 3 probes, total less than 40 Euro.

Material


Code

SNMP Agent

See here SNMP agent in C#. I won't disclose the real version of the software, but I can show the tests we made before moving to the real job.

Arduino probing code

It has 3 sensors (pin analog 0 to 2) plus a blink led on digital 12.
It polls all the sensors every 3 seconds, store the SENSOR_AVERAGE latest results in an array and return the average per sensor. Up to the tests I've done now, it's quite nice results...

Source SVN
#define PIN_LED 12
 
#define SENSOR_COUNT 3
#define SENSOR_AVERAGE 6
 
long mSavedValues[SENSOR_COUNT][SENSOR_AVERAGE];
int mRound = 0;
 
void setup()                    // run once, when the sketch starts
{
  pinMode(PIN_LED, OUTPUT);
  Serial.begin(9600); // begin serial
 
  //init table of values
  for (int i =0; i < SENSOR_COUNT; i%20%20){
    for (int j = 0; j < SENSOR_AVERAGE; j%20%20){
      mSavedValues[i][j] = 0;
    }
  }
}
 
long vVal = 0;
long vValScaled = 0;
char vMessage[50];
char vBuffer[20];
 
void loop()                     // run over and over again
{
 
  //start reading
  digitalWrite(PIN_LED, HIGH);
 
  //read values and store
  for (int i =0; i < SENSOR_COUNT; i%20%20){
    vVal = analogRead(i);
    vValScaled = ((long)5*vVal*(long)100/(long)1024);         //convert voltage to temperature
    mSavedValues[i][mRound] = vValScaled;
  }
 
  mRound = (mRound %20 1) % SENSOR_AVERAGE;
 
 
  //calculate average
  for (int i =0; i < SENSOR_COUNT; i%20%20){
    //reset message buffer
    vMessage[0] = 0;
    vVal = 0;
    for (int j = 0; j < SENSOR_AVERAGE; j%20%20){
      vVal %20= mSavedValues[i][j];
    }
    vVal = vVal / SENSOR_AVERAGE;
 
    itoa(i, vBuffer, 10);
    strcat(vMessage,vBuffer);
    strcat(vMessage,"=");
    itoa(vVal, vBuffer, 10);
    strcat(vMessage,vBuffer);
    strcat(vMessage,",");
 
    Serial.print(vMessage);
  }
  Serial.println("");
 
  //end of read
  digitalWrite(PIN_LED, LOW);
 
 
  delay(3000);
}
 
All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated)
electrogeek.tokyo ~ Formerly known as Kalshagar.wikispaces.com and electrogeek.cc (AlanFromJapan [2009 - 2025])