Liquid Flow Measuring, SQLite Data Logging, and Tweeting Simultaneously


I am trying to put together a keg monitoring system that estimates how much beer is left in a keg via a water flow sensor. I also would like to log the data on an SQLite database, and tweeting out information via ThinkSpeak’s twitter integration. My flow sensor checks to see if there is input every second, and I would like to log the data every minute or so, but my the logging is skipped or the twitter integration can’t handle the speed of the processes. Basically, I may need to log data or tweet information while liquid is flowing through the sensor is this possible? I’ve attached my code

List of hardware:

Water Flow Sensor

Arduino Uno
Ethernet Shield

Please let me know if I can provide any further details

water_flow_twitter_ethernet_forum.ino (7.84 KB)

That flow sensor isn’t food rated. If you pull it apart you’ll probably find a stainless steel shaft of unknown composition and a metal washer to keep the magnet in place. Worst case scenario is that bits of corroded metal end up in the beer.

Disabling the interrupt is guaranteed to result in missing data.
Just let the interrupt log data as a background task and read the counter value in the main loop as required.