You are on page 1of 5

International Conference on Digital Image Processing

Design Considerations for Microcontroller


Based Process Control for Washing Machine
Ms. Lei Lei Yin Win , Ms. Phyu Hnin Khaing , Dr. Mg Mg Latt
Department of Electronic Engineering
Mandalay Technological University
Mandalay, Myanmar
llyw05@gmail.com

The first stage is a main power supply. In the power


Abstract---- This paper describes the design considerations supply, step down transformer is used to reduce the necessary
of microcontroller based process control for washing machine. voltage for the control unit and other components. Then
In this paper, AT89S51 microcontroller is used to control the rectifier and filter follow by positive regulator to regulate the
process of washing cycle and to drive the external output DC voltage source. A voltage regulator provides a constant
devices such as water inlet valve, wash motor, water drain DC output voltage that is essentially independent of the input
valve. The control strategy program for AT89S51 voltage and output load current. Then microcontroller
microcontroller is implemented by using assembly language. controls the processes and senses the interrupt. The inputs for
The objectives of this development are to design a simple microcontroller are water level switch, mode select switch,
control system using low cost microcontroller, to construct the door switch, auto/manual switch and door switch. The
functions of system using simple control system. The main interrupt may be door switch and reset switch. The control
abstraction of this research is to improve control and software signal from the microcontroller controls the driver circuit for
motor and valves. The driver circuit gives signal to power
systems of microcontroller based process simple control
electronic devices such as relays, triacs and optocouplers. The
system in Electronics.
output devices are motor, water solenoid valve and drain
valve.
Keywords— Process control, applied electronics, sequence control,
driver circuit and control circuit.
III. PIN ASSIGNMENT FOR AT89S51
I. INTRODUCTION Pin No. Input /output Description
Washing machine control system can be divided into P0.0 Input Wash button
function and supply rating. As functions, 8051 microcontroller
P0.1 Input Inlet-water level switch
and input switches are categorized as control input and main
processing units of system. And more, 8051 controller and P0.2 Input Mode switch 1
components are worked at only low voltage DC supply. Motor
P0.3 Input Mode switch 2
and valves drivers are worked at live DC 12 volts supply and
220V AC circuit. These two main DC and AC circuits are P0.4 Input Auto/Manual switch
isolated with optical couplers. DC components are AT89S51
microcontroller, optocouplers and driver and +5V DC supply. P0.5 Input Door Switch
AC components are motor driver (AC 220V), inlet valve P1.0 Output Motor Forward
driver (AC 220V), outlet valve driver (DC 220 V), +12V DC
supply (Live). P1.1 Output Motor Backward
P1.2 Output Water Inlet Valve
II. BLOCK DIAGRAM
P1.3 Output Water Drain Valve
P2.0 Output Wash LED
P2.1 Output Spin LED
P2.2 Output Error LED
Pin 18,19 Crystal 4MHz Crystal
Pin 40 VCC 5V power supply
Fig.1 Block Diagram of Microcontroller Based Process
Control for Washing Machine

978-0-7695-3565-4/09 $25.00 © 2009 IEEE 122


DOI 10.1109/ICDIP.2009.22
Pin 20 GND Ground 4.2. 12 V Live DC Supply
For triac and valves driver circuit, a DC supply
Pin 9 RST Start / Reset which reference to AC line is required. This can be
constructed by using 12V regulator IC7812 and some
components. A 220V to 12VDC transformer is also required.
IV. HARDWARE DESIGN CONSIDERATION The output of supply is required 500 mA to supply all
components. 1A current can be get from 7812 and only one IC
In this control system, two power supplies are
is enough to drive all Triacs and Relay.
considered; one is 5V DC for AT89S51, pin40 VCC, and 12V
Main fact of this design is that +12V DC output of
DC for driver circuit of motor and valves. In this circuit,
regulator is connected to 220 AC phase line. Thus, +12 V DC
simple positive regulator ICs; 7805 for 5V output and 7812
supply from circuit is reference to 220 VAC and this voltage
for 12V DC output are used.
can be used to drive AC Triac directly.
4.1. Opto Coupler Circuit
Caution from this circuit is not to touch any device
For safety factor, AC and DC components are
by hand. This can get electrical shock since all devices are
isolated with Opto Couplers. This can be safe from live AC
working at live area.
fault which affected to microcontroller control and user.
Output source current from 8051 is a little lower than other U2 +12V (Live DC)

