AC Voltage Detection circuit

Hi guys,

I was looking for a way to detect AC mains voltage (120V here in the US) when a fan in an enclosure turned on. I'm not measuring the voltage, just detecting it's presence.

Edwin Robotics had a breakout board I used for a little while since it was convenient, but now I am looking to bring to parts onto my own PCB. I know there is a necessary separation distance and board cuts that need to be done from DC.

My question is, how would you rate this for safety, and what would you add or change?

Thanks

You have opto-coupler as isolation. If you want more robust isolation, you may use a tiny 120V/5V PCB mountable transformer (Fig-1).


Figure-1:

Zero Crossing Detection Circuit: (tested for 240V/5V)


Figure-2:

Your circuit could use an AC optocoupler (say LTV 814) which has two leds reversed with respect to each other.

You could also look here: Mains voltage detector (neon bulb based for 230v door bell repeater)

I once did this by wrapping insulated (guaranteeing safe separation) wire around the live then connecting that wire to an input on a 40106 hex Schmitt trigger, with a 10M Ohm pull up / down (can't remember) and the whole circuit connected to earth (note 'earth', not 'ground'). Added some RC smoothing and a couple more of the spare Schmitt triggers and got a reliable output showing mains present or not. No connection to mains anywhere.

That board was designed for 230V and most likely will not work on 120V.
What optocoupler do you plan on using?

A simple SPDT relay with a 120VAC coil would work. There will be contacts closed for AC on and also for AC off.

Two high-power resistors BEFORE the bridge rectifier, to share the voltage and keep the temperature down.

  • If you have an old 5 VDC power supply, use it to monitor the presence of AC.

Many multimeters /testers can detect mains live NCV without earth connection, without user holding the device. I wouldn't mind to learn how they do it.


Any AC opto coupler.
Pin with internal pull up (no 10k resistor).
Zero crossing removal can be done in software (no capacitor).
Two resistors for safety.

If you don't mind very slow detection (until the supply bleeds out).

I think everyone here has put forth some good ideas, and can work in different scenarios.

@WaWa That's an even simpler solution eliminating the rectifier. This will work perfectly for future projects. The K814P is obsolete now (what isn't?), but Lite-On and others still make the LTV814 (as mentioned by @6v6gt), especially in DIP, which is a drop in replacement. I'll probably throw a picofuse on the L leg - 250V@250mA for added safety.

Not needed. No significant current can flow because of the two resistors.

In some countries phase and neutral can be swapped (no keyed power plugs).
There every wire of a power cord should be treated as live, hence one resistor in each leg.

I usually build these things inline with a power cord, with heatshrink.
The pc814 could work, as do many others.

Even with keyed plugs neutral should be treated as live. Faults happen. Wiring mistakes happen. You can't safely assume the neutral wire will always be neutral.

Broadcom HCPL-3700 is a chip designed to give a logic level output in response to mains voltage on its input side. It's basically an optocoupler.

Works fine on 240-V AC, but does need thermal management on the input resistors.

The specific application was for a no-neutral lights programmer that worked fine with halogen lamps but didn't like LED lamps. Can't remember the exact circuit, now replaced by a WiFi switch, but useful for the duration.

Yes, seen it.

Plug wired correctly, neutral and live swapped in the socket. No RCD.

@tigger,
Good chip and solution, but not economical at over $12 each at Digikey, even for my projects. I'll keep an eye on it though. If it was cheaper I'd take it as the solution for sure.

Are you now working with 240V?

Maybe have a look at how those "voltage sticks" work.

Battery powered, no contact, bleeps when AC mains voltage detected.
Downside is susceptible to false positives.

Not surprised, main distributor. UK Digikey has them at £3.14.
Even RS, and they aren't cheap, have them at less than £3 and genuine.

AliExpress has them as low as £1 (£9.90 for 10 pieces).

I'd go with the optocouplers as suggested before. Worth doing a bit more research