0:05
Hello everyone, welcome to automation
0:08
community. Today in this video we are
0:11
going to discuss an example which will
0:14
be about controlling LEDs using
0:17
switches. So let's start.
0:20
Example four. If toggle switch one is on
0:24
then LED one will be on. If toggle
0:26
switch two is on then LED 1 and LED 2
0:30
will be on. If toggle switch three is on
0:33
then LED 1, LED 2 and LED 3 will be on.
0:37
If toggle switch 4 is on then LED 1, LED
0:41
2, LED 3 and LED 4 will be on.
0:46
So for LED one to be on either switch
0:49
one or switch two or switch three or
0:52
switch four should be on. Any one switch
0:54
should be on. then LED one will be on.
0:58
And if switch two or switch three or
1:00
switch four is on then LED 2 will be on
1:04
and if switch three or switch four is on
1:07
then LED 3 will be on and if switch four
1:10
is on then LED 4 will be on. So for this
1:15
example we will be using normally open
1:17
contacts and with that we will be
1:20
implementing or logic git. So let's move
1:23
to cortices where we will draw a ladder
1:25
diagram for this example.
1:39
Let's create a new project here and
1:42
select standard project as template and
1:49
After that choose this PLGPRGN
1:52
ladder logic diagram and click on okay.
1:55
This is actually PLC programming and
2:02
After that go to PLC programming and
2:05
here we will draw the ladder diagram.
2:09
So firstly we will insert an orally open
2:11
contact for switch one and then we will
2:15
insert one more in parallel. Then one
2:20
and then one more in parallel. So this
2:38
This will be switch three.
2:44
This will be switch four.
2:48
So when any one of the switches is on
2:55
motor one will be on. So this will be
3:00
sorry this will be LED LED one will be
3:06
on. So if switch one is on LED one will
3:09
be on. If switch two is on LED one will
3:11
be on. If switch three is on, LED one
3:14
will be on. And if switch four is on,
3:21
After that, we will add one more network
3:23
here. Insert network below. And here we
3:27
will use three switches for motor two.
3:32
So we'll insert a normally open contact.
3:37
insert contact parallel. And then one
3:40
more contact in parallel. So this will
3:54
and this will be switch four. So here if
3:58
switch two or switch three or switch
4:00
four is on then uh then LED 2 will be
4:05
on. So this uh this coil will be for LED
4:09
2. So when switch one is on LED one will
4:17
no LED will be on only LED 1 will be on.
4:20
And when switch two is on LED one will
4:23
be on and LED 2 will be on.
4:27
And then we will insert one more network
4:29
here. And here we will use
4:36
one normally open contact and one more
4:39
normally open contact in parlor.
4:43
So this will be switch three
4:48
and this will be switch four. So when
4:52
switch three or switch four is on then
4:54
LED 3 will be on. So we'll insert a coil
4:57
here and this will be LED 3. Okay. And
5:03
after that we'll insert one more network
5:05
here below. And here we will use one
5:08
normally open contact and a coil. So
5:11
this will be switch four
5:16
and this will be LED 4.
5:20
So when switch one is on only LED one
5:23
will be on. If switch two is on the
5:26
signal will pass through this and LED 1
5:28
gets on. With that also the signal will
5:30
pass through this also and LED 2 will be
5:32
on. And then if switch three is on the
5:35
the signal will pass through this LED
5:38
min gets on also with that LED 2 gets on
5:41
and also the signal will pass through
5:43
this and LED 3 will also get on. And
5:46
then if switch four is on the signal
5:48
will pass through this and LED 1 gets on
5:51
also the signal passes through this and
5:53
LED 2 gets on. The signal passes through
5:56
this contact and LED 3 gets on. And when
5:59
switch four is on, the LED 4 also gets
6:01
on. So if switch one is on, only LED one
6:04
will be on. If switch two is on, only
6:06
LED 1 and LED 2 will be on. If switch
6:09
three is on, LED 1, LED 2, LED 3 will be
6:13
on. And if switch four is on, all the
6:15
four LEDs will be on. We will generate
6:21
and then go to online and start
6:23
simulation. and then login here. Yes.
6:29
And then start. As you can see here, no
6:31
LED is on. And if I turn on switch one,
6:35
I will uh keep it true and debug it and
6:39
write values. So you can see here LED
6:41
one gets on. When switch one is on,
6:50
when switch one is on, only LED one is
6:52
on and other LED 2 is off, LED 3 is off
6:56
and LED 4 is off. And then if
7:12
switch one we will turn it off and turn
7:15
on switch two. Let's debug it and write
7:18
values. You can see here LED 1 is on
7:21
with that LED 2 is also on and LED 3 and
7:24
LED 4 are off. And now let's turn on
7:28
switch three. Toggle switch three. Let's
7:32
And you can see LED 1 is on, LED 2 is
7:35
on, and also LED 3 is on. And then if we
7:38
turn on switch 4 and debug it
7:43
and you can see LED 1 is on, LED 2 is
7:46
on, LED 3 is on, and also LED 4 is on.
7:50
So when switch four is turned on, all
7:53
the four LEDs gets on. And when I turn
7:59
switch three then only three LEDs gets
8:03
on. LED 1 gets on, LED 2 gets on and LED
8:06
3 gets on. And when I turn on switch two
8:12
only two LEDs gets on. LED one gets on
8:15
and LED 2 gets on. And if we turn on
8:18
switch one only then only LED one will
8:21
get on and all other LEDs will turn off.
8:25
It was all about this example. Thank you