Abdul.Hadi
Newbie level 5
Hello Guys
I am currently working on A17 turbine flow meter. I am having a trouble with calibrating the flow meter. I am setting a certain value of flow rate on the rota meter however the flow sensor doesn't giving the exact values.
I have attached the comparison values.
Actual (Rota meter)
Experimental (A17 Flowmeter)
The Aurdino Code I am using for the flow meter is :
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
volatile int flow_frequency; // Measures flow sensor pulsesunsigned
int l_hour; // Calculated litres/hour
unsigned char flowsensor = 2; // Sensor Input
unsigned long currentTime;
unsigned long cloopTime;
void flow () // Interrupt function
{
flow_frequency++;
}
void setup()
{
lcd.begin();
lcd.backlight();
pinMode(flowsensor, INPUT);
digitalWrite(flowsensor, HIGH); // Optional Internal Pull-Up
Serial.begin(9600);
attachInterrupt(0, flow, RISING); // Setup Interrupt
sei(); // Enable interrupts
currentTime = millis();
cloopTime = currentTime;
}
void loop ()
{
currentTime = millis();
// Every second, calculate and print litres/hour
if(currentTime >= (cloopTime + 1000))
{
cloopTime = currentTime; // Updates cloopTime
// Pulse frequency (Hz) = 7.5Q, Q is flow rate in L/min.
l_hour = (flow_frequency/13.5); // (Pulse frequency x 60 min) / 7.5Q = flowrate in L/hour
flow_frequency = 0; // Reset Counter
Serial.print(l_hour, DEC); // Print litres/hour
Serial.println(" L/sec");
lcd.setCursor(0, 0); // set cursor to 2nd row
lcd.print("Flow: ");
lcd.setCursor(6, 0); // set cursor to 2nd row and colum 6
lcd.print(l_hour, DEC);
lcd.setCursor(11, 0); // set cursor to 2nd row and colum 11
lcd.print("L/sec");
}
}#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
volatile int flow_frequency; // Measures flow sensor pulsesunsigned
int l_hour; // Calculated litres/hour
unsigned char flowsensor = 2; // Sensor Input
unsigned long currentTime;
unsigned long cloopTime;
void flow () // Interrupt function
{
flow_frequency++;
}
void setup()
{
lcd.begin();
lcd.backlight();
pinMode(flowsensor, INPUT);
digitalWrite(flowsensor, HIGH); // Optional Internal Pull-Up
Serial.begin(9600);
attachInterrupt(0, flow, RISING); // Setup Interrupt
sei(); // Enable interrupts
currentTime = millis();
cloopTime = currentTime;
}
void loop ()
{
currentTime = millis();
// Every second, calculate and print litres/hour
if(currentTime >= (cloopTime + 1000))
{
cloopTime = currentTime; // Updates cloopTime
// Pulse frequency (Hz) = 7.5Q, Q is flow rate in L/min.
l_hour = (flow_frequency/13.5); // (Pulse frequency x 60 min) / 7.5Q = flowrate in L/hour
flow_frequency = 0; // Reset Counter
Serial.print(l_hour, DEC); // Print litres/hour
Serial.println(" L/sec");
lcd.setCursor(0, 0); // set cursor to 2nd row
lcd.print("Flow: ");
lcd.setCursor(6, 0); // set cursor to 2nd row and colum 6
lcd.print(l_hour, DEC);
lcd.setCursor(11, 0); // set cursor to 2nd row and colum 11
lcd.print("L/sec");
}
}
If you can help me in this regard.
I am thinking there is an issue in my code.
I am currently working on A17 turbine flow meter. I am having a trouble with calibrating the flow meter. I am setting a certain value of flow rate on the rota meter however the flow sensor doesn't giving the exact values.
I have attached the comparison values.
Actual (Rota meter)
Experimental (A17 Flowmeter)
--- Updated ---
Hello Guys
I am currently working on A17 turbine flow meter. I am having a trouble with calibrating the flow meter. I am setting a certain value of flow rate on the rota meter however the flow sensor doesn't giving the exact values.
I have attached the comparison values.
Actual (Rota meter)
Experimental (A17 Flowmeter)
The Aurdino Code I am using for the flow meter is :
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
volatile int flow_frequency; // Measures flow sensor pulsesunsigned
int l_hour; // Calculated litres/hour
unsigned char flowsensor = 2; // Sensor Input
unsigned long currentTime;
unsigned long cloopTime;
void flow () // Interrupt function
{
flow_frequency++;
}
void setup()
{
lcd.begin();
lcd.backlight();
pinMode(flowsensor, INPUT);
digitalWrite(flowsensor, HIGH); // Optional Internal Pull-Up
Serial.begin(9600);
attachInterrupt(0, flow, RISING); // Setup Interrupt
sei(); // Enable interrupts
currentTime = millis();
cloopTime = currentTime;
}
void loop ()
{
currentTime = millis();
// Every second, calculate and print litres/hour
if(currentTime >= (cloopTime + 1000))
{
cloopTime = currentTime; // Updates cloopTime
// Pulse frequency (Hz) = 7.5Q, Q is flow rate in L/min.
l_hour = (flow_frequency/13.5); // (Pulse frequency x 60 min) / 7.5Q = flowrate in L/hour
flow_frequency = 0; // Reset Counter
Serial.print(l_hour, DEC); // Print litres/hour
Serial.println(" L/sec");
lcd.setCursor(0, 0); // set cursor to 2nd row
lcd.print("Flow: ");
lcd.setCursor(6, 0); // set cursor to 2nd row and colum 6
lcd.print(l_hour, DEC);
lcd.setCursor(11, 0); // set cursor to 2nd row and colum 11
lcd.print("L/sec");
}
}#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
volatile int flow_frequency; // Measures flow sensor pulsesunsigned
int l_hour; // Calculated litres/hour
unsigned char flowsensor = 2; // Sensor Input
unsigned long currentTime;
unsigned long cloopTime;
void flow () // Interrupt function
{
flow_frequency++;
}
void setup()
{
lcd.begin();
lcd.backlight();
pinMode(flowsensor, INPUT);
digitalWrite(flowsensor, HIGH); // Optional Internal Pull-Up
Serial.begin(9600);
attachInterrupt(0, flow, RISING); // Setup Interrupt
sei(); // Enable interrupts
currentTime = millis();
cloopTime = currentTime;
}
void loop ()
{
currentTime = millis();
// Every second, calculate and print litres/hour
if(currentTime >= (cloopTime + 1000))
{
cloopTime = currentTime; // Updates cloopTime
// Pulse frequency (Hz) = 7.5Q, Q is flow rate in L/min.
l_hour = (flow_frequency/13.5); // (Pulse frequency x 60 min) / 7.5Q = flowrate in L/hour
flow_frequency = 0; // Reset Counter
Serial.print(l_hour, DEC); // Print litres/hour
Serial.println(" L/sec");
lcd.setCursor(0, 0); // set cursor to 2nd row
lcd.print("Flow: ");
lcd.setCursor(6, 0); // set cursor to 2nd row and colum 6
lcd.print(l_hour, DEC);
lcd.setCursor(11, 0); // set cursor to 2nd row and colum 11
lcd.print("L/sec");
}
}
If you can help me in this regard.
I am thinking there is an issue in my code.