SlideShare ist ein Scribd-Unternehmen logo
1 von 18
HOME
AUTOMATION
TEMPRATURE CONTROL
SUBMITTED BY:AJITESH PAL SINGH
INTRODUCTION
The goal of our project is to design a user-friendly
home automation system which can be easily
integrated into existing homes and businesses.
 It is automation of the home, housework or household
activity.
 Home automation may include centralized control of
lighting, HVAC (heating, ventilation and air
conditioning), appliances, security locks of gates and
doors and other systems, to provide improved
convenience, comfort, energy efficiency and security.

How it works?


Basically it is used to control temperature.



At 30°C temp it will work normally but when the
temperature above 30°C the fan will start moving.




Temperature will show in the LCD display.
Connector is connected with the motor driver and it will
help to rotate the fan.
Advantages


Increasing safety System.



Lighting Control (Centralized).



Heat and Cool Control system.



Video systems.
Applications





Low-cost Program Control of Industrial Furnaces.
Ideal for Increasing the Control Performance of Industrial
Hot Air Blowers

High Resolution Temperature Measurement.
Power supply


This is used to control the voltage and current coming from the main
supply.



We use step down center tap transformer with fullwave rectifier and
7805 voltage regulator.
Fullwave Rectifier


A bridge is simply two fullwave circuits... So. fullwave has
the advantage of having half the diode drop.



The PIV is one half that of the center tap circuit.
MICROCONTROLLER (AT89S52)


It has inbuilt ram, rom, timer or we can say that it is a
small cpu which is used for performing specific task.



AT89S52 microcontroller is made up with c mos
technology with operation form 2.7 to 5.5v.



It has 256 B ram and 8k rom,32 i/o lines,16 bit
counter/timer,6 interrupts.



It has one full duplex UART.
LCD(Liquid Crystal Display)


It is used to display a data



It is a 16*2 lcd .



It has 16 pins from which it has 8 data lines.



Its one block is 5*7 dot matrix pattern.
Temperature Sensor LM35


It is precision temperature sensor in celcius.



Its sensitivity is linear + 10 mV/°C.



It can measure from -55°C and 150°C.



Can be used to detect ambient air temperature



LM35 Linear Temperature Sensor is based on the
semiconductor LM35 temperature sensor.



The output voltage is proportional to the temperature.
ADC0808 (ANOALG
TO DIGITAL
CONVERTOR )



It is commonly called ADC.



ADC0808 is an 8 bit analog to
digital converter with eight
input analog channels.



The default step size is 19.53mV
corresponding to 5V reference
voltage.



The ADC needs some specific
control signals for its operations
like start conversion and bring
data to output pins.



The voltage reference can be
set using the Vref+ and Vrefpins.
Motor Driver(L293D)



L293D is a dual H-bridge motor
driver integrated circuit (IC).



Motor drivers act as current
amplifiers since they take a
low-current control signal and
provide a higher-current signal.
This higher current signal is used
to drive the motors.



L293D contains two inbuilt Hbridge driver circuits. In its
common mode of operation,
two DC motors can be driven
simultaneously, both in forward
and reverse direction.
Program


#include<reg51.h>



#include"lcd.h"



#define MYDATA P3



sbit ADDR_A=P1^7;



sbit ADDR_B=P1^6;



sbit ADDR_C=P1^5;



sbit ALE =P1^4;



sbit clock =P1^3;



sbit OE =P1^2;



sbit EOC =P1^1;



sbit SC =P1^0;



sbit m1a =P2^0;



sbit m1b =P2^1;



unsigned char adc_start(unsigned
char );



unsigned char
*display_numbers(unsigned char);



unsigned int
speed_on=0,speed_value_on_time=0,s
peed_value_off_time=1020,t;
void timer0(void) i
{ clock=~clock;}
• unsigned char adc_start(unsigned char
kkk )
• { unsigned char value;
• TR0=1;
• MYDATA=0XFF;
• EOC=1;
• ALE=0;
• OE=0;
• SC=0;
• ADDR_C=(kkk>>2)&0x01;
• ADDR_B=(kkk>>1)&0x01;
• ADDR_A=(kkk>>0)&0x01;
• delay(50);//for 4ms
• ALE=1;
• delay(50);//for 4ms
• SC=1;
• delay(50);//for 4ms
•
ALE=0;
•
SC=0;
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
}

