How to convert 14V AC to 5V DC?
simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. Opto-isolated signal detector.

An opto-isolator electrically isolates and protects your micro from the AC and eliminates any ground-loop issues.


R1 limits the current to about 10 mA rms.
D2 provides reverse voltage protection for the opto-LED, D1.
D1 will illuminate on positive half-cycles of the 12 V AC signal.
Q1 will pull the GPIO pin low when the LED is on.
R2 will pull the GPIO pin high when the LED is off.