The raspberry pi GPIO pins cannot handle more than 3.3v dc. Ideally we want to convert each group of ac waves into a single square wave. My first approach, following what others have done, was to ;
This circuit worked - see the traces below for the output - but the pi can still see (!) the little dropouts between the pulses, which means I had to read the beginning of each pulse sequence, and ignore the remaining 42ms. The easiest way to do this is with the debounce parameter in software.
The trace on the left shows one "pulse", composed of 6 half waves of the AC signal. The trace on the right shows the 220 ms gap between the letter and number pulses