ICs. Current source of 8051 is only 5 mA and it is not F1


1A D1
18DB05
sufficient to drive PC 817 inter diode directly. T1 U1
78L12
IN OUT
V1 220v AC
5V COM
+V

+
+
C1 C2
12V Supply 470uF 220uF
R1
330 PCU1
817

Control output for triac


Live Ground
R2
1k Q1
Control In
NPN Fig.4 12V live DC Power Supply Circuit
4.3. Inlet Valve Driver
DC Ground Inlet valve is a solenoid type valve and which can
Fig.2 Optical Isolation Circuit for Triac drive directly with 220 AC. A relay and relay driver circuit is
C828 general NPN transistor is used to solve this used to drive this valve. Specification of valve is 220V/500
problem. Maximum current 50mA & 3.3V are necessary to mA. So relay must be handle this load and this design’s relay
drive internal diode in PC817. C828 has current gain of 70 is 12VDC operational voltage and can handle 220V/10A load.
and required base resistor value can be calculated as follows: This type relay is enough to switch both inlet and outlet valve.
Ib = Ic / hFE Darlington transistor pair of C945 and D882 is used
to drive relay coil from optical isolator signal. Required
= 50mA / 70
components can be calculated as follows. C945 is used as
= 0.714 mA driver and D882 is used as relay driver. Both transistor has
rating of Vcc=35 V maximum and this operation voltage is
To get Ib, required base resistor Rb can be calculated.
well cover for 12 V relay.
Rb= Vb / Ib Relay Voltage = 12 V DC
Relay Current = 700 mA
= 5 / 0.714 mA
So, collector current Ic of darlington pair should have
= 7000 = 6.8 k: 1.4 A for safety factor (twice of load current 500 mA).
So 4.7k resistor is suitable for the situation. hFE (Total) = hFE(945) x hFE(882)
= 120 x 60
PC 817
U2
= 7200
Control Out
Ib= Ic / hFE
Control In = 1.4/7200
= 0.19mA
R3 Thus,
330

Rb = (Vcc -1.4)/Ib
Fig.3 Optical Isolation Circuit for Valves Driver = (12-0.14) /0.19 mA
The next optical isolation circuit design for PC817 is = 56000= 56k
used for inverted signal such as valves control. It is not R1 and R2 can be considered as less than 56k: to
necessary to use a transistor because sink current of 8051 is limit the base current for transistor selected, it is needed to
more than 25 mA and this advantage can be used to drive give the sufficient collector current. To get sufficient collector
internal LED of PC817 from high to low. Normally, this is current, the base resistance of darlington transistor pair must
common with open collector circuit and can only be used as be maximum and any resistor under this value can be chosen
inverted. Resistor R3 is used to limit voltage drop of internal for base resistance of this transistor pair. In this case, R1 and
LED. R2 are chosen as the combination of 47k: and 4.7k:.

123
V1
5V
Phase
To prevent from spark surges, 150 ohms resistor is
+V
RLY1
12VSPDT F1
2A
series with gate and C945 collector. This cannot be effected to
P1
operation but can limit surge noise current.
PC817
U1
R1
47k RLY2
220 V AC Source
Triac Q1 is to drive left winding of motor and Q2 is
Inlet Valve
Q1
NPN for right. Capacitor C1 is 4.7 uF/440V capacitor and which is
Q2
NPN N used for starting excitation of motor.
V1
12V
+V

Fig.5 Relay driver circuit for Ac inlet solenoid valve U1


R3
150

For outlet valve, this valve has specification rating of R1


10k Q3
NPN Q1
BTA8-600
F1
5A
Right Coil
L1

220V DC and 4 A load current. So, a 5A diode bridge is C1


4.7uF

connected directly AC 220 line and converted as supply U2 R4


