Duak: Thanks, I added a 1.8K resistors and tomorrow I will check if there still are "spikes" in the measurement. Today I noticed that although this resistor, the output still need to be picked out at the end of the series R36-C4 to be reliable in terms of mesurement. A little more investigation and I noticed that it was not the R36 resistor that is changing the game, but the C4! In fact, I removed the R36 and connected C4 to ground at the pull-up resistor junction with the pin 1. And the things worked well (I have to check in detail the presence of the "spikes"). Also a C4=100nF was good. How can be explained this? (in the gammon routine I tried both FALLING and RISING option) in the interrupt definition.
OM2220: The circuit I posted should be a "true" schmitt trigger with a comparator instead of an op-amp, from what is my limited knowdledge. I need to use a single power supply and not dual only 5V or 12V. I have a TL081, can you suggest me how to connect it with 2 resistor? Thanks. I would like to try the generated signal in the website directly in the arduino input, but it need at lest >3V to be discriminated as high level. I measured about 1V, so I would need to amplificate etc. etc.. I will try instead the sine wave as input at the comparator to see if the noise (that produces the spikes) is directly generated form the ac generator (it is a speed sensor connected to a washing machine motor driving axle).
Kleinstain: At the moment no other routine are run in my code, only the gammon frequency routine. So only one (visible to me) interrupt is generated. I instead was thinking at the fact that the Serial library could get some delay that disturb the capturing time code. I could copy the frequency values in a long array and then print it in a text file at the end of the program, avoiding the Serial library load. What do you thinks.
Regards.