Reading 3 Flow Sensors

A quick question on the sitcores. I am planning to read water flows with the duino board. The flow sensor is one of those inexpensive hall effect sensors that send a 5V square wave at the rate of 7.5Hz per 1 liter/min flow rate. I have 3 sensors I need to simultaneously monitor, and the maximum flow rate is going to be around 12 US Gal/min (50 l/min, or 50*7.5 = 400 hz, 2-3ms between pulses).

My program does some network (mqtt) work, but only every once every few mins, normally the program will be available to service the 3 interrupts I have set up to detect a rising edge for the flows.

The interrupt routines basically just increment a counting integer until it hits 2000, then resets it to zero and increments the total gallons integer, pretty simple.

So my question is - should the sitcore duino runnig at 480mhz be able to process the events if they are say 2ms apart? If not, I could get some little fleas, and dedicate each one to each flow meter, and process them that way, but I’m not sure that would be any faster as they only run at 40/80mhz.

Can you offload some of the work to the pulse counter? : Signal Control

Counting pulses in native code with the pulse counter should be orders of magnitude faster than counting rising edges in TinyCLR. You would have to use the signal capture to periodically sample the flow (as oppose to continuous reading) but that will still be more accurate and gain you more sample groups than trying to do the same in managed code. You can integrate the samples over time for a total flow volume.

1 Like

Thanks Martin, I’ll change to reading the pulse frequency rather than counting rising edges.