Multiple power lines energy monitor...

I need to build an energy monitor; it has to count energy consumption per day (kWh / Day) and instant power drawn (W), but I need this for 8x power lines at the same time.
I have 8x S0 outputs to control. S0 interface outputs an impulse every 0,5Wh, so I need to sense those impulses and accumulate their count, plus I need an instant power value every 10s (actually there will be 8x separate counters and instant power values).
I'd like to display values on a LCD display and store them on a SD card with RTC timestamping.
Have you got some idea on how to proceed? I was thinking on using interrupts and MCP23008 port expander driven via SPI interface, but I lack on programming skills and I'm stuck. Could some of you help me on doing this? Thanks in advance!
Bye!

Basicly you want 8x this - Arduino Playground - HomePage -

instead of the "normal" interrupts you should consider pin change interrupts - Arduino Playground - HomePage - for a lib

Enough for a direction or ...?

Hi! You're right about 8x EEM12L approach. In fact I saw that project (and many others) and I tried to modify that to match what I need.
But I wasn't aware of the PinChangeInt lib... It seems very interesting, thanks! I only have a question: S0 impulses last for 20ms, so it's not so difficult to count their falling edge; but what happens if two different S0 impulses arrive on two different pins almost at the same time? Could I loose one of the two? What do you think to be the minimum time interval between two pulses (on two different pins) to be successfully count?
Thanks again for your reply!
Bye

What do you think to be the minimum time interval between two pulses (on two different pins) to be successfully count?

That would depend on two factors - how long it takes to look up what function to call, and to call that function, when the interrupt occurs and how long that function takes to do its work. The first is fixed, and is only a few microseconds (~3.5). The second depends on your code, which we haven’t seen.

what happens if two different S0 impulses arrive on two different pins almost at the same time?

Each interrupt type has its own queue. When an interrupt occurs, it is queued. The interrupts in the queues are processed in the order received, if the interrupts are all the same priority. However, only one interrupt of any given type can be in the queue. So, if two pin change interrupts arrive before the one being processed is processed, the second one will be lost.

Thanks. The ISR code consists of only one integer variabile increment. It should be very quick. All the rest will be in the main loop function.
Bye