Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

A17 Flow meter

Status
Not open for further replies.

Abdul.Hadi

Newbie level 5
Newbie level 5
Joined
Dec 20, 2022
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
87
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)
--- 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.
 

Attachments

  • Screenshot_20230113_181721.jpg
    Screenshot_20230113_181721.jpg
    105.9 KB · Views: 140

Hi,

I don´t understand your math.
Where does:
* 7.5 (You say it´s 7.5 Q in liters/hour, which I doubt)
* 13.5
come from?

Why don´t we see decimals in the results.

What flow_frequency do you expect (range)?

Please post a link to the datasheet of the sensor.
What microcontroller do you use?

Klaus
 

Hi,

I don´t understand your math.
Where does:
* 7.5 (You say it´s 7.5 Q in liters/hour, which I doubt)
* 13.5
come from?

Why don´t we see decimals in the results.

What flow_frequency do you expect (range)?

Please post a link to the datasheet of the sensor.
What microcontroller do you use?

Klaus
We have imported the sensor from China and they provided us with this. I couldn't share the pdf because of low memory.

We have directly connected the Flow sensor with aurdino uno.
And the code we used is not producing any decimal number this was also my question and I was going to ask this.
 

Attachments

  • Screenshot_20230114_012013.jpg
    Screenshot_20230114_012013.jpg
    155.2 KB · Views: 157
  • Screenshot_20230114_011956.jpg
    Screenshot_20230114_011956.jpg
    161.6 KB · Views: 154
Last edited:

Hi,

You didn't answer a single of my questions.

I asked for a link (just maybe 50 bytes). But you provided pictures 6000 times this size. Even a PDF should be less in size.

I asked where "7.5 Q" comes from.
No answer.
In pist #1 you said it's liters per hour,
* but datasheet says nothing about "7.5" and
* it gives the frequency related to liters/ minute (not liter/hour)

I asked where "13.5" comes from.
No answer.
Datasheet gives it as factor related to "liters/minute" but you try to calculate liter/hour without taking care.

I asked for math.
No answer.
Your variable is "liters/hour", datasheet is in "liters/minute", but your display and UART output states "L/sec".
--> Totally confusing.

I asked why we see no decimals.
No answer.

I asked for the frequency you expect.
No answer.

I asked what microcontroller you used.
You just stated "Arduino UNO". This is no microcontroller, it's a module name.
I had to do internet search to find out it uses "ATMEGA328P"

I don't spend more time to repeat questions.
Good luck

Klaus
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top