Top Banner
TECHNO INDIA COLLEGE OF TECHNOLOGY New Town, Mega City, Rajarhat, Kolkata – 700156 Department of Electronics and Communication Engineering and Electronics and Instrumentation Engineering PROJECT REPORT ON AUTOMATIC TEMPERATURE CONTROLLER WITH COOLING SYSTEM USING MICROCONTROLLER\ Under the supervision of Mr. Rajib Barui
30
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Automatic Temperature Controller

TECHNO INDIA COLLEGE OF TECHNOLOGY

New Town, Mega City, Rajarhat, Kolkata – 700156

Department of Electronics and Communication Engineering and

Electronics and Instrumentation Engineering

PROJECT REPORT ON

“AUTOMATIC TEMPERATURE CONTROLLER WITH COOLING

SYSTEM USING MICROCONTROLLER”

\

Under the supervision of

Mr. Rajib Barui

Submitted By:

1). Arun Bera 4). Chandra Prakash

2). Sonal Kumar 5). Rakesh Mishra

3). Mukesh Kumar

Page 2: Automatic Temperature Controller

ACKNOWLEDGEMENT

We would like to express our sincere gratitude towards Mr. Rajib Barui, our project guide for his able guidance, comprehensive suggestions and tremendous technical support to make this project a reality.

We also extend our profound gratitude to Dr Sanjib Sil, Head Of Department, ECE, for his comprehensive suggestions and support to complete this project successfully.

We would also like to thank the other faculty members who have helped us whenever we needed any type of assistance.

Date: 06th May, 2011                 

1. Arun Bera

2. Sonal Kumar

3. Mukesh Kumar

4. Chandra Prakash

5. Rakesh Mishra

Page 3: Automatic Temperature Controller

ABSTRACT:-

This project is designed to control the room temperature automatically for those temperature sensitive instruments and any other industrial applications. This circuit comprises of Microcontroller AT89S52, Analog to Digital Converter ADC0804, Temperature sensor LM35, 16×2 LCD, Darlington pair (BC547, SL100), Relay, Buzzer, etc. This circuit displays the current temperature and any change in temperature. This circuit concerns over the room temperature, if the temperature goes over a certain limit which is fixed here at 45° C then the cooler is set ON and it will remain ON until the room temperature drops below 35° C. If the room temperature for any reason does not drop down and crosses certain higher temperature, fixed here at 50° C the alarm will be set ON.

Page 4: Automatic Temperature Controller

INDEX

Sl.No Events Page no.

1 BLOCKDIAGRAM OF PROJECT

2 MICROCONTROLLER

3 ADC 0804

4 TEMPERATURE SENSOR LM-35

5 16×2 LCD

6 DARLINGTON PAIR & BUZZER

7 CIRCUIT DIAGRAM

8 WORKING CIRCUIT

9 PROGRAM

10 CONCLUSION

11 REFERANCE

Page 5: Automatic Temperature Controller

Block Diagram:-

Relay

Darlington pair

Page 6: Automatic Temperature Controller

MICROCONTROLLER AT89S52 :

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8 Kbytes of in-system programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. 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 AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective 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. 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 contents but freezes the oscillator, disabling all other chip functions until the next interrupter hardware reset.

Page 7: Automatic Temperature Controller

Pin Description

VCC: - Supply voltage.

GND: - Ground.

Port 0:-

Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pull-ups are required during program verification.

Port 1:-

Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the low-order address bytes during Flash programming and verification.

Port 2:-

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high

Page 8: Automatic Temperature Controller

by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.

Port 3:-

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups.

RST:-

Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled. ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is

Page 9: Automatic Temperature Controller

weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.

PSEN:-

Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

EA/VPP:-

External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash Programming.

XTAL1:-

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2:-

Output from the inverting oscillator amplifier.

Page 10: Automatic Temperature Controller

ANALOG TO DIGITAL CONVERTER:-

