My name is Ahmad Shamshiri. I am presenting this tutorial from Canada.
Hi, welcome to Robojax. in this video we are going to see how we can use this
2 channel 5 volts relay for Arduino to control an AC load and a DC or maybe
with the combination of both ACE or both DC like this. now the load
will be on and then the motor will be on alternatively in mind that when you are
connecting this to AC load do not touch this area or this area if you're working
with this you have to have proper protective gloves and also make sure
that you do not leave it on a surface that is metallic or conductive
so this is a relay the size you can see it in my hand
we have to relays each relay has these three contacts so these three contacts
belong to this relay and this relay has these three contacts
these contacts are named as normally closed (NC) this and this so if you
connect a wire here and here it will be normally connected so the wire will be
connected and passed through but if you connect it in here and here that the
middle one and the other one so this is normally open (NO) and only will switch when
it receives the signal same thing for this one so you can connect two
different AC or DC load separately to control .and here we have four
pins for connections here
we have we have 4 connection pins
on this side it says VCC and here is a ground so you connect this to five volts
presumably from Arduino, Arduino has 5 volts and this connected to the zero or
the ground GND and then we have IN1 and IN2 so IN1 means input 1 for this relay that's
relay number 1 and input 2 that's 4 relay 2. For each relay we have two LED lights
here this is for input 2 light when it receives a signal this
will let informing you that there is a signal and when there is a signal for
that and put 1 this light will turn on. these two relays are optically isolated
so we have optocoupler here what it means is that if you want totally to
isolate even the power of the relay from the current from the DC circuit you can
do so so it makes it safer if you want to isolate the operation of the relay
from the circuit here's a jumper here for that purpose so
normally when it comes it is on the left side so it says JD VCC so if you are
planning to power the relay from the the same circuit that receives the
signal just leave it here so when you connect the 5 volts the 5 volt also will
go from here and energize the same relay so it will supply the power to the relay
from this 5 volts. of course it will wait for the signal but the power will be
supplied from this 5 volts but if you are planning to supply voltage for the
separately you just need to remove this and then here is a ground and that's the
VCC so VCC is here and that's the ground you cannot connect it here ok so
just supply your separate voltage of 5 volts and here. is if you are using it
for development and test purpose that's fine because amount of current that this
draws is very minimal (40mA per relay ) and it can be handled with the Arduino now about the
rating of this which many people miss is that you cannot turn on and off and
heavy load let's say depending on the region for example if you are in Asia
and Europe which uses 240 volts then it cannot be more than 2.5 kilowatt so what
it means is that this the contact of the relay can handle up to 10 ampere and any
circumstance here so 10 ampere means if you are using 240 volts so that's 10
ampere multiplied by 10 just put a 0 here so it will be 2500 watt at 250
volts and if you are in North America let's say 120 so that's times 10 1200
watt so it has 5 extra so 1250 so remember that and also in DC if you are
using lower voltages let's say 30 26 volt so that will be 280 or 300 watt
more than that will not be handled by the contact of the relay it may melt
down or malfunction so keep that in mind this really is
built very solid all the soldering is are very good but be careful when you
are connecting it to the AC load this area should be totally isolated and you
should not touch it be careful with this because it'll be very dangerous .so let
me explain the AC bulb here so this is a table light and wil l be connected to the
wall outlet and then the wire goes and will be turned on but I have
disconnected one of these 2 wires (the live or hot wire) here so let me show you
so I've just cut this wire from here now this can be connected to that relay the
relay's job is to just connect it so it will be on and disconnected will be off
I've just twisted them and then put some solder so this can be inserted into a
connector with a screw. so to connect the wires you just unscrew this and insert
the wire here and then tighten it back I've now connected the two wires of AC
bulb in here on the left side and at the middle one to explain the DC so this
is the my DC motor the DC motor has two wires the two wire that goes to the DC
are coming so the positive have gone to the middle one and then from this side
the positive is out now I have two wires to be connected to the DC source of this
motor because v DC so this will be connected to the DC and then the other
two wires that I showed you(the bulb wires) before that I cut one goes to the middle one to the
other side and then this side just goes to the AC power line if you are
connecting an AC. but doesn't matter you can connect DC or different type of
load that you want as long as it just matches the rating of the relay. let me
explain the code now here this serial begin inside the set up the serial begin
is to display the text here so if you don't want to display anything just
remove this or comment this out when seven is set up as an output this will
be connected to relay one and in the pen mode also we say pen eight of Arduino
will be connected to really 2 that is this pin and pin 7 and pin 8 or here and
then we have inside the loop I've put the original functions here and text a
little indented so if you want to remove it these are very
safe to be removed so initially as soon as the Arduino program runs
it puts this pin 8 in LOW so which means relay 2 will be off and also we say
pin 8 LOW so just anywhere you see pin 8 LOW will be printed by this
here I put print without LN so this goes in one line and then I print this one
again and then LN so these two texts can be displayed in one line that's why we
see all this and one line so if you want new line just put LN that means (Line New)
I don't know how they came but it is new line and then so pin 7 will go
HIGH so pin 8 goes LOW pin 7 goes HIGH and then we wait for three seconds
so keep relay 2 off so that's relay 2 and kept keep relay 1 on for
three seconds so both of them whatever they status is so it will be kept
for three seconds and after that and they will be reversed so pin 7 will
which was high will be LOW and then pin 8 is which was LOW, it will
be HIGH for three second so you can play with this and can configure it the way that
you want for the purpose and application that you are interested.
the load can be connected or we turned on and off based on some temperature based
on some condition based on some switch so you can just put if() condition F some
voltage is bigger than something or a temperature is higher than something
then turn it on and off and I have separate video that explains and
practically the thermometer with a relay so you can learn from that one also I
will put a link at the description as well. now here is a demonstration I'm
gonna connect it so when it says pin 8 is HIGH that's the motor when I say
spend 7 high that is for the light. as you can see this is going up and down
if I connect the motor it makes so much noise so I just put this so you can see
the rotation
and see here that the light and 8 is the motor
and this is also indicating that this is for
this was the introduction of how to use that to channel 5 volt relay for Arduino
to control 2 different loads such as AC bulb or a DC motor or both of them thank
you for watching please thumb up 👍 the video please share it and also subscribe
to get updates of my upcoming videos you can get the code by clicking at the link
at the description below or you can go directly to www.robojax.com/learn/arduino
Subtitle corrected and typed on Mar 26, 2020 in Ajax, Ontario, Canada
I did my part to help you.
the least you can do for me is to 👍 the video and subscribe.
you