150
440V

Phase
voltage for valve. Other driver transistor and switch relay are R2
10k Q4
NPN
Q2
BTA8-600
F2
5A
Left Coil
L2
P1 220 AC source

the same as inlet valve.


Neutral

V2
5V
+V
D1
RLY4
12VSPDT F2
1A
5A
F3
5A Phase
Fig.7 Triac Controlled Motor Driver Circuit
P2
R2
47k RLY3
PC817 Outle Valve 220 V AC Source
U2
Q4
NPN
Q3
NPN N

Fig.6 Relay driver circuit for Water Drain Valve


4.4. TRIAC Motor Driver
To drive split phase wash motor, a driver circuit is
required to construct with direction control. Traditional circuit
use relay to switch motor direction. This mechanical method is
not reliable for long term and high current use. So, a TRIAC Fig.8 AC Driver Circuit for Washing Machine System
base control circuit is used in this design. When solenoid valves and motor are de-energized, a
Motor rating are 220V and 3.5 A in normal loading. large variety of transient voltage from these inductive loads
So, TRIAC must be at least 240 V and 7 A rating. BTA series can produce a spike. When these transients occur, it may have
600 model Triac is used in this design. They can be used as an voltage levels which are two or five times the original supply
ON/OFF function in applications such as static relays, heating voltage. So, the fuse in the motor is used to protect the circuit
regulation, induction motor starting circuits or for phase against over current.
control operation in light dimmers, motor speed controllers.
The snubberless versions (BTA/BTB...W and T8series) are
specially recommended for use on inductive loads by their
high commutation performances according to datasheet.
Specification of BTA8-600 TRIAC are:
IT(RMS) =8A
VDRM/VRRM =600 and 800 V
IGT = 50 mA
VGT = 1.3 volts

The output from PC817 photocoupler is 25 mA and


C547 transistor is used as gate trigger driver. Required
calculation can be done as follows.
Then, Ic for C547 should have 100mA for safety factor. Fig.9 Constructed Circuits for Wash Motor, Water Inlet Valve
and Drain Valve
Ic(IGT) = 50 mA
Ib = Ic/hFE
= 100mA/100
= 1mA
Thus,
Rb= (Vcc-Vbe)/Ib
= (12-0.7)/1m
= 11 k:
For this case Rb is chosen as 10k:

124
interrupt. When the door switch is opened during process, it
will call the interrupt routine and it will stop the process. And
then it will re-operate the process when the door switch is
enclosed.
5.1. Time Delay Loop Calculation
Software time delay loops are often used in computer
programs and the tasks performed by these types of loops are
Fig.10 PCB Schematics for Washing Machine Control System simple to waste time. The timing sequence for the washing
(Control Circuit and Driver Ciurcuit) machine requires long time to be completed. But in
demonstration, long period is not necessary as practical. The
4.5. Cautions from this Circuit in Testing delay time for debouncing can be calculated as follows.
1. For the DC water drain valve, the inductive voltage is TT8: MOV VAR2,#33
created anytime power to the coil is de-energized. It MOV VAR1,#104
is ten times the applied voltage. TT9: DJNZ VAR1,TT9
2. +12V DC supply from circuit is referenced to 220V DJNZ VAR2,TT9
AC and this voltage can be used to drive AC triacs Crystal = 4 MHz
directly. Oscillator period = 250 ns
3. While this circuit is working, any device in driver Instruction execution time for mov R, # data= 12
circuit should not be touched by hand. This can get Instruction execution time for djnz Rn, rel = 24
electrical shock, since all devices are working at live 250 ns u (12  12)  250 ns u (103 u 24)  250 ns u (255 u 32 u 24)
area. 50m s
In this system, 3seconds delay, 7seconds delay, 10seconds
V. SOFTWARE DEVELOPOMENT delay and 5seconds delays are written as the subroutines in the
main program.
5.2. Flow Chart for Process Control
A number of operations have to be carried out in the
The mainline program is written just to call the
correct sequence in the control process of washing machine.
sequence of corresponding procedure. These are water inlet
Each of these operations involves opening valve to fill the
valve routine, wash routine for soft mode, regular mode and
machine drum to the required level, closing the valve,
heavy mode, spin routine and drain valve routine are written
switching on the wash motor to rotate the forward and
in sequence as shown in Fig 12.
backward direction for a specific time. The operating
sequence is called program, the sequence of instructions in
each program being predefined and built into the controller
used.

