element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Vertical Farming
  • Challenges & Projects
  • Design Challenges
  • Vertical Farming
  • More
  • Cancel
Vertical Farming
Blog Automated Green House Blog:8.2 -  Water Meter Calibration
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: m.ratcliffe
  • Date Created: 19 Oct 2015 3:01 PM Date Created
  • Views 1025 views
  • Likes 1 like
  • Comments 2 comments
  • adapted_greenhouse
  • ardexpert
Related
Recommended

Automated Green House Blog:8.2 -  Water Meter Calibration

m.ratcliffe
m.ratcliffe
19 Oct 2015

In the previous water meter Blogs we used a cheap flow meter to give us a measure of water flowrate and total water used. The flow meters are cheap and the spec sheet can be misleading, this code is used to get a real world value of number of pulses per L of water delivered.

 

>Connect the water meter in-line, and prime system

>Turn tap off

>Start Arduino

>Turn tap on to fill up a known volume

Clicks per L= Volume/Pulse Count   [Volume must be in L]

We can use this value in our previous code to get really accurate readings

 

LCD Shiled that it will work with:

 

image

 

Pinout [Solder onto LCD shiled is preferred ] :

 

image

 

Ignore external pull up, we are doing that in software instead

 

 

Header 1

/* This script is used to make sense of the output from a hall effect water flow meter for calibration

Calibrating Water Meters:

>Load Calibration Code

>Connect the water meter in-line, and prime system

>Turn tap off

>Start Arduino

>Turn tap on to fill up a known volume

Clicks per L= Volume/Pulse Count   [Volume must be in L]

We can use this value in our previous code to get really accurate readings

 

Michael Ratcliffe  Mike@MichaelRatcliffe.com

  

    This program is free software: you can redistribute it and/or modify

    it under the terms of the GNU General Public License as published by

    the Free Software Foundation, either version 3 of the License, or

    (at your option) any later version.

 

 

    This program is distributed in the hope that it will be useful,

    but WITHOUT ANY WARRANTY; without even the implied warranty of

    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

    GNU General Public License for more details.

 

 

    You should have received a copy of the GNU General Public License

    along with this program.  If not, see <http://www.gnu.org/licenses/>.

  

   

    Components:

    See main folder for sensor data sheets, required liabaries and extra information: [can be downloaded via www.michaelratcliffe.com]

  

    All power systems should be powerd of DC voltage of below 48v for safter [water is around] 12v is prefferable and cheapest. As always this is a DIY project and done at your own risk.

  

  

    >Arduino Uno

    >Hall Effect Water Flow Meter 5v

    >LCD button Shield [Hobby tronix]

 

*/

// including some libraries for interfacing with harware

#include <LiquidCrystal.h> //Standard LCD Lbrary

 

 

#define Water_pin 2

#define Relay A2

 

 

 

 

//*********************8* Setting up LCD ************************//

// select the pins used on the LCD panel

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

 

 

//***************************** End Of User Defined Variables **************************************************//

 

 

unsigned long PulseCount=0;  //counter for water meter pulses

 

 

 

 

//**************************** Setup Routine , Runs Once and Sets used pins to correct value *******************//

void setup() {

//Stoping noise from being a problem, pin is high untill hall sensor pulls it low

pinMode(Water_pin, INPUT);

digitalWrite(Water_pin, HIGH);// saves having an external pullup

    

//External Interrupts: This is what the watr meter pulse count is collected from     

attachInterrupt(0, WaterCounter, FALLING);  //watermeter pulse output connected to pin2

lcd.begin(16, 2);              // start the library

                      lcd.setCursor(0,0);

                      lcd.print("                ");

                      delay(3);

                      lcd.setCursor(1,1);

                      lcd.print("                    ");

 

 

 

 

 

 

 

 

};

 

//************************************** Main Loop that will continualy run ******************************************//

void loop(){

 

 

                      lcd.setCursor(0,0);

                      lcd.print("Pulse_Count:   ");

                    

                      lcd.setCursor(0,1);

                      lcd.print(PulseCount);

                       

delay(300); //just a short delay to let things settle

};

 

 

 

 

//*************Interupt routine for water meter readings - Runs everytime sensor has a pulse *************//

 

 

void WaterCounter() {

 

   // Increment the pulse counter

  PulseCount++;

 

};

  • Sign in to reply
  • m.ratcliffe
    m.ratcliffe over 9 years ago in reply to DAB

    They are great products, the spec sheets arnt that accurate but for a few dollars they are great.

    Its a inline turbine with magnets mounted and a hall sensor to pick the turning motion up, so not much to go wrong.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 9 years ago

    Nice simple interface.

     

    I did not know that they had meters like this for measuring fluid flow.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube