Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Arduino Controlled Water Cooling info center.

  1. #1
    If you can't hack it, you don't own it! Oneslowz28's Avatar
    Join Date
    Mar 2007
    Location
    Aiken, Sc
    Posts
    5,084

    Default Arduino Controlled Water Cooling info center.

    This is actually a side project for my COD MW2 case mod found in my sig. I plan on building a water pump cover that has a 16x2 or 20x4 LCD that will display several parameters about its WC loop including: 2 temperature locations, 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.


    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...-info-display/


    Here is the beginning of the code. Thanks to OvRiDe for helping me with this.

    Code:
    //Arduino Controlled 2 sensor Temp Display. Uses 2 10k thermistors and a 10k pull up resistor. 
    //Code By Charles Gantt http://themakersworkbench.com
    //Code based on Thermistor2 Elaborate code found here http://www.arduino.cc/playground/ComponentLib/Thermistor2
    //This code was developed as a side project to my Call of Duty Modern Warfare 2 Case mod found at http://www.thebestcasescenario.com/forum/showthread.php?t=21320
    
    #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.setCursor(0, 1);
      temp=Thermistor(analogRead(Thermistor2PIN));
      lcd.print("Sensor 2 ");
      printDouble(temp,2);
      lcd.print((char)223);   
      lcd.print("C   ");  
      delay(100);
    }
    Code sources
    http://www.arduino.cc/playground/Com...ib/Thermistor2
    http://www.arduino.cc/en/Reference/LiquidCrystal
    Last edited by Oneslowz28; 06-11-2010 at 11:35 PM.

  2. #2
    If you can't hack it, you don't own it! Oneslowz28's Avatar
    Join Date
    Mar 2007
    Location
    Aiken, Sc
    Posts
    5,084

    Default Re: Arduino Controlled Water Cooling info center.

    I posted the first bits of code I have worked on. I am having trouble figuring out how to get the arduino to print the temp to the LCD. As the code sits right now it will not compile due to the last line. What am I doing wrong?

    Edit: I just spent the last hour consulting with crenn and he helped me sort things out. Once he explained how the arduino tells the LCD what to display it was not that hard. Thanks to crenn for editing that code and showing me what I was doing wrong. The new code has been uploaded to the first post.

    **note to self. Add a "c" after temp display

    Code:
    lcd.print("c");   //label temp format displayed
    Last edited by Oneslowz28; 06-01-2010 at 05:35 AM.

  3. #3
    One Eye, Sixteen Cores. Kayin's Avatar
    Join Date
    Jun 2009
    Location
    Birmingham, AL
    Posts
    1,921

    Default Re: Arduino Controlled Water Cooling info center.

    Hook up a wire to read off the RPM sensor on the pump and you can do flow too.
    Project:Mithril, sponsored by Petra's Tech Shop and Sidewinder Computers-MOTM Nominee October '08




  4. #4
    If you can't hack it, you don't own it! Oneslowz28's Avatar
    Join Date
    Mar 2007
    Location
    Aiken, Sc
    Posts
    5,084

    Default Re: Arduino Controlled Water Cooling info center.

    I found some code for that also. More later

  5. #5
    Modders block rendermandan's Avatar
    Join Date
    Mar 2007
    Location
    Nowhere near the beach :(
    Posts
    1,510

    Default Re: Arduino Controlled Water Cooling info center.

    very nice!

  6. #6
    If you can't hack it, you don't own it! Oneslowz28's Avatar
    Join Date
    Mar 2007
    Location
    Aiken, Sc
    Posts
    5,084

    Default Re: Arduino Controlled Water Cooling info center.

    Thanks Dan!

    The code I found for reading RPM via the PPM signal does not work for some reason. I think its more to do with me than the code. I think I have the pull up resistor hooked up wrong. I have asked for more information over on the arduino forums. My post is on the second page of this thread http://www.arduino.cc/cgi-bin/yabb2/...52891511/15#15

  7. #7
    One Eye, Sixteen Cores. Kayin's Avatar
    Join Date
    Jun 2009
    Location
    Birmingham, AL
    Posts
    1,921

    Default Re: Arduino Controlled Water Cooling info center.

    Let me know how tis works out, I might get one off of you!
    Project:Mithril, sponsored by Petra's Tech Shop and Sidewinder Computers-MOTM Nominee October '08




  8. #8
    If you can't hack it, you don't own it! Oneslowz28's Avatar
    Join Date
    Mar 2007
    Location
    Aiken, Sc
    Posts
    5,084

    Default Re: Arduino Controlled Water Cooling info center.

    I will keep you updated Kayin.

    I can not get the Arduino to read the fan RPM correctly. I have tried 4 different fans including a CPU fan I know has a working RPM sensor. As it is right now the Arduino is just printing random RPM numbers out to the serial console. I can stop the fan with my fingers Arduino makes no change in the serial output.

    I am using a 10k resistor per the second post in this thread.

    Here is how I have tings wired up.


    And this is the sketch I am using. (found on page 1 of this thread)

    Code:
    volatile byte NbTopsFan;
    int hallsensor = 2;
    
    void rpm()
    {
     NbTopsFan++;
    }
    
    
    /***************************************/
    void setup()
    {
    // pinMode(hallsensor, INPUT);
     Serial.begin(9600);
     attachInterrupt(0, rpm, RISING);
    };
    
    void loop ()
    {
       NbTopsFan = 0;
       
       delay (1000);
       NbTopsFan = NbTopsFan * 30;
       Serial.print ("     ");
       Serial.print (NbTopsFan, DEC);
       Serial.print (" rpm");
    
       
    };
    Can anyone see where I am going wrong? Anyone want to breadboard this schematic and double check that you also get random RPM numbers in the serial console?

  9. #9
    If you can't hack it, you don't own it! Oneslowz28's Avatar
    Join Date
    Mar 2007
    Location
    Aiken, Sc
    Posts
    5,084

    Default Re: Arduino Controlled Water Cooling info center.

    With much help from Crenn we finally got this figured out.

    The water pump I have selected outputs RPM signals similar to a standard three wire PC fan. In fact you can plug the signal wire to the CPU fan header on a motherboard and if your pump dies or stops sending a signal it will shut your PC down to prevent a CPU failure due to heat. While a nice feature for safety, it will be much cooler to see the RPM at which your pump is running than knowing your CPU wont melt if it dies right?

    Since the Fan and Pump RPM signals are so similar, and my water pump has not arrived yet I decided to dev using a 120mm PC fan. The following schematic should explain how to wire things up.


    This is pretty simple to hook up. First you need to run the Signal wire (almost always yellow) to the breadboard. Then from it connect a jumper wire to Arduino Digital Pin 2. Also from the sensor wire you need to connect a 10k resistor to the Arduino's 5V pin. This is a simple pull-up resistor. We also need to make sure that we connect the fans ground line to one of the Arduino's ground pins. Next just connect the fans power wire to the PSUs 12v line and the fans ground wire to the PSUs ground.

    Now upload the following code to your Seeeduino, and then open the serial terminal. Again I would like to thank Crenn for his help with the code.

    Code:
    //code by Crenn from http://thebestcasescenario.com
    //project by Charles Gantt from http://themakersworkbench.com
    
    
    /*To disable interrupts:
     cli();                // disable global interrupts
    
    and to enable them:  
     sei();                // enable interrupts
    */
    
    
                                       //Varibles used for calculations
    int NbTopsFan; 
    int Calc;
    
                                      //The pin location of the sensor
    int hallsensor = 2;
    
                            
    typedef struct{                  //Defines the structure for multiple fans and their dividers
      char fantype;
      unsigned int fandiv;
    }fanspec;
    
    //Definitions of the fans
    fanspec fanspace[3]={{0,1},{1,2},{2,8}};
    
    char fan = 1;   //This is the varible used to select the fan and it's divider, set 1 for unipole hall effect sensor 
                   //and 2 for bipole hall effect sensor 
    
    
    void rpm ()      //This is the function that the interupt calls 
    { 
     NbTopsFan++; 
    } 
    
                  //This is the setup function where the serial port is initialised,
                 //and the interrupt is attached
    void setup() 
    { 
     pinMode(hallsensor, INPUT); 
     Serial.begin(9600); 
     attachInterrupt(0, rpm, RISING); 
    } 
    void loop () 
    {
       NbTopsFan = 0;	//Set NbTops to 0 ready for calculations
       sei();		//Enables interrupts
       delay (1000);	//Wait 1 second
       cli();		//Disable interrupts
       Calc = ((NbTopsFan * 60)/fanspace[fan].fandiv); //Times NbTopsFan (which is apprioxiamately the fequency the fan is spinning at) by 60 seconds before dividing by the fan's divider
       Serial.print (Calc, DEC); //Prints the number calculated above
       Serial.print (" rpm\r\n"); //Prints " rpm" and a new line
    }
    You should see an RPM output in the serial terminal. It is accurate within 10-15 RPM of the fans actual RPM which is close enough for me. If your RPM output seems to be double what it should be your fan may have a bipolar Hall efect sensor and its counting each pass of the magnets pole as a single RPM when each should be 1/2 an RPM. No worries though as this is an easy fix. Just simply change the " char fan = 0 code from 0 to 1. Upload the modified code and you should be seeing accurate RPM numbers.

    Next time we will cover how to measure and display the liquid flow rate of the system.

    What I have left to do:

    • Work out flow meter design and schematic
    • Determine alarm parameters
    • Complete code and refine it.


    My fritzing page on this project. (Download all the files there)
    Reading PC Fan / Water Pump RPM with an Arduino
    Last edited by Oneslowz28; 06-07-2010 at 06:01 AM.

  10. #10
    If you can't hack it, you don't own it! Oneslowz28's Avatar
    Join Date
    Mar 2007
    Location
    Aiken, Sc
    Posts
    5,084

    Default Re: Arduino Controlled Water Cooling info center.

    Just wanted to post an updated schematic of the whole project.

    I am still working on refining the custom board but thought I would post my latest revision to the schematic. This was created in Eagle. I will get a new fritzing schematic up soon.

    Click the image for a full sized version.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •