Connecting uC Ground to AC Neutral

Status
Not open for further replies.

dknguyen

Well-Known Member
Most Helpful Member
I'm using a PIC to do some zero-cross detection on the AC mains using a similar double-diode voltage clamp that is used for ESD protection. I need to connect the AC neutral to the logic ground so that the logic has something to reference the AC to.

In some app notes, they connected the AC neutral to the logic ground through a 1MOhm resistor, but I was wondering if there was a way to connect neutrals together but filter out noise. Like could I connect the two together with an inductor and the inductor might filter out high frequency AC mains noise from disrupting the logic ground and introducing noise into the logic?
 
Are you saying that you really want to do it AS IS without any insulation? I know that many do it but come-on, be smarter than those. Some Microchip APPnote should be removed from their website. Somes are great but some are really bad and dangerous. I think i know wich one you talk anyway and i really don't agree with this.

Are you using a transformer to supply your PIC? If so, how dificult is to modify your current circuit and read from the output of your transformer? That way you take all benefit of those KVs of insulation and keep the potential user on a safe path.

BUT there's also an alternative. Using a optocoupler (like PS-2505-1 or anything else). That a better and safer way.
 
I'm using an AC-DC switching supply so I don't have a transformer.

How would I use an opto for that? You mean use an opto to isolate the clamping diodes from the rest of the circuit?

EDIT after some searching: Oh, I didn't know they had optocouplers with zero-detect circuits built right in!
 
Last edited:
OK so really consider the OPTO coupler stuff. Keep it safe. Few cents of investement worth.

Connect the LED side of the OPTO coupler in serie with a capacitor(0.22-0.47uF 2-4X rated) directly on the main, and read from the output of it. The one i suggest use two LED back to back. So you'll generate exactly what you need.
 
Last edited:
While we are on the subject, is it "safe" to switch an AC current directly with a uC (or via switching transistor) by switching a triac? Or should there also be galvanic isolation between the logic and triac gate?
 
Last edited:
it's never safe unless you're using the same rule... opto-coupler+Triac, opto coupler+SCR, opto-coupler+XYZ or a SSR.
 
mister_e said:
it's never safe unless you're using the same rule... opto-coupler+Triac, opto coupler+SCR, opto-coupler+XYZ or a SSR.

I would disagree!, it's perfectly safe if designed properly, and depending on what it's doing - if the control circuitry has no external connections it's perfectly safe to drive a triac directly, and it's VERY commonly done.

There's nothing 'magical' about opto-isolators that make things 'safe', what makes it safe is correct design and knowing what you're doing - for many purposes opto-isolation may be a good solution, but for many more it's not.

Basically in this case it's impossible to say, as we don't have the circuit to see what's going on.
 
Nigel Goodwin said:
for many purposes opto-isolation may be a good solution, but for many more it's not.

Interesting, any example for the not good solution?

My point is that i prefer the KV of insulation between the low voltage device(and user) and the high-voltage. In this case using a PIC would probably imply some user control, but as you said, there's some missing details.

Always nice to have somebody else's opinion so far. I take'em all!
 

Classic example, a light dimmer! - in this case the entire circuitry is live, and 'isolation' is basically done by an insulated shaft on the control. No need for an otpo-isolator, and no advantage would be gained by using one.

There's no need to isolate between the control and the triac, isolation ANYWHERE between mains and user is all that's required. Historically TV's were always fully live to the mains, with the only isolation done at the aerial socket (just a couple of capacitors). Once AV inputs became required, it was easier to isolate using a switch-mode mains transformer, and almost all TV's use this method now. However, there have been a few cases where the set is still completely live, and isolation for the AV sockets is done using high speed opto-isolators and small transformers.
 
The direct line connection is ok if you don't have any exposed metal, serial port, etc or any connections or grounds to any parts which do. Some types of buttons and switches would probably be inadvisable too.

The other prob is you still need to power the device. A 5v device taking even 10mA will make 1.7W of heat in a linear regulator running on rectified-filtered 120VAC! Also difficult to find 5v regs that run off of 160VAC. So you need a fancier solution at that point.
 


Yeah, that's covered. I'm using a 120VAC->5VDC switching PCB-mounted block.

The triac I am using is one of the ones in the massive through-hole package where the leads are more like tabs with holes (I think it's TO-218X?). I was planning on routing the mains wires directly through those tabs so that the main AC line would never be anywhere on the PCB (except for the power supply I guess). I was also hoping to do that with the zero-cross detection too, but opto-isolators never crossed my mind there (well they did, but I didn't look into them too much and crossed them off my list because I assumed some things about them which turned out not to be true).
 
Oznog said:
Some types of buttons and switches would probably be inadvisable too.
You're implying I should not use a switch to directly turn power on and off to the device? The alternative is to use a mechanical relay with a pull-down resistor and a small pull-up toggle switch on the relay's control line. Seems unecessary though.

THanks to those who suggested optos. I actually found an opto that has zero-cross switching built in so I can blindly treat the relay and opto has a SSR. You apply a high line to the opto and it switches the AC on and the next zero crossing (and a low line to switch off at the next zero crossing). Complete isolation for the zero-cross detection and AC switching!

Interesting things, optos. I didn't know that the photovolataic versions were self powered. I thought you needed a power supply on both sides.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…