I currently have an almost finished project where I have a raspberry pi control a relay module, which acts like a switch in an extension cord. The goal of the project is to remotely control my christmas lights through my raspberry pi.
Everything is done and working except I don’t know how I should encase it (for long term use I’d rather have it neat and tidy in some form of a case rather than just having open wires taped to my wall.)
Since (sleeved, but still live) wire directly from the outlet is running through the case, what material(s) would be best to use? My first though was cardboard since I have an abundance of it but common sense tells me that’s just a fire waiting to happen. Aluminum seems like an obvious choice however I don’t have any scrap aluminum laying around nor don’t have a welder on hand. Plastic from old Rubbermaid’s might work but would be hard to cut out for the exit outlet.
If it is just AC in and AC out then there aren’t any long runs of DC wires that could pick up power via induction. If the only DC is in the box then it is just like any other electronic device that has the power supply built in, as opposed to a power brick.
You could keep things separated in a box, with the relays and Pi PSU on one side, and the Pi on the other. The low voltage wires on the PSU/relay side would be short and direct to the Pi, not some huge coil or long parallel run. You could add a divider to make certain parts stay on their respective sides, much like a PC PSU keeps the power in away from all the DC wires and equipment.
A lot of keeping different wires separate is more about interference or damage to the low voltage device. Like those FCC warnings “This device must accept all interference”. You would have to go to great lengths to actually cause a fire via induction. Loose parts in a live box would be immensely more dangerous.
And along those lines, having the Pi extremely close to the high voltage contacts on the relays opening and closing mostly certainly can cause interference, particularly with wifi and bluetooth. You may want to do an external antenna mod or USB dongles for those, as well as some magnetic shielding on the power supply side like any other home electronic device employs.
If you aren’t terribly familiar with working with high voltage then I most certainly wouldn’t do a test run indoors or near anything expensive or flammable.