Jump to content

Case air temp display, Pics + code

Go to solution Solved by TheEndisHere,

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.

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
 Serial.begin(9600);
// sensors.begin();
 lcd.begin(20,4);
 // starts each sensor
 sensors1.begin();   
 sensors2.begin();  
 sensors3.begin();
 sensors4.begin();
 sensors5.begin(); 

}

void loop(void)

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

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

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

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

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

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

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

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

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

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

// Intake temp
 lcd.setCursor(0,0);
 lcd.print("Intake= ");
 
 lcd.setCursor(8,0);
 lcd.print(temp1c);
 lcd.setCursor(12,0);
 lcd.print("C ");
  
 lcd.setCursor(14,0);
 lcd.print(temp1f);
 lcd.setCursor(18,0);
 lcd.print("F  ");
 
// SYS Exhaust
 lcd.setCursor(0,1);
 lcd.print("Sys Ex=");
 
 lcd.setCursor(8,1);
 lcd.print(temp2c);
 lcd.setCursor(12,1);
 lcd.print("C ");

 lcd.setCursor(14,1);
 lcd.print(temp2f);
 lcd.setCursor(18,1);
 lcd.print("F ");
 
// GPU temp
 lcd.setCursor(0,2);
 lcd.print("GPU Ex=");
 
 lcd.setCursor(8,2);
 lcd.print(temp3c -1);
 lcd.setCursor(12,2);
 lcd.print("C ");

 lcd.setCursor(14,2);
 lcd.print(temp3f -2);
 lcd.setCursor(18,2);
 lcd.print("F ");
 
// PS temp
 lcd.setCursor(0,3);
 lcd.print("PS=");
 
 lcd.setCursor(4,3);
 lcd.print(temp4c -.2);
 lcd.setCursor(8,3);
 lcd.print("C ");

 //lcd.setCursor(5,3);
 //lcd.print(temp4f);
 //lcd.setCursor(8,3);
 //lcd.print("F ");
 
// HDD temp
 lcd.setCursor(10,3);
 lcd.print("HDD=");
 
 lcd.setCursor(14,3);
 lcd.print(temp5c -1.2);
 lcd.setCursor(18,3);
 lcd.print("C ");

 //lcd.setCursor(14,3);
 //lcd.print(temp5f -1);
 //lcd.setCursor(18,3);
 //lcd.print("C ");
  
 delay(1000);

 

IMG_20190207_220418.jpg

IMG_20190207_220357.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, TheEndisHere said:

-snip-

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:

Spoiler

CPU: Intel Core i5-4670k @ 4.3GHz
Motherboard: Asus Maximus VI Formula
RAM: 16GB Corsair Vengeance DDR3
GPU: Nvidia GeForce GTX770 2GB
Case: Some free Sharkoon case
Storage: Crucial MX500 500GB SSD | Western Digital Blue 1TB
PSU: Corsair HX750
Display(s): Acer framless 24" 1080p thing | Acer 22" 1600x900 thing
Cooling: Corsair H100i AIO | 2 x Corsair LL120 front intakes on radiator | 1 x Corsair LL120 rear exhaust
Keyboard: Steelseries Apex
Mouse: R.A.T 7
Sound: HyperX Cloud II headset | Creative EAX 5.1 speakers
OS: Windows 10 Pro

 

Link to comment
Share on other sites

Link to post
Share on other sites

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.

Link to comment
Share on other sites

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 comment
Share on other sites

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

×