The
RaspberryPints team (well, at least hbt member
@mcangeli) actually had planned on integrating a
Centipede shield, an array of four 16-bit I2C registers with state-change interrupts, which would have supported up to 64 meters.
The Centipede stacks atop the AlaMode atop the RPi, making for a relatively compact solution (though the wiring to 64 meters could get intense
)
I actually had a working Centipede all ready to go (still do) but the team didn't get a round tuit before they lost their mojo.
I don't think the Arduino code that would replace the existing sketch would be all that daunting. It'd be essentially an ISR responding to the Centipede register state change interrupts. There are four of those (one per register) which can be used independently requiring four interrupt-capable Arduino GPIO, or paired requiring only two GPIO, or ganged together on a single GPIO.
If fully independent the code would immediately know which of the four registers "saw" a meter tick and could drill into it directly to determine which meter ticked; with shared or ganged interrupts the code would have to read the 2 or 4 register status values to figure out which saw a state change, then drill into that chip to find which pin toggled, then start counting meter ticks and resetting interrupts.
As we're not using the AlaMode beyond counting ticks, and all the meters would be wired to the Centipede thus freeing up GPIO, I would keep the four interrupts independent and go from there - unless the coding would be easier with all four interrupts ganged on one GPIO (which might actually be the case).
The bottom line concern is the sketch has to resolve the source of a tick, increment the related pour counter and clear the interrupt, before the next tick is registered. I don't think that'd be a big deal as the SF800 meters running under typical flow rates are generating around 190 ticks per second, so the code would have to have a worst-case loop duration around 5 milliseconds. Which in this era is crippled turtle speed
And alternative meters have far lower tick counts per volume so they'd go along for the ride...
Cheers!