e011030.PDF

(712 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
GENERAL INTEREST
Microprocessor
Controlled
Light Dimmer
with pushbutton control
Design by P. Staelens
This easy to construct light dimmer is controlled by
a PIC controller and can handle a maximum cur-
rent of 6 A. Three pushbuttons ensure extremely
user-friendly operation.
The light dimmer described here can
be split into two parts. The light
dimmer proper follows the familiar
recipe. It is an analogue circuit,
which uses a triac for phase control
of the mains voltage. This is hardly a
surprise. A little more striking is the
fact that this dimmer circuit is not
controlled with a simple poten-
tiometer but with a programmed
PIC16F84 processor. The processor is
operated with the aid of three push-
buttons: a combined on/off button,
an up and a down button.
Usage Instructions
The microprocessor is programmed
in such a way that the dimmer will
be in the ‘off’ position when first
powered up, while at the same time
the control circuit starts off in the
30
Elektor Electronics
1/2001
855743498.479.png 855743498.490.png
GENERAL INTEREST
5V
C6
S1
S2
S3
T2
100n
14
4
6
MCLR
RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7
R7
330
R8
470
7
BC337
R3
17
8
IC1
RA0
18
9
RA1
PIC16
1
10
RA2
RA3
IC2
F84
1
5
ZERO
2
11
R9
3
12
C4
RA4
13
47n
400V
TRI1
OSC2
OSC1
2
4
S202S11
5
15
16
X1
T1
C5
R12
R1
R2
R4
2k7
TIC226D
10n
400V
C1
C2
BC337
27p
4MHz
27p
IC4 = 74HCT14
IC4c
IC4d
IC4e
IC4f
R13
470k
R5
470k
6
1
8
1
10
12
1
1
IC4b
4
C3
1
R6
5
9
11
13
5V
470n
400V
K1
K2
3
IC4a
2
R11
1
230V
D6
D4
230V
IC3
D8
D2
5V
7 805
4x
1N4007
1
R10
100k
1W
4x
1N4007
IC5
14
1
6
5
D1
D7
D5
C8
C7
IC4
D9
D3
7
22µ
16V
9V1
500mW
100n
2
4
4N25
000117 - 11
Figure 1. The classic triac light dimmer is driven from a programmed PIC16F84 processor.
‘fully open’ position. Pushing the
on/off button activates the dimmer,
only then will current be supplied to
the attached lamp. However, it is
also possible to adjust the control
circuit before the dimmer is acti-
vated; in other words, it makes no
difference whether the dimmer is
activated or not.
The processor circuit is a text-
book example and requires no fur-
ther explanation. The three input
pushbuttons are connected to RA0,
RA1 and RA2, while the triac circuit
is driven from RB1 and RB7. The con-
nection that has been drawn
between RB7 and RA4 is now actu-
ally superfluous. Initially, the soft-
ware used this connection to sense
if the dimmer was on or off. Later on
this was changed to enable the
processor to keep track if this itself.
Now to the triac circuit . This is
also a textbook example, with the
exception that the triac (TRI1) is dri-
ven by a triac-driver (IC2). This pro-
vides separation between the low
voltage and the high voltage cir-
cuitry. This is required because
ground of the 5 V power supply has
a different potential with respect to
the high voltage circuit. T1 and T2 control the
triac driver. These two transistors together
perform an AND-function. The drive signal is
applied only when both transistors conduct
(RB1 and RB7 high). Snubber network R9/C5
protects the triac from inductive loads.
In order to determine the exact trigger
point, a zero-crossing detector is indispens-
able. IC5 (optocoupler 4N25) is the most
important part in this sub-circuit. A separate
bridge rectifier drives the light source in the
optocoupler. This is because the other bridge
rectifier does not provide phase information
of the mains, due to the presence of C3. The
100 Hz voltage applied to the input of IC5
causes the transistor in the optocoupler to
block briefly at every zero crossing of the
mains voltage. As a consequence, at every
zero crossing there is a short 5-V pulse at the
collector of this transistor. This signal is
applied to the processor via the double
Schmitt-trigger IC4a/IC4b. This makes it pos-
Operation
The dimmer schematic is shown in
Figure 1 . It is immediately obvious
that the amount of hardware
required is quite small. The various
functional blocks will be easily
recognised by most of you. At top
centre is the PIC-processor, to its
right is the triac circuit, at bottom
left is the zero-crossing detector and
at bottom right is the power supply.
1/2001
Elektor Electronics
31
855743498.501.png 855743498.512.png 855743498.001.png 855743498.012.png 855743498.022.png 855743498.033.png 855743498.044.png 855743498.055.png 855743498.066.png 855743498.077.png 855743498.088.png 855743498.099.png 855743498.110.png 855743498.121.png 855743498.132.png 855743498.143.png 855743498.154.png 855743498.165.png 855743498.176.png 855743498.187.png 855743498.198.png 855743498.209.png 855743498.220.png 855743498.231.png 855743498.242.png 855743498.253.png 855743498.264.png 855743498.275.png 855743498.286.png 855743498.297.png 855743498.308.png 855743498.319.png 855743498.330.png 855743498.341.png 855743498.352.png 855743498.363.png 855743498.374.png 855743498.385.png 855743498.396.png 855743498.407.png 855743498.418.png 855743498.429.png 855743498.440.png 855743498.451.png 855743498.462.png 855743498.472.png 855743498.473.png 855743498.474.png 855743498.475.png 855743498.476.png 855743498.477.png 855743498.478.png 855743498.480.png 855743498.481.png 855743498.482.png 855743498.483.png 855743498.484.png 855743498.485.png 855743498.486.png 855743498.487.png 855743498.488.png 855743498.489.png 855743498.491.png 855743498.492.png 855743498.493.png 855743498.494.png 855743498.495.png 855743498.496.png 855743498.497.png 855743498.498.png 855743498.499.png 855743498.500.png 855743498.502.png 855743498.503.png 855743498.504.png 855743498.505.png 855743498.506.png 855743498.507.png 855743498.508.png 855743498.509.png 855743498.510.png 855743498.511.png 855743498.513.png 855743498.514.png 855743498.515.png 855743498.516.png 855743498.517.png 855743498.518.png 855743498.519.png 855743498.520.png 855743498.521.png 855743498.522.png 855743498.002.png 855743498.003.png 855743498.004.png 855743498.005.png 855743498.006.png 855743498.007.png 855743498.008.png 855743498.009.png 855743498.010.png 855743498.011.png 855743498.013.png 855743498.014.png 855743498.015.png 855743498.016.png
 
GENERAL INTEREST
sible for the software to synchronise itself to
the mains.
Finally, the power supply . As can be
observed, the required 5 V supply voltage is
derived directly from the mains, without the
use of a transformer. ‘AC resistor’ C3 reduces
the mains voltage to an acceptable level. This
reduced voltage is rectified by a bridge recti-
fier (D4-D7) and regulated by a 7805. Diode
D1 prevents the input voltage of IC3 from
exceeding safe limits. Two 100 nF capacitors
are used for power supply decoupling.
Because a 5 V power supply appears
harmless, we would like to stress that this
voltage in this instance is everything but
safe! The reason is that this power supply is
not electrically isolated from the mains. Be
very careful!
C4
C2
C1
R3
R4
T2
X1
GAT42
R7
K2
T1
OUT
D6
C6
TRI1
IC1
D7
D5
R2
D4
R12
R11
R1
C7
S3
D9
S1
S2
D8
D2
C3
GAT
000117-1
D3
Construction
Figure 2 depicts the layout for the PCB
designed for the project. The construction of
the light dimmer is a relatively simple task,
because the number of components required
is very modest, and the PCB and pro-
grammed PIC are available from the Elektor
Electronics Readers Services (the source code
files as well, for that matter).
We again urge all prospective constructors
to take the utmost caution. The entire circuit
is directly connected to the mains! Despite
the presence of an optical triac driver and an
optocoupler, the entire low voltage circuit is
not electrically isolated from the mains. Keep
this in mind while testing and making mea-
surements on this circuit.
Another important practical matter is that
for C3, C4 and C5, Class-X2 capacitors must
be used. These are short-circuit proof and are
guaranteed never to cause a short circuit in
the event that they develop a defect. If you
intend to fit the circuit into a typical enclo-
sure, it may be better to mount voltage regu-
lator IC3 horizontally. This can be achieved by
bending IC3 over the top of IC4; do not trim
the leads too short, otherwise this will not be
possible.
Because of the compact dimensions of the
PCB, finding a suitable enclosure should not
be an issue. Use plastic screws and stand-
offs to fasten the PCB, in order to maintain
the required insulation spacing between
mains voltage and parts that may be
touched. Our prototype was built into a plas-
tic case from Bopla. The PCB fitted nicely, but
it was necessary to shorten the internal
stand-offs by some 3 mm for the cover to be
fitted properly.
Figure 2. The PCB has everything clearly arranged and is compact. Keep in mind that
the entire circuit is connected to the mains!
COMPONENTS LIST
D2-D9 = 1N4007
T1,T2 = BC337
Tri1 = TIC226D
IC1 = PIC16F84-04, programmed,
order code 000117-41 (see
Readers Services page)
IC2 = MOC3021
IC3 = 7805
IC4 = 74HCT14
IC5 = 4N25
Resistors:
R1,R2,R12 = 33 k
R3 = 120
R4 = 2k
7
R5,R13 = 470 k
R6 = 47
R7 = 330
R8 = 470
R9 = 39
R10 = 100 k
Miscellaneous:
S1,S2,S3 = pushbutton with make
contact, safety Class 2
X1 =4 MHz quartz crystal
K1,K2 = 2-way PCB terminal block,
lead pitch 7.5 mm
Case: e.g. Bopla (Conrad-Electronics
order code 52 22 52-11)
PCB, order code 000117-1 (see
Readers Services page)
Project disk (PIC source code files),
order code 000117-11
1 W
R11 = 10 k
Capacitors:
C1,C2 = 27 pF
C3 = 0.47
F 400 V (Class X2)
C4 = 47 nF 400 V (Class X2)
C5 =10 nF 400 V (Class X2)
C6,C7= 100 nF
C8 = 22 µF 16 V radial
µ
Semiconductors:
D1 = zener diode 9.1V 500mW
(000117-1)
32
Elektor Electronics
1/2001
855743498.017.png 855743498.018.png 855743498.019.png 855743498.020.png 855743498.021.png 855743498.023.png 855743498.024.png 855743498.025.png 855743498.026.png 855743498.027.png 855743498.028.png 855743498.029.png 855743498.030.png 855743498.031.png 855743498.032.png 855743498.034.png 855743498.035.png 855743498.036.png 855743498.037.png 855743498.038.png 855743498.039.png 855743498.040.png 855743498.041.png 855743498.042.png 855743498.043.png 855743498.045.png 855743498.046.png 855743498.047.png 855743498.048.png 855743498.049.png 855743498.050.png 855743498.051.png 855743498.052.png 855743498.053.png 855743498.054.png 855743498.056.png 855743498.057.png 855743498.058.png 855743498.059.png 855743498.060.png 855743498.061.png 855743498.062.png 855743498.063.png 855743498.064.png 855743498.065.png 855743498.067.png 855743498.068.png 855743498.069.png 855743498.070.png 855743498.071.png 855743498.072.png 855743498.073.png 855743498.074.png 855743498.075.png 855743498.076.png 855743498.078.png 855743498.079.png 855743498.080.png 855743498.081.png 855743498.082.png 855743498.083.png 855743498.084.png 855743498.085.png 855743498.086.png 855743498.087.png 855743498.089.png 855743498.090.png 855743498.091.png 855743498.092.png 855743498.093.png 855743498.094.png 855743498.095.png 855743498.096.png 855743498.097.png 855743498.098.png 855743498.100.png 855743498.101.png 855743498.102.png 855743498.103.png 855743498.104.png 855743498.105.png 855743498.106.png 855743498.107.png 855743498.108.png 855743498.109.png 855743498.111.png 855743498.112.png 855743498.113.png 855743498.114.png 855743498.115.png 855743498.116.png 855743498.117.png 855743498.118.png 855743498.119.png 855743498.120.png 855743498.122.png 855743498.123.png 855743498.124.png 855743498.125.png 855743498.126.png 855743498.127.png 855743498.128.png 855743498.129.png 855743498.130.png 855743498.131.png 855743498.133.png 855743498.134.png 855743498.135.png 855743498.136.png 855743498.137.png 855743498.138.png 855743498.139.png 855743498.140.png 855743498.141.png 855743498.142.png 855743498.144.png 855743498.145.png 855743498.146.png 855743498.147.png 855743498.148.png 855743498.149.png 855743498.150.png 855743498.151.png 855743498.152.png 855743498.153.png 855743498.155.png 855743498.156.png 855743498.157.png 855743498.158.png 855743498.159.png 855743498.160.png 855743498.161.png 855743498.162.png 855743498.163.png 855743498.164.png 855743498.166.png 855743498.167.png 855743498.168.png 855743498.169.png 855743498.170.png 855743498.171.png 855743498.172.png 855743498.173.png 855743498.174.png 855743498.175.png 855743498.177.png 855743498.178.png 855743498.179.png 855743498.180.png 855743498.181.png 855743498.182.png 855743498.183.png 855743498.184.png 855743498.185.png 855743498.186.png 855743498.188.png 855743498.189.png 855743498.190.png 855743498.191.png 855743498.192.png 855743498.193.png 855743498.194.png 855743498.195.png 855743498.196.png 855743498.197.png 855743498.199.png 855743498.200.png 855743498.201.png 855743498.202.png 855743498.203.png 855743498.204.png 855743498.205.png 855743498.206.png 855743498.207.png 855743498.208.png 855743498.210.png 855743498.211.png 855743498.212.png 855743498.213.png 855743498.214.png 855743498.215.png 855743498.216.png 855743498.217.png 855743498.218.png 855743498.219.png 855743498.221.png 855743498.222.png 855743498.223.png 855743498.224.png 855743498.225.png 855743498.226.png 855743498.227.png 855743498.228.png 855743498.229.png 855743498.230.png 855743498.232.png 855743498.233.png 855743498.234.png 855743498.235.png 855743498.236.png 855743498.237.png 855743498.238.png 855743498.239.png 855743498.240.png 855743498.241.png 855743498.243.png 855743498.244.png 855743498.245.png 855743498.246.png 855743498.247.png 855743498.248.png 855743498.249.png 855743498.250.png 855743498.251.png 855743498.252.png 855743498.254.png 855743498.255.png 855743498.256.png 855743498.257.png 855743498.258.png 855743498.259.png 855743498.260.png 855743498.261.png 855743498.262.png 855743498.263.png 855743498.265.png 855743498.266.png 855743498.267.png 855743498.268.png 855743498.269.png 855743498.270.png 855743498.271.png 855743498.272.png 855743498.273.png 855743498.274.png 855743498.276.png 855743498.277.png 855743498.278.png 855743498.279.png 855743498.280.png 855743498.281.png 855743498.282.png 855743498.283.png 855743498.284.png 855743498.285.png 855743498.287.png 855743498.288.png 855743498.289.png 855743498.290.png 855743498.291.png 855743498.292.png 855743498.293.png 855743498.294.png 855743498.295.png 855743498.296.png 855743498.298.png 855743498.299.png 855743498.300.png 855743498.301.png 855743498.302.png 855743498.303.png 855743498.304.png 855743498.305.png 855743498.306.png 855743498.307.png 855743498.309.png 855743498.310.png 855743498.311.png 855743498.312.png 855743498.313.png 855743498.314.png 855743498.315.png 855743498.316.png 855743498.317.png 855743498.318.png 855743498.320.png 855743498.321.png 855743498.322.png 855743498.323.png 855743498.324.png 855743498.325.png 855743498.326.png 855743498.327.png 855743498.328.png 855743498.329.png 855743498.331.png 855743498.332.png 855743498.333.png 855743498.334.png 855743498.335.png 855743498.336.png 855743498.337.png 855743498.338.png 855743498.339.png 855743498.340.png 855743498.342.png 855743498.343.png 855743498.344.png 855743498.345.png 855743498.346.png 855743498.347.png 855743498.348.png 855743498.349.png 855743498.350.png 855743498.351.png 855743498.353.png 855743498.354.png 855743498.355.png 855743498.356.png 855743498.357.png 855743498.358.png 855743498.359.png 855743498.360.png 855743498.361.png 855743498.362.png 855743498.364.png 855743498.365.png 855743498.366.png 855743498.367.png 855743498.368.png 855743498.369.png 855743498.370.png 855743498.371.png 855743498.372.png 855743498.373.png 855743498.375.png 855743498.376.png 855743498.377.png 855743498.378.png 855743498.379.png 855743498.380.png 855743498.381.png 855743498.382.png 855743498.383.png 855743498.384.png 855743498.386.png 855743498.387.png 855743498.388.png 855743498.389.png 855743498.390.png 855743498.391.png 855743498.392.png 855743498.393.png 855743498.394.png 855743498.395.png 855743498.397.png 855743498.398.png 855743498.399.png 855743498.400.png 855743498.401.png 855743498.402.png 855743498.403.png 855743498.404.png 855743498.405.png 855743498.406.png 855743498.408.png 855743498.409.png 855743498.410.png 855743498.411.png 855743498.412.png 855743498.413.png 855743498.414.png 855743498.415.png 855743498.416.png 855743498.417.png 855743498.419.png 855743498.420.png 855743498.421.png 855743498.422.png 855743498.423.png 855743498.424.png 855743498.425.png 855743498.426.png 855743498.427.png 855743498.428.png 855743498.430.png 855743498.431.png 855743498.432.png 855743498.433.png 855743498.434.png 855743498.435.png 855743498.436.png 855743498.437.png 855743498.438.png 855743498.439.png 855743498.441.png 855743498.442.png 855743498.443.png 855743498.444.png 855743498.445.png 855743498.446.png 855743498.447.png 855743498.448.png 855743498.449.png 855743498.450.png 855743498.452.png 855743498.453.png 855743498.454.png 855743498.455.png 855743498.456.png 855743498.457.png 855743498.458.png 855743498.459.png 855743498.460.png 855743498.461.png 855743498.463.png 855743498.464.png 855743498.465.png 855743498.466.png 855743498.467.png 855743498.468.png 855743498.469.png 855743498.470.png 855743498.471.png
 
Zgłoś jeśli naruszono regulamin