The ADC080X family are CMOS 8-Bit, successive approximation A/D converters which use a modified potentiometric ladder and are designed to operate with the 8080A control bus via three-state outputs. These converters appear to the processor as memory locations or I/O ports, and hence no interfacing logic is required. The differential analog voltage input has good common mode -rejection and permits offsetting the analog zero-input voltage value. In addition, the voltage reference input can be adjusted to allow encoding any smaller analog voltage span to the full 8 bits of resolution.

Features :-• 80C48 and 80C80/85 Bus Compatible - No Interfacing Logic Required

• Conversion Time . . . . . . . . . . . . . . . . . . . . . . . . . . <100μs

• Easy Interface to Most Microprocessors

• Will Operate in a “Stand Alone” Mode

• Differential Analog Voltage Inputs

• Works with Bandgap Voltage References

• TTL Compatible Inputs and Outputs

• On-Chip Clock Generator

• Analog Voltage Input Range

(Single + 5V Supply) . . . . . . . . . . . . . . . . . . . . . . 0V to 5V

• No Zero-Adjust Required.

ADC INTERFACING:

Page 11: Automatic Temperature Controller

TEMPERATURE SENSOR LM-35 :-

General Description

Page 12: Automatic Temperature Controller

The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±1⁄4°C at room temperature and ±3⁄4°C over a full −55 to

+150°C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35’s low output impedance, linear output, and precise inherent calibration make interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 μA from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over a −55° to +150°C temperature range, while

the LM35C is rated for a −40° to +110°C range (−10° with improved accuracy). The LM35 series is available packaged in hermetic TO-46 transistor packages, while the LM35C, LM35CA, and LM35D are also available in the plastic TO-92 transistor package. The LM35D is also available in an 8-lead surface mount small outline package and a plastic TO-220 package.

Features1. Calibrated directly in ° Celsius (Centigrade)2. Linear + 10.0 mV/°C scale factor3. 0.5°C accuracy guarantee able (at +25°C)4. Rated for full −55° to +150°C range5. Suitable for remote applications6. Low cost due to wafer-level trimming7. Operates from 4 to 30 volts8. Less than 60 μA current drain9. Low self-heating, 0.08°C in still air10. Nonlinearity only ±1⁄4°C typical11. Low impedance output, 0.1 W for 1 mA load

LIQUID CRYSTAL DISPLAY(16×LCD) :-

Page 13: Automatic Temperature Controller

FEATURES• 5 x 8 dots with cursor• Built-in controller (KS 0066 or Equivalent)• + 5V power supply (Also available for + 3V)• 1/16 duty cycle• B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)• N.V. optional for + 3V power supply

16×2 LCD INTERFACING:

Page 14: Automatic Temperature Controller

DARLINGTONPAIR :-

Page 15: Automatic Temperature Controller

The Darlington pair is basically a combination of two bipolar transistors connected as shown. In Darlington pair, two transistors connected together so that the current amplified by the first is amplified further by the second transistor. The overall current gain is equal to the two individual gains multiplied together.

Darlington pair current gain, hFE = hFE1* FE2 (hFE1 and hFE2 are the gains of the individual transistors).

To turn on two transistors TR1 and TR2 at the same time there must be 0.7V across base-emitter junctions of both the transistors. To put it simply, 1.4V is required to turn two transistors on at same time.

Darlington pairs are available as complete packages in the market but you can make up your own from two transistors; TR1 can be a low power type, but normally TR2 will need to be high power. The maximum collector current Ic(max) for the pair is the same as Ic(max) for TR2.

Transistor:-1. BC547

2. SL100

BUZZER :- It is an electrical Buzzer.It requires 5v – 12 v for operation.

CIRCUIT DIAGRAM :

Page 16: Automatic Temperature Controller
Page 17: Automatic Temperature Controller

PROGRAM :#include<reg51.h>

#define ldata P0

#define UPTEMP 45

