
Relay Control Box - AC or other via USB or Raspberry PI GPIO Control
thingiverse
Please post a make if you make one! :)\r\n\r\nTwo relay type / size boxes are available here... regular and an optocoupler relay. The optocoupler better isolates the relay control from the rest of the board is how I've read it. I've not had any issues with the smaller regular relay with switching power on and off via USB so far.\r\n\r\nStandard Relay - https://www.aliexpress.com/item/32708600505.html\r\nOptocoupler Relay - https://www.aliexpress.com/item/32983499479.html\r\n\r\nI've documented two different ways to switch with this relay below.\r\n\r\nZiptie insertion is easier if you bend the last 1cm or so of the zip tie end to make the curve as you insert it.\r\n\r\n*** USB power control description below this one ***\r\n\r\nI wanted to toggle power for my Prusa printer via OctoPrint using 3.3V/Ground/GPIO on the Pi via this plugin https://plugins.octoprint.org/plugins/psucontrol/. This allowed me to turn on and off the power supply.\r\n\r\nI used the smaller relay for this. The relay installs into the printed box and is held in place by some friction protrusions. You're going to put the relay into the opening at a tilt and then roll it down into these protrusions to keep the relay in place.\r\n\r\nYou need to strip off the power cable jacket to expose the wiring and you'll cut and install the black wire into the relay NO(Normally Open/COM) inputs. Easiest way to do this is to cut the cable where you want to install your relay and then strip back 7cm on each end. \r\nCut off the excess white and green wire and solder those back together covered with heatshrink and maybe put two wraps of electric tape over one connection to ensure no pointed bits work their way through the headshrink. This should provide enough of the black/hot wire loop to pull over to the relay location to then cut and terminate the wires in the relay. I pull the loop into place first to ensure I'm cutting the wire in a location that yields the longest leads to the termination.\r\n\r\nAmazon has the GPIO jumpers. $2.50 or so from China if you can wait a few weeks: https://www.aliexpress.com/item/32349445870.html\r\n\r\nThe GPIO outputs only 3.3V, so I used 3.3V to power the relay as well, which works great.\r\n\r\nNote when you connect to a GPIO and configure it in the plugin, the plugin references the 1-40 pin number, not the GPIO number.\r\n\r\nThis setup works well but I also wanted to toggle my LED power and enclosure exhaust fan so I built a new version that holds a 10mm cable. I turn on and off the power to a small power strip for all three devices.\r\n\r\nZiptie openings are chamfered, making it easy to push the ziptie in and out.\r\n\r\nHeld closed with a M3x12 screw. This set is pretty handy for your projects (https://www.amazon.com/VIGRUE-M2-M3-M4-1080PCS-Stainless-Screws-Socket/dp/B071KBVZVV/).\r\n\r\nI leave Octoprint running 24/7. When I want to print, I click connect which turns this relay on. Thirty seconds later, I'm ready to print. After my print completes, the plugin will turn off the relay after a set amount of time. I have mine set to thirty minutes. This has worked flawlessly for me.\r\n\r\n*** USB Box ***\r\n\r\nImage above shows how to wire this to turn on power to the power strip when the USB port has power. I use this on my son's PC to turn on his wall LED art. The LEDs were too much to run off a standard USB port so I did the next best thing and turned the power on and off based on just a USB port on the PC. When the PC is off, so is the power to the USB connection, and the relay is open. When the PC is powered on, the USB port turns on the relay and since 'IN' is tied to ground, the relay closes and turns on power to the power strip.
With this file you will be able to print Relay Control Box - AC or other via USB or Raspberry PI GPIO Control with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Relay Control Box - AC or other via USB or Raspberry PI GPIO Control.