0% found this document useful (0 votes)
3 views

Filler Water Flowmeter

This document contains an Arduino code for a water flow meter using a LiquidCrystal display. It measures water flow rate and total volume, displaying the results on an LCD and sending data to the Serial monitor. The code calculates frequency based on pulse duration and updates the display every second.

Uploaded by

lovcare001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Filler Water Flowmeter

This document contains an Arduino code for a water flow meter using a LiquidCrystal display. It measures water flow rate and total volume, displaying the results on an LCD and sending data to the Serial monitor. The code calculates frequency based on pulse duration and updates the display every second.

Uploaded by

lovcare001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <LiquidCrystal.

h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
int X;
int Y;
float TIME = 0;
float FREQUENCY = 0;
float WATER = 0;
float TOTAL = 0;
float LS = 0;
const int input = A0;
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(�Water Flow Meter�);
lcd.setCursor(0,1);
lcd.print(�****************�);
delay(2000);
pinMode(input,INPUT);
}
void loop()
{
X = pulseIn(input, HIGH);
Y = pulseIn(input, LOW);
TIME = X + Y;
FREQUENCY = 1000000/TIME;
WATER = FREQUENCY/7.5;
LS = WATER/60;
if(FREQUENCY >= 0)
{
if(isinf(FREQUENCY))
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print(�VOL. :0.00�);
lcd.setCursor(0,1);
lcd.print(�TOTAL:�);
lcd.print( TOTAL);
lcd.print(� L�);
}
else
{
TOTAL = TOTAL + LS;
Serial.println(FREQUENCY);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(�VOL.: �);
lcd.print(WATER);
lcd.print(� L/M�);
lcd.setCursor(0,1);
lcd.print(�TOTAL:�);
lcd.print( TOTAL);
lcd.print(� L�);
}
}
delay(1000);
}

You might also like