Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Case air temp display, Pics + code

The model of the thermometers I used is the DS18b20. I did have to calibrate them in a bath of ice water, they were off about +-1.5C.

Recommended Posts

Posted · Original PosterOP

For a while, I have wanted to know what the different temps were in my case. It's not necessary at all but I like having all the info.

The info has helped me tune my fan curves for all my components keeping my PC quieter and 5C cooler ish.

Just thought this is a good place to share it.  


I used an Arduino Uno and 5 digital temps. sensors, and a 20 X 4 LCD. So here is the code I think its C+


#include <LCD.h>
#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>

#include <DallasTemperature.h>
#include <OneWire.h>

OneWire ourWire1(9);  
OneWire ourWire2(10);             
OneWire ourWire3(11);
OneWire ourWire4(12);
OneWire ourWire5(13);
DallasTemperature sensors1(&ourWire1); 
DallasTemperature sensors2(&ourWire2); 
DallasTemperature sensors3(&ourWire3);
DallasTemperature sensors4(&ourWire4);
DallasTemperature sensors5(&ourWire5);

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

void setup() 

  // sets the lcd
// sensors.begin();
 // starts each sensor


void loop(void)

//temp intake data
float temp1c= sensors1.getTempCByIndex(0); 
float temp1f= sensors1.getTempFByIndex(0); 

float temp2c= sensors2.getTempCByIndex(0); 
float temp2f= sensors2.getTempFByIndex(0); 

float temp3c= sensors3.getTempCByIndex(0); 
float temp3f= sensors3.getTempFByIndex(0);

float temp4c= sensors4.getTempCByIndex(0); 
float temp4f= sensors4.getTempFByIndex(0); 

float temp5c= sensors5.getTempCByIndex(0); 
float temp5f= sensors5.getTempFByIndex(0); 

Serial.print("Temperatura 1 = ");
Serial.print(" C");

Serial.print("   Temperatura 2 = ");
Serial.println(" C");

Serial.print("   Temperatura 3 = ");
Serial.println(" C");

Serial.print("   Temperatura 4 = ");
Serial.println(" C");

Serial.print("   Temperatura 5 = ");
Serial.println(" C");

// Intake temp
 lcd.print("Intake= ");
 lcd.print("C ");
 lcd.print("F  ");
// SYS Exhaust
 lcd.print("Sys Ex=");
 lcd.print("C ");

 lcd.print("F ");
// GPU temp
 lcd.print("GPU Ex=");
 lcd.print(temp3c -1);
 lcd.print("C ");

 lcd.print(temp3f -2);
 lcd.print("F ");
// PS temp
 lcd.print(temp4c -.2);
 lcd.print("C ");

 //lcd.print("F ");
// HDD temp
 lcd.print(temp5c -1.2);
 lcd.print("C ");

 //lcd.print(temp5f -1);
 //lcd.print("C ");




Link to post
Share on other sites
6 hours ago, TheEndisHere said:


Cool project, and thanks for sharing the code :)


Any chance of the make/model of the temp sensors that you used?

I will only ever answer to the best of my ability - there is absolutely no promises that I will be correct. Or helpful. At all.


My toaster:


CPU: Intel Core i5-4670k
Motherboard: Asus Maximus VI Formula
RAM: 16GB Corsair Vengeance DDR3
GPU: Nvidia GeForce GTX770 2GB
Case: Antec P180
Storage: Western Digital Blue 1TB
PSU: Corsair HX750
Display(s): AOC 24" 1080p thing, Acer 22" 1600x900 thing
Cooling: EVGA CPU cooler, 1x Silent Wings 2 120mm PWM, 2x Antec standard case fans (3 speed manual)
Keyboard: Steelseries Apex
Mouse: R.A.T 7
Sound: Cheap Aldi chinesium headset, Creative EAX 5.1 speakers
OS: Windows 10


Link to post
Share on other sites

As an alternative to DS1820 you can use MCP9701 or MCP9700 , with or without A at the end.  Here's the datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/20001942G.pdf


Instead of 1 wire protocol, they simply output a voltage which you can read using the 10bit ADC in the microcontroller - they're also designed to output 10mV or 19.5mV / degree Celsius ... with a 10bit ADC, and the voltage reference set to 4.096v, you basically have 4mV steps, so around 0.2 degree celsius steps... good enough.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now