#define DOWNTEMP 35

#define AL 50

sbit rs = P2^3;

sbit rw = P2^2;

sbit en = P2^1;

sbit adc_read= P3^4;

sbit adc_write= P3^3;

sbit adc_intr= P3^5;

sbit output=P3^7;

sbit alarm =P3^6;

bit loadon=0;

void delay(int time)

{

int i,j;

for(i=0;i<127;i++)

{

for(j=0;j<time;j++)

{

Page 18: Automatic Temperature Controller

}

}

}

void lcd_data(unsigned char a)

{

rs=1;

ldata=a;

en=1;

delay(1);

en=0;

delay(1);

}

void lcd_cmd(unsigned char a)

{

rs=0;

ldata=a;

en=1;

delay(1);

en=0;

delay(1);

}

void lcd_string(char *s)

{

while(*s)

{

lcd_data(*s);

Page 19: Automatic Temperature Controller

s++;

}

}

void lcd_init()

{

lcd_cmd(0x38);

lcd_cmd(0x0e);

lcd_cmd(0x01);

lcd_cmd(0x0C);

lcd_cmd(0x80);

}

void main()

{

unsigned char val=0,temp=0;

unsigned int x=0;

float temp1;

output=0;

alarm=1;

rw=0;

lcd_init();

lcd_string(" WELCOME!");

lcd_cmd(0xC0);

lcd_string("TEMP. METER");

adc_read=1;

Page 20: Automatic Temperature Controller

adc_write=1;

delay(1000);

lcd_cmd(0x01);

while(1)

{

delay(100);

adc_read=1;

adc_write=0;

delay(1);

adc_write=1;

while(adc_intr==1);

adc_read=0;

val=P1;

temp1=((float)val/255)*100.00;

x+=(int)temp1;

delay(10);

delay(100);

adc_read=1;

adc_write=0;

delay(1);

adc_write=1;

while(adc_intr==1);

adc_read=0;

val=P1;

temp1=((float)val/255)*100.00;

Page 21: Automatic Temperature Controller

x+=(int)temp1;

delay(10);

delay(100);

adc_read=1;

adc_write=0;

delay(1);

adc_write=1;

while(adc_intr==1);

adc_read=0;

val=P1;

temp1=((float)val/255)*100.00;

x+=(int)temp1;

temp=x/3;

x=0;

if(temp>=UPTEMP && loadon==0)

{

output=1;

loadon=1;

}

if(temp<=DOWNTEMP && loadon==1)

{

output=0;

loadon=0;

}

if(temp>=AL)

{

Page 22: Automatic Temperature Controller

alarm=0;

}

lcd_cmd(0x80);

lcd_string("TEMP= ");

lcd_data((temp/10)%10+48);

lcd_data(temp%10+48);

lcd_string(" DEG. C");

lcd_cmd(0xC0);

if(loadon==1)

{

lcd_string("COOLER ON ");

}

else

{

lcd_string("COOLER OFF");

}

lcd_cmd(0x80);

}

}

Page 23: Automatic Temperature Controller

CONCLUSION :Main features of the circuit are

1) The instrument’s main control circuit employs micro-controller system and large scale integrated circuit. It adopts man-machine dialogue interface and large screen LC character display technology and is prominent in display, convenient in operation and handy.

2) Stable and reliable temperature control system. It has automatic control circuit,

3) Stable and reliable air flow system using fan.

.4)Can be implemented wherever necessary.

FUTURE DEVELOPMENT

• We will also connect an automatic dialer to our Circuit. When the temperature will be so much i.e. greater than certain temp. it will automatically dial a number.

• We will interface a Keyboard so that we can change the range of the temperature in the field i.e. field programmable.

Page 24: Automatic Temperature Controller

BIBLEOGRAPHY

www.wikepedia.com

The 8051 microcontroller by Mazidi and Mazidi

8051 tutorial from www.8052.com

www.datasheets4u.com