This is actually a side project for my COD MW2 case mod found here. I plan on building a water pump cover that has a 16x2 or 20x4 LCD that will display several parameters about the water cooling system including: 2 temperature locations, 2 Fan RPM readings, Pump RPM, liquid flow rate and possibly even an audio alarm in the event of pump / flow failure.
This is what I have so far.
[CENTER][/CENTER]
The 2 10k thermistors are 2 temp sensors from Bits Power which use a 10k thermistor epoxied into the stop fitting. The 10k Trim pot is there to set the contrast on the LCD.
What I have left to do:
- Figure out flow meter
- Figure out how to read pump rpm (PPM signal on yellow wire?)
- Write code
- Set alarm parameters.
My fritzing page on this project. (Download all the files there)
http://fritzing.org/projects/arduino-controlled-pc-water-cooling-info-display/
Here is the beginning of the code. All of my code is still in the dev phaze. Right now I have it outputting the correct temp in C and F to the Display now.
[code]#include <LiquidCrystal.h>
#include <math.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
double Thermistor(int RawADC) {
long Resistance;
double Temp;
Resistance=((10240000/RawADC) - 10000);
Temp = log(Resistance);
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp - 273.15;
return Temp;
}
void printDouble(double val, byte precision) {
lcd.print (int(val));
if( precision > 0) {
lcd.print(".");
unsigned long frac, mult = 1;
byte padding = precision -1;
while(precision–) mult *=10;
if(val >= 0) frac = (val - int(val)) * mult;
else frac = (int(val) - val) * mult;
unsigned long frac1 = frac;
while(frac1 /= 10) padding–;
while(padding–) Serial.print(“0”);
lcd.print(frac,DEC) ;
}
}
void setup() {
Serial.begin(115200);
lcd.begin(16, 2);
}
#define ThermistorPIN 0
#define Thermistor2PIN 1
double temp;
void loop() {
lcd.setCursor(0, 0);
temp=Thermistor(analogRead(ThermistorPIN));
lcd.print("Sensor 1 ");
printDouble(temp,2);
lcd.print((char)223);
lcd.print(“C”);
lcd.print((char)223);
lcd.setCursor(0, 1);
temp=Thermistor(analogRead(Thermistor2PIN));
lcd.print(“Sensor 2 “);
printDouble(temp,2);
lcd.print((char)223);
lcd.print(“C”);
lcd.print((char)223);
//uncomment the next 4 lines for temp display in F
//temp = (temp * 9.0)/ 5.0 + 32.0;
//lcd.print(””);
//printDouble(temp,3);
//lcd.println(“f”);
delay(500);
}
[/code]
Code sources
http://www.arduino.cc/playground/ComponentLib/Thermistor2
http://www.arduino.cc/en/Reference/LiquidCrystal