Microcontroller and Triacs ON THE 110/240V MAINS: Application Note
Microcontroller and Triacs ON THE 110/240V MAINS: Application Note
Microcontroller and Triacs ON THE 110/240V MAINS: Application Note
INTRODUCTION
Today, electronics is used in home appliances for purposes as different as the motor regula-
tion of a washing machine, the control of a vacuum cleaner, the light dimming of a lamp or the
heating in a coffee machine. This pervasion increases rapidly because appliances require en-
hanced features, easy to built and modify while electronics based solutions become cheaper
and more sophisticated.
Within this evolution, the microcontrollers (MCU) progressively replace analog controllers and
discrete solutions even in low cost applications. They are more flexible, often need less com-
ponents and provide faster time to market. With an analog IC, the designer is limited to a fixed
function frozen inside the device. With a DIAC control, features like sensor feedback or en-
hanced motor drive can not be easily implemented. With the MCU proposed in this note (the
ST6210), the designer can include his own ideas and test them directly using EPROM or One
Time Programmable (OTP) versions.
The triac is the least expensive power switch to operate directly on the 110/240V mains. Thus
it is the optimal switch for most of the low-cost power applications operating on-line. The
LOGIC LEVEL or SNUBBERLESS triacs are a complement to the ST6210 MCU for such ap-
pliances. These triacs can operate with low gate current and can be directly triggered by the
MCU, while still maintaining a high switching capability.
This application note describes three different MCU based applications: a universal motor
drive, an AC switch and a light dimmer. They all operate with the same user interfaces and al-
most the same software and hardware.
AN392/1098 1/12
1
MCU AND TRIAC ON THE MAINS
R L 2 Power
Vpeak
IA 2Z
V line R
VAK
R,L
td
10 ms
Vsynchro
td
V line
VAK
IA
Isynchro
VR001730
2/12
2
MCU AND TRIAC ON THE MAINS
A universal motor is an inductive load which may generate very strong dynamic constraints on
the circuit at turn-off. Because of the phase lag of current with respect to voltage, the reapplied
voltage can be different from zero. So the leading edge of the reapplied voltage across the
triac can be very sharp because it is limited only by parasitic capacitances (fig.8). A SNUB-
BERLESS triac is well adapted to this kind of loads because fast commutation characteristics
can be obtained with low current rating devices. Otherwise, inrush current at motor startup is
limited by the soft start feature included in the control.
Triac drive
The triac is directly driven by the MCU. The pulse driving the triac is short (100s) in order to
minimize the +5V supply circuit size. The SNUBBERLESS triac is driven in quadrants QII and
QIII with 60 mA gate current provided by three I/O bits of the ST6210 in parallel. This pulse is
sufficiently long to insure the triac is latched at the end of the pulse. Pulse length can be mod-
ified if another triac or motor is used.
User Interfaces
There are three different user interfaces: a touch control, a push button and a potentiometer.
Four modes can be selected on the board in order to define how the transmitted power is re-
lated to the user interface.
Three modes operate with the touch sensor or the push button. Dimming is obtained when the
sensor or the button is touched for more than 330ms. If the touch duration is between 50ms
and 330ms, the circuit is switched on or off. A contact of less than 50ms causes no action.
Modes 1,2,3 differ in the way the motor speed is changed by sensor or button contact. (These
values are given for the 60Hz version, for a 50Hz mains values are respectively 400ms and
50ms).
Figure 2. User interfaces
t
Pmax
Memory
Mode 2
t Vpot
Pmax VDD
Mode 3
t
VR001812
3/12
MCU AND TRIAC ON THE MAINS
Mode 4 directly relates transmitted power to potentiometer position (fig.2). All modes include
a soft start.
When operating together, the SNUBBERLESS triac and the ST6210 MCU save components
on the drive, logic power supply, mains connection, and the power side (fig.3).
The MCU chosen (ST6210) includes an 8 bit accumulator, 2k ROM, 64 bytes RAM, an 8 bit A/
D converter that can be connected to 8 different inputs, 4 I/O lines with 10mA sink current ca-
pability and a timer. Hysteresis protection is included in series with each I/O pin. The ST6210
is packaged in DIL or SMD packages. The ports, the timer and interrupts configurations can
be chosen by software, providing high flexibility. The ST6210 has been designed to operate in
very disturbed environments. Each I/O line contains internal diodes which clamp the input
voltage between Vdd and Vss. These diodes are sized to withstand a continuous current of
1mA (typ.). With EPROM and OTP versions, the equipment development and preproduction
can be done directly from the design lab providing a fast time to market.
The SNUBBERLESS triac (BTA 16-400CW for 110 V, BTA10-600CW for 220V) has been
specially designed to drive loads which generate very strong dynamic constraints such as a
vacuum cleaner motor. This triac can be triggered in quadrants QI, QII or QIII with gate and
latching current of 35mA and 80mA respectively. In this application it is driven by three I/O
lines of the ST6210 in parallel. This triac has high current switching capability ([dI/dt]c>8.5A/
ms and 5.5A/ms for BTA10- 600CW), and high static dv/dt ([dV/dt]>250V/ms). So, in this cir-
cuit, it can operate without a snubber.
ST62+ TRIAC
ON THE MAINS (110/240v)
FUSE +5V
LINE 1 OPTIONAL
USER INTERFACES
47
19 PA0VDD RESET 4,7M
2x4,7M
18 PA1
17 PA2 PB0 15 TOUCH SENSOR
16 PA3
VERSION
BTA 16-600CW 13 PB2 14
12 PB1
PB3
0V ST6210 PUSH BUTTON
11 PB4
1M NMI 5
TEST 6 0V
VSS 20
OSCIN OSCOUT +5V
LOAD
+5V 3 PIEZO 4
4/12
MCU AND TRIAC ON THE MAINS
Figure 4. Major steps of the software Total consumption of the board is 3mA with
an 8MHz oscillator. The board supply comes
from the mains through a simple RCD circuit.
The +5V is referred to anode 1 of the triac in
order to provide the negative gate current
necessary to drive the triac in quadrants QII
RESET
and QIII. The 5V supply capacitance is
mounted as near as possible to the MCU
Initialization
with very short interconnecting traces to
Read version
maximize RFI immunity.
The touch sensor is a voltage divider be-
Line synchronisation tween line and neutral. It operates when the
+5V supply input of the circuit is connected
Sensor acquisition to the line potential. This connection to the
mains must be provided.
Power level requirement Software
All operating features are contained in a 700
Delay time td1 in timer
byte program. More than 1byte of ROM is
Calculation next delay
available for additional features. The archi-
tecture of the software is modular in order to
provide maximum flexibility.
Triac firing
A lockup table relating delay time to the
Delay time td2 in timer power requirement contains 64 different
levels. The conduction time of the triac can
Calculation next delay vary from 1.7ms to 6.7ms for a 60Hz applica-
tion and from 2ms to 8ms to a 50Hz applica-
Triac firing tion. The user can easily adjust the minimum
and maximum power levels because the cor-
Window responding delay times are slowly changing
for zero crossing mains at the top and bottom of the table. The table
can be modified in ROM/EPROM to meet dif-
VR001731
ferent conditions e.g. 50Hz or 60Hz opera-
tion or varying loads.
One software version covers all four user in-
terface modes without hardware change.
All inputs are digitally filtered so that an input
is validated only if it remains constant for 15s
or more. So, passive filter components can
be saved. The mains supply carries distur-
bances (glitches, telecommand signals, ...)
which could disturb the triac drive. For this
reason, a mains voltage zero crossing is only
5/12
MCU AND TRIAC ON THE MAINS
validated if it occurs during a window of time (1.7ms each 16.6ms for 60Hz operation and 2ms
each 200ms for 50Hz operation) selected by the internal timer of the MCU. This block acts as
a filter and again eliminates external components (fig.4).
This circuit can be used as a basis for development of more sophisticated features such as
vacuum regulation in a vacuum cleaner, speed control in a food processor, speed regulation
with torque limiting in a drill, unbalance detection in a washing machine or door opener with re-
mote control.
AC SWITCH
AC switches operate as relays. They have to turn-on as soon as possible after a mains voltage
zero crossing in order to prevent the disturbances induced by a sharp leading edge of current.
Their operating current has to be small in order to minimize the supply coming from the mains.
Also, they are usually driven through isolated interfaces such as an optocoupler or trans-
former.
The motor drive circuit described previously can be used as a basis for such applications.
When the zero crossing of the mains voltage is detected, this triac is turned-on.
A SNUBBERLESS triac such as the BTA 16-600BW is suitable for an AC switch. Its switching
characteristics ([dI/dt]c>14A/ms) allows it to control various types of resistive and inductive
loads.
Figure 5. Delay time in drive of an AC switch
6/12
MCU AND TRIAC ON THE MAINS
The figure 5 shows that a ST6210 can turn-on a triac 35ms after the mains voltage zero
crossing. With such phase delay (0.75°/60Hz and 0.63°/50Hz), the voltage reapplied across
the load is small (V) and the leading edge of current is minimal.
Such an AC switch can include additional features such as voltage and current monitoring or
feedback features. This AC switch can also be used, for instance, in a refrigerator (with
smaller triacs) with several compartments where the MCU controls different temperatures.
The MCU can then interface the sensors, solve the priority conflicts and drive the AC switches
with the optimal sequence.
LIGHT DIMMER
Basic function
The motor drive board can also operate as a light dimmer. However, the board can be slightly
modified such that the neutral connection is no longer necessary. Then, the board can be
plugged in series with the line wire like a mechanical switch. The synchronization and the aux-
iliary supply are obtained from the voltage across the triac (Fig.6).
A light dimmer operating directly on the 110V or 240V mains has been realized using a MCU
ST6210 and a LOGICLEVEL triac. This circuit drives halogen or incandescent lamps supplied
directly from the mains or through a low voltage transformer. It includes softstart and protec-
tion against transformer saturation and against open load. The user interfaces are the same
as with the motor drive.
ST62+ TRIAC
LIGHT DIMMER
FUSE +5V
LINE 1
19 PA0VDD RESET 4,7M USER INTERFACE
100 18 PA1 2x4,7M
17 PA2 PB0 15 TOUCH SENSOR
BTA 08-600 SW 16 PA3
VERSION
+5V 13 PB2 14
12 PB3 PB1
100K 0V S T6 210 PUSH BUTTON
11
PB4 NMI 5
12V 100K 200K 10 TEST 6 0V
PB5 VSS 20
200K OSCIN OSCOUT +5V
+5V 3 PIEZO 4
22K
22p 8MHz 22p POTENTIOMETER
5V6
0V
820-1/2W 1N4148 100ÿF
6V 0V 0V 0V 0V
NEUTRAL 220nF/400V 0V
7/12
MCU AND TRIAC ON THE MAINS
Power control
Power is controlled by the phase delay (td) of the triac drive. In the previous design, td is re-
ferred to the zero crossing of the line voltage. In order to avoid a connection to the mains neu-
tral and connect the circuit directly in series with the load, the trigger delay is referred to the
previous zero crossing of the current (fig.1). When the current in the triac is zero, the mains
voltage is reapplied across it. Synchronization is achieved by measuring this voltage. This
main voltage is monitored over each halfwave with a network of resistances connected to two
I/O lines of the ST6210. This allows detection of spurious open load and the retriggering of the
triac with multipulse operation if it is not latched after the first gate pulse.
Operation with a transformer
Low power halogen spots use low voltage lamps (12V typ.) usually supplied through a low
voltage transformer. Dimming these lamps is simple with this circuit thanks to the program fea-
tures included in the ST6210 :
* At the start, the delay time between the first gate pulse and the synchronization instant is
greater than 5ms. This limits induction in the transformer and the risk of saturation.
* The circuit starts on a positive line halfwave and stops on a negative one. Thus it starts with
positive induction and stops after negative induction has been applied. This helps to minimize
the size of the magnetic core material, and the current rating of the triac.
* The timer is precisely tuned in order to obtain 8.3ms (for 60Hz) or 10ms (for 50Hz) delay be-
tween two gate pulses. As a result, the triac is driven symmetrically in both phases so that con-
tinuous voltage in the transformer is avoided and noise in the transformer is reduced. Other-
wise, the voltage across the triac is monitored to detect a spurious open load condition at the
secondary of the transformer.
The inrush current at the turn-on of a lamp (halogen or incandescent) is also reduced due to
the soft start feature of the circuit (fig.7).
Triac drive
The triac is directly driven by the MCU. The pulse driving the triac is 50ms long. The LOGIC
LEVEL triac is driven in quadrants QII and QIII with a gate current of 20mA provided by two I/
O lines of the ST6210 in parallel. The LOGICLEVEL triac has a maximum specified gate trig-
gering current of 10mA at 25°C.
The triac is multi-pulse driven. Therefore, inductive loads can be driven without the use of long
pulse drives. As a result, the consumption on the +5V supply can be minimized and the supply
circuit becomes very small. Before supplying the first drive pulse, the triac voltage is tested. If
no voltage is detected, a spurious open load or a supply disconnection is assumed to have oc-
curred and the circuit is stopped. After the first driving pulse, the triac voltage is monitored. If
the triac is not ON, another pulse is sent. The same process can be repeated up to four times.
Then, if the triac is still not ON, the circuit is switched off.
Hardware
The light dimmer board is almost the same as the motor drive board (fig.6). The major differ-
ences concern the position where the voltage is measured and the triac choice. When the
board is dimming a resistive load, an RFI filter should be added in order to the RFI standards
(i.e. VDE 875).
In a dimmer, because of the resistive load, dynamic constraints are lower than in a motor con-
8/12
MCU AND TRIAC ON THE MAINS
trol, so a LOGIC LEVEL triac (BTA08-400SW or BTA08-600SW) is used for safe gate current.
This triac has been especially designed to operate with a MCU. It is a sensitive triac
(IGT<10mA) which can be triggered in quadrants I, II and III. This triac has high switching ca-
pabilities (dI/dt]c>3.5A/ms), ([dV/dt]c>20V/ms). Thus it can also operate without a snubber in
this circuit.
This board is supplied when the triac is off. A minimum off-time of the triac (1.7ms/60Hz and
2ms/50 Hz) is necessary to ensure its supply. The RCD circuit is the same as the one used for
the motor drive board.
Software
The light dimmer software is practically the same as with the motor drive. The major difference
concerns the mains disturbances rejection in order to prevent lamp flickering. The timing is
carried out internally by the MCU timer. The period of operation can be modified to follow the
variations of the mains frequency but not the spurious disturbances. The mains synchronisa-
tion signal is received every cycle.
Figure 7. Soft start with lamps
HALOGEN LAMP AT THE SECONDARY OF A TRANSFORMER
TRIAC ANODE CURRENT : 1A/div 200ms/div
9/12
MCU AND TRIAC ON THE MAINS
The corresponding mains period is measured and compared to the internal timer period.
If a difference remains after many cycles, the timer period is modified to follow the mains. This
block acts like a low band filter which eliminates external filtering components.
The user interface can be modified to fit other applications such as IR presence detection or
alarm, remote control, etc .
PRACTICAL RESULTS
Figure 7 presents the soft start operation with a halogen lamp operating from the secondary of
a low voltage transformer and with a high voltage tungsten filament lamp.
With soft start, the peak in-rush current is about 3 times the nominal current compared with 10
to 15 times otherwise. Therefore, the lamp life time is maximized, blowing the input fuse is pre-
vented and the size of the triac is minimized. The figure 8 presents the current and voltage in
a triac driving a universal motor.
SUMMARY
Microcontrollers (MCU) are in common use in most areas of electronics. They are now set to
penetrate the very cost sensitive area of home appliances. The applications described in this
paper show that enhanced appliance circuits can be designed with fast prototyping using a
ST6210 MCU and a SNUBBERLESS or LOGIC LEVEL triac. These circuits are low cost and
they can provide more features with less components than classical solutions.
The presented circuits are a universal motor drive, a AC switch and a light dimmer operating
from the 110/240V mains. The light dimmer drives incandescent and halogen lamps supplied
either directly from the mains or through a low voltage transformer. The motor drive can be
adapted, for instance, to vacuum cleaners, food processors, drills or washing machines.
Those circuits include soft start and protection features. Different user interfaces can be
chosen: touch sensor, push button or potentiometer.
Such features are obtained with only few components: a ST6210 MCU in 20pin DIL/SMD
package with a LOGIC LEVEL or SNUBBERLESS triac in TO220 package and some passive
components.
Additional features like motor speed regulation, torque limitation, vacuum or unbalance con-
trol, IR presence detection, remote control, alarm, homebus interface or electronic shortcircuit
protection with IGBT/Mosfet can be implemented from these circuits.
Bibliography
Thyristors and triacs application manual 1986 / STMicroelectronics Universal Motor Speed
Control / P.Rault + Y.Bahout
10/12
MCU AND TRIAC ON THE MAINS
Thyristors and triacs application manual 1989 / STMicroelectronics Microcontroller based uni-
versal motor speed control / M.Queyrol
ST62 user manual 1991 / STMicroelectronics
Power control with ST6210MCU and triac / Ph.Rabier + L.Perier
11/12
MCU AND TRIAC ON THE MAINS
THE PRESENT NOTE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH INFORMATION
REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS
SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO
ANY CLAIMS ARISING FROM THE CONTENT OF SUCH A NOTE AND/OR THE USE MADE BY CUSTOMERS OF
THE INFORMATION CONTAINED HEREIN IN CONNEXION WITH THEIR PRODUCTS.
Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences
of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted
by implication or otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject
to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not
authorized for use as critical components in life support devices or systems without the express written approval of STMicroelectronics.
The ST logo is a registered trademark of STMicroelectronics
1998 STMicroelectronics - All Rights Reserved.
Purchase of I2C Components by STMicroelectronics conveys a license under the Philips I2C Patent. Rights to use these components in an
I2C system is granted provided that the system conforms to the I2C Standard Specification as defined by Philips.
STMicroelectronics Group of Companies
Australia - Brazil - Canada - China - France - Germany - Italy - Japan - Korea - Malaysia - Malta - Mexico - Morocco - The Netherlands -
Singapore - Spain - Sweden - Switzerland - Taiwan - Thailand - United Kingdom - U.S.A.
http://www.st.com
12/12