Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Contents:-: Temperature Sensor and Control

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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.

35 is used for sensing the

The

this temperature was compared with the value stored by

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

TEMPERATURE SENSING & CONTROL


What is a temperature sensor?
An analog temperature sensor is pretty easy to explain, its a chip that tells you what the ambient temperature is! These sensors use a solid-state technique to determine the temperature. That is to say, they dont use mercury (like old thermometers), bimetallic strips (like in some home thermometers or stoves), nor do they use thermostats (temperature sensitive resistors). Instead, they use the fact as temperature increases, the voltage across a diode increases at a known rate. By precisely amplifying the voltage change, it is easy to generate an analog signal that is directly proportional to temperature. There have been some improvements on the technique but, essentially that is how temperature is measured. Because these sensors have no moving parts, they are precise, never wear out, don't need calibration, work under many environmental conditions, and are consistent between sensors and readings. Moreover they are very inexpensive and quite easy to use.

What is a Temperature Controller?


As the name implies a temperature controller is an instrument used

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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.

How do Temperature Controllers work?


To accurately control process temperature without extensive operator involvement, a temperature control system relies upon a controller, which accepts a temperature sensor such as a thermocouple or RTD as input. It compares the actual temperature to the desired control temperature, or set point, and provides an output to a control element. The controller is one part of the entire control system, and the whole system should be analyzed in selecting the proper controller. A temperature control system is a programmable thermostat that can keep the home or office at a desired temperature regardless of fluctuating exterior conditions. The advantage of having a temperature control system over a common thermostat is that it can save energy and money by automatically maintaining different temperatures at different times of the day and night.

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

BRIEF INTRODUCTION TO MICROCONTROLLER


When we have to learn about a new computer we have to familiarize about the machine capability we are using, and we can do it by studying the internal hardware design (devices architecture), and also to know about the size, number and the size of the registers. A microcontroller is a single chip that contains the processor (the CPU), non-volatile memory for the program (ROM or flash), volatile memory for input and output (RAM), a clock and an I/O control unit. Also called a "computer on a chip," billions of microcontroller units (MCUs) are embedded each year in a myriad of products from toys to appliances to automobiles. For example, a single vehicle can use 70 or more microcontrollers. The following picture describes a general block diagram of microcontroller.

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

89s52: The AT89S52 is a low-power, high-performance


CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel's AT89S52 is a powerful microcontroller which provides a highly-flexible and costeffective solution to many embedded control applications.
The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, Two data pointers, Three 16-bit timer/counters, A six-vector two-level interrupt architecture, A full duplex serial port, On-chip oscillator, and Clock circuitry.

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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

The following Figure shows PIN Diagram of AT89S52 Microcontroller:-

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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.

8051 Burner Software

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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.

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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.

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

CIRCUIT DIAGRAM:-

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

LAYOUT OF PCB:-

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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();

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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;

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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)

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

{ 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)

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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;

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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);

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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<=0x6f)) // temp between 1-100

{ sendstring("SYS. TEMP. "); lcd_busy(); sendReading(temp); lcd_busy(); // display temperature

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

} 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

else if((adc_val>=0x10)&&(adc_val<=0x19)) // temp between 16-25

{ lcd_command(0xc0); // goto 2nd line of LCD sendstring("ACT:"); lcd_busy();

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

sendstring("POWER HEATER"); lcd_busy(); pwrtrip=0; fan=0; heater=1; buzzer(100); }

// display active devices

// switch the // respective device

// audible feedback

else if((adc_val>=0x1a)&&(adc_val<=0x2d)) // temp between 26-45

{ 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

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

} 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

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

lcd_command(0xc0); // goto 2nd line of LCD sendstring("ACT:"); lcd_busy();

sendstring("POWER FAN "); lcd_busy(); pwrtrip=0; fan=1; heater=0; buzzer(10); }

// display active devices

// 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

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

ADVANTAGES & APPLICATIONS:


This project can be used in Home. This project can be used in Industry. This will help in saving the electricity / energy.

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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.

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

DIFFERENT PRECAUTIONS
DURING SOLDERING:
The bit of soldering iron should be kept clean with the help

of file at time to time.


The solder wire should be of smaller thickness. We should not use extra solder because it may be a cause

of short circuit in the conductive path.


The components should not be overheated. The leads of the components should be clean before

soldering, by the send paper.

DURING USING POWER SUPPLY:


switches and fuses should be used in a project circuit. Earthing is essential in wiring. We should use insulated wires. Power supply should be switched off, when it is not -

required.
If there is a fault in the circuit, then firstly we should

repair it. After repairing it connect again the power supply.

DURING TESTING OF PROJECT:


Each component should be checked before checking the

project.
Potentiometer should be adjusted at proper range.

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

Battery of the testing equipment should be properly

checked otherwise it will not measure the actual reading.

The components, which are not doing function properly,


should be changed as soon as possible; otherwise, other components may also be damaged by it.

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.

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

CONCLUSION

TEMPERATURE SENSOR AND CONTROL

PROJECT REPORT (2011-2012)

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

You might also like