<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Convert pulse flow meter to litre p&#x2F;hour or positive flow or not]]></title><description><![CDATA[<p dir="auto">Hey Guys, long time no post...</p>
<p dir="auto">I have a new flow meter on a water system setup I am running on Mango.<br />
It's a pulse flow meter, I don't know how many pulses per litre at this stage but I can work that out by watching the level in the tank over a time period.<br />
The issue I have is the digital input on my RTU (Moxa E1212) is 2 byte unsigned, and with the current resolution I have monitoring the pulses it go's over 65000 pulses rather quickly and resets back to 0 then counts again.</p>
<p dir="auto">I've got Mango reading this value, and it's accurate, however I'm basically wanting to read the value and set something to say yes the pump is running. We're not too worried about flow rates as we can work this out from the water going into the tank upstream.</p>
<p dir="auto">Do you think it would be easiest to achieve this with some more lines in my script? I'm not sure how to write in script form the following:</p>
<pre><code>if flowmeter value now is more than flowmeter value 10 seconds ago, then set value of point to 1
or if flowmeter value now is the same as flowmeter value 10 seconds ago, then set value of point to 0

</code></pre>
<p dir="auto">Something along those lines anyway. The main issue we have is a solar pump in the system has a nice control panel on the front of it, but no external indication to tell us the pump is running :(</p>
<p dir="auto">Regards<br />
Dan</p>
]]></description><link>https://forum.mango-os.com/topic/2134/convert-pulse-flow-meter-to-litre-p-hour-or-positive-flow-or-not</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 14:01:23 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/2134.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 22 Feb 2016 02:04:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Convert pulse flow meter to litre p&#x2F;hour or positive flow or not on Mon, 22 Feb 2016 21:23:43 GMT]]></title><description><![CDATA[<p dir="auto">ah ok, it's kinda working now. Thanks for the update.<br />
I'll try the changes later and see if it makes much difference to the results?</p>
<p dir="auto">Cheers<br />
Dan</p>
]]></description><link>https://forum.mango-os.com/post/11045</link><guid isPermaLink="true">https://forum.mango-os.com/post/11045</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Mon, 22 Feb 2016 21:23:43 GMT</pubDate></item><item><title><![CDATA[Reply to Convert pulse flow meter to litre p&#x2F;hour or positive flow or not on Tue, 23 Feb 2016 03:51:56 GMT]]></title><description><![CDATA[<p dir="auto">Not a problem!</p>
<p dir="auto">I think I messed up the logic a little... This makes more sense, thinking about it another few minutes...</p>
<pre><code>TOLERANCE = 5 //if you want to accept some number of pulses as a non-running
prevValue = p2.ago(SECOND, 10);

if ( p2.value &gt; prevValue + TOLERANCE)
  p1.set(true);
else if ( prevValue &gt; p2.value &amp;&amp; (prevValue + TOLERANCE)%65536 &lt; p2.value ) //wrap around case
  p1.set(false);
else if ( prevValue &gt; p2.value )
  p1.set(true);
else 
  p1.set(false);</code></pre>
]]></description><link>https://forum.mango-os.com/post/11042</link><guid isPermaLink="true">https://forum.mango-os.com/post/11042</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Tue, 23 Feb 2016 03:51:56 GMT</pubDate></item><item><title><![CDATA[Reply to Convert pulse flow meter to litre p&#x2F;hour or positive flow or not on Mon, 22 Feb 2016 20:57:13 GMT]]></title><description><![CDATA[<p dir="auto">That worked great, thanks heaps! I changed the timing to 5 seconds as it was taking a little while for the state to change once the flow was detected.<br />
I put a flashing green LED on the graphical view for when the pump has normal flow and a solid red LED for when it's not seeing any flow.</p>
<p dir="auto">Thanks again.</p>
<p dir="auto">Cheers<br />
Dan</p>
]]></description><link>https://forum.mango-os.com/post/11041</link><guid isPermaLink="true">https://forum.mango-os.com/post/11041</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Mon, 22 Feb 2016 20:57:13 GMT</pubDate></item><item><title><![CDATA[Reply to Convert pulse flow meter to litre p&#x2F;hour or positive flow or not on Mon, 22 Feb 2016 20:35:00 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for that Phil, I'll give that a go and will report back.</p>
<p dir="auto">Cheers<br />
Dan</p>
]]></description><link>https://forum.mango-os.com/post/11039</link><guid isPermaLink="true">https://forum.mango-os.com/post/11039</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Mon, 22 Feb 2016 20:35:00 GMT</pubDate></item><item><title><![CDATA[Reply to Convert pulse flow meter to litre p&#x2F;hour or positive flow or not on Mon, 22 Feb 2016 17:41:43 GMT]]></title><description><![CDATA[<p dir="auto">If I understand you correctly...</p>
<p dir="auto">p1 = status point (virtual or script point, or use this whole thing as a meta point)<br />
p2 - pulse counter</p>
<pre><code>TOLERANCE = 5 //if you want to accept some number of pulses as a non-running
prevValue = p2.ago(SECOND, 10);

if ( p2.value &gt; prevValue + TOLERANCE)
  p1.set(true);
else if ( prevValue &gt; p2.value &amp;&amp; (prevValue + TOLERANCE)%65536 &gt; p2.value ) //wrap around case
  p1.set(true);
else 
  p1.set(false);</code></pre>
]]></description><link>https://forum.mango-os.com/post/11035</link><guid isPermaLink="true">https://forum.mango-os.com/post/11035</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Mon, 22 Feb 2016 17:41:43 GMT</pubDate></item></channel></rss>