My Cart

Arduino Water Flow Meter with I2C LCDMay 3, 2012

Our friend Carlos has used the G1/2 Water Flow Meter and an I2C/TWI LCD to control the water flow in a standard liquid cooling for his PC. He has used a simplified circuit, without blocks or radiators.

The Flow Meter is G1/2 and the standard liquid cooling for PCs uses G1/4 so he has used 2 adaptors from G1/2 to G1/4.

Here some pics of his project:


#include < Wire.h >
#include < LiquidCrystal_I2C.h >

LiquidCrystal_I2C lcd(0x27,16,2);
// set the LCD address to 0x27 for a 16 chars and 2 line display
// reading liquid flow rate using Seeeduino and Water Flow Sensor from Seeedstudio.com
// Code adapted by Charles Gantt from PC Fan RPM code written by Crenn @thebestcasescenario.com
// http:/themakersworkbench.com http://thebestcasescenario.com http://seeedstudio.com

volatile int NbTopsFan; //measuring the rising edges of the signal
int Calc;
int hallsensor = 2;    //The pin location of the sensor

void rpm ()     //This is the function that the interupt calls
{
  NbTopsFan++;  //This function measures the rising and falling edge of the hall effect sensors signal
}
// The setup() method runs once, when the sketch starts
void setup()
{
  Serial.begin(9600); //This is the setup function where the serial port is initialised,
  lcd.init();
  lcd.backlight();
  pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
  attachInterrupt(0, rpm, RISING); //and the interrupt is attached
}

// the loop() method runs over and over again,
// as long as the Arduino has power
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 / 7.5); //(Pulse frequency x 60) / 7.5Q, = flow rate in L/hour 

  sei();
  lcd.init();
  lcd.backlight();

  lcd.print (Calc, DEC); //Prints the number calculated above
  lcd.print (" L/hour"); //Prints "L/hour" and returns a  new line
  cli();

  Serial.print (Calc, DEC); //Prints the number calculated above
  Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a  new line
}

Via: Youtube

2 thoughts on “Arduino Water Flow Meter with I2C LCD”

  • plumbing

    Arduino water flow meter with I2C LCD is used to control the water flow in a standard liquid cooling for a PC. This one has used a simplified circuit, without blocks or radiators. A great invention!

    Reply
    • Cooking Hacks
      Cooking Hacks June 3, 2012 at 7:28 pm

      Thanks. It's is a nice project to know if a liquid pump works fine in the liquid cooling for PC. A lot of useful info for PC-hackers. ;)

      Reply
Leave a Reply