Long Delay Timer Circuit for Refrigerators(Old Types)

/ * My refrigerator does not have an automatic temperature cut-off system. So i made a long delay cut 0ff timer using 89c2051 micro controller . Here i am going to explain how it is made. */


Calculation:

Crystal frequency Used in circuit = 12Mhz
Frequency for 1 Machine cycle = 12/12 Mhz ie = 1Mhz
ie Time period for 1 Machine cycle = 1Micro seconds

Now

Calculate for 50 Milli Seconds = (50x10^-3) / (1x 10^ -6) = 50000

We program Timer O in Mode1 (16 bit)
ie maximum value is FFFF (H), or 65535 (10)

65535 - 50000 = 15535
Equivalent HEX value for Decimal 15535 = 3CAF

So in program :

TL0 = AF
TH0 = 3C

This will generate for 50 Milli Seconds, we need to calculate for 2 hours and Half an hours

Now Moving to the Program:

/ **********************************************************************/
#include<AT89x051.h>
  int i,j;
     void delay1()
    //Delay for 2 hours
{
     TMOD=0x01;    //starting 16bit timer
         for (i=0;i<=380;i++)
           {
              for(j=0;j<=380;j++)
                {
      TL0=0xAF;
      TH0=0x3C;
      TR0=1;
 while(TF0==0);
        TR0=0;
        TF0=0;
        }
    }
}

    void delay2()    // Delay for Half an Hour
{
     TMOD=0x01;
         for (j=0;j<=144;j++)
            {
                for(i=0;i<=144;i++)        
                  {
       TL0=0XAF;             
       TH0=0x3C;             
       TR0=1;         
while(TF0==0);             
       TR0=0;             
       TF0=0;
        }    
    }
}
       void main()

       P1=0;       // PORT1 = 0
       P3=0;      //  PORT3 = 0
while(1)
    {
         P1_7 =1;        // PIN P1.7 High (PHASE )
         P1_6 =1;        // PIN P1.6 High (NEUTRAL )
         P1_5 =1;        // PIN P1.5 High (LED)
delay1();
        P1_7 =0;        // PIN 1.7 Low (PHASE)
        P1_6 =0;        // PIN 1.6 Low (NEUTRAL)
        P1_5 =0;        // PIN 1.6 Low (LED)
delay2();                     
    }
}
/ **********************************************************************/

Now going in to the circuit :

The circuit consists of two sections
1) Micro controller section
2) Relay Section

Circuit:

Component Layout :









Now my refrigerator will cut off  for half an hour after every 2 hours of operation ...

Saving my current bill...

Happy Electronics...

HOME


Comments

Popular posts from this blog

Clonebot Technical Documentation

Run your apps in the system background

Self-Regulating Battery Charger Circuit