How many pulse counter inputs does an Arduino w/Atmega328P support? The ATmega328P spec. sheet mentions two 8-bit and one 16-bit counter. To a novice like me, this implies 3 counters. Can these 3 counters be used simultaneously to count the pulses from three different sensors? I've read reports online that only 2 counters are supported in this fashion, but I am confused by the spec. sheet's claim. I recall a few sources mentioning there being only two "interrupt-based counters". I'm very new to the Arduino, so any clarification on this would be much appreciated. I am assuming that these interrupt counters are hardware controlled counters. Can software controlled counters be used? I've seen many different functions in which users have performed pulse counting, but I am lacking a general overview of the benefits and disadvantages of each method. Can somebody enlighten me?
As for my application, I am working on a BTU meter for hot water heating (production) and consumption. The hot water in this case is for home heating, not personal consumption (like from the shower tap). I need to collect flow rate data from 3 flow meters (1 flow meter is for the produced BTUs, the other 2 are for spent heat BTUs). I also need to collect data from 6 temperature sensors (thermistors in this case). It is fairly straight-forward to read thermistor data from the ADC of the Arduino, and as such, I am more concerned with the number of pulse counter inputs.
I expect the frequency of pulses to be between 50 and 300 Hz. I will be logging data to the embedded microSD card (using an EtherTen), and eventually uploading the data to the network at the end of each day. The data logging doesn't need to be fast, perhaps every 1 min, but I would like data from each flow meter to be read at about the same time, perhaps within 5 s or less of each other. Can this be done with the available digital pins on the Arduino, or do I need to multiplex a single counter input and grab data in a more serialised fashion? Given the low frequency of pulses, I may need to sample pulses for up to 5 seconds to increase resolution, after which time the counter could be reset.
Since flow rate meters are utilised, I'll be dividing by time. It seems like the millis() function holds the time value. Will this function consume one of the counter/timer slots? I was planning on adding an RTC to timestamp the data (DS1302), if that makes any difference towards freeing up a counter. I've run across cases online of people using low-level hardware language to use a dedicated Arduino for a 12-input pulse counter, but this is a little out of my scope, and perhaps a bit overkill for this application.
In advance, please excuse the rookie questions; I have had trouble finding discrete answers to these seemingly basic questions. Any advice on how to tackle this is greatly appreciated.