The things to worry about are 1) strain relief; 2) having an appropriately rated and sized fuse or circuit breaker; 3) having a large, easily-operated, within reach of the operator, power on-off switch or other control (http://dx.com/p/ac-220-380v-waterproof-on-off-push-button-switch-167441); 4) making sure everything is properly grounded; and 5) appropriate use of conduit for fire and abrasion protection. Use a C13-style connector mounted on the side of the unit and a standard power cord if the device is portable, or conduit if nonportable. An internal AC receptacle should be enclosed in a standard metal box.
If, as you say, there is water or moisture involved with the operation of the unit then the power source (wall socket) must be equipped with a Ground Fault Circuit Interrupter (GFCI).
Generally you won't have code-compliance issues if you're not manufacturing the units for sale and if your unit looks professional (no sloppy or frayed wiring). For legal advice consult a licensed attorney.
If your unit could injure someone if not shut off immediately (e.g. if a worker's hair or clothing were to become stuck in the mechanism) consider a pull-string or other emergency shutoff mechanism. The string would be connected to a shorting plug the socket for which is wired in series with the mains.
I don't have much experience with audio, but I'm guessing a speaker
needs a positive and negative voltage to function.
A loudspeaker is (typically) a two-terminal device so it simply requires a voltage across the terminals.
What you want to be sure to do is to eliminate any constant voltage across; you want AC voltage only across the speaker terminals.
Thus, for example, you can have a single supply amplifier coupled to the loudspeaker with an appropriate capacitor. For example:
In summary, you do not need bipolar power supplies but you must make sure to remove the DC component from the output via, e.g., a coupling capacitor.
how is a decoupling capacitor able to produce a voltage lower than 0V
In the quiescent (no-signal) state, there is a voltage across the coupling capacitor. Assume for concreteness, that you're using a single +5V power supply and that, when there is no signal, the voltage at the output of the amplifier is +2.5V.
The coupling capacitor charges to this voltage when the amplifier is powered up so that the voltage across the speaker is 0V.
Now, if we assume that the capacitance is large enough such that the sinusoidal signals of interest do not significantly charge or discharge the capacitor, the voltage across the coupling capacitor is effectively constant.
Thus, if the output of the amplifier 'swings' down to, say, +1V, the voltage across the speaker is:
$$v_{sp} = 1V - 2.5V = -1.5V$$
In other words, the quiescent voltage across the coupling capacitor is subtracted from the amplifier output voltage to find the voltage across the speaker.
Under the assumptions above, the capacitor is acting like a 2.5V battery and this is the source of the negative voltage.
Best Answer
It must be a matter of stray leakage.
Either intentionally (e.g., GFCI circuitry) or unintentionally (e.g., stray voltages removing bias from a node) the circuit stops working.
Turning the plug around changes the relationship of any reference node to the stray capacitance to “the world” through the lamp’s body. This leads to more or less stray currents in different nodes in the circuitry.
If the lamp has a Triac driving circuit for a dimmer, this stray current might be enough to cause this circuit to stop operating.
Measure the AC voltage from the lamp housing to ground. You might be able to see a difference depending on the orientation of the plug.