WEBVTT
Kind: captions
Language: en-US

00:00:00.066 --> 00:00:02.502
This is a relay and this is a smart plug.

00:00:02.502 --> 00:00:06.906
These are two different methods
of controlling power to your 3D printer.

00:00:07.007 --> 00:00:10.210
Each has its drawbacks,
but together both will make your 3D

00:00:10.210 --> 00:00:14.547
printer safer, cheaper to run,
and the best part more convenient.

00:00:14.647 --> 00:00:16.116
The relay v 1.2.

00:00:16.116 --> 00:00:18.084
By BIGTREETECH comes with some cool

00:00:18.084 --> 00:00:21.688
safety features and the needed flexibility
for more complicated set ups.

00:00:21.888 --> 00:00:25.492
It can power off your printer, detect
short circuits on your motherboard,

00:00:25.558 --> 00:00:28.128
and let your printer know
when there has been a power loss.

00:00:28.128 --> 00:00:33.533
Its downside
is that it is time consuming to implement,

00:00:33.633 --> 00:00:35.935
and comes with the danger
of working with mains voltage.

00:00:35.935 --> 00:00:38.805
The smart plug, on the other hand,
is very easy to install.

00:00:38.805 --> 00:00:42.409
You simply plug it into the wall
and you're done.

00:00:42.509 --> 00:00:45.512
I chose this plug in particular
because I have some like it already.

00:00:45.678 --> 00:00:48.715
This one comes with the added advantage
of being able

00:00:48.715 --> 00:00:51.317
to measure the amount of power
that my 3D printer is using.

00:00:51.317 --> 00:00:54.654
It's also rated up to 15 amps,
which is plenty for this application.

00:00:54.788 --> 00:00:57.424
You can grab a pack of four of these
for about $40

00:00:57.424 --> 00:01:00.326
If you want to support the channel
or have an Amazon affiliate link to that

00:01:00.326 --> 00:01:03.329
in the description along with some of
the other tools that I use in this video.

00:01:03.396 --> 00:01:06.833
Now, both of these methods
can be controlled by your Klipper host,

00:01:07.000 --> 00:01:08.435
a Raspberry Pi in my case.

00:01:08.435 --> 00:01:12.272
Getting the software side of things
to work was extremely frustrating, as I'm

00:01:12.272 --> 00:01:16.543
still not super familiar with Klipper
or Moonraker, but I've hopefully saved you

00:01:16.543 --> 00:01:20.814
from that by condensing everything down
onto a single repository on my GitHub.

00:01:20.980 --> 00:01:23.083
I'll have a link to that down
in the description as well.

00:01:23.083 --> 00:01:25.752
since the GitHub is pretty comprehensive
and covering

00:01:25.752 --> 00:01:28.955
all of the different moving parts
and the configuration of these...

00:01:28.955 --> 00:01:32.025
this video will only really act
as an overview of both methods.

00:01:32.125 --> 00:01:35.462
The relay v 1.2 is a small PCB
with a relay on it.

00:01:35.595 --> 00:01:36.863
That's the little blue box.

00:01:36.863 --> 00:01:38.932
A relay has two lines inside of it.

00:01:38.932 --> 00:01:42.402
One line creates a magnetic field
when powered, which causes a switch

00:01:42.402 --> 00:01:46.005
on the other line to close completing
a circuit and allowing current to flow.

00:01:46.005 --> 00:01:49.008
That's the whole purpose of a relay
to use a small current like one

00:01:49.008 --> 00:01:52.812
from a microcontroller to control
a big current like the AC mains voltage.

00:01:52.946 --> 00:01:54.147
The relay can be wired up

00:01:54.147 --> 00:01:57.150
between your 3D printers, power
switch and power supply unit.

00:01:57.217 --> 00:01:58.418
Installing it like this

00:01:58.418 --> 00:02:01.354
allows you to mechanically cut power
to your entire printer.

00:02:01.354 --> 00:02:02.388
The relay included.

00:02:02.388 --> 00:02:04.224
This is both safer and practical.

00:02:04.224 --> 00:02:07.894
The relay itself is toggled
by a small microcontroller on the board.

00:02:07.894 --> 00:02:09.262
We can tell this microcontroller

00:02:09.262 --> 00:02:11.731
to toggle the relay switch
by sending signals to it

00:02:11.731 --> 00:02:18.571
from either our motherboard
or a Raspberry Pi.

00:02:18.638 --> 00:02:20.607
and Now, as a reminder, we

00:02:20.607 --> 00:02:24.043
are going to be working on a device
that interacts with mains voltage.

