The IPM is finally deployed and counts the blinks. Everything seems to be working well and there's already some things happening that are worth mentioning.
Robust blink reading
The household power meter is in the basement, there is no parasitic light sources that could make the light detector go off without a blink. I tried shining a flashlight on it and it didn't count extra blinks, so pretty robust.
More useful than ever
Immediately after deploying it I saw the difference with the old system, the minute resolution allows to clearly see when the heat pump is on.
I tried turning on and off various household appliances to see the difference in live power usage, it works! Basically this device can tell you how much power an appliance uses.
The dryer had a peak power usage in the end of its cycle, I suspect there's something else that consumed power as well... I need to dry more clothes to confirm that. The other appliances, such as the fridge, computer, lights... are drowned in the ground hum of about 400-600Wh (7-10Wmin).
Useful log system
The log system has already paid off: the IPM missed one hour on Google Spreadsheets, the log indicated that the upload failed, now it's a matter of finding out why, but that's already much better than the first version where I had no idea what was going on.
Thanks to the data on the SD card I was able to manually copy the missing data to the spreadsheets, however this is typically something that could be automated in the future.
Debounce issue fixed
As with the first version the IPM tends to read one LED pulse multiple times. I used the same debouncing technique. The multiple reading is because the signal has a ringing to it, perhaps due to some weird optic or electric effect that I don't care enough about to investigate.
The debouncing works, but now the system has a fundamental limit: a light pulse from the LED takes 100ms, after the first rising edge pulses are ignored for 200ms to avoid reading the same pulse multiple times. This means the maximum instantaneous power reading can only be:
The limit is pretty high, the highest number, during one hour, recorded by the old system was 6.6kWh, so there's some margin. There may be peaks over 18kW however and this might not be a good solution for everybody. There are other ways to debounce a signal, but I'm not going to mess with the counter now that it has been deployed.