A relay is one of the most important components to understand for hobbyists or professionals working with electronics! The ability to control circuits of one voltage from another completely electrically isolated circuit is super useful and important!
And the larger board with 16 relays which I love to use for big projects with lots of devices is available here:https://amzn.to/4aMrqSq (But this one does require you power it with 12 Volts which an arduino can't provide so you'd need a power supply (https://amzn.to/3voyzIF))
Hopefully you found this useful and have been enjoying the Arduino content on the channel! Don't forget to leave a comment saying what we should do next, drop a like on the video and subscribe to the channel! and if you LOVE the channel, consider becoming a super supporter at my patreon link below: https://www.patreon.com/LeMasterTech
welcome back to the MasterTech and in
today's video I'm going to show you how
to control a high voltage AC device from
a low voltage DC signal coming from a
microcontroller like an Arduino and
we're going to achieve this using a
pretty simple beautiful electrical
component known as a
[Music]
relay so we're going to keep today's
video pretty short and focused on uh the
concept at hand on the relay because uh
a lot of the bigger uh Better Batter
Arduino projects that we're going to be
doing soon on the channel we'll rely
heavily on using relays to control the
higher voltage components and also
because my garage is still chaos and not
set up for building bigger projects just
yet so the 3D printer is still getting
hooked up the CNC is getting hooked up
my desks are getting hooked up we're
unpacking bins and boxes so let's stay
pretty focused on this video now
obviously I love Arduino projects I
think anyone with a interest in hobby
electronics can have a ton of fun
building with Arduino Raspberry Pi and
other commercially available
microcontrollers um however these
devices are all pretty much limited by
the fact that they can only Power low
voltage DC outputs without using some
sort of switching mechanism but there
are so many things you might want to
control that are much higher voltage
than this and uh ac voltage even so like
way higher and not even DC voltage but
basically the solution to controlling
really high voltage things with really
low voltage things is a uh electrical
component known as a relay and now
relays are always going to have two
voltages uh two measurements with regard
to uh how they're rated that you need to
know um one of them is going to be the
voltage at which they switch because
they make relays for kind of almost
every level of voltage so uh to control
something from an Arduino which is
capable of outputting kind of at most 5
volts you need a 5volt relay or you need
uh a board kind of like I have here
that's capable of taking 5volt signals
from an Arduino and then uh it needs a
12volt power supply on it because these
are 12vt re relays um so I'll show a
better image of my 5vt relay on the
screen now and I'll link some of these
products below if you need relays for
your project um but basically the first
measurement is what voltage the relay
gets Switched at so for uh like I said
for just an Arduino application you want
that switching voltage to be at about 5
volts or you need a power supply and a
switching mechanism to go bigger than
that and the second measurement that all
relays have is a maximum voltage and
current that it can tolerate on the
downstream side on the side being
switched so there are basically two
completely independent electrical
connections that get made in a relay one
is the one that you actuate and the
other one is the one getting switched
the one getting switched will give you a
maximum voltage and a maximum current
and it obviously it doesn't care if less
voltage and less current um than that go
through but that is how much it's
electrically rated to be able to handle
so for example a relay that says 10 amps
250 volts on it does not mean you have
to put a 10 amp 250 volt circuit through
through it it just means don't use more
than that much voltage and current um on
that don't use that more than that
voltage or current it's rated for either
of those two maximums not both of those
two maximums now for DC relays most
relays follow a pretty standard
convention where they have three pins
one of those gets ground one of those
gets the uh switching voltage so 5 volts
12 volts whatever for the Arduino one
it's 5 volts and then the third pin is
your signal wire so that is the one that
you hook up to an Arduino digital
digital output or even a push button if
you're going to make it just simple
relay logic instead of using a
controller um that third signal that
third terminal is the signal wire which
is what you actually switch to switch
the relay on and off and then the
downstream side of your relay which is
being switched will also have three
terminals but most of the time for most
applications you only need two the
reason for three terminals is it gives
you the option of connecting your device
as normally open or normally closed one
of those terminals is the common meaning
you bring in the wire that you want to
sometimes make contact to your
Downstream wire sometimes break into the
common terminal and if you want the
device to be running until you send the
signal then you want the normally closed
terminal block because that means when
no voltage is being provided to the
relay it is making contact with the
normally closed side of your relay but
if you want the device to turn on when
you turn the output on which is probably
more common for jav electronics um then
you're actually going to want to uh put
it on the normally open side because
that means when no vol is being sent it
is open and then when you do send
voltage uh it gets broken that chain
gets broken so that's the difference
between normally open normally closed if
you have questions about that let me
know in the comments below but normally
open and normally closed are super
common Concepts in electronics controls
and automation uh robotics anything like
that so it's good to familiarize
yourself with those terms and it's super
important to reiterate this uh you don't
hook 120 power and neutral up to two
terminals on the high voltage side of
the relay you let one of those wires go
inter uninterrupted straight to your
device just like it would if there was
no relay you're only interrupting one
signal wire uh if you put one 120 on the
common and a neutral wire on normally
open or normally closed then you're
going to create a dangerous uh AC short
on that relay at some point you don't
want to do that um you want to interrupt
like your neutral line of AC power by
putting the side closer to the plug to
the wall outlet on the common and then
the downstream side that will actually
connect uh and close the loop of power
for your device on normally open or
normally closed so hopefully I've
created a super useful graphic on the
screen right now that illustrates that
do not create an AC short and this is a
good opportunity for a general
disclaimer don't do any work with high
voltage or ac voltage uh unless you're
super comfortable with basic electrical
components if you are a child or a
younger person um consider grabbing an
adult or watching a whole bunch more
videos on how to safely work with ac
voltage because um 120 230 not usually
lethal but totally a short is capable of
starting a fire causing a ton of harm so
be super duper careful with anything
considered higher voltage than like 20
volts DC and even then you could do some
damage so just be generally careful with
electricity and to be honest for this
video I think writing any Arduino code
together would actually be over
complicating the tutorial that I'm
trying to do here because you control
this relay like you control any other
output from any Arduino at any point and
if you really need help going all the
way back to those basics of how to
control and output using Arduino I will
uh drop a link to my Arduino beginner
tutorial series on the channel cuz we
use tons of LEDs and motors and push
buttons and other sorts of inputs and
outputs so if you need a total Basics
refresher um you can watch those videos
but in general you turn a digital output
on from your Arduino and you're going to
activate the relay you turn it off and
you'll turn the relay back off you can
simulate this even just by connecting
the signal wire to 5 Vols and then
removing it from 5 volts you should
physically hear the relay connecting you
most relays have an LED indicating when
they're on and off so I'm not going to
write any code with you if you have
questions about the code just go ahead
and ask them in the question uh comments
below but that is going to do it for
this video I hope you found it useful I
hope this was what you were looking for
when you clicked on this video as always
let me know if any comments in the uh
comments below questions in the comments
below let me know what project you'd
like to see next on the channel in the
comments below a massive thank you as
always to my patreon supporters thank
you everyone who's a regular fan of the
channel for sticking with me through the
holiday season obviously didn't roll out
a ton of content around the new year um
traveling for family uh dealing with a
baby moving into a new house so I
appreciate everyone uh sticking around
we're going to do a lot of cool things
in 2024 thank you so much for watching
good luck with your projects see you
next time
bye