Hoagie wrote:Had to skip a bit near the end of this thread. If the number of pulses is a problem, just use a binary counter IC to divide the frequency by 16, or 256.
Let me just expand on that a bit.
Feed 5V through a resistor into the meter. When the transistor in the meter pulses, it'll pull it down and there's a detectable pulse.
Feed those pulses to binary counter ICs. The 4020 counter IC should do the job and is 79p from Maplin - almost certainly cheaper elsewhere. Now you have pins going up and down at the input frequency divided by 2, 4, 8, 16 etc. I'd try to aim for something like 1 pulse per second at normal load. If you can't get the frequency down to that, you may need a second counter IC, fed from the slowest output of the first.
NOTE: The signals are still at 5V and would kill the Pi if you miss the next step.
Now you need to step the signal voltage down to 3.3v. I'm sure there are chips to do this, or you could use a simple two resistor potential divider wired something like this.
Counter output - 2k resistor - GPIO PIN - 3.3k resistor - GND.
That will give just under 3.3v at the input to the Pi.
Use the excellent WiringPi library to look after the GPIO and either set interrupt triggering on each pin and use 12 threads waiting on those interrupts, or just poll each pin every 100ms in one thread. If your input frequencies are still high, go for every 10ms. Sleep between reads and the CPU shouldn;t be hit too hard. Count the low to high transitions to get an idea of the power in use. Keep the absolute counts in a 32 bit unsigned int variable for the next step.
I'd use RRDTool to make graphs of the power usage. Here's my house usage from a while ago. The dark part is economy seven.
To make that graph I just need to feed the count into RRDTool every minute. RRDTool handles the time part of the calculation and just needs a bit of scaling applied to the graph to get kW in use at any particular time.
So, there's one solution with a total parts cost of about a £10 at a guess.