00:02:24.144 --> 00:02:27.914
So the first thing I did was design
a case for it to remove the likelihood

00:02:27.914 --> 00:02:29.849
of starting a fire or shocking myself.

00:02:29.849 --> 00:02:32.785
The lid has some text on top
reminding you of the AC voltage

00:02:32.785 --> 00:02:35.788
and indicating which side is AC
and which side has the controls.

00:02:35.855 --> 00:02:36.723
It also has slots

00:02:36.723 --> 00:02:40.493
for the wiring and snaps to the base
without any extra mounting hardware.

00:02:40.593 --> 00:02:44.030
the case used in this video
was a little too small, but I fixed that.

00:02:44.030 --> 00:02:46.533
In the second version
which is posted on printables.com.

00:02:46.533 --> 00:02:48.468
There's a link to that in the description
if you want to use it.

00:02:48.468 --> 00:02:50.303
Now that I had a layer of insulation
achieved,

00:02:50.303 --> 00:02:52.138
it was time to wire up the board.

00:02:52.138 --> 00:02:55.608
I started by disconnecting my printer
from the power and waiting a few minutes

00:02:55.608 --> 00:02:59.546
to make sure all capacitors inside
the power supply unit were discharged.

00:02:59.612 --> 00:03:02.415
I then removed all the wiring
from the power supply unit

00:03:02.415 --> 00:03:04.684
except for the ground wire.

00:03:04.684 --> 00:03:07.320
I taped the wires that led
to the motherboard to the side.

00:03:07.320 --> 00:03:07.854
As I wanted

00:03:07.854 --> 00:03:11.558
to test the relay without the risk
of destroying the rest of my printer.

00:03:11.658 --> 00:03:14.627
I crimped some wire forks
and attached the relay to my power, switch

00:03:14.627 --> 00:03:16.329
and the power supply unit.

00:03:16.329 --> 00:03:24.404
I then connected the
switch to mains and prayed.

00:03:24.504 --> 00:03:26.172
Luckily, nothing caught fire.

00:03:26.172 --> 00:03:29.442
I then continued to pray
as I flipped the switch,

00:03:29.542 --> 00:03:32.378
Seeing the fan whir up
and not smelling any smoke confirmed

00:03:32.378 --> 00:03:34.647
that the wiring was done properly.

00:03:34.647 --> 00:03:37.650
The relay itself
actually shut off after a few seconds.

00:03:37.684 --> 00:03:40.753
Since it wasn't attached
to the motherboard, so it assumed that

00:03:40.753 --> 00:03:43.756
something had gone wrong
and cut power to the power supply unit.

00:03:43.790 --> 00:03:44.857
Fantastic.

00:03:44.857 --> 00:03:49.429
Next, I wired up a momentary switch
to reset the relay, and it worked too.

00:03:49.529 --> 00:03:50.930
Next, I wired up the motherboard.

00:03:50.930 --> 00:03:54.133
Now that I was confident I wouldn't
break it and I continued to test things.

00:03:54.133 --> 00:03:57.070
Each time
I was making sure that I was turning off

00:03:57.070 --> 00:04:00.440
and unplugging the printer and
giving the power supply time to discharge.

00:04:00.607 --> 00:04:03.343
There are some really cool ways to die
and this is not one of them.

00:04:03.343 --> 00:04:04.177
So be careful.

00:04:04.177 --> 00:04:07.180
The next step was to wire up the power off
signal line.

00:04:07.247 --> 00:04:10.950
This is the line that lets the Pi
talk to the microprocessor on the relay,

00:04:11.184 --> 00:04:12.518
which shuts the relay off.

00:04:12.518 --> 00:04:14.787
There are also headers for the short
circuit detection

00:04:14.787 --> 00:04:17.123
and power loss detection,
which I cover on GitHub.

00:04:17.123 --> 00:04:21.361
Now if you plan to install the relay V
1.2, then please do it properly.

00:04:21.361 --> 00:04:24.931
Make sure your wires are rated
for much higher than 120 volts.

00:04:24.964 --> 00:04:26.499
Mine were about 600 volts.

00:04:26.499 --> 00:04:28.901
Make sure they're thick enough
for currents passing through them.

00:04:28.901 --> 00:04:31.371
14 gauge is a safe bet
and should work for this.

00:04:31.371 --> 00:04:34.540
Make sure that the wires you're
using are stranded and not solid core.

00:04:34.540 --> 00:04:35.842
And don't do any soldering.

00:04:35.842 --> 00:04:38.077
It's just going to ruin the crimp
connections.

