Photon and FT-330 flow meter

Has anybody used an FT-330 flow meter (http://goo.gl/u6oUdt), Adafruit flow meter (https://goo.gl/YKkmqQ), or any other kind of flow meter with the Photon? Any suggestions/sample code/tips/tricks/etc.?

Yes, it’s going on a kegerator. This is my third build. The first was an Arduino based one that used interrupts. It worked ok, but I still needed to reboot it 4-5 times per day. :frowning: The second was a Raspberry Pi based build. It was an epic fail. This will be the truly successful one, right? Third time’s a charm and all that? :smile:

Thanks for any pointers!

@Butch, I’ve used a similar flow meter on an Arduino and it’s on my books to port over to a Photon. I use interrupts to count the number of pulses and a non-blocking millis() counter in loop() that samples the pulse counter every seconds (or so). In my original design, I had a fixed pulse-per-second conversion to flowrate but for my sensor it seems it is not linear over its range so I did a curve fit on Excel and plan to implement the pulse-to-flow conversion in the Photon code. For increased accuracy, you can use the SparkIntervalTimer library to create precise 1 second interrupts to read/reset the pulse count and set a flag that loop() can read. If I recall, one thing to remember is that the hall effect sensor is open collector so a pull-up resistor is needed. :smile:

That sounds very similar to the code I wrote for the Arduino, modulo the curve fitting. I also used the pull-up resistor.

Thanks!

1 Like