Just a short post with some images showing the innards of a Counting Piggy Bank.
You push suitable money through the slit and it counts the total. I’ve already found out that it can be tricked though. You can push the coin in far enough so it gets registered, but it will pop out again.
The innards are as suspected: battery compartment, brain-board with potted microcontroller, LCD with zebra-strip.
The sensor module is more interesting. Of course it does not check for the right kind of alloy using magnetism, it only measures the diameter. You could use wood/plastic chips to trick it.
A spring-loaded slider makes the physical connection between the coin and a bunch of contacts.
It counts reliably.