I have no experience creating PCBS, and I was wondering what design considerations should be made concerning having line voltage (sometimes in the single digit amps) running through one. I'm talking wire sizes, trace widths, etc. I want it to be safe after all! =)
It's not about wire size and trace width. Those are dictated by the current no differently than for low voltage lines. The issues is insulation and spacing.
To be safe, leave 5mm creapage distance between anything line-connected and everything else. There are various standards, but if you can keep to 5mm spacing, you're pretty much covered.
I can hear Russell already typing in New Zealand warning you in capital letters and italics how dangerous anything connected to the line is. Yeah, yeah, he's right but I'm figuring you know not to stick your finger in a light socket and put the other hand on the kitchen faucet. Besides, if you want to kill yourself that's your business. That's why we keep a supply of Darwin awards around.
There's a lot more to this, but I gotta now. Just remember, 5mm and don't touch the kitchen sink.
Track widths, spacing and copper thickness need to be chosen to suit the voltages and currents employed. The Pulsonix PCB software I use has calculators which help with such designs. Conformal coating is often used to prevent arcing caused by moisture. Suitable connectors and cables also need to be selected.
Why should we be careful and use 5mm instead of 15.75 mils(0.4 mm) for 171-250V, B4 (External Conductors, with permanent polymer coating, any elevation)? Also, B2 (External Conductors, uncoated, sea level to 3050m) gives 1.25mm for the same voltage rating. Are these ratings wrong, or did I misunderstand them? –
Creepage and clearance distances are usually larger than minimum thicknesses for solid insulation.
Clean dry air is a good insulator but there is no gaurantee that the air will be clean and dry. Contaminants in the air can settle on a surface making a path along the surface that has a lower breakdown voltage than the bulk of the air. We call the distance between two conductors through bulk air "clearance" and the distance along a surface "creepage".
You could argue that the soldermask on your PCB was a solid insulator but I would be relucant to do so because it's thin and easilly damaged. So treating the distance between PCB features as "creepage" (or putting slots in the board to make them clearance) is the safe option.
According to http://www.smps.us/pcbtracespacing.html the minimum for reinforced insulation (and I would suggest treating barriers between the mains and low voltage side as "reinforced insulation" unless you really know what you are doing) is 6.4mm.