I need to measure the state (on/off) of a 24V AC line that is currently powering a solenoid valve. The microcontroller will take over the control of the solenoid through a solid state relay, but I need to know if the line is being powered or not, for the control logic.
I am planning on using a half-bridge to rectify the signal. The signal is then passed through a passive low-pass RC filter to remove the 60Hz line frequency component. Lastly, a voltage divider is then used to reduce the signal voltage to the microcontroller's logic level.
I will probably also use an isolation transformer before the rectifier diodes for safety. Switching speed is not particularly important, so the filter can be tuned for a pretty low cutoff.
It would be simpler to use a relay, but I would rather not use one for this application. Does this seem like a reasonable approach? Is this safe considering that the circuit will be properly built, enclosed, and grounded?