2016 Jan 24, 07:18 PM
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:
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
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)
It should be easy to put this into a plugin for SIP.
Dan