A note on mains voltage: Mains voltages are DANGEROUS. This project should only be undertaken by people experienced (and preferably formally trained) to work with mains voltages. At the very least, have your work checked by a qualified electrician before plugging it in. The author can take no responsibility for injuries or death resulting from attempting to build the device described.
This project is to allow mains voltages to be switched from low-voltage signals such as Arduino Microcontrollers. I built these myself so that students in the DMC can switch such voltages with minimal risk to themselves. As such, these devices are presented to the students as a pre-built sealed unit. We strongly discourage unqualified people from touching mains-voltage circuits directly.
Note: This circuit will switch incandescent lighting loads fine, it has a bit of trickle current, so LED lighting will periodicaily flash breifly as the LED's charge circuit builds up a bit of voltage. For LED lighting I generally just run at low voltage and use switching transitors, like here.
I ordered items 1,2,6 and 7 above from commercial electronic supplier Element14. The extension cable was from a local shop. All other items and those below (not shown in image) are from my spares box.
Starting with the case, I measured, centre-punched and drilled and filed out the holes I needed for cabling and screws.
Next I soldered the connection wire to the spring-terminals, then threaded and shrunk heat-shrink tube over the solder joint and terminal pins to make sure there was no chance at all of a short to the case.
I screwed the terminal unit into the side of the case and bolted the SSR to the base. Then I soldered the other ends of the terminal wires to the SSR. (As my case is a bit thin, I had to bend the SSR terminals over - carefully!).
Next I (very very carefully) ring-stripped the outer sheath off the middle 80mm of the 240V extension lead, not damaging the inner cable sheaths. I stripped a slot from the earth wire (green) and added a wire with a lug on the end. This lug is screwed under one of the nuts holding the SSR to the case. It provides an earth to the aluminium case, which is very important for safety - all user-accessible metal surfaces in high-voltage devices must be earthed in case of a fault.
I cut the active wire (the brown one) in two and soldered it across the switch terminals of the SSR.
The neutral wire (blue) runs through the box untouched.
Finally, I slipped some envelopes of folded electrical-insulator plastic over the terminals to stop electrical shorts to the case - the control lines shorting would be annoying, the active cable shorting would be potentially lethal! (I can't stress the danger of mains voltages enough, if you hadn't noticed. Being paranoid about electrical insulation is always a good thing). The Earth shorting to the case doesn't matter as it is connected to the case anyway.
Threading the mains cable on the gromets and screwing down the lid finishes the electrics off. These are cable-locking grommets and while they certainly aren't an excuse to yank on the cables, they will hold it securely in place for normal wear-and-tear usage.
I used Inkscape and GIMP to make a nice label for the front panel, which provides information on what the device does and how it is wired inside:
The label is released public domain: you can modify/use it if you like (it is a 300dpi PNG image). I laser-printed it to photo-copier-safe plastic sticker sheet.
That looks nice and professional - I am quite proud of how it came out!
Before putting it anywhere near a mains voltage, I used a multimeter set to continuity indicator mode to check that there were no shorts between any of: Active in, Active out, Neutral, Earth, control positive, control negative.
Next, I took the device down to the university electrical engineering department for electrical certification (they have someone trained to certify things like this, and as well as being generally sensible, it is an insurance-liability requirement in the workplace).
With everything cleared, I plugged it into one of our photographic/stage lamps (300Watts in this case), and wired an Arduino micro-controller running the blink sample program into the control terminals. It worked as expected.
3 more to make (and get certed) should be enough to keep the students happy - they don't use mains stuff very often (I discourage it where low-voltage alternatives are reasonable) but it is good to have the option.