Contents:-: Temperature Sensor and Control
Contents:-: Temperature Sensor and Control
Contents:-: Temperature Sensor and Control
CONTENTS:Introduction Temperature Sensor and Control Pin Diagram of Microcontroller Hardware Used Working Circuit Diagram Layout of Circuit Coding Advantages & Application Future development Different Precautions Conclusion Reference
INTRODUCTION :The for aim doing of this this project project is is to design the an fact ambient temperature measurement circuit. The motivation that temperature measurement has become an integral part of any control system operating in a temperature sensitive environment and the various learning outcomes associated during the implementation of the project. In this project the ambient temperature will be displayed on a LCD. An 89s52 Microcontroller will be used for handling all the required computations and control. In following we have briefly discussed details of a Microcontroller and LM the the the project system IC seven and it segment in will will display general. get display and A temperature sensor ambient temperature. the temperature from the temperature over the user.
The
to control temperature. The temperature controller takes an input from a temperature sensor and has an output that is connected to a control element such as a heater or fan.
In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt The hardware is driven by a set of program instructions, or software. Once familiar with hardware and software, the user can then apply the microcontroller to the problems easily.
The following are some of the capabilities of 8051 microcontroller. Internal ROM and RAM I/O ports with programmable pins Timers and counters Serial data communication The 8051 architecture consists of these specific features: 16 bit PC &data pointer (DPTR) 8 bit program status word (PSW) 8 bit stack pointer (SP) Internal ROM 4k Internal RAM of 128 bytes. 4 register banks, each containing 8 registers 0 bits of general purpose data memory
32 input/output pins arranged as four 8 bit ports0-P3 Two 16 bit timer/counters: T0-T1 Two external and three internal interrupt sources Oscillator and clock circuits
Hardware Used: Microcontroller AT89S52(8052 derivative). ICS 1. DS 1820 (Temperature Sensor). LM 7805 (Regulator IC for 5 volts constant D.C supply). LCD For display at remote station. Crystal Oscillator To produce 11.0592 MHz Frequency for microcontroller clock. General Purpose PCBs.2.2 Software Used. Keil u-Vision 3.0: Keil Software is used provide you with software development tools for 8051 based microcontrollers. With the Keil tools, you can generate embedded applications for virtually every 8051 derivative. The supported microcontrollers are listed in the -vision.
WORKING
The main work of the project is to sense the temperature and display it and then control it by using relays. Now to display a temperature we have to just convert the temperature which is analog into a digital quantity by using an analog to digital convertor that is referred as ADC or A/D convertor. To control a temperature sensitive device we refer a range of temperature which with compared by the current temperature that is sensed by the temperature sensor. The temperature based applications are based on mostly on three types these are:1 .Under temperature application 2. Over temperature application 3. Power tripping application Now for an example if equipment is working continuously then it becomes heated. Due to heating the insulation of that particular device is being molten. And now it become slow or we can say that it become less efficient. To prevent this condition we continuously monitor the device temperature. The work of relay to control temperature is depends on the surrounding conditions, like if the device is over heated then the reference range of temperature. At this time we have to avoid the overheating & provide cooling to the device.
But in those countries where the snow fall occurs then the device is become under heating then to avoid this condition we have to provide heating to the device. And if the device exceeds the temperature range which is previously define by us, then the device is being turned OFF or we can say that the device is being tripped. The above discussed three cases are operated by three different relays. One relay provide heating by heater which is connected to the relay; this relay is activated when the UNDER TEMPERATURE condition occur. Once heater is on the device starts heating & works properly as required. The second relay provides cooling to the device by a fan or blower which is connected with relay, this relay activated when over temperature condition occurs. Due to this the device becomes cooled. If the temperature range get out of the range of reference range then required to on the fan or blower. But if in case the fan is not in working condition and the device temperature is exceeds the relay tripped the device to prevent the damage. It is used for safety purpose. In this whole system is using the oscillation frequency 11.0592MHz. all the relays are connected with the transistors at active high mode so as buzzer is also connected in the active high mode with the transistor. Buzzer is blow vary with respect to the temperature change. As the temperature increases the sound of buzzer also increase.
CIRCUIT DIAGRAM:-
LAYOUT OF PCB:-
CODING OF MICROCONTROLLER:#include <89s51.h> #include<stdio.h> #define lcddata P1 #define adcport P2 #define rd P3_5 #define wr P3_6 #define intr P3_7 #define rs P3_4 #define rw P3_3 #define en P3_2 #define pwrtrip P0_0 #define fan P0_1 #define heater P0_2 unsigned int adc_val; void conv();
void read(); void lcd_busy() { unsigned char i,j; for(i=0;i<80;i++) for(j=0;j<80;j++); } void wait(unsigned int time) { unsigned char i,j; for(i=0;i<100;i++) for(j=0;j<time;j++); } void lcd_init() { lcddata=0x38; rs=0; rw=0; en=1; en=0;
lcd_busy(); lcddata=0x0f; rs=0; rw=0; en=1; en=0; lcd_busy(); lcddata=0x01; rs=0; rw=0; en=1; en=0; lcd_busy(); lcddata=0x07; rs=0; rw=0; en=1; lcd_busy(); } void lcd_command(unsigned char var)
{ lcddata=var; rs=0; rw=0; en=1; en=0; lcd_busy(); } void lcd_sendlcddata(unsigned char var) { lcddata=var; rs=1; rw=0; en=1; en=0; lcd_busy(); } void sendstring(unsigned char *var) { while(*var)
lcd_sendlcddata(*var++); lcd_busy(); } void conv() { wr = 0; wr = 1; while(intr); } void read() { rd = 0; adc_val=adcport; rd = 1; } void buzzer(unsigned int pwm) { P0_3=1; wait(pwm); P0_3=0;
wait(pwm); P0_3=1; wait(pwm); P0_3=0; wait(pwm); P0_3=1; wait(pwm); P0_3=0; wait(pwm); P0_3=1; wait(pwm); P0_3=0; wait(pwm); } void sendReading(unsigned int num) { unsigned char t=0,H=0,T=0,U=0; H=(num%1000)/100; T=((num%1000)%100)/10; U=((num%1000)%100)%10; lcd_sendlcddata(H+48); // Hundred's characted
lcd_sendlcddata(T+48); // Ten's character lcd_sendlcddata(U+48); // Unit's character } void main(void) { unsigned int temp; P0=0x00; P2=0xff; lcd_init(); sendstring(" TEMP. DISPLAY "); lcd_busy(); lcd_busy(); lcd_command(0xc0); sendstring("& CONTROL SYSTEM"); lcd_busy(); wait(100); wait(100); wait(100); wait(100); wait(100);
wait(100); wait(100); wait(100); wait(100); wait(100); wait(100); while(1) { lcd_init(); conv(); read(); temp=adc_val;
} if((adc_val>=0x01)&&(adc_val<=0x0f)) // temp between 1-15 { lcd_command(0xc0); sendstring("ACT:"); lcd_busy(); sendstring("POWER HEATER"); lcd_busy(); pwrtrip=0; fan=0; heater=1; buzzer(50); } // audible feedback // switch the // respective device // display active devices // goto 2nd line of LCD
// audible feedback
{ lcd_command(0xc0); // goto 2nd line of LCD sendstring("ACT:"); lcd_busy(); sendstring("POWER lcd_busy(); pwrtrip=0; fan=0; heater=0; P0_3=0; // audible feedback // switch the // respective device "); // display active devices
} else if((adc_val>=0x2e)&&(adc_val<=0x3c)) { lcd_command(0xc0); // goto 2nd line of LCD sendstring("ACT:"); lcd_busy(); sendstring("POWER FAN "); lcd_busy(); pwrtrip=0; fan=1; heater=0; buzzer(100); } else if((adc_val>=0x3d)&&(adc_val<=0x46)) { lcd_command(0xc0); // goto 2nd line of LCD sendstring("ACT:"); lcd_busy(); sendstring("POWER FAN "); // display active devices // audible feedback // switch the // respective device // display active devices
lcd_busy(); pwrtrip=0; fan=1; heater=0; buzzer(50); } else if((adc_val>=0x47)&&(adc_val<=0x50)) { lcd_command(0xc0); // goto 2nd line of LCD sendstring("ACT:"); lcd_busy(); sendstring("POWER FAN "); lcd_busy(); pwrtrip=0; fan=1; heater=0; buzzer(25); } else if((adc_val>=0x51)&&(adc_val<=0x5a)) { // audible feedback // switch the // respective device // display active devices // audible feedback // switch the // respective device
// audible feedback
else if((adc_val>=0x5b)&&(adc_val<=0x6f)) { lcd_command(0xc0); // goto 2nd line of LCD sendstring("ACT:"); lcd_busy(); sendstring("POWER OFF"); lcd_busy(); pwrtrip=1; fan=0; // switch the // respective device // display active devices
heater=0; P0_3=1; } else { sendstring("SEARCHING."); lcd_busy(); wait(100); sendstring("."); lcd_busy(); wait(100); sendstring("."); lcd_busy(); wait(100); sendstring("."); lcd_busy(); wait(100); sendstring("."); lcd_busy(); wait(100); // audible feedback
sendstring("."); lcd_busy(); wait(100); sendstring("."); lcd_busy(); lcd_command(0xc0); sendstring("NO/INVALID DATA"); lcd_busy(); wait(100); wait(100); wait(100); pwrtrip=1; fan=0; heater=0; P0_3=0; } } } // switch the // respective device // goto 2nd line of LCD
FUTURE DEVELOPMENT:
We can monitor parameters like humidity, light and at the same time control them. We can send this data to remote location using mobile or internet. We can draw graphs of variations in these parameters using computer.
DIFFERENT PRECAUTIONS
DURING SOLDERING:
The bit of soldering iron should be kept clean with the help
required.
If there is a fault in the circuit, then firstly we should
project.
Potentiometer should be adjusted at proper range.
Testing equipment should be in proper range when output measured at any point of the circuit, or component. Otherwise testing equipment may be showed the wrong reading.
CONCLUSION
REFERENCE:8051 and embedded system by Mazidi and Mazidi All datasheets from http://www.datasheetcatalog.com About AT89s8252 from http://www.atmel.com And http://www.triindia.co.in About DS1820 from http://www.dallas.com. And from www.seminarprojects.com