Making an usable solid state relay

Using a microcontroller to control a device which uses mains power can be dangerous. There are products which try to overcome this problem, but I think they still have a lot to improve. If we take a look at the Sparkfun catalog, the Beefcake Relay requires you to find a safe enclosure for your project. On the other hand, the PowerSwitch Tail  comes in a nice enclosure but supports only American power plugs. Moreover, the low voltage connector is a screw terminal which is slow to mate and de-mate. Industrial solid state relays, like eBay Foteks, also require a proper enclosure.

Finding an enclosure which has suitable dimensions is quite easy, but there is quite a lot of boring work if you want to use connectors instead of just running a cable through the enclosure wall.

DIY solid state relay used to turn the heat bed of 3D printer on and off.

Recently I upgraded the heatbed of my 3D printer so I had to figure out a solution to this. I decided to use Schurter 4300.0301 for the mains connection and a 5.5mm DC plug for the low voltage connection. The circuit board, which implements the functionality from the application circuit of the MOC3043M datasheet, is soldered directly to the terminals of the mains connector. The whole thing fits nicely to a Kradex Z56 enclosure.

I hope decent commercial MCU controlled mains switches emerge soon.