Sometime back, I bought a 12 V, 5 A SMPS from a electronics ship for audio amplifier. It was a class-2 SMPS with an earth pin. I used it as such with earth connection and an inductor was used in series with the output to remove any extra oscillations. Without the earth connection, it leaked current through its metal body and caused hum in the amplifier.
Recently, I bought another SMPS and I did the same procedure, but this time it started making some hum even after earthing. Then I found that connecting the 12 V output negative terminal and earth terminal of SMPS stopped the noise. I connected a 1 μF, 63 V capacitor between the negative output DC and earth and the strange hum stopped. Everything seemed fine.
The problem is that my friend installed this set in his home and he reported shocks. While testing with a line tester, he found the equipment to be slightly live.
What could be the cause of this problem?