Mains Ground Safety for Power Supply?

I'm trying to build my first switched mode power supply. I'll be using it to drive two 24v 50W heating elements. I don't want to use a transformer. The design I have so far seems to work well in simulations, but I need some advice regarding mains ground.

The control electronics will be operated on power from a small transformer. This provides isolation from mains. I've done this a million times. 

However, the mains power connects directly to the loop that produces the 24V signal. This is the loop after the FET, containing a diode, inductor, and capacitor. The wire coming from this loop and going to the comparator is where I'm having trouble. This is a voltage sensing wire and carries very little current, and is used by the comparator to produce negative feedback. This feedback loop is what allows me to get 24V from 120V. The comparator is powered by the 12V isolated supply. In order for it to sense the voltage properly, the comparator's ground must be at the same voltage as the power supply's ground. But the power supply's ground is tied directly to mains ground. Is that safe? Am I allowed to do that?

In mains wiring in the US, the left notch is neutral, the bottom hole is ground, and the right notch is hot. Neutral is basically ground, except ground is connected to the actual ground and neutral is this mysterious thing I probably don't completely understand. Is it safe to use it as ground?

What if the person using this circuit flips the plug over and suddenly the circuit's "ground" is fluctuating wildly between +/- 120V? The circuit may function just fine, but someone using a switch or knob connecting to ground could get a nasty shock. How do I make sure the ground of my circuit is always connected to actual ground? Do I need to preserve the isolation of the control circuitry? I know how to use Gate Drive Transformers for the FETs, but the sense wire for the comparator still needs to have both halves of the circuit with their grounds at the same voltage.

Any advice is greatly appreciated.

Picture of Mains Ground Safety for Power Supply?
sort by: active | newest | oldest
This circuit is LETHAL. There is no supply isolation from the mains to the output. It may kill the used, it may kill the designer. I suggest you look at some DOL SMPSU topologies.

Ground is NOT the supply return. Neutral is.

The mosfet will blow in seconds

Hint: The transformer is there for a reason.
laserjocky (author)  steveastrouk3 years ago
Dang. Ok, well I'm glad I asked. I knew something was fishy here. I've studied a lot of analog and digital electronics and had college courses on them, but sadly I've never taken any electrical engineering courses of this nature. I don't know what DOL is. Could you point me to a book that would help me with the specifics of this project? I have a programmer friend and he has tons of books with example circuits but when I looked through there I didn't see anything particularly useful.

I really wanted to avoid using high power transformers due to their size and weight. Is it possible to use a smaller 1:1 transformer for the high power side? As in switch the FET through a 1:1 and then tie one side of the other end to ground, and the other can go to the L-C-diode loop and sense wire? That would provide isolation, and the ground would be common and isolated. But I'm unsure about what to use for a trafo. I have a bunch of large ferrite toroids I've pulled from ATX PSUs. Would one of those do the job? I need at least 24V 4A.
Just get a true 24VDC Switch Mode Power Supply suitable for your AC mains supply voltage. They are not expensive and will give isolation from your mains supply. 24VDC @ 4 Amps or above is not really too difficult to get. The large ferrite toroids that you have are not suitable for low frequency transformers (50 - 60Hz). If they're from a computer power supply, they are most likely used as filtering inductors. Proper low frequency toroids used in some power supplies are wound laminated sheet steel (or Iron). Now, alternatively you are trying for 24VDC @ 4 Amps which is 96 Watts. You already have access to computer power supplies which can easily give 5 VDC @ 20 Amps which is near the power dissipation that you are after.
LawrenceB2 years ago

Can you use a 1:1 isolation transformer up-stream of your X1-1 and -2 and then use a floating ground plane - all that within an enclosure wherein the floating ground plane has no contact with the enclosure and the enclosure is earth bonded?

There are thousands of lab power supplies sold into the market using this approach. I am looking at two right in front of me. Both are UL/CAS marked.

It is serious work. How do you run the heating elements in such a way that a user can not possible touch it? Take a look at ceramic heating elements in consumer products. You will get some idea how hard it is to do the user isolation part. It will make floating a PSU look easy.

Slowpoke has probably the best idea - buy it !

DOL means Direct On Line - ie no conventional transformer.

Real switchers work by taking mains, rectifying it to DC DIRECTLY, and then chopping up the DC at very high frequency into a transformer, THEN taking the resulting low voltage HF AC and turning THAT into DC.

The advantage, amongst several, is that the transformers are a LOT smaller
Make sure to video tape it if it blows up.

Just being funny.

Use a three pronged plug or a purpose use plug. (A plug that can only be plugged in one way.)