# Do you want to remotely control power to your Taz and peripherals?

**URL:** <https://forum.lulzbot.com/t/do-you-want-to-remotely-control-power-to-your-taz-and-peripherals/3631>\
**Category:** LulzBot TAZ\
**Created:** [June 21, 2016, 11:42pm UTC](https://forum.lulzbot.com/t/do-you-want-to-remotely-control-power-to-your-taz-and-peripherals/3631 "2016-06-21T23:42:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeterT](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@PeterT](https://forum.lulzbot.com/u/PeterT)\
**Post date:** [June 21, 2016, 11:42pm UTC](https://forum.lulzbot.com/t/do-you-want-to-remotely-control-power-to-your-taz-and-peripherals/3631/1 "2016-06-21T23:42:32Z")

</div>

Do the following:

1. Get one of these (relay power strip): [https://www.amazon.com/gp/product/B00WV7GMA2/ref=oh\_aui\_detailpage\_o00\_s00?ie=UTF8&psc=1](https://www.amazon.com/gp/product/B00WV7GMA2/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1)

2. Make one of these (Octopi): [http://octoprint.org/](http://octoprint.org/) (I suggest this for simplicity [https://github.com/guysoft/OctoPi](https://github.com/guysoft/OctoPi))

Once you have Octoprint up and running…

1. Do this: [https://github.com/foosel/OctoPrint/wiki/Controlling-a-relay-board-from-your-RPi](https://github.com/foosel/OctoPrint/wiki/Controlling-a-relay-board-from-your-RPi)

-. Hardware and setup:

- The relay only needs a GPIO pin (3.3v) and a ground pin. I used board pins 7&9
- Install WiringPi ([https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/](https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/))
- Edit the init.d/octoprint file as described under [https://github.com/foosel/OctoPrint/wiki/Controlling-a-relay-board-from-your-RPi#using-a-grove-relay-with-the-octopi-image](https://github.com/foosel/OctoPrint/wiki/Controlling-a-relay-board-from-your-RPi#using-a-grove-relay-with-the-octopi-image)
- Edit the config.yaml script under .octoprint and under the system section, add the two clocks of scipt; one for ON, one for OFF

Remember, there are two ways to refer to GPIO pins; board, and BCM. Board means the physical pin number, BCM means the port number. Above, when adding the line to the init.d/octoprint file, the entry assumes BCN. So in this case, if you are using physical GPIO pin 7, its BCM address is 4.

So what you have in the end is this:

init.d/octoprint:

**gpio export 4 out** (line 77, where export makes GPIO available to octoprint, 4 sets the BCM pin number (pysical GPIO pin 7), and “out” sets the GPIO as outputing the state [1 or 0, on or off] )

RETVAL="$?" (existing line)

Your config. yaml looks like this:

\*\*system:  
actions:

- action: printer on  
command: gpio -g write 7 1  
name: Turn on the printer
- action: printer off  
command: gpio -g write 7 0  
confirm: You are about to turn off the printer.  
name: Turn off the printer\*\*

Note: You can make the text in “Name” and “Confirm” anything you want.

So there ya go, what you get in the end is an install of "WiringPi ", a pair of normally OFF and a pair of normally ON plugs in a relay controlled power strip. Two wires leading out the side that plug into your Raspberry Pi, and a couple of new commands in Octoprint for turning stuff on and off.

Credits go to:  
Gina Häußge (foosel) aka Ms. Octoprint!  
Digital Loggers Direct ([https://www.amazon.com/gp/help/seller/at-a-glance.html/ref=oh\_aui\_sellerprofile\_o00\_s00?ie=UTF8&isAmazonFulfilled=1&marketplaceSeller=1&orderID=106-4833551-0540255&seller=A3D4241373L385](https://www.amazon.com/gp/help/seller/at-a-glance.html/ref=oh_aui_sellerprofile_o00_s00?ie=UTF8&isAmazonFulfilled=1&marketplaceSeller=1&orderID=106-4833551-0540255&seller=A3D4241373L385)) for making cool stuff like this relay.  
 ![temp.jpg](https://us1.discourse-cdn.com/flex020/uploads/lulzbot/original/2X/6/66489a044053ab32b9320b4772acb8eb182ca06d.jpeg)

---

<div class="post-metadata">

**Author:** ![i-t-w.com](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.lulzbot.com/i-t-w.com/32/65_2.png) [@i-t-w.com](https://forum.lulzbot.com/u/i-t-w.com)\
**Post date:** [June 22, 2016, 3:18pm UTC](https://forum.lulzbot.com/t/do-you-want-to-remotely-control-power-to-your-taz-and-peripherals/3631/2 "2016-06-22T15:18:40Z")

</div>

Nice mod, thanks!

I was only aware of the power tail [http://www.powerswitchtail.com/Pages/default.aspx](http://www.powerswitchtail.com/Pages/default.aspx) nice to see another option with more outlets and both NO and NC relays built in. It looks like the power tails advantage is size and the placement flexibility of the cable pigtails.

---

<div class="post-metadata">

**Author:** ![PHugger](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.lulzbot.com/phugger/32/89_2.png) [@PHugger](https://forum.lulzbot.com/u/PHugger)\
**Post date:** [June 22, 2016, 3:52pm UTC](https://forum.lulzbot.com/t/do-you-want-to-remotely-control-power-to-your-taz-and-peripherals/3631/3 "2016-06-22T15:52:41Z")

</div>

These 5v relays are available in a variety of sizes.  
I’m using a 4 gang version -  
[https://www.amazon.com/JBtek-Channel-Module-Arduino-Raspberry/dp/B00KTEN3TM/ref=sr\_1\_4?s=electronics&ie=UTF8&qid=1466610467&sr=1-4&keywords=5v+relay](https://www.amazon.com/JBtek-Channel-Module-Arduino-Raspberry/dp/B00KTEN3TM/ref=sr_1_4?s=electronics&ie=UTF8&qid=1466610467&sr=1-4&keywords=5v+relay)

There is a _very_ nice case for it on Thingiverse -  
[http://www.thingiverse.com/thing:957292](http://www.thingiverse.com/thing:957292)  
  
  
  
Best regards,  
PCH

---

<div class="post-metadata">

**Author:** ![PeterT](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@PeterT](https://forum.lulzbot.com/u/PeterT)\
**Post date:** [June 22, 2016, 5:01pm UTC](https://forum.lulzbot.com/t/do-you-want-to-remotely-control-power-to-your-taz-and-peripherals/3631/4 "2016-06-22T17:01:25Z")

</div>

> [@PHugger](#):
>
> These 5v relays are available in a variety of sizes.  
> I’m using a 4 gang version -  
> [Amazon.com: JBtek 4 Channel DC 5V Relay Module for Arduino Raspberry Pi DSP AVR PIC ARM : Electronics](https://www.amazon.com/JBtek-Channel-Module-Arduino-Raspberry/dp/B00KTEN3TM/ref=sr_1_4?s=electronics&ie=UTF8&qid=1466610467&sr=1-4&keywords=5v+relay)

Agreed, this is a good solution, but much riskier for a layman. Wit these relays, you must be absolutely confident that you are wiring it correctly and that you understand that you are dealing directly with mains voltage.

With the Loggers solution, you are only controlling a power strip with 3.3 volts for all intent and purpose, and one with built in fail safes.
