Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add an interface for a flow meter
#2
Looking at the data sheet for the flow sensor you mentioned in your GitHub post, It looks like the maximum flow rate for the sensors is 30L/min and the pulse output of the sensor is about 8.2 Hz/L/min.

This would indicate a maximum pulse rate of 246 Hz.

Data sheet:
http://www.seeedstudio.com/wiki/images/b...asheet.pdf

You could use the standard RPi.GPIO library that now comes pre-installed with the Raspbian OS for the Pi.

Here is a project on GitHub that implements a Python pulse counter:
https://github.com/sanderjo/GPIO-counter...counter.py

Actually the only thing you need to do  is count the rising edge of the pulses like so:

Code:
    # wait for pin going up
    GPIO.wait_for_edge(mygpiopin, GPIO.RISING)
You could increment a counter variable, then if you check the value of the counter once a sec. you would have the Hz. Be sure to clear the counter after checking. Divide the Hz by 8.2 to get the L/min

It should be easy to put this into a plugin for SIP.

Dan
Reply


Messages In This Thread
Add an interface for a flow meter - by mattip - 2016 Jan 23, 06:42 PM
RE: Add an interface for a flow meter - by dan - 2016 Jan 24, 07:18 PM
RE: Add an interface for a flow meter - by mattip - 2016 Jan 24, 09:06 PM
RE: Add an interface for a flow meter - by dan - 2016 Jan 25, 12:58 AM
RE: Add an interface for a flow meter - by kozoroh - 2018 Jul 03, 12:56 PM
RE: Add an interface for a flow meter - by dan - 2018 Jul 03, 03:00 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)