washing machine micro controller

Upload: sheilalisondra

Post on 07-Apr-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Washing Machine Micro Controller

    1/12

    Did you ever face that, your washing m/c already run out the mechanical timer dial? After

    using for several times, the dial gear may worn out, and then it can not move anymore.

    Yeeeeeezzzz.... if you are like me, than this page is the right for you.

    A. PREFACE

    Many washing m/c shell in the market has mechanical controlled sequence for activated the

    timer and the sequence back and forth for their motor; washing motor or spinning motor.Spinning motor control only has one direction only, and its simple could be changed to the

    discrete mechanical timer which sell on the market. But washing motor control has 2 direction

    for this purpose, it means to squeeze the clothes, it must go to forward and then reversed. Thesequence is like this :

    First, go to forward direction for about a few seconds

    Than stop, while the chamber is still rotate

    Second, go back to reverse direction for about a few seconds

    Than stop, while the chamber is still rotate

    And so on, back and forth, until the the timer elapsed

    At first, I want to change it to the original parts. But to find the perfect parts is very difficult,

    even the shop (store) or its showroom don't have the part. I think to change it to electroniccircuit. But to run it from electronic, it takes a lot of components and beside that it is not so

    simple circuit. At last I try to make it from microcontroller, because by using microcontroller, it

    takes more simple circuit and the sequence can be changed easily, when it is not perfect. Many-many times. Here it is ...

    B. SCHEMATIC

    Timing sequence like the above description, can be implemented with many way, by using

    discrete electronic components, timer, using a program or a microcontroller or microprocessor,

    etc. Because I am learning the PIC microcontroller for right now, I will implement this functionusing this microcontroller, but for you who familiar with another kind of microcontroller my

    adapted it to your purpose. By using PIC micro, it can be made more compact. First I plan to

    make 2 buttons, 1 for set the timer and another for reset the timer or for the emergency stop push

    button. Then to know the timer works or not, I need a visual display. For this purpose I will use7-segmen display showing the rest of the timer. To run the motor sequence of course I need a

    pair of relays (power relays, about 3 Amperes output), one for forward and another for reverse

  • 8/6/2019 Washing Machine Micro Controller

    2/12

    option. I will use the very common family of PIC micro, ie : 16F84A, because this is the most

    popular type and very simples used and very much used. Also can be obtained easily in the

    market. But this is the medium type of PIC micro family. It has 1kByte of memory (EEPROMtype) and 13 I/O pins. It can be reprogrammable thousands times. Because the I/O just only 13

    pins, I used a BCD to 7-segmen chip. So it will left a few I/O pins for expanded in the future.

    You can omitted this chip fortiming sequence purposeand save one IC price, because the I/Ojust exactly enough. By selecting the proper pin of PIC micro like this :

    I/O port A-0 = SET push button

    I/O port A-1 = RST push button

    I/O port A-2 = Reserved

    I/O port A-3 = Reserved

    I/O port A-4 = Reserved

    I/O port B-0 = Forward Relay (Run motor forward)

    I/O port B-1 = Reverse Relay (Run motor reverse)

    I/O port B-2 = Activated unit 7-segmen (multiplexed)

    I/O port B-3 = Activated ten 7-segmen (multiplexed) I/O port B-4 = BCD data A (for 7-segmen) I/O port B-5 = BCD data B (for 7-segmen)

    I/O port B-6 = BCD data C (for 7-segmen)

    I/O port B-7 = BCD data D (for 7-segmen)

    Also integrated power supply to run it modularly

    The I/O can be configured as input pin or output pin bit-ly. It is up to you to choose the I/O

    pin number goes to what function, but it infect the program firmware of course. Once you

    choose, then it is just like that, except you also change both, the program and the hardware. So

    the schematic are like this.

    C. LAYOUT

    I already design the PCB layout for this purpose, and for compact use. Of course you can

    use another kind of wiring like vero-board or direct wiring (rat nest), but this design already

    tested. I put the relay to another board, so the design can be used for another purpose.

    http://www.dsaprojects.110mb.com/electronics/timer/washing_mc.html#CHEAPER_VERSION%23CHEAPER_VERSIONhttp://www.dsaprojects.110mb.com/electronics/timer/washing_mc.html#CHEAPER_VERSION%23CHEAPER_VERSIONhttp://www.dsaprojects.110mb.com/electronics/timer/wash_sch.pdfhttp://www.dsaprojects.110mb.com/electronics/timer/wash_sch.pdfhttp://www.dsaprojects.110mb.com/electronics/timer/washing_mc.html#CHEAPER_VERSION%23CHEAPER_VERSION
  • 8/6/2019 Washing Machine Micro Controller

    3/12

    D. PART LIST

    Here are the part list for this washing controller :

    1. Resistors :

    R1 ~ R7 = 220 Ohm, 1/4W, 5% ................................ 7 pcs

    R8 ~ R11 = 1k, 1/4W, 5% .................................... 4 pcs

    R12 ~ R14 = 4k7, 1/4W, 5% .................................. 3 pcs

    R15 = 68 Ohm, 1W, 5% ....................................... 1 pcs

    Optional R16, R17 = 1k5, 1/4W, 5% (relay indicator led) .... 2 pcs

    2. Capasitors :

    C1 ~ C2 = 22 pF (for oscillator) ........................... 2 pcs

    C3 ~ C4 = 100 nF (for IC decoupling, used as necessary)..... 2 pcs

    C5 = 100 uF/25V ............................................ 1 pcs

    3. Semiconductors :

    IC1 = PIC16F84A (PIC microcontroller) ..................... 1 pcs

    IC2 = 74LS248 (7-segmen decoder common cathode, optional) .. 1 pcs

    Q1 ~ Q2 = BC548B (NPN transistor) .......................... 2 pcs

    Q3 ~ Q4 = C1061 or H1061 (NPN transistor) .................. 2 pcs

    D1 ~ D6 = 1N4007 (Silicon diode) ........................... 6 pcs

    SEG1 ~ SEG2 = 7-segmen common cathode (red) ................ 2 pcsOptional LED1, LED2 = 3mm, Red (for relay indicator) ....... 2 pcs

    4. Others :

    X1 = 4MHz (Crystal oscillator) ............................. 1 pcs

    Optional IC socket for 18-pins (use 20-pins) ............... 1 pcs

    Optional IC socket for 16-pins ............................. 1 pcs

    Optional IC socket for 24-pins (for 7-segmen LED) .......... 1 pcs

    Optional terminal connector CON1 = 2 pin ................... 1 pcs

    Optional terminal connector CON2 ~ CON3 = 3 pin ............ 2 pcs

  • 8/6/2019 Washing Machine Micro Controller

    4/12

    S1 ~S2 = Miniature push button (Push on) ................... 2 pcs

    RL1 ~ RL2 = 12V Power Relay (output 220V-AC/3A) ............ 2 pcs

    T1 = Transformer (P=220V, S=12V/250mA) ..................... 1 pcs

    E. FIRMWARE

    PIC microcontroller IC needs to programmed with the specific programmer. Manycommercial programmers can programmed this IC. But for this purpose of course, I don't want tospend too much to these kind of programmer. So I used a self made PIC programmer. Many free

    design PIC programmer included with its software program on the net right now (search the net

    by types "PIC micro programmer). Some are free, some are shareware, many are commercial

    made. Some only for a specific type, some for a wide variety types. I choose a free one. I madethe El-Cheapo PIC programmer, because I already have the PCB when I buy the book of Myke

    Predko (as a free bonus included with his book), also this is a simple one. It can programmed a

    few types of PIC micro from the small type to the large type. And the most important, it works. Ialready reprogrammed many-many times. But I change the original design to fit the last version

    (newer version, its V0.84 when I made this). This is my PIC programmerlooks like.

    When making a PIC micro firmware, it needs a compiler too. Many commercial program

    selling at the market, from assembler, basic, c, pascal, and so on. Also as usual many are free,shareware or limited version of this program reserved on the net. I used C program PICCLITE

    compiler (This is a free limited version C compiler from Hi-Tech software, only for PIC16X84

    & PIC16X627 types), because its already included with CDROM that come with the book andalso can be fast learned (This template C program suppose to used for the robot application by

    the writer). The free MPLAB assembler compileralso a good tools, but more difficult to learn. I

    also found a good compiler, free pascal compiler, but still limited development (all is free,include the source program base on GNUlicence). More interesting to learn yet.

    For this washing sequence algorythm, I make the sequence like this :

    If SET push button pushes, the washing sequence start

    If RST push button pushes, the washing sequence stop immediately

    Washing sequence start like thiso Overall timing about 10 minutes

    o Every elapsed minutes displayed to 7-segmen (2-digits)

    o Run forward about 10 seconds

    o Stop about 3 seconds

    o Run reverse about 10 seconds

    o Stop about 3 seconds

    o Then loop from run forward again (repeatedly), until the last

    seconds timing

    To immediately response the stop button (or as an emergency stop button), it needs ahardware interrupt infect. This microcontroller are capable to do this task, but the I/O pin must

    be dedicated to the specific I/O number. So I decide to used a timer interrupt. Timer interrupt

    used the internal timer to make an interrupt from an interval time (for this purpose once at every1ms). This interval time used to generate the timing for seconds and minutes, also the 1/1000

    http://www.myke.com/elcheapo.htmhttp://www.dsaprojects.110mb.com/electronics/timer/pic_programmer.jpghttp://www.htsoft.com/http://www.microchip.com/http://www.voti.nl/jal/http://www.gnu.org/http://www.gnu.org/http://www.myke.com/elcheapo.htmhttp://www.dsaprojects.110mb.com/electronics/timer/pic_programmer.jpghttp://www.htsoft.com/http://www.microchip.com/http://www.voti.nl/jal/http://www.gnu.org/
  • 8/6/2019 Washing Machine Micro Controller

    5/12

    times from a second to response the push button presses (this is more than enough to stop the

    sequence). I can stop the process immediately in anywhere from the 10 minutes processing

    timing. This 1ms also used to refresh the data sequence to the display, because I used amultiplexed 7-segmen (for a good visual, about 50 to 60 times a second, the blinker can not be

    seen any more). That's all ...!!!

    Here is the firmware : washing controller(wash.c, wash.hex).

    F. PROTOTYPE

    Here are my prototypes controller board and relay board look like.

    G. COMPACT VERSION

    http://www.dsaprojects.110mb.com/electronics/timer/wash.ziphttp://www.dsaprojects.110mb.com/electronics/timer/wash.zip
  • 8/6/2019 Washing Machine Micro Controller

    6/12

    As I told before, The PIC16F84A type PIC micro have 13 I/O pins and can accomodate all

    the function for this washing timer. By using all of this option, 7-segmen decoder chip can be

    omitted and we can save one componen price. Here is the new I/Os mapping :

    I/O port A-0 = SET push button

    I/O port A-1 = RST push button I/O port A-2 = Forward Relay (Run motor forward)

    I/O port A-3 = Reverse Relay (Run motor reverse) I/O port A-4 = Activated unit 7-segmen (multiplexed)

    I/O port B-0 = Activated ten 7-segmen (multiplexed)

    I/O port B-1 = Data a for 7-segmen

    I/O port B-2 = Data b for 7-segmen

    I/O port B-3 = Data c for 7-segmen

    I/O port B-4 = Data d for 7-segmen

    I/O port B-5 = Data e for 7-segmen

    I/O port B-6 = Data f for 7-segmen

    I/O port B-7 = Data g for 7-segmen

    But be careful of pin A-4, because this I/O can not function as a source output (it is an opencollector I/O), I got cheated by this pin when I make my stepper controllerboard, so it must have

    a pull up resistor. With this kind of layout the schematic also change. Once you change the

    hardware, then you must change the firmware too.

    Here is the new firmware (wash1.c, wash1.hex) for this purpose and the new pcb layout.

    H. MODIFICATION & IMPLEMENTATION

    Implementation to my washing machine in fact need one more option, ie: for selecting theoperation mode, it is a normal mode or a soft/gentle mode. My washing machine type is like

    this :

    http://www.dsaprojects.110mb.com/electronics/cnc/cnc_ctrl.htmlhttp://www.dsaprojects.110mb.com/electronics/cnc/cnc_ctrl.htmlhttp://www.dsaprojects.110mb.com/electronics/timer/wash1_sch.pdfhttp://www.dsaprojects.110mb.com/electronics/timer/wash1.ziphttp://www.dsaprojects.110mb.com/electronics/timer/wash1.gifhttp://www.dsaprojects.110mb.com/electronics/cnc/cnc_ctrl.htmlhttp://www.dsaprojects.110mb.com/electronics/timer/wash1_sch.pdfhttp://www.dsaprojects.110mb.com/electronics/timer/wash1.ziphttp://www.dsaprojects.110mb.com/electronics/timer/wash1.gif
  • 8/6/2019 Washing Machine Micro Controller

    7/12

    At the left, there are 2 selection mode push buttons, soft or normal mode, then follow by the

    broken wash dial timer. Hacking the contact of this timer dial show that for the normal mode

    operation, it is about 3 times contact for a round, while for soft mode operation, it is about 2times contact for a round.

  • 8/6/2019 Washing Machine Micro Controller

    8/12

    So I add this option mode to the I/O map like these :

    I/O port A-0 = SET push button

    I/O port A-1 = RST push button

    I/O port A-2 = Normal mode select

    I/O port A-3 = Soft mode select

    I/O port A-4 = Reserved

    ... and so on ...

    and made some changes to the firmware like these :

    For normal mode operation, nothing change from the above sequenceo 10 sec forward/reverse and 3 sec stop

    For soft/gentle mode operation, change the sequenceo 5 sec forward/reverse and 5 sec stop

    Here is the firmware (wash-a.c, wash-a.hex)

    Don't forget to put the pull-up resistors (4k7) for these input buttons. Then the wired connectionfor the new circuitis like this.

    There is still more place for any parts to fit inside the control panel. I put the start stop

    buttons and the 7-segmen display at the left side of this panel. Here is the pictures before andafter modified :

    http://www.dsaprojects.110mb.com/electronics/timer/wash-a.ziphttp://www.dsaprojects.110mb.com/electronics/timer/wash-a_sch.pdfhttp://www.dsaprojects.110mb.com/electronics/timer/wash-a_sch.pdfhttp://www.dsaprojects.110mb.com/electronics/timer/wash-a.ziphttp://www.dsaprojects.110mb.com/electronics/timer/wash-a_sch.pdf
  • 8/6/2019 Washing Machine Micro Controller

    9/12

  • 8/6/2019 Washing Machine Micro Controller

    10/12

    Then these are the pictures after modification :

  • 8/6/2019 Washing Machine Micro Controller

    11/12

    Here is the complete packagefor all project.

    I. ELECTRONIC CIRCUIT VERSION

    Last search for this function recently, I bump to another site that give the perfect match with

    this function but all in electronic circuit. So for you who did not want to built it with the

    microcontroller version, you could choose this electronic version washing machine timer.

    References :

    1. Data Praktis Elektronika - Kumpulan Data Elektronika Populer, oleh :

    Elektuur,1986, Multimedia/ELKOMM - Gramedia (1985, Elektuur B. V. -

    Netherlands)

    http://www.dsaprojects.110mb.com/electronics/timer/washing.ziphttp://www.dsaprojects.110mb.com/electronics/timer/washing.ziphttp://www.dsaprojects.110mb.com/electronics/timer/cir-5-washing.pdfhttp://www.dsaprojects.110mb.com/electronics/timer/washing.ziphttp://www.dsaprojects.110mb.com/electronics/timer/cir-5-washing.pdf
  • 8/6/2019 Washing Machine Micro Controller

    12/12

    2. Kumpulan Data Penting Komponen Elektronika : Panduan Cepat IC Linier, TTL,

    CMOS (Data Sheet Book), oleh : Elektuur, alih bahasa : Wasito S., 1986,

    Multimedia/ELKOMM - Gramedia (1985, Elektuur B. V. - Netherlands)3. Programming and Customizing PICMicro Microcontrollers, by : Myke Predko,

    Mc. Graw Hill, 2001, Second Edition

    4. PIC Microcontroller Project Book : A True Beginner's Guide to The Popular PICMicrocontroller, by : John Iovine, Mc. Graw Hill, 2000

    5. Programming Robot Controllers, by : Myke Predko, TAB Robotics, Mc. Graw

    Hill, 2003

    Create on : Feb 1, 2004Last updated : 02/19/2011 20:28:16 - by : David Setya Atmaja

    Persons who interest so far :

    Return to Parent Page

    mailto:[email protected]://www.dsaprojects.110mb.com/electronics/timer/%20http://www.dsaprojects.110mb.com/index.html#ELECTRONICSmailto:[email protected]://www.dsaprojects.110mb.com/electronics/timer/%20