[top]Use a wall-wart supply!
Whenever possible, it is recommended to use commercially available and approved (UL, VDE, KEMA) power supplies to power your equipment. These power supplies are tested for safety by independent institutions, they are readily available and usually quite cheap as well.
[top]Safety Classifications
If it is necessary to build a mains-connected application, protection against electric shock can be provided in two classes:
Class I equipment uses basic insulation; its conductive parts, which may become hazardous if this insulation fails, must be connected to the supply protective earth. Examples are computer power supplies and kitchen appliances.
In summary, Class I isolation requires adequate insulation between mains and any user accessible part, capable of withstanding a test voltage of at least 2120V peak. An isolation distance of at least 3 mm must be maintained between any user accessible part and mains carrying parts. Furthermore, any conductive, user accessible part must be adequately connected to the safety ground.
Class II equipment uses double or reinforced insulation for use where there is no provision for supply protective earth. Examples are power tools, hair dryers and cell phone chargers.
The double insulation requirement means that the insulation between mains and any user accessible part is capable of withstanding a test voltage of at least 4240V peak. An isolation distance of at least 6 mm must be maintained between any user accessible part and mains carrying parts.
In practice, it is recommended to separate mains carrying parts and user accessible part as much as possible, but never less than required (see above).
When building a power supply, the use of a Class II insulated transformer is preferred, but note that when this is fitted in a Class I equipment, this does not, by itself, confer Class II status on the equipment.
[top]When the mains enter your project
It is always recommended to use an approved mains entry with an integrated fuse holder and switch. If this is not possible, you should do the following.
- In case you intend to route the mains cable directly into your equipment, use a proper strain relief at the point of entry.
- The first thing after the mains enter your equipment must be a properly sized fuse in an approved fuse holder. If you use a mains plug, keep the wiring to the fuse as short as possible. Use properly insulated wiring, and be sure to make firm and mechanically strong connections.
- A separate mains switch should be of the double pole type. In case of three-phase appliances, all phases and neutral must be disconnected simultaneously.
- It is not required, but strongly recommended to place filtering components after the mains switch. Placing them before the mains switch will expose them to continuous stress and reduces their lifetime.
- A secondary on/off switch is allowed if the equipment consumes less than 10W in the “off/standby” state. In such case a visible means (e.g. a stand-by LED) must be provided to indicate that mains are connected.
[top]Safety Ground
Anyone constructing a Class I equipment, must pay special attention to proper safety grounding:
- Use yellow/green insulated wire (if necessary, green with a narrow yellow stripe. Do not use yellow wire with a green stripe)
- If you route the mains cable directly into your equipment, the ground wire must be the longest, such that it is the last one to come free if someone accidentally pulls the wire.
- Any user accessible metallic part must be adequately grounded.
- Adequate grounding may require, for example, an additional ground wire to be connected between the front plate and the mains ground wire.
- If the entire enclosure is conductive, and all parts are firmly connected to each other using metal screws, one grounding point is considered adequate.
- Take care when using metallic switches or potentiometer shafts. They must not provide any hazard!
Source: Elektor Construction and Electrical Safety Guidelines (Dutch, English)
!!! DO NOT MESS WITH MAINS !!!