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?

  • \$\begingroup\$ Why do you have two rectification diodes? \$\endgroup\$ – Hearth Nov 18 '18 at 19:49

There is nothing intrinsically wrong with your idea. It can be made to work as long as you are conscious of your design decisions (e.g, reaction time and need for isolation). However, given that you are considering isolation, which adds a relatively large transformer into the mix...

You should consider just using an optoisolator driven with a resistor and perhaps a protection diode or a full bridge around it. The output transistor would be directly driven at line frequency and its signal can be processed in either analog or digital form.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.