Fig.11 Flow Chart for Mode Selection of Washing Machine


Process
There are three modes of operation in washing
machine program. Control is activated as fully auto or manual
mode by mode selection switch. Auto mode can be selected
more option such as soft, regular and heavy depending on
wash cycle. Soft and regular modes are less duration of wash
and faster in spin mode. These modes are reliable for soft
clothes and light towels. Heavy mode has more duration in
wash and longer spin time. This mode is useful for heavy
clothes.
Two inputs for mode selection, start switch and water level
detect switch inputs must be used. The program starts
initialization when the AT89S51 processor is reset. Then it Fig.12 Flow Chart for Main Process of Washing Machine
will scan the inputs. The door switch must be scanned as the Control System

125
VI. DISCUSSIONS AND FUTHER EXTENSION [4] Thomas E. Kisseell.. 1997 “Industrial Electronics” Prentice Hall, Inc.
[5] Predko, M. 2001. “Programming and Customizing the 8051
Microcontroller. Reprinted in India by arrangement with the M. Graw
This control system is designed by using 8051 Hill Companies Inc, New York
architecture and based on discrete digital control system. The [6] Philips Semiconductor Company. April 1999. “Data sheet of 80S51, 8
bit, Microcontroller Family”. April 1999
design is based on AT89S51, which is produced from Atmel’s [7] Kleitz. W. 1998 “Microprocessor and Microcontroller Fundamentals” .
company. The application software has been developed by 1998
using assembly language. [8] http://www.repairclinic.com
For monitoring, status LEDs are used to show [9] http://www.home.howstuffworks.com
[10] http:// www.wikipedia.com
process and error condition of control system. As a safety
factor, optical isolation method is used to separate AC and DC
control user interface. Moreover, switches are substituted to
indicate the water level sensors other than implementation the
water level sensing circuits. Switches are used instead of door
sensor. When this switch is pressed during the motor is
running, the motor will stop. The opening and closing of
valves are indicated by means of AC water inlet valve and DC
water drain valve. System can drive all real components of a
washing machine. The main advantages of system are
compact in design, accurate timing control, solid switching for
motor driving, safety optical isolation. As optional,
microcontrollers are easily re-programmable and customizable
for user requirement. Firmware base design are more flexible
in function than hardware only control.
The actual water level sensing circuits and water
pump should also be added to form a physically complete
washing machine. And the hardware modifications are also
required for further applications.
For power black out condition, the system should
store the process time that has been completed in the
EEPROM. But AT89S51 microcontroller does not contain
internal EEPROM. So the connection techniques for external
EEPROM and microcontroller should be studied as further
extensions.

ACKNOWLEDGMENT
The author wishes to acknowledge Dr. Maung
Maung Latt Professor and Head, Electrical and Electronic
Research Department, Mandalay Technological University,
for his kind permission, helpful advices and encouragement in
carrying out this paper. The author especially thanks to her
teachers at Department of Electronic Engineering, Mandalay
Technological University and Yangon Technological
University, for their encouragement, help, support and
guidance during the theoretical study and preparation duration
of this paper.
The author wishes to express her deep gratitude to all
persons who helped her directly or indirectly towards the
successful completion of this paper.

REFERENCES

[1] Atmel Corporation, 2007. “8 bit microcontroller with 4k bytes in-system


Programmable Flash AT89S51”
[2] Ayala K.J, 1996. “8051 microcontroller Architecture, Programming and
Application” Second Edition Printed by Sunil Binding and printing
Wrokes, Indie Printing Hous, Wadala, Mumbai 400031
[3] Thomas L. Flovd. 1996, “Electronics Devices” Fourth Edition , Prentice
Hall, Inc.

126

You might also like