00:04:38.077 --> 00:04:40.213
Use proper crimp tools and connectors.

00:04:40.213 --> 00:04:43.316
if you need any of the tools I used,
I put links in the description

00:04:43.316 --> 00:04:45.318
so you can at least
get an idea of what you might need

00:04:45.318 --> 00:04:50.490
if you skimp out on this part. You're only

00:04:50.590 --> 00:04:51.257
After I got the

00:04:51.257 --> 00:04:54.227
relay installed, I needed to configure
Klipper to deal with it.

00:04:54.260 --> 00:04:55.628
If you are configuring Klipper.

00:04:55.628 --> 00:04:57.063
There are just a few main steps.

00:04:57.063 --> 00:04:58.298
First, you'll need to enable

00:04:58.298 --> 00:05:02.368
the Raspberry Pi as a second MCU
so that you can use its GPIO pins.

00:05:02.535 --> 00:05:05.538
Next, you'll need to add a section
to your Moonraker config file,

00:05:05.638 --> 00:05:09.542
your printer config file and your macros
config file if you have one.

00:05:09.642 --> 00:05:11.678
All the info for
this can be found on the GitHub.

00:05:11.678 --> 00:05:14.447
You'll just have to copy paste
and do a little bit of adjusting.

00:05:14.447 --> 00:05:16.215
The configuration I provided.

00:05:16.215 --> 00:05:19.352
Sets the printer up so that 5 minutes
after a print is finished,

00:05:19.485 --> 00:05:23.823
the printer decides that it is idle
and then 10 minutes after it's been idle,

00:05:23.823 --> 00:05:26.793
the relay will cut power to the printer
to turn the printer back on.

00:05:26.793 --> 00:05:30.596
You just click the switch within your web
interface to tell the relay that it's

00:05:30.596 --> 00:05:40.540
allowed to turn back on.

00:05:40.640 --> 00:05:43.343
but it would require an additional relay
and some more wiring.

00:05:43.343 --> 00:05:47.347
Now, the wiring for the smart
plug was very straightforward.

00:05:47.413 --> 00:05:48.648
Yeah.

00:05:48.648 --> 00:05:50.917
The configuration for the smart
plug is very similar

00:05:50.917 --> 00:05:54.253
to the relay, but you don't need
to configure the Raspberry Pi as an MCU.

00:05:54.287 --> 00:05:55.688
you just need to have one of the mini

00:05:55.688 --> 00:05:59.425
brands supported by Moonraker
and be able to get the IP address of it.

00:05:59.492 --> 00:06:03.162
Otherwise, it's the same as the relay,
just without the added safety features.

00:06:03.429 --> 00:06:05.531
Again,
one of the great features of the smart

00:06:05.531 --> 00:06:08.768
plug I got is that it can monitor
the energy consumption of my printer.

00:06:08.901 --> 00:06:11.838
This can give you an idea of
the amount of power your printer is using.

00:06:11.838 --> 00:06:14.273
It's also pretty cool
that my printer is now voice controlled,

00:06:14.273 --> 00:06:21.514
Alexa, turn on my 3D printer.

00:06:21.614 --> 00:06:27.286
Alexa, turn my 3D printer off.

00:06:27.353 --> 00:06:29.956
so my setup moving forward
is going to combine

00:06:29.956 --> 00:06:39.999
both the relay for its safety features
and the smart plug for its convenience.

00:06:40.099 --> 00:06:43.736
but while the smart plug is much
more convenient than the relay and doesn't

00:06:43.736 --> 00:06:47.140
require any of the installation or
the dangers of working with mains voltage,

00:06:47.240 --> 00:06:51.611
it can't detect short circuits or check
if there's power to the motherboard

00:06:51.677 --> 00:06:54.680
so the relay is really good
for these conditional situations.

00:06:54.680 --> 00:06:56.883
That's why I'm choosing
to use the both of them moving forward.

00:06:56.883 --> 00:07:00.253
If you want to support the channel, then
the best way to do that is by interacting.

00:07:00.386 --> 00:07:02.922
I made this YouTube channel
so that I could, meet some really cool

00:07:02.922 --> 00:07:05.925
people and work on projects
that others were interested in.

00:07:06.025 --> 00:07:06.793
Leave a comment.

00:07:06.793 --> 00:07:09.796
Recommend a project or give some positive
or negative feedback.

00:07:09.929 --> 00:07:11.130
Everything helps a ton.

00:07:11.130 --> 00:07:15.067
I can't wait to see you
all for the next project by.

00:07:15.168 --> 00:07:15.468
old

