Arduino server room thermometer (Blinky)

This is the first generation of the project with only visual alerts. The second generation was Ethernet enabled.

At my last job, I rarely had to set foot in my server room. The air conditioning unit, however, sometimes falls behind in the summer. I wanted something that would grab the attention of people walking by if it were to go over 80F ambient temperature. Except for a little wiring, the parts list is 100% Adafruit stock:


That's $31.75 if you have an UNO handy, $30 more if you don't. 

To build the LCD shield:

A long section of ribbon cable (I used 7 wires - more than I need) to go around the door and a little wire, time, and solder to assemble the bits together are all that is left. I have the proto shield's LEDs on pins 12 and 13, the LCD shield exactly how I described it built in a previous thread, and the temperature sensor on (analog 0) pin 14. I have analog 1 and 2 going to the back breadboard too just in case I want to use them.

On the ribbon cable, I am using VIN to power the display. This way the power supply can sit inside the server room and won't be hanging off the wall in the "public area." The barrel jack was perfect for that. 

Make sure to get the required libraries for the temperature sensor and LCD from the product links above or it'll never compile. The code is ugly and poorly commented, but it does the job. I even got lazy and read the temperature through two different functions (one as a string, one as an int) because I hate converting back and forth. 


// Arduino "FREAK OUT OVER 80F" thermometer

#include <PCD8544.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include "String.h"
#include "WProgram.h"

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 14

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);

// arrays to hold device address
DeviceAddress insideThermometer;
PCD8544 nokia = PCD8544(7, 6, 5, 4, 3);
char msg[125];
int flash = 0;
int currTemp;

void setup(void)
  // start serial port
  Serial.println("Dallas Temperature IC Control Library Demo");
  // locate devices on the bus
  Serial.print("Locating devices...");
  Serial.print("Found ");
  Serial.print(sensors.getDeviceCount(), DEC);
  Serial.println(" devices.");
  // report parasite power requirements
  Serial.print("Parasite power is: "); 
  if (sensors.isParasitePowerMode()) Serial.println("ON");
  else Serial.println("OFF");
  if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address for Device 0"); 
  // show the addresses we found on the bus
  Serial.print("Device 0 Address: ");
  // set the resolution to 9 bit (Each Dallas/Maxim device is capable of several different resolutions)
  sensors.setResolution(insideThermometer, 9);
  Serial.print("Device 0 Resolution: ");
  Serial.print(sensors.getResolution(insideThermometer), DEC); 
  // back to normal
  pinMode(13, OUTPUT); // Green  LED
  pinMode(12, OUTPUT); // Red LED 
  digitalWrite(12, HIGH);

void loop(void)

  sensors.requestTemperatures(); // Send the command to get temperatures
  String msgHead = "The current   server room   temp is ";
  String termMessage = msgHead + fetchTemp(insideThermometer) + "F " + "\0";
  int msglen = (termMessage.length()+1); // count the characters, add 3 just in case
  Serial.println(" - message length");
  termMessage.toCharArray(msg,msglen); // Convert it to an array called msg
  Serial.print("Attempted message ");
  nokia.drawstring(0, 0, msg);
  if (numTemp(insideThermometer) > 80){
    for (int flash = 1; flash < 10; flash++){
    digitalWrite(13, HIGH);
    digitalWrite(12, LOW);
    digitalWrite(12, HIGH);
    digitalWrite(13, LOW);
  else {


// function to print a device address
void printAddress(DeviceAddress deviceAddress)
  for (uint8_t i = 0; i < 8; i++)
    if (deviceAddress[i] < 16) Serial.print("0");
    Serial.print(deviceAddress[i], HEX);

String fetchTemp(DeviceAddress deviceAddress)
  float tempC = sensors.getTempC(deviceAddress);
  int tempF = DallasTemperature::toFahrenheit(tempC);
  String reportTemp = tempF;
  String reportText = reportTemp + "F";
  return reportTemp;

int numTemp(DeviceAddress deviceAddress)
  float tempC = sensors.getTempC(deviceAddress);
  int tempF = DallasTemperature::toFahrenheit(tempC);
  return tempF;