I'm making a simple battery-powered project that measures water flow with a liquid flow meter and transmits the value with an nRF24L01+. The microcontroller I've chosen is a TI MSP430FR2110 (family datasheet), which includes an asynchronous timer (Timer_B) and a low-power sleep mode (LPM4) that disables the CPU and all clocks.
The liquid flow meter comprises a simple magnet and hall effect sensor to output 450 pulses per liter. From what I've gathered from the family datasheet (Figure 13-1, pg. 385), I'll connect the pulse signal (reduced to DVCC, max) to the TB0CLK pin for counting operation, clear the TBSSEL bits, and set the ID and IDEX dividers to 1.
Here's my high-level plan of operation:
- Put MSP430 to sleep while flow meter pulses are incrementing TB0
- Wake up microcontroller after, say, 8s (1L/min --> 60 pulses/8s)
- Read TB0 value into variable, clear TB0
- Send variable with nRF24L01+
Question: Is this a reasonable approach? I've tested most parts in isolation, but would like to make sure I'm not missing big gotchas before I order parts.
TI provides a water meter reference design with more bells and whistles than I care for, but the basic operation seems the same (section 3.2.2, pg. 9).
The measurement principle uses MSP430 Timer0_A3 as the pulse counter. Timer0_A3 operates without any CPU intervention, allowing the CPU to remain in low-power mode. The CPU then wakes up and read the TA0R register once per second. The TA0R value will be the instantaneous flow.
(Since my application is more for abnormal operation detection (e.g. unexpected flow or lack thereof) I can get away with a longer sleep period to reduce battery consumption.)