Electronics > Projects, Designs, and Technical Stuff
Help with AC ground question
<< < (3/3)
lmagalhaes:
The mains is only used to supply power to some transformers, after which have full bridge rectifiers and a large cap. The live is switched on and off with the TRIACS and, per regulation, you can't even have a plug to connect to the wall (by our laws), since you could flip the live and the neutral with european plugs. So the logic board doesn't have any other connection to the mains, even the live is only switched on and off.

About the boiler itself, it is connected to earth (or protective ground). The heater element is connected to live and neutral. Hopefully that doesn't mess with the whole system here and it shouldn't, honestly. If it did, it would trip the breaker right? So, in theory, this should all *just* work.

For a safety precaution, maybe having an isolated 5V converter and an optocoupler to receive the probe level isn't that bad of an idea.. If, for some reason, it couples to live or neutral, it only damages that part of the circuit and not the 5V rail it's associated with and the microcontroller directly.

EDIT: using an isolated DC-DC converter, I can have a separate ground to turn on the LEDs of of the optocoupler and only have this virtual ground connected to earth right ? That way, I don't have to make the whole digital gnd as earth, which will decrease the chances of it going BOOM on my face.
magic:
The heater could be a problem if its insulation breaks down and sends mains current through water to protective earth. Then the water sensor may see several volts on it before circuit breaker trips and perhaps damage the control board or put hazardous voltage on user accessible parts. I guess you're right and it should be isolated.

For power supply, besides integrated switchers, I have seen tiny transformers with a few mA of current capacity and dimensions like 30x20x20mm. This could be an option too and it gives AC output for free.

Finally, there is the option of simply taking current from mains as somebody suggested, but I don't know if it's legal and it still requires some decent resistors to withstand all mains transients and prevent failures.

Alternatively, ground the PCB and sense the probe trough a capacitor, as suggested by Ian.M. It's not grounding the PCB which causes danger, but connecting it to a wire submerged in water. Perhaps a suitably rated safety capacitor (Y class?) between the board and the sensor would be enough, plus generous safety clearances and a transil to protect the MCU from capacitively coupled crap in the event water goes live. But I have no idea about those things, better ask somebody familiar with regulations in your area.
Ian.M:
A water heater element in the E.U. almost certainly has a grounded metal sheath so the probability of a significant leakage current to the sensing electrode is negligible.   If the heating element fails in a way that puts current into the water (which is virtually impossible: the sheath would have to corrode through completely at both ends before the water penetrating the insulation caused the element to short to the sheath and fuse + requires the supply to it not to be RCD protected), does it really matter if the control board fails as well as long as it doesn't cause a safety hazard?

However if you needed to mitigate that a heavy duty bidirectional TVS diode could be put from the sensor signal to ground to clamp any line frequency voltage on the sensor to something the MCU board can withstand, possibly with a fuse between it and the sensor in case salt contamination (e.g. from a water softener) increases conductivity far beyond what would normally be expected.
Siwastaja:
Threads like this tend to end up in a total trainwreck full of misconceptions.

I would request only the following proper terms are used:
PE: protective earth
L: Live
N: Neutral

Both L&N are considered "hot" or dangerous wires. To simplify, think both of them as "L". This is because many countries use them interchangebly by using nonpolarized plugs. Even the countries where the plugs are polarized, it's a common mistake to mix them up. So N is often L.

PE is connected literally everywhere and never mixed up with L. (Whenever it is mixed up, it's a very rare and serious crime, worth reporting to the police as an attempted manslaughter, either on purpose, or by negligence.)

I have come to the conclusion that having word "ground" in the same sentence as "mains" and "safety" discredits the whole sentence. This is a major source of confusion. What is ground?

Many power supplies just internally connect the output minus to the PE. This means, your microcontroller ground reference may already be connected to PE. If not, doing that causes absolutely no harm whatsoever. It's just on the same potential than all the pipework and most device metal cases are already.

The microcontroller circuit actually becomes completely irrelevant. The safety of the heating element is important regardless of the microcontroller circuit and its grounding. If you use the microcontroller to turn the heater on/off, then this subpart of the circuit must be dealt with properly, but it wasn't the OP's question.

Apart from possible corrosion issues, there is nothing wrong in what you suggest. I don't see how an optocoupler does anything in that circuit (except improve ESD performance). You would still need to reference it to the same PE, and still power the detection (optocoupler input) from something referenced to PE.
magic:

--- Quote from: Siwastaja on July 24, 2019, 10:49:07 am ---Many power supplies just internally connect the output minus to the PE. This means, your microcontroller ground reference may already be connected to PE. If not, doing that causes absolutely no harm whatsoever.

--- End quote ---
I mostly agree except for this paragraph. There are installations where grounding is not desired. Don't ask me, but I know that they exist (search SELV). OP's probably isn't one of them, though.
Navigation
Message Index
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod