4-Channel Relay Module Case

by thehair Aug 6, 2015
Download All Files

Thing Apps Enabled

Please Login to Comment

This thing is so strong!
<I'm sure it had nothing to do with the 100% infill that I left turned on from a previous print>

Thanks a lot. This design fits perfect for my board.

I like your design. It just doesn't fit mine. Can you share the dwg or dxf file for adjustment?
Thanks. And gret job.

Apparently there is a similar board that has different dimensions than the one I bought. I've uploaded my Solidworks files as well as a step file if that is helpful

Not sure what happened but the mounting holes for the board are way off. Maybe i accidentally scaled it up? Access holes dont line up with the board either. Other than that brilliant design i love it had it fit correctly.

This is the relay board that i got and modeled the case for:

Are your mounting holes in the corners of the board? It is possible that they have changed the layout of the relay board.

Yeah, I didnt pay attention to brand. Apparently Jbtek and Sains have exactly the same relay except the Jbtek (which I bought) was slightly more narrow...ugh. I just used your design and made my own top to fit my relay so wasnt a big deal.

Nice work. Just what I was looking for.

I am curious what you are controlling with these relays. Also, how do you control GPIOs via OctoPi? I would love to be able to control my added cooling fans via GCode.

I'm still in the process of implementing everything, so I haven't gotten everything figured out yet. My initial plan is to control cooling fans and lights with the relay. Possibly even controlling the power to my printrboard with the relay as well. I started with this example:


However it seems like the only default way to execute shell commands for the GPIO pins in octoprint are from the "system" drop down menu or though event hooks in the config.yaml file. I wanted the option to control the relay though the control tab of octoprint, however it seem like you can only send gcode with the custom controls in the control tab. I also wanted to the cooling fans to turn on and off automatically with the hotend, but there aren't any event hooks for that.

So right now my plan is to make buttons in the controls tab that send fake gcode. Then I will use an Octoprint plugin which will intercept the fake gcode, execute the shell commands for the GPIO pins, and then suppress the fake gcode before it goes to the printer. It is a super round about way to issue the commands, but it looks like it is going to work. Here is some documentation on how to write a custom octoprint plugin.


Sounds interesting! I did see the first link. I was also thinking, since the camera integration can take a snapshot per layer, there must be a hook there. I was thinking it can run something completely outside of OctoPi. That might be a simple workaround. Then, life got busy.

Thanks for the info! I would love to see what you come up with in the end!

Bit of update... I didn't get to work on the GPIO. However, I did just use a single relay module, power it off the Pi, and tapped the signal to the LEDs on my printer. I still use my switch to turn the fans on. However, when the printer sleeps, the fans shut off. I think it will be quite a while before I tackle the GPIO solution, if ever. Thought I'd share the idea.