0% found this document useful (0 votes)
201 views

MC Based 4 Channel Dimmer

This document describes a microcontroller-based 4-channel dimmer circuit. The circuit uses a PIC16F877A microcontroller to control the brightness of 4 LEDs or light bulbs by varying the trigger time of thyristors (TRIACs) through phase-controlled modulation of the AC power. The microcontroller can set the light intensity of each channel independently between 1-20 steps by programming the trigger time value. The circuit allows changing the preset intensity values for each channel through the microcontroller's LCD and button interface.

Uploaded by

bapoonprd
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
201 views

MC Based 4 Channel Dimmer

This document describes a microcontroller-based 4-channel dimmer circuit. The circuit uses a PIC16F877A microcontroller to control the brightness of 4 LEDs or light bulbs by varying the trigger time of thyristors (TRIACs) through phase-controlled modulation of the AC power. The microcontroller can set the light intensity of each channel independently between 1-20 steps by programming the trigger time value. The circuit allows changing the preset intensity values for each channel through the microcontroller's LCD and button interface.

Uploaded by

bapoonprd
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Microcontroller Based

4 Channel Dimmer
100W Bulb

230V
A.C.
220V
100W Bulb

230V
A.C.
220V
DWN Switch

ENT Switch

UP Switch

100W Bulb

230V
A.C.
220V
Apply 12V AC
From a transformer
100W Bulb

230V
A.C.
220V

Apply 12V AC
From a transformer

One can reduce the light intensity to 20 steps. 1 means full light and 19 means lowest intensity.
This kit is delivered with
Channel 1 has a intensity step value of 5.
Channel 2 has a intensity step value of 10.
Channel 3 has a intensity step value of 15.
Channel 4 has a intensity step value of 18.
These value will be displayed on LCD
CH1 05 CH2 10
CH3 15 Ch4 18
How to Change the Set Values
Press ENT Button for two second. Next LCD Display shows
Next release ENT button and Press and
hold UP button for 6 seconds. And then Set High PPM
release it.
The LCD Display shows

Set High PPM Followed by

PPM Channel3
Followed by 00
PPM Channel1 Use UP key to set the light intensity
step(any value between 1 to 20, 1
00 means highest light intensity , 19 means
lowest light intensity) let put 15 light
Use UP key to set the light intensity intensity step value for channel3.
step(any value between 1 to 20, 1
means highest light intensity , 19 means PPM Channel3
lowest light intensity) let put 05 light
intensity step value for channel1. 15
PPM Channel1 Press ENT button to select the value for
channel3.
05
Press ENT button to select the value for Next LCD Display shows
channel1.
Set High PPM
Next LCD Display shows

Set High PPM


Followed by

PPM Channel4
Followed by
00
PPM Channel2 Use UP key to set the light intensity
00 step(any value between 1 to 20, 1
means highest light intensity , 19 means
Use UP key to set the light intensity lowest light intensity) let put 18 light
step(any value between 1 to 20, 1 intensity step value for channel4.
means highest light intensity , 19 means
lowest light intensity) let put 10 light PPM Channel3
intensity step value for channel2. 18
PPM Channel2
Press ENT button to select the value for
10 channel4.

Press ENT button to select the value for


