top of page

Tailwind series: Measuring water flow rate using flowmeter and Arduino

by Quasortech Labs

ArudAndRelaySwitchHeaderImage.png

The article discusses measuring water flow rate using flow meter and Arduino.

Disclaimer

  1. This step-by-step how-to covers lab setup and not the field setup or test.

  2. This how-to does not cover the calibration of flow meter.

  3. This does not cover the working principles of flow meter.

Working sample

Before we continue, let's examine what our final outcome will resemble.

Click on this video to play.

Items needed

  • Arduino Uno.

  • Hall effect flow meter sensor.

Pre-requisites

This post assumes you already have,

1.     Arduino Editor installed on your laptop.​

2.    Your laptop connected to Arduino using the USB cable.

3.    Basic familiarity with Arduino programming using C++.

Technical details

How flow meter works?

This post does not delve deeply into the operational intricacies of flow meters. There are abundant resources available on the internet for further information.

GR201-FlowMeter.png

Schematic & Wiring diagrams

Schematic_IoT_2022-09-30.png

This is how the final setup looks like:

IMG_6437_edited.jpg

How-to steps

Step 1: Connecting Arduino to flow meter

Water flow sensors normally have three leads. +ve, -ve and interrupt.

Interrupt output from flow meter sensor sends a certain amount of HIGH signals depending on the flow rate, and it needs to be connected to Arduino's interrupt pins.

Arduino Uno has two interrupt pins, pin #2 and pin #3. These pins are referenced as 0 and 1 in the c++ code, which you can see in the sample code below.

IMG_6438_edited.jpg
IMG_6439_edited.jpg

Connection point details:

Step 2: Flow meter sensor

IMG_6440_edited.jpg

Flow rate is measured based on the specification you can see on the flow meter.

F = (7.5 * Q), Q = L/Min.

Where F - Frequency & Q - Flow rate

Using above spec,

Q (flow rate) = F / 7.5 liters per minute

Step 3: Arduino C++ I2C code

No additional libraries need to be downloaded. The code is straightforward.

C++ code

Step 4: Testing the flow meter

Now the setup should be ready to measure the flow rate.

When the C++ code runs,

  • Interrupts are activated for 1 second through "delay(1000)" command in the code.

  • When there is an interrupt signal in Arduino's pin #2, the funtion 'calculateNumberOfPulsees()' gets called, which increments the counter variable by 1.

  • After 1 second, the interrupt is stopped, and we proceed to calculate the flow rate.

  • After calculating the flow rate, the counter is reset to 0.

Please watch the accompanying video for a demonstration. In this demonstration, we've utilized the airflow through the device to activate the flowmeter instead of water.

Closing note

I hope this post provides you with the fundamental details for measuring flow rate using hall effect flowmeter and Arduino. For a demonstration, please refer to the accompanying video located at the top of this page.

bottom of page