delay(50);//for 4ms
while(EOC==1);
while(EOC==0);
OE=1;
delay(10);//for 4ms
value=MYDATA;
OE=0;
TR0=0;
return(value);
}
unsigned char *display_numbers(unsigned char abbc)
{
unsigned char kkk[3],ttt=0;
while(ttt<3)
{
kkk[ttt]=abbc%10;
ttt++;
abbc=abbc/10;
}
return(kkk);
void main()
{
unsigned char *bb,temp_resister;
initialize();
m1a=0;
m1b=0;
cmd(0x80);
ptr("Temperature= ");
TMOD=0X02; //mode 2
TH0=0xfb;
IE=0X82;
TR0=0;
//timer stop
cmd(0xc0);
bb[0]=0;
bb[1]=0;
bb[2]=0;
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•

while(1)
{
temp_resister=adc_start(0x00);
if(temp_resister>30)
{
m1a=0;
m1b=1;
cmd(0xc0);
ptr(" FAN ON ");}
else
{
m1a=0;
m1b=0;
cmd(0xc0);
ptr(" FAN OFF ");}
bb=display_numbers(temp_resister);
delay(50);
cmd(0x8C);
}
}
Fan automation

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Open and closed loop systems
Open and closed loop systemsOpen and closed loop systems
Open and closed loop systems
 
PLC and SCADA
PLC and SCADAPLC and SCADA
PLC and SCADA
 
Project ideas ece students
Project ideas ece studentsProject ideas ece students
Project ideas ece students
 
LPG gas leekage dectection
LPG gas  leekage  dectectionLPG gas  leekage  dectection
LPG gas leekage dectection
 
Plc presentation
Plc presentation Plc presentation
Plc presentation
 
L298 Motor Driver
L298 Motor DriverL298 Motor Driver
L298 Motor Driver
 
Temperature Based Fan Controller
Temperature Based Fan Controller Temperature Based Fan Controller
Temperature Based Fan Controller
 
Voice Control Home Automation
Voice Control Home AutomationVoice Control Home Automation
Voice Control Home Automation
 
Fire fighting robot using arduino
Fire fighting robot using arduinoFire fighting robot using arduino
Fire fighting robot using arduino
 
PLC LADDER DIAGRAM
PLC LADDER DIAGRAMPLC LADDER DIAGRAM
PLC LADDER DIAGRAM
 
INDUSTRIAL AUTOMATION ( SHUBHAM KURDIYA)
INDUSTRIAL AUTOMATION ( SHUBHAM KURDIYA)INDUSTRIAL AUTOMATION ( SHUBHAM KURDIYA)
INDUSTRIAL AUTOMATION ( SHUBHAM KURDIYA)
 
Automatic light control using PIR sensor
Automatic light control using PIR sensorAutomatic light control using PIR sensor
Automatic light control using PIR sensor
 
TEMPERATURE SENSORS.pptx
TEMPERATURE SENSORS.pptxTEMPERATURE SENSORS.pptx
TEMPERATURE SENSORS.pptx
 
anti sleep alarm for students
anti sleep alarm for studentsanti sleep alarm for students
anti sleep alarm for students
 
11.automatic water tap control abstract
11.automatic water tap control abstract11.automatic water tap control abstract
11.automatic water tap control abstract
 
Tuning of pid
Tuning of pidTuning of pid
Tuning of pid
 
Clap Switch Using Arduino
Clap Switch Using ArduinoClap Switch Using Arduino
Clap Switch Using Arduino
 
Control system lectures
Control system lectures Control system lectures
Control system lectures
 
Programmable Logic Controllers
Programmable Logic ControllersProgrammable Logic Controllers
Programmable Logic Controllers
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
 

Ähnlich wie Fan automation

Automatic temperature control using 8085 microprocessor
Automatic temperature control using 8085 microprocessorAutomatic temperature control using 8085 microprocessor
Automatic temperature control using 8085 microprocessor
subhradeep mitra
 
Temperature based speed control of fan
Temperature based speed control of fanTemperature based speed control of fan
Temperature based speed control of fan
Çdh Suman
 
Temperature based speed control of fan using microcontroller
Temperature based speed control of fan using microcontrollerTemperature based speed control of fan using microcontroller
Temperature based speed control of fan using microcontroller
Çdh Suman
 
Monitoring and data logging system for a generator
Monitoring and data logging system for a generatorMonitoring and data logging system for a generator
Monitoring and data logging system for a generator
Moon Shahzad
 

Ähnlich wie Fan automation (20)

Automatic temperature control using 8085 microprocessor
Automatic temperature control using 8085 microprocessorAutomatic temperature control using 8085 microprocessor
Automatic temperature control using 8085 microprocessor
 
Temperature Control System Using Pid Controller
Temperature Control System Using Pid ControllerTemperature Control System Using Pid Controller
Temperature Control System Using Pid Controller
 
New microsoft power point slide
New microsoft power point slideNew microsoft power point slide
New microsoft power point slide
 
Temperature based speed control of fan
Temperature based speed control of fanTemperature based speed control of fan
Temperature based speed control of fan
 
Temperature Controller with Atmega16
Temperature Controller with Atmega16Temperature Controller with Atmega16
Temperature Controller with Atmega16
 
Temperature Controlled Fan Project
Temperature Controlled Fan ProjectTemperature Controlled Fan Project
Temperature Controlled Fan Project
 
Presentation
PresentationPresentation
Presentation
 
Arduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorArduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulator
 
E top controls thermostat catalog
E top controls thermostat catalogE top controls thermostat catalog
E top controls thermostat catalog
 
Industrial Temperature Controller System
Industrial Temperature Controller SystemIndustrial Temperature Controller System
Industrial Temperature Controller System
 
Microprocessor project
Microprocessor projectMicroprocessor project
Microprocessor project
 
Temperature based speed control of fan using microcontroller
Temperature based speed control of fan using microcontrollerTemperature based speed control of fan using microcontroller
Temperature based speed control of fan using microcontroller
 
TEMPERATURE CONTROL AND DATA ACQUISITION METHOD FOR FACTORY USING LABVIEW
TEMPERATURE CONTROL AND DATA ACQUISITION METHOD FOR FACTORY USING LABVIEWTEMPERATURE CONTROL AND DATA ACQUISITION METHOD FOR FACTORY USING LABVIEW
TEMPERATURE CONTROL AND DATA ACQUISITION METHOD FOR FACTORY USING LABVIEW
 
Monitoring and data logging system for a generator
Monitoring and data logging system for a generatorMonitoring and data logging system for a generator
Monitoring and data logging system for a generator
 
Ic2414251429
Ic2414251429Ic2414251429
Ic2414251429
 
Temperature detection and control
Temperature detection and controlTemperature detection and control
Temperature detection and control
 
DESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINO
DESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINODESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINO
DESIGN OF TEMPERATURE BASED FAN SPEED CONTROL and MONITORING USING ARDUINO
 
Ranisha FAN.pptx
Ranisha FAN.pptxRanisha FAN.pptx
Ranisha FAN.pptx
 
Temperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring usingTemperature based fan speed control & monitoring using
Temperature based fan speed control & monitoring using
 
Automatic temperature control
Automatic temperature control Automatic temperature control
Automatic temperature control
 

Mehr von AJITESH PAL SINGH (10)

Sdm ppt
Sdm pptSdm ppt
Sdm ppt
 
Fleet manag at reliance
Fleet manag at relianceFleet manag at reliance
Fleet manag at reliance
 
Total quality management
Total quality managementTotal quality management
Total quality management
 
Sm
SmSm
Sm
 
Bmw
BmwBmw
Bmw
 
Redressal agencies in India
Redressal agencies in IndiaRedressal agencies in India
Redressal agencies in India
 
Nurturing talents in software companies
Nurturing talents in software companiesNurturing talents in software companies
Nurturing talents in software companies
 
Marico satisfying customers need and demand
Marico satisfying customers need  and demandMarico satisfying customers need  and demand
Marico satisfying customers need and demand
 
Theory X & Theory Y
Theory X & Theory YTheory X & Theory Y
Theory X & Theory Y
 
Its cartoon time : Study On Cartoon Channel
Its cartoon time : Study On Cartoon ChannelIts cartoon time : Study On Cartoon Channel
Its cartoon time : Study On Cartoon Channel
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Kürzlich hochgeladen (20)

Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 

Fan automation

  • 2. INTRODUCTION The goal of our project is to design a user-friendly home automation system which can be easily integrated into existing homes and businesses.  It is automation of the home, housework or household activity.  Home automation may include centralized control of lighting, HVAC (heating, ventilation and air conditioning), appliances, security locks of gates and doors and other systems, to provide improved convenience, comfort, energy efficiency and security. 
  • 3. How it works?  Basically it is used to control temperature.  At 30°C temp it will work normally but when the temperature above 30°C the fan will start moving.   Temperature will show in the LCD display. Connector is connected with the motor driver and it will help to rotate the fan.
  • 4. Advantages  Increasing safety System.  Lighting Control (Centralized).  Heat and Cool Control system.  Video systems.
  • 5. Applications    Low-cost Program Control of Industrial Furnaces. Ideal for Increasing the Control Performance of Industrial Hot Air Blowers High Resolution Temperature Measurement.
  • 6. Power supply  This is used to control the voltage and current coming from the main supply.  We use step down center tap transformer with fullwave rectifier and 7805 voltage regulator.
  • 7. Fullwave Rectifier  A bridge is simply two fullwave circuits... So. fullwave has the advantage of having half the diode drop.  The PIV is one half that of the center tap circuit.
  • 8. MICROCONTROLLER (AT89S52)  It has inbuilt ram, rom, timer or we can say that it is a small cpu which is used for performing specific task.  AT89S52 microcontroller is made up with c mos technology with operation form 2.7 to 5.5v.  It has 256 B ram and 8k rom,32 i/o lines,16 bit counter/timer,6 interrupts.  It has one full duplex UART.
  • 9. LCD(Liquid Crystal Display)  It is used to display a data  It is a 16*2 lcd .  It has 16 pins from which it has 8 data lines.  Its one block is 5*7 dot matrix pattern.
  • 10. Temperature Sensor LM35  It is precision temperature sensor in celcius.  Its sensitivity is linear + 10 mV/°C.  It can measure from -55°C and 150°C.  Can be used to detect ambient air temperature  LM35 Linear Temperature Sensor is based on the semiconductor LM35 temperature sensor.  The output voltage is proportional to the temperature.
  • 11. ADC0808 (ANOALG TO DIGITAL CONVERTOR )  It is commonly called ADC.  ADC0808 is an 8 bit analog to digital converter with eight input analog channels.  The default step size is 19.53mV corresponding to 5V reference voltage.  The ADC needs some specific control signals for its operations like start conversion and bring data to output pins.  The voltage reference can be set using the Vref+ and Vrefpins.
  • 12. Motor Driver(L293D)  L293D is a dual H-bridge motor driver integrated circuit (IC).  Motor drivers act as current amplifiers since they take a low-current control signal and provide a higher-current signal. This higher current signal is used to drive the motors.  L293D contains two inbuilt Hbridge driver circuits. In its common mode of operation, two DC motors can be driven simultaneously, both in forward and reverse direction.
  • 13. Program  #include<reg51.h>  #include"lcd.h"  #define MYDATA P3  sbit ADDR_A=P1^7;  sbit ADDR_B=P1^6;  sbit ADDR_C=P1^5;  sbit ALE =P1^4;  sbit clock =P1^3;  sbit OE =P1^2;  sbit EOC =P1^1;  sbit SC =P1^0;  sbit m1a =P2^0;  sbit m1b =P2^1;  unsigned char adc_start(unsigned char );  unsigned char *display_numbers(unsigned char);  unsigned int speed_on=0,speed_value_on_time=0,s peed_value_off_time=1020,t;
  • 14. void timer0(void) i { clock=~clock;} • unsigned char adc_start(unsigned char kkk ) • { unsigned char value; • TR0=1; • MYDATA=0XFF; • EOC=1; • ALE=0; • OE=0; • SC=0; • ADDR_C=(kkk>>2)&0x01; • ADDR_B=(kkk>>1)&0x01; • ADDR_A=(kkk>>0)&0x01; • delay(50);//for 4ms • ALE=1; • delay(50);//for 4ms • SC=1; • delay(50);//for 4ms • ALE=0; • SC=0;
  • 15. • • • • • • • • • • • • • • • • • • • • } delay(50);//for 4ms while(EOC==1); while(EOC==0); OE=1; delay(10);//for 4ms value=MYDATA; OE=0; TR0=0; return(value); } unsigned char *display_numbers(unsigned char abbc) { unsigned char kkk[3],ttt=0; while(ttt<3) { kkk[ttt]=abbc%10; ttt++; abbc=abbc/10; } return(kkk);
  • 16. void main() { unsigned char *bb,temp_resister; initialize(); m1a=0; m1b=0; cmd(0x80); ptr("Temperature= "); TMOD=0X02; //mode 2 TH0=0xfb; IE=0X82; TR0=0; //timer stop cmd(0xc0); bb[0]=0; bb[1]=0; bb[2]=0;