How to use AC voltage trigger in ardunio nano

I want to sense when a 24 VAC becomes active. I can voltage divide to get below 5 volts but don't know if it would work on a digital pin. I don't need to know the voltage value. Is there a module that would put out a signal? I can't seem to find one. My other approach would be to use a rectifier to get dc voltage to a digital pin.
If I'm in the wrong place just let me know.
Many thanks from a beginner.

How often will the swiching take place?

If the coil of a 110Vac relay won't present too much of a load you could use one and watch the relay contacts like a regular switch.

image

Or a solid state relay. That will present less load, but you will have to find one with a DC output ( most are AC).

You could use a zero cross optocoupler, from this you could get the timing of the line frequency and whether it is present or absent. Use an edge detect input for this or if so inclined use an interrupt and let it simply set a power on flag or whatever you want to call it. Doing it this way will give you a fast response time, for 60Hz you would get 120 actuations per second. The edge sense gives you control over repeating if needed.

rectify and opto isolate it..
Optocoupler

have fun.. ~q

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.