TEMPERATURE MEASUREMENT AND CONTROLLER.doc (Size: 458.5 KB / Downloads: 2432)
MICROCONTROLLER BASED TEMPERATURE CONTROLLER
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.
BLOCK DIAGRAM OF THE PROJECT
Â¢ 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
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
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
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
80 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
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.
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 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
Â¢ 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.
Â¢ 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.
Understanding the hardware detail of a 8051 microcontroller
7 segment display interfacing and use of Temperature Sensor
Introduction to DC motor
8051 and embedded system by Mazidi and Mazidi
All datasheets from http://www.datasheetcatalog.com
About AT89s8252 from http://www.atmel.com
About DS1820 from http://www.dallas.com.