channel2.
PIC16F877A Microcontroller Based
Four Channel Dimmer
Dimmer control is often used to change the gate will be lost, current continues flowing. This
brightness of the light with AC. Bidirectional current continues flowing until it removes the
thyristor(TRIAC) is used for controlling current. voltage applying a thyristor. If current stops, a
The circuit which controls a thyristor using a gate function will work again. Therefore, even if
variable resister and a capacitor is common. voltage is applied between an anode and
MUDIT AGARWAL
The circuit introduced on this page is a circuit cathode, current does not flow into a thyristor.
which controls a thyristor by software of PIC. SCR is the abbreviation for Silicon Controlled
Rectifier.
Phase controlled modulation There are two kinds of semiconductors, P type
In case you don't know yet how phase controlled semiconductor and N type semiconductor. P
modulation works, here is a very short descrip-
tion. There is lots of documentation avaliable, so
you'll find a better and more detailed one if you
need it. On electricity networks, the phase
crosses zero several times a second. In Europe,
it's 100 times per second which is what we call a
50 Hz AC voltage. Triacs (two bipolary con-
nected thyristors) have the character of getting
conductible after their ignition until they have
same potential of electric tension on both sides.
This is - in the circuit used here - the zero
crossing point. So, all we have to do is switch it
on after each phase cycle, it switches itself off
automatically. Thus, by alternating the time
called T in the graphic above, we can influence
the amount of power a consumer load can use.
For example, this can be the luminance of a light
bulb.
And this is the whole concept already:
· measure the zero crossing points and cause type semiconductor is a semiconductor with
interrupts on a microcontroller every time insufficient electrons and N type semiconductor
is a semiconductor with electrons. The portion
· start counting after each zero crossing and
without an electron is called a hole with P type
ignite a triac after a certain amount of time
semiconductor and it has the electric charge of
(trigger time) .
plus. This hole is not a substance. A hole is
served like a substance with the electric charge
What is Thyristor of plus. If these two kinds of semiconductors are
I will explain the operation principle of a thyristor combined, a semiconductor with various
first. A thyristor is a kind of a diode. The differ- character will be made. A diode is made from the
ence from a diode is having another terminal two-layer structure of P and N. This device has
called Gate. Usually, current flows through a the character to pass current only one way.
diode into a forward direction, and current does A transistor is made from the three-layer
not flow into an opposite direction. A forward structure of P and N. It is the structure of PNP or
direction is in the condition which applied plus NPN. This device has the character which
voltage to the anode and applied minus to amplifies current.
cathode. Current flows into a diode in this In case of a thyristor, it has the structure of four
condition. layers of PNPN. This device has the same
In case of a thyristor, current does not flow only character as a diode fundamentally. However,
by having applied plus to the anode and apply- the timing into which current begins to flow is
ing minus to cathode. If trigger current is given to controllable by a gate. I will explain operation of
a gate, current will begin to flow. Once current a thyristor with transistors. Two transistors
begins to flow, even if the trigger current of a
3.3K 180
1 4 220V
100W Bulb

1
2 Bt136
3
18 17 16 15 141312 11 2 3 2 230V
A.C.
MOC3021 6

180
26
27 PIC16F876A
28
4

20 1 9 10 8 19 21 24 23 22 5 3.3K 180
4MHZ 1 4 220V
100W Bulb

1
4.7K 2 Bt136
+ 3
22pf 22pf 2
+ 5V 230V
A.C.
MOC3021 6

180

+ 5V
+
5 4
3.3K 180
6 16X2 LCD 15 1 4 220V
100W Bulb
VA
VLC VCC VSS VC
1
2 Bt136
14 13 12 11 10 9 8 7 3 2 1 16 3
2 230V
A.C.
MOC3021 6
10K 0.1 uf
180

3.3K 180
4
+
+5 V DC 1 220V
100W Bulb

1
Transformer 2 Bt136
3
3.3K 2
1 4 10K
230V
A.C.
D2 D1 MOC3021 6
230V
5
2 180
A.C.
D3 D4
6
MCT2E
+

+ 5V + 5V + 5V

4.7K 4.7K 4.7K


Transformer
+5 V DC +
D2 D1 7805
1 3
230V 2
A.C.
UP ENT DWN
D3 0.1 uf 0.1 uf
D4 1000uf
(TR1, TR2) which share two layers of the center
of a thyristor are assumed.
When current does not flow into a gate, TR1 will
be in an OFF state and current will not flow into
the collector of TR1. Therefore, current does not
flow into the base of TR2, and TR2 is in the state
of OFF. Even if voltage is applied over the anode
of a thyristor in this state, current does not flow.
Next, if current flows into a gate, current (1)
flows into the base of TR1, and TR1 will be in ON
state. Thereby, the base current (2) of TR2 flows
through the collector of TR1. If base current
flows into TR2, TR2 will be in ON state and
current (3) will flow into the base of TR1 through
the collector of TR2. Because current flows into ductor and N type semiconductor are together
the base of TR1 from TR2, even if the current of put with structure like the right of a left figure.
a gate is lost, current continues flowing into a Because I want control an alternating current by
thyristor. the equipment created this time, so I use
bidirectional thyristor. A
bidirectional thyristor is
called TRIAC. In a
bidirectional thyristor,
current begins to flow
from the time of a pulse
signal being given to a
gate. That is, the quantity
of the current which flows
is changeable by
changing the position of a
gate pulse. I will explain
the operation of the
circuit which used the
bidirectional thyristor.
What is Bidirectional thyristor Below, a bidirectional thyristor is called TRIAC.
(TRIAC) Even if a voltage is applied to the TRIAC, the
current doesn't flow through the load (RL) until
Bidirectional thyristor can be related to two the current flows through gate (G). If a switch
SCRs connected in parallel in opposite direc- (SW) closes and current flows into the gate,
tions. The timing into which a volts alternating MT1 and MT2 will be in an electrical connection
current begins to flow is controllable by this state, and current will flow into load. If MT1 and
device. Two independent thyristors are not MT2 will be in an electrical connection state,
combined in an actual device. P type semicon- because the electrical connection resistance of
the TRIAC is smaller than R2, current will hardly
flow into the gate. Even if a switch opens, the
electrical connection state of MT1 and MT2 is
maintained, and current continues flowing into
load. When the polarity of alternating voltage
changes, the current which flows through MT1
and MT2 stops. Thereby, the TRIAC returns to
an initial state. It works like the above when
voltage of the opposite polarity be applied.
Probably, you understand that the timing which
closes a switch is important. Because a switch
needs to operate to millisecond order, a
mechanical switch cannot be used. It is neces-
sary to use electronic parts. of the main TRIAC only through short time until
TRIAC drive circuit the TRIAC itself will be in an electrical connec-
Photo-Triac(MOC3021 and BT136 combines to tion state. Even if the lighting time of LED is long,
form a photo traic) is used for the part of a switch there is no problem. It effects only the first short
in this circuit. The reason for using Photo-Triac time that Photo-Triac operates.
is for carrying out insulation of a circuit, separa- The trigger current of the gate of the main
TRIAC is controllable by lighting control of LED
with the above operation. The capacitor (C) and
resistor (R) which are connected in parallel with
TRIAC are for abnormal-voltage prevention of
load. In this circuit, from RA0 to RA3 are used as
ports for TRIAC drive. There is a zero voltage
crossing turn.on type photo-triac. This is the
type turned on from 0V, in order to stop a noise.
Since it turns ON from the middle of alternating
voltage wave form with this equipment, this type
cannot be used.

Synchronous circuit
tion of an alternating current circuit and a direct It is necessary to generate a gate pulse at time
current circuit, and high-speed operation. The required in order to control TRIAC. A starting
voltage to handle in main TRIAC is compara- point is 0V of alternating voltage. It is necessary
tively high voltage like 220VAC. However, to detect 0V of alternating voltage. By this
because the voltage of a PIC circuit is 5VDC, it is circuit, the voltage of 5V is inputted into RB0
necessary to separate both circuit. So terminal of PIC in the shape of a pulse when the
optocoupler MOC3021LED is controlled by PIC polarity of alternating voltage changes.
which operates with 5VDC, it is possible to As a photo coupler, the photo coupler for AC/DC
control the current of circuits, such as 220VAC, is used. LED is driven with alternating voltage
and ON/OFF of a photo transistor is controlled
by the light. LED makes polarity reverse and
is connected in parallel. Therefore, even if the
polarity of alternating voltage changes, one of
LED lights up. When LED is ON, a photo
transistor will be in ON state, and the voltage
of RB0 terminal of PIC is set to almost 0V.
Because voltage falls in the portion which
changes the polarity of alternating voltage,
there is time to turn on neither of the LED.
Because the light to a photo coupler is lost at
this time, a photo transistor will be in an OFF
state and the voltage of RB0 terminal of PIC
with TRIAC. If light is put in LED to the portion of
will be set to 5V. PIC16F series is equipped with
the base of a transistor like a photo transistor,
the function to which interruption operation is
the motion of the electrons and holes of N type
carried out by the pulse inputted into RB0. In the
and P type semiconductor will be activated.
left figure, the external pull-up resistor is drawn
Thereby, the same effect as having passed
on RB0. In an actual circuit, the pull-up function
current to the base. Therefore, if LED is turned
built in PIC is used. The current which can be
on, Photo-Triac can be changed into an electri-
passed in the LED section of a photo coupler is
cal connection state. If the Photo-Triac is in an
about tens of mA at the maximum. Therefore,
electrical connection state, and if a gate current
the high voltage for turning on LED cannot be
flows into the main TRIAC, it will be in an
used. In this time, 6VAC for making the power
electrical connection state. Then, the voltage
supply for PIC is used. Furthermore, current is
applied to Photo-Triac becomes almost 0V.
controlled by the resistor. The pulse duration
Thereby, an electrical connection state is
given to RB0 depends on the time which LED
canceled. Therefore, current flows into the gate
has switched off. It seems hundreds of micro-
seconds.

You might also like