temperature measurement and controller

16
MICROCONTROLLER BASED TEMPERATURE CONTROLLER This Project is used to control the Fan speed according to the temperature and it also indicates the temperature. The system will get the temperature from the IC (DS1820) and it will control the speed according the values stored in the code. The System is fully controlled by 8-bit microcontroller. SUBMITTED BY: 1

Upload: bene

Post on 27-Apr-2015

1.167 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Temperature Measurement and Controller

MICROCONTROLLER BASED TEMPERATURE CONTROLLER

This Project is used to control the Fan speed according to the temperature and it also indicates the temperature. The system will get the temperature from the IC (DS1820) and it will control the speed according the values stored in the code. The System is fully controlled by 8-bit microcontroller.

SUBMITTED BY:

1

Page 2: Temperature Measurement and Controller

INTRODUCTION

The aim of this project is to design an ambient temperature measurement circuit. The motivation for doing this project is the fact 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 the project in general. A temperature sensor DS 1820 is used for sensing the ambient temperature. The system will get the temperature from the IC and it will display the temperature over the seven segment display and this temperature was compared with the value stored by the user and if the Room temperature goes beyond the Preset temperature then fan will on and if temperature goes below to a fixed value then heater will on.

8051

HEATER

RELAY

RELAY

PORT 2

P1.1

2

Page 3: Temperature Measurement and Controller

BLOCK DIAGRAM OF THE PROJECT

Hardware Used

Microcontroller AT89S52(8052 derivative)

IC’S 1. DS 1820 (Temperature Sensor) 2. 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 PCB’s.

2.2 Software Used

Keil u-Vision 3.0

3

Page 4: Temperature Measurement and Controller

Keil Software is used provide you with software development tools for 8051 based microcontrollers. With theKeil tools, you can generate embedded applications for virtually every 8051 derivative. The supported microcontrollers are listed in the µ-vision

8051 Burner Software

A BRIEF INTRODUCTION TO 8051 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.

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 Atmel’s 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 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 con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt

4

Page 5: Temperature Measurement and Controller

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 pin diagram of the 8051 shows all of the input/output pins unique to microcontrollers:

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

5

Page 6: Temperature Measurement and Controller

80 bits of general purpose data memory 32 input/output pins arranged as four 8 bit ports:P0-P3 Two 16 bit timer/counters: T0-T1 Two external and three internal interrupt sources Oscillator and clock circuits

For any electronics project the power supply plays a very important role in its proper functioning.In this project we are using external A.C supply (220 v) as input , this high voltage is converted into 12 Volts A.C by step down transformer , then we use voltage regulators and filters with bridge rectifier to convert the A.C into D.C voltage .

For voltage regulation we are using LM 7805 and 7812 to produce ripple free 5 and 12 volts D.C constant supply.

6

Page 7: Temperature Measurement and Controller

7

Page 8: Temperature Measurement and Controller

8

Page 9: Temperature Measurement and Controller

DS 1820 Temperature Sensor:

The DS18S20 digital thermometer provides 9-bit Celsius temperature measurements and has an alarm function with nonvolatile user-programmable upper and lower trigger points. The DS18S20 communicates over a 1-Wire bus that by definition requires only one data line (and ground) for communication with a central microprocessor. It has an operating temperature range of –55°C to +125°C and is accurate to ±0.5°C over the range of –10°C to +85°C. In addition, the DS18S20 can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply.

Each DS18S20 has a unique 64-bit serial code, which allows multiple DS18S20s to function on the same 1-Wire bus. Thus, it is simple to use one microprocessor to control many DS18S20s distributed over a large area. Applications that can benefit from this feature include HVAC environmental controls, temperature monitoring systems inside buildings, equipment, or machinery, and process monitoring and control systems.Figure shows a block diagram of the DS18S20, and pin descriptions are given in the Pin Description table. The 64-bit ROM stores the device’s unique serial code. The scratchpad memory contains the 2-byte temperature register that stores the digital output from the

9

Page 10: Temperature Measurement and Controller

temperature sensor. In addition, the scratchpad provides access to the 1-byte upper and lower alarm trigger registers (TH and TL). The TH and TL registers are nonvolatile (EEPROM), so they will retain data when the device is powered down.

The DS18S20 uses Maxim’s exclusive 1-Wire bus protocol that implements bus communication using one control signal. The control line requires a weak pullup resistor since all devices are linked to the bus via a 3-state or open-drain port (the DQ pin in the case of the DS18S20). In this bus system, the microprocessor (the master device) identifies and addresses devices on the bus using each device’s unique 64-bit code. Because each device has a unique code, the number of devices that can be addressed on one bus is virtually unlimited. The 1-Wire bus protocol, including detailed explanations of the commands and “time slots,” is covered in the 1-Wire Bus System section.

Another feature of the DS18S20 is the ability to operate without an external power supply. Power is instead supplied through the 1-Wire pullup resistor via the DQ pin when the bus is high. The high bus signal also charges an internal capacitor (CPP), which then supplies power to the device when the bus is low. This method of deriving power from the 1-Wire bus is referred to as “parasite power.” As an alternative, the DS18S20 may also be powered by an external supply on VDD.

DS18S20 Block Diagram

10

Page 11: Temperature Measurement and Controller

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.

The bit of a new soldering iron should be clean properly before soldering.

The joint should be heated up to required temperature by which, the solder melts

and comes around the joint. The joint should not be disturbed before setting the

solder. The good joint looks pointed spot.

b.) 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.

c.) DURING TESTING OF PROJECT:

Each component should be checked before checking the project.

Potentiometer should be adjusted at proper range.

Battery of the testing equipment should be properly checked otherwise it will not

measure the actual reading.

11

Page 12: Temperature Measurement and Controller

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.

LEARNING OUTCOMES:

Understanding the hardware detail of a 8051 microcontroller Microcontroller programming 7 segment display interfacing and use of Temperature Sensor Introduction to DC motor

References

“8051 and embedded system” by Mazidi and Mazidi All datasheets from www.datasheetcatalog.com About AT89s8252 from www.atmel.com And www.triindia.co.in About DS1820 from www.dallas.com.

12