Giter Club home page Giter Club logo

flowmeter's Introduction

FlowMeter Library Build Status analytics

FlowMeter is an Arduino library that provides calibrated flow and volume measurement with flow sensors.

You can use it to count flow and volume of liquids and gases (although the documentation focuses on applications using liquids) and can support multiple flow sensors at the same time.

It also works as a totalizer, accumulating total volume and average flow rate over the run time of your project.

A provision for calibration helps you to get the most out of your sensor. You can even estimate the recent and overall error margin.

The library is intended for use with flow sensors that provide a frequency output signal proportional to flow, although other types of sensors could be made to work.

A Simple Example

Getting started with FlowMeter is easy. Take a look at this simple example:

void setup() {
  // prepare serial communication
  Serial.begin(9600);

  // enable a call to a helper function on every rising edge
  attachInterrupt(INT0, MeterISR, RISING);
}

void loop() {
  // wait between output updates
  delay(period);

  // process the (possibly) counted ticks
  Meter.tick(period);

  // output some measurement result
  Serial.print("Currently ");
  Serial.print(Meter.getCurrentFlowrate());
  Serial.print(" l/min, ");
  Serial.print(Meter.getTotalVolume());
  Serial.println(" l total.");

  //
  // any other code can go here
  //
}

In the above example, a flow sensor is assumed to be connected to the INT0 pin. The corresponding object Meter is updated every period (in milliseconds, e.g. 1000ms).

So after every measurement period, the current flow rate and the total volume are printed out.

Please read on in the examples section of the library's documentation pages.

Installing the library

Just check out the FlowMeter Repository on GitHub (or download the ZIP archive) and copy it to your libraries/ folder (usually within your Arduino sketchbook).

See the installation section in the documentation pages for more.

Unit of measure

The FlowMeter library expresses flow in the unit l/min. Most units of measure can be derived by simple conversion (just try not to measure in Sverdrups).

As an example, conversion between l/min and US gal/min can be done with a factor of 3.78541178, conversion from min to s with a factor of 60.

$$3.78541178 l/min โ‰ˆ 1 gal/min โ‰ˆ 0.0167 gal/s.$$

Please make sure you consult the documentation in order to further understand how the library works.

Should you calibrate your own sensor?

The FlowMeter library can be used with many different flow sensors right away. Some sensor examples are listed in the documentation.

For many projects you don't need to worry about calibration. But it still makes sense to be aware of the limitations that come with an uncalibrated sensor in a metering application.

It's easy to calibrate yourself. Preferrably you'd do this after installing the sensor into your project. The flow meter then benefits from increased precision within the viscosity and flow range of your application.

There's a complete how-to in the documentation.

Calibration Example: Irrigation with FS400A

Documentation

For further details please take a look at the FlowMeter documentation pages.

Also, the library source code (in the folder src/) and the examples (in the folder examples/) are fully documented.

flowmeter's People

Contributors

sekdiy avatar

Forkers

lekobh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.