I am working on a project to add some digital processing, using Arduino, to an old Electro-Mechanical Pinball Machine. Specifically, I want to detect the score reel triggering on the pinball machine and make a digital version of the score.
When a score reel is triggered, a switch closes, putting power into the coil of the score reel mechanism. This then advances the reel one position, and the power is switched off to the coil.
The pinball uses 25V AC through the switches and the coils. I have connected up and opto-isolator circuit across the switch, and so I can detect when it is powered. If I sample it constantly, of course with it being AC, I get a lot of ON/OFF's per second (UK 50Hz). I have programmed in a delay, which is partially working, but I either get too many or too few digital readings, compared to the mechanical movement of the score reel itself.
Part of the problem is that within the pinball machine, lots of different targets, rollover switches, etc. can trigger a point score. These work at different speeds and switch the coil on for different time periods. Also, say, if the pinball rolls over a rollover switch slowly, that switch is on for a long time, compared to a fast moving ball that triggers the switch for much less time. So, I cannot rely on fixed timing. I need to treat one instance of the switch being truly on as one digital read (or point score).
I have tried a full bridge rectifier, to turn the AC signal into DC, but this doesn't help fully either, although has improved. So I'm looking for any other ideas please.