Circuit to detect 120VAC with 3.3VDC micro

Hi,

I don’t really feel like re-inventing the wheel in this case. Does anyone have a reference design to detect an open or closed 120VAC circuit using 3.3VDC GPIOs?

It seems to me like you could use a pullup resistor along with an opto-coupler to detect whether or not the circuit is open or not. I’d love to get a reference design that works and where all of the edge cases have been thought out.

Thanks

The simplest way I’ve done this before is to use a relay with a 120VAC coil and sense the contact closure just as you would any other switch.

I’ve used a simple plug in DC power supply plugged into the 120VAC I wanted to monitor. Then it is relatively easy to monitor the DC voltage of the supply. Any old cell phone charger etc should do, may just need a simple voltage divider to lower the voltage to your 3.3V level.