Feeding higher voltage sine wave to Arduino interrupt pin
There's a dirty method of connecting AC to a microcontroller - just use a resistor.

I happen to have the Atmega datasheet open, it shows you that the input pin looks like this:

The two diodes on the left are for ESD protection, they shunt any overvoltage to earth or to the 5V rail.  You can abuse these diodes to clip your AC signal to the range 0-5 V.

Selecting a resistor: use the largest possible value that will reliably drive the pin. Leakage current is 1 uA, and the capacitance is 10 pF. If your dynamo frequency tops out at 1 kHz, the input impedance will be around 1.5 MOhm. 1 uA leakage will also become a problem in the MOhm range. If you choose a resistor near 100 kOhm, and the voltage rises to +10V, the current into the protection diodes will have a peak of perhaps 20 uA, which won't cause any harm.

Things to consider:


This only works if the AC voltage is higher than 5 V. If it is lower, try using the comparator module to compare it to a 1 V reference you make with a resistive divider.
If the arduino is powered by the AC voltage, then think carefully about where you connect the AC, and ground. I am currently doing it like this:








simulate this circuit &ndash; Schematic created using CircuitLab


You might need to do something different depending on the ground reference of the AC source.


All of the above is really dirty and unprofessional. Good for a quick frequency counter or zero-crossing detector for a circuit. If you're going to sell the product or show it to anyone else, you should definitely use a diode clamp and a Schmitt trigger.