My current favorite relay board.
A PiNet Without Relays is Like a Day Without Sunshine.
There is a host of small inexpensive microcontrollers available such as the Raspberry Pi's, Arduinos, and ESP32, and they are great for controlling stuff. But many things we want to control require more power than their GPIO outputs can handle. To do this safely, we use relays. I really like these little opto-isolated high/low trigger relay boards. They meet my need in nearly every circumstance.
Mounting them, however, is sometimes a pain. So I made up this little housing to meet that need. Two screw holes for mounting, and square holes for a standard Home Depot variety 4-inch zip tie on both ends. The cover is friction fit, and mine all fit perfectly.
And once again, it's in OpenSCAD, so you can tweak to your heart's content!
Let's Go Straight to the Pics
// relay-housing.scad - 2025 dr.gerg@drgerg.com
// A housing and mount solution for Amazon B095YD3732 relay board.
//
bX = 75; // base X
bY = 30; // base Y
bZ = 3; // base z
$fn = 64;
mX = 50; // relay module X
mY = 26; // relay module Y
mZ = 3; // relay module Z
module mnthole(){
cylinder(h=10,r=2);
}
module cutter(){
cube([80,30,10]);
}
module screwhole(){
rotate([0,0,0])
cylinder(h=10,r=1);
}
module zipslot(){
cube([3,9,1.5]);
cube([3,1.5,6]);
translate([0,7.5,0])
cube([3,1.5,6]);
}
module cover(){
difference(){
cube([mX+4,mY+4,27]);
translate([1.9,1.9,-1])
union(){
cube([mX+0.2,mY+0.2,23]);
translate([-5,mY/2,2])
rotate([0,90,0])
cylinder(h=120,d=12);
}
}
}
module base(){
color("blue")
difference(){
difference(){
translate([2,2,0]) // puts result back on 0,0,0.
minkowski(){
cube([bX-4,bY-4,bZ-1]); // subtracting the radii and height added by Minkowski function.
cylinder(r=2,h=1);
}
union(){
translate([5,bY-5,-1])
mnthole();
translate([bX-5,5,-1])
mnthole();
translate([7.5,bY/2-4.5,-0.1])
zipslot();
translate([bX-10.5,bY/2-4.5,-0.1])
zipslot();
}
}
union(){
translate([59,42,-2])
rotate([0,0,295])
cutter();
translate([-40,37,-2])
rotate([0,0,295])
cutter();
}
}
}
module relaystand(){
difference(){
difference(){
// color("green")
cube([mX,mY,mZ]);
translate([5,1,-2])
cube([mX-10,mY-2,mZ+4]);
}
union(){
translate([3,3,-3])
screwhole();
translate([mX-3,mY-3,-3])
screwhole();
translate([mX-3,3,-3])
screwhole();
translate([3,mY-3,-3])
screwhole();
}
}
}
// uncomment next three lines for base
base();
translate([bX/2-mX/2,bY/2-mY/2,bZ])
relaystand();
// uncomment below for cover
// translate([(bX/2-mX/2)-2,(bY/2-mY/2)-2,bZ])
// cover();
All together, this package is another Thing That Works.