SlideShare a Scribd company logo
1 of 50
THIRU SEVEN HILLS POLYTECHNIC COLLEGE
MADURAVOYAL, CHENNAI – 600095.
DEPT. OF ELECTRONICS & COMMUNICATION ENGINEERING
PROJECT REPORT 2003-2004
PROJECT REPORT
ON
ELECTRONIC THERMOMETER USING
MICROCONTROLLER
SUBMITTED BY
R.ANAND BALAN
S.BALAJI
D.RAJESH PANDIYAN
K.B.RAJKUMAR
T.SUBRAMANIA SIVA
S.SUNIL
THIRU SEVEN HILLS POLYTECHNIC COLLEGE
CHENNAI – 600 095
DEPT. OF ELECTRONICS & COMMUNICATION ENGINEERING
BONAFIDE CERTIFICATE
This is to certify that this ELECTRONIC THERMOMETER USING
MICROCONTROLLER is a bonafide record of project work carried
out by Mr. D.RAJESH PANDIYAN REG.NO: 2143127 of III year, Sixth
Semester in Electronics & Communication Engg. had successfully
Completed the entitled. In partial fulfillment for the award of
Diploma in Electronics & Communication Engg. Under my
supervision during the academic year 2003-2004.
Guide H.O.D
Submitted for the exam held on______________________________________
Internal Examiner External Examiner.
ACKNOWLEDGEMENT
We render our profound and heart felt gratitude to our
principal Mrs. Premalatha Kanikannan, B.E., M.B.A., Thiru
Seven Hills Polytechnic College, Chennai for the encouragement
and co-operation for accomplishing our project entitled
ELECTRONIC THERMOMETER USING MICROCONTROLLER.
We thank our H.O.D. Mr.V.ELANGOVAN, D.E.C.E., MISTE
for allowing us to under take the object.
We thank our Internal guide Mr.V.ELANGOVAN, for his
sustained guidelines and encouragement. His constant
enthusiasm showed us the path to achieve this cherished goal.
We express our sincere thanks to Mr.G.SARAVANAN who
provided us with his expertise.
We also reveal our sincere thanks to all faculty members of
E.C.E. Department whose suggestions and teaching brought the
comprehensive in us to complete this project.
We would like to take this opportunity to thank our
friends for their endurance, patience and support in achieving
our ambition.
We will remain with gratitude to our parents, lecturers,
non-teaching staff and management forever.
CONTENTS
 INTRODUCTION
 REGULATED POWER SUPPLY
 OVERVIEW OF MICROCONTROLLER
 PERIPHERAL INTERFACE
 ADC 804
 DISPLAY INTERFACE
 TEMP. TRANSDUCER
 FUNCTIONAL BLOCK DIAGRAM OF CIRCUIT
 OPERATION OF ADC CIRCUITS
 ADC PROGRAM
 MEASURING,PROGRAM AND DISPLAY
 BIBLIOGRAPHY
 CONCLUSION
INTRODUCTION
Temperature is the most important variable in industrial processing,
primarily because it is the fundamental condition characteristic of the
thermal state of the body. Consequently it is most important that the
various ways of measuring temperature be well mastered and the
advantages and disadvantages of each method we well understood and the
operating limitation in terms of time of response, temperature range
distance of operation and compatibility with other control etc. should be
considered for each installation and measurement. There are two types of
measurement 1. Non-electrical method (e.g. Glass thermometer) and 2.
electrical method (e.g. Digital thermometer, thermo couples and RTDs)
THERMO COUPLES
Thermocouple is a device that converts thermal energy to electric
voltage when there is a temperature difference between the ends of a pair
of dissimilar metals. One end of the pair is fused together to form a hot
junction, and the other end called the cold junction is connected to the
measuring instrument. The open circuit voltage developed is a function of
the Seebeck coefficient for the two metals and is proportional to the
temperature difference. The Seebeck effect refers to the set conversion of
thermal energy to voltage under zero current conditions. The direction and
magnitude of the voltage depends on the metals making up the junction
and the temperatures of the junctions. As opposed to the Seebeck effect if a
current is passed through junctions made of two dissimilar metals, heat is
absorbed in one junction and liberated in the other. When current is
flowing in the same direction as the seebeck current heat is absorbed at the
hot junction and liberated at the cold junction. This is known as peltier
effect and is utilized in thermoelectric refrigeration and heating.
Peltier thermoelectric heating is different from Joule heating. Joule
heating is given by i²R and so depends on the resistance of the wires
making up the circuit.
In our project we are using encapsulatedAD590 temperature
transducer as an input device.
REGULATED POWER SUPPLY
Since a power supply is a vital part of all electronic system, it has to
be discussed. Most digital IC, including microprocessor and memory ICs,
operate on a ±15 supplies. Therefore, the power supply presented in this
section will have ±5 and ±12v.
Consider how the ± 12V supply voltage are obtained in circuit as
shown in the diagram, the 7812 is a +12V regulator, 7912 is a -12V regulator
and both can deliver output current excess of 1.0A. They will hence
perform satisfactorily in the circuit as shown in the diagram by providing
±12V at 0.500A. However since the drop out voltage (Vin-V0) is 2V, the
input voltage for these 7812 must be at least +15v and -15v for 7915. This
means that the rectified peak voltage must be greater than +15V and -15V
which in turn implies that the secondary voltage must be greater than 30V
peak or 24V rms. Since we are using center-tapped (CT) transformer, the
voltage across them will be satisfied.
Finally, the size of the filter capacitor depends on the secondary
current of the transformer. As per thumb rule, a 1500 μfd capacitor should
be used for each ampere of current. The working voltage rating (WVDC) of
the capacitor, depends on the peak rectified output voltage and must be at
least 20% higher than the peak value of the voltage it is expected to charge
to.
The circuit arrangement of ±5V is similar as ±12V except the
regulator 7805 and the power supply transformer (0-9) V additional filter
capacitor provided at the regulator output.
MICRO CONTROLLER
A By – product of microprocessor development was the
microcontroller. Microcomputers are also known as single chip
microcontrollers.
Nowadays the conventional pneumatic controllers are replaced by
electronic controllers built using high speed microprocessors and personal
computers.
Microcontroller / Microcomputers offer more advantages than the
conventional microprocessors for performing dedicated jobs. These ICs are
also cost effective and could be used for any applications such as process
control equipments, dot matrix Printers, PLCs etc., For the Present work,
microcontroller 8051 is made use of. This has timers and I/O ports needed
for the work.
INTRODUCTION TO 8051:
The 8051 is one of the most popular microcontrollers in use today.
Many derivative microcontrollers have since been developed that are based
on—and compatible with--the 8051. Thus, the ability to program an 8051 is
an important skill for anyone who plans to develop products that will take
advantage of microcontrollers.
The 8051 has three very general types of memory. To effectively
program the 8051 it is necessary to have a basic understanding of these
memory types.
On-Chip Memory refers to any memory (Code, RAM, or other) that
physically exists on the microcontroller itself. On-chip memory can be of
several types
External Code Memory is code (or program) memory that resides off-
chip. This is often in the form of an external EPROM.
External RAM is RAM memory that resides off-chip. This is often in the
form of standard static RAM or flash RAM.
Register Banks
The 8051 uses 8 "R" registers which are used in many of its
instructions. These "R" registers are numbered from 0 through 7 (R0, R1, R2,
R3, R4, R5, R6, and R7). These registers are generally used to assist in
manipulating values and moving data from one memory location to
another. For example, to add the value of R4 to the Accumulator, we would
execute the following instruction:
ADD A, R4
However, as the memory map shows, the "R" Register R4 is really part of
Internal RAM. Specifically, R4 is address 04h. This can be see in the bright
green section of the memory map. Thus the above instruction accomplishes
the same thing as the following operation:
ADD a, 04 h This instruction adds the value found in Internal RAM address
04 h to the value of the Accumulator, leaving the result in the Accumulator.
Since R4 is really Internal RAM 04h, the above instruction effectively
accomplished the same thing. But watch out! As the memory map shows,
the 8051 has four distinct register banks. When the 8051 is first booted up,
register bank 0 (addresses 00h through 07h) is used by default. However,
your program may instruct the 8051 to use one of the alternate register
banks; i.e., register banks 1, 2, or 3. In this case, R4 will no longer be the
same as Internal RAM address 04h. For example, if your program instructs
the 8051 to use register bank 3, "R" register R4 will now be synonymous
with Internal RAM address 1Ch. The concept of register banks adds a great
level of flexibility to the 8051, especially when dealing with interrupts.
However, always remember that
the register banks really reside in the first 32 bytes of Internal RAM.
Special Function Register (SFR) Memory
Special Function Registers (SFRs) are areas of memory that
control specific functionality of the 8051 processor. For example, four SFRs
permit access to the 8051’s 32 input/output lines. Another SFR allows a
program to read or write to the 8051’s serial port. Other SFRs allow the user
to set the serial baud rate, control and access timers, and configure the
8051’s interrupt system. When programming, SFRs have the illusion of
being Internal Memory.
The Program Counter (PC)
The Program Counter (PC) is a 2-byte address which tells the 8051 where
the next instruction to execute is found in memory. When the 8051 is
initialized PC always starts at 0000h and is incremented each time an
instruction is executed. It is important to note that PC isn’t always
incremented by one. Since some instructions require 2 or 3 bytes the PC
will be incremented by 2 or 3 in these cases. The Program Counter is special
in that there is no way to directly modify its value. That is to say, you can’t
do something like PC=2430h. On the other hand, if you execute LJMP 2340h
you’ve effectively accomplished the same thing. It is also interesting to note
that while you may change the value of PC (by executing a jump
instruction, etc.) there is no way to read the value of PC.
Interrupts
An interrupt is a special feature which allows the 8051 to provide
the illusion of "multitasking," although in reality the 8051 is only doing one
thing at a time. The word "interrupt" can often be substituted with the word
"event." An interrupt is triggered whenever a corresponding event occurs.
When the event occurs, the 8051 temporarily puts "on hold" the normal
execution of the program and executes a special section of code referred to
as an interrupt handler. The interrupt handler performs whatever special
functions are required to handle the event and then returns control to the
8051 at which point program execution continues as if it had never
been interrupted.
Interrupt Priorities
The 8051 offers two levels of interrupt priority: high and low. By
using interrupt priorities you may assign higher priority to certain interrupt
conditions. For example, you may have enabled Timer 1 Interrupt which is
automatically called every time Timer 1 overflows. Additionally, you
may have enabled the Serial Interrupt which is called every time a character
is received via the serial port. However, you may consider that receiving a
character is much more important than the timer interrupt. In this case, if
Timer 1 Interrupt is already executing you may wish that the serial
interrupt itself interrupts the Timer 1 Interrupt. When the serial interrupt is
complete, control passes back to Timer 1 Interrupt and finally back to the
main program. You may accomplish this by assigning a high priority to the
Serial Interrupt and a low priority to the Timer 1 Interrupt.
Instruction Set, Timing, and Low-Level Info
In order to understand--and better make use of--the 8051, it is
necessary to understand some underlying information concerning timing.
The 8051 operates based on an external crystal. This is an electrical device
which, when energy is applied, emits pulses at a fixed frequency. One can
find crystals of virtually any frequency depending on the application
requirements. When using an 8051, the most common crystal frequencies
are 12 megahertz and 11.059 megahertz--with 11.059 being much more
common. Why would anyone pick such an odd-ball frequency? There’s a
real reason for it--it has to do with generating baud rates and we’ll talk
more about it in the Serial Communication chapter. For the remainder of
this discussion we’ll assume that we’re using an 11.059 MHz crystal.
Microcontrollers (and many other electrical systems) use crystals to
synchronize operations. The 8051 uses the crystal for precisely that: to
synchronize its operation. Effectively, the 8051 operates using what are
called "machine cycles." A single machine cycle is the minimum amount of
time in which a single 8051 instruction can be executed. Although many
instructions take multiple cycles. A cycle is, in reality, 12 pulses of the
crystal. That is to say, if an instruction takes one machine cycle to execute, it
will take 12 pulses of the crystal to execute. Since we know the crystal is
pulsing 11,059,000 times per second and that one machine cycle is 12 pulses,
we can calculate how many instruction cycles the 8051 can execute per
second: 11,059,000 / 12 = 921,583 This means that the 8051 can execute
921,583 single-cycle instructions per second. Since a large number of 8051
instructions are single-cycle instructions it is often considered that the 8051
can execute roughly 1 million instructions per second, although in reality it
is less--and, depending on the instructions being used, an estimate of about
600,000 instructions per second is more realistic. For example, if you are
using exclusively 2-cycle instructions you would find that the 8051 would
execute 460,791 instructions per second.
The 8051 also has two really slow instructions that require a full 4
cycles to execute--if you were to execute nothing but those instructions
you’d find performance to be about 230,395 instructions per second. It is
again important to emphasize that not all instructions execute in the same
amount of time. The fastest instructions require one machine cycle (12
crystal pulses), many others require two machine cycles (24 crystal pulses),
and the two very slow math operations require four machine cycles (48
crystal pulses).
Timers
The 8051 comes equipped with two timers, both of which may be
controlled, set, read, and configured individually. The 8051 timers have
three general functions:
1) Keeping time and/or calculating the amount of time between events,
2) Counting the events themselves
3) Generating baud rates for the serial port. The three timer uses are distinct
so we will talk about each of them separately. A timer is always
incremented by the microcontroller.
USING TIMERS AS EVENT COUNTERS
We've discussed how a timer can be used for the obvious
purpose of keeping track of time. However, the 8051 also allows us to use
the timers to count events. Temperature sensor placed on a hot surface that
would send a pulse every time depends upon the change in temperature.
This could be used to determine the temperature. We could attach this
sensor to one of the 8051's I/O lines through proper interface and constantly
monitor it, detecting when it pulsed high and then incrementing our
counter when it went back to a low state.
Writing to the Serial Port
Once the Serial Port has been properly configured as explained
above, the serial port is ready to be used to send data and receive data. If
you thought that configuring the serial port was simple, using the serial
port will be a breeze. To write a byte to the serial port one must simply
write the value to the SBUF (99h) SFR. For example, if you wanted to send
the letter "A" to the serial port, it could be accomplished as easily as:
MOV SBUF, #’A’
Upon execution of the above instruction the 8051 will begin transmitting
the character via the serial port. Obviously transmission is not
instantaneous--it takes a measurable amount of time to transmit. And since
the 8051 does not have a serial output buffer we need to be sure that a
character is completely transmitted before we try to transmit the next
character. The 8051 lets us know when it is done transmitting a character by
setting the TI bit in SCON. When this bit is set we know that the last
character has been transmitted and that we may send the next character, if
any. Consider the following code segment:
CLR TI; be sure the bit is initially clear
MOV SBUF, #’A’; Send the letter ‘A’ to the serial port
JNB TI, $; Pause until the RI bit is set. The above three instructions will
successfully transmit a character and wait for the TI bit to be set before
continuing. The last instruction says "Jump if the TI bit is not set to $"--
$, in most assemblers, means "the same address of the current instruction."
Reading the Serial Port
Reading data received by the serial port is equally easy. To
read a byte from the serial port one just needs to read the value stored in
the SBUF (99h) SFR after the 8051 has automatically set the RI flag in
SCON. For example, if your program wants to wait for a character to be
received and subsequently read it into the Accumulator, the following code
segment may be used: JNB RI, $; Wait for the 8051 to set the RI flag MOV
A, SBUF; Read the character from the serial port The first line of the above
code segment waits for the 8051 to set the RI flag; again, the 8051 sets the RI
flag automatically when it receives a character via the serial port. So as long
as the bit is not set the program repeats the "JNB" instruction continuously.
Once the RI bit is set upon character reception the above condition
automatically fails and program flow falls through to the "MOV"
instruction which reads the value.
PIN DIAGRAM OF 8051
MEMORY MAPPING
The 8051 memory register map is shown in the diagram. The 8051 internal 4K
ROM and 128 byte RAM, including the special function registers, are shown in the
diagram. The 8051 can address external memory if there is not enough internal RAM
and /or ROM. When used to address external memory, two ports provide the
memory addressing. The 8051 addresses two separate memory spaces.
The 8051 uses one memory space for storing programs and the other for storing
variable data. The program memory space is a read only space. One can read
program instructions from this space, but the processor cannot write data into or read
data from these memory locations. The 8051 internal ROM is in program memory
space. All instruction fetches are taken from the program memory space.
The data memory space is read-write memory space. The processor can read
data from this memory space and can write data to this memory space. It cannot
execute program functions from this memory space. The 8051 internal RAM is in this
memory space.
The 128 bytes of internal RAM (memory locations 00H to 7 FH) provide
general read write data storage. Although we say the 8051 has 128 bytes of internal
RAM. Part of this memory space is often referred to as general-purpose registers.
It is important that the 8051 internal RAM is often referred to as registers.
The 8051 also has 22 special –function registers which are not part of the
128 byes of internal RAM. The 8051 special – function registers occupy data memory
space from 80H to F8H. Although addressable as memory locations, these registers
must be used for their intended purpose.
If more program memory is needed, the 4-Kbyte, memory can be
expanded by an additional 60 K bytes giving the 8051 a full 64-K bytes program
memory space. If the 8051 EA pin is asserted (Connected to ground) the 8051 does
not use the internal 4K ROM. The external memory must start at memory location
0000H and can be up to a full
64 K bytes.
If more RAM are needed add external data memory. AS shown in the diagram
full use of all 64 Kbytes of the external memory address space also possible. This is,
this memory is addressed separately from the internal 128 bytes of RAM.
Although the 8051 normally operates with separate program memory and data
memory space, there are applications where it is desirable to have these work as
common memory when this is done, the 8051 only has 64 K bytes of total external
memory. However, when used in this configuration, the 8051 can input a block of
data through its serial communications port, load that data into memory, and then
execute that data as a program. This is called a downloaded program. It is a very
common technique used to change the program operating in a remote
microprocessor-based controller.
PROGRAMMABLE PERIPHERAL INTERFACE 8255
A PPI (Programmable peripheral Interface) is a multi port device. The ports
may be programmed in a variety of ways as required by the programmer. The device
is very useful for interfacing peripheral device.
The INTEL 8255 is a PPI. It has 2 versions namely the INTEL 8225A and the
INTEL 8225A-5. General descriptions of both are same. There are some differences
in their electrical characteristics. Hereafter they will be referred to as 8255. Its main
functions are to interface peripheral devices to the microcomputer. It has three 8 bit
ports namely, port A, Port B and Port C. The port C has been further divided into
two 4 ports. Port C upper and port C lower. Thus a total of 4 ports are available, tow
8 bit ports and two 4 bits ports. Each can be programmed as either input port or an
output port.
FEATURES OF 8255
The 8255 is a 40-pin DIP chip. It has three separately accessible ports. The
ports are each 8-bit, and are named A, B, and C. The individual ports of the 8255 can
be programmed to be input or output, and can be changed dynamically. In addition,
8255 ports have handshaking capability, thereby allowing interface with devices that
also have handshaking signals, such as printers.
PA0 –PA7
The 8-bit port A can be programmed as all input, or as all output, or all bits as
bidirectional input/output.
PB0 – PB7
The 8-bit port B can be programmed as all input or as all output. Port B cannot
be used as a bidirectional port.
PC0 – PC7
This 8-bit port C can be all input or output. It can also be split into two parts,
CU (upper bits PC4 – PC&) and CL (Lower bits PC0 – PC3). Each can be used for
input or output. In addition, any of bits PC0 to PC7 can be programmed
individually.
RD and WR
These two active-low control signals are inputs to the 8255. The RD and WR
signals from the 8031/51 are connected to these inputs.
D0 – D7 data pin
The data pins of the 8255 are connected to the data pins of the microcontroller
allowing it to send data back and forth between the controller and the 8255 chip.
RESET
This is an active-high signal input into the 8255 used to clear the control
register. When RESET is activated, all ports are initialized as input ports. In many
designs this pin is connected to the RESET output of the system bus or grounded to
make it inactive. Like all IC input pins, it should not be left unconnected.
A0, A1, and CS
While CS (Chip Select) selects the entire chip, it is A0 and A1 that select
specific ports. These three pins are used to access ports A, B, C or the control register
according to the pin diagram. Note that CS is active low.
CONTROL WORD
According to the requirement, a port can be programmed to act either as an
input port or an output port. For programming the ports of 8255 a control word is
formed. The bits of control word. The word is written into the control word register
which is within 8255. No read operation of the control word register is allowed. The
control word bit corresponding to a particular port is set to either 1 or 0 depending
upon the definition of the port.
MODE SELECTION OF THE 8255
While ports A, B, and C are used to input or output data, it is the control
register that must be programmed to select the operation mode of the three ports.
The ports of the 8255 can be programmed in any of the following modes.
1. Mode 0, simple I/O mode. In this mode, any of the ports, A, B, CL, and CU can
be programmed as input or output. In this mode, all bits are out or all are in.
In other words, there is no such thing as single-bit control as we have seen in
P0 – P3 of the 8051. Since the vast majority of applications involving the 8255
use this simple I/O mode, we will concentrate on this mode in this chapter.
2. Mode 1. In this mode, ports A and B can be used as input or output ports with
handshaking capabilities. Handshaking signals are provided by the bits of
port C. The details of this mode are discussed in the third section of this
chapter.
3. Mode 2. In this mode, port A can be used as a bidirectional I/O port with
handshaking capabilities whose signals are provided by port C. Port B can be
used either in simple I/O mode or handshaking mode1. This mode will not be
explored further in this book.
4. BSR (bit set/reset) mode. In this mode, only the individual bits of port C can
be programmed. This mode is discussed further in the third section of this
chapter
CONNECTING THE 8051 TO 8255
The 8255 chip is programmed in any of the 4 modes mentioned earlier by
sending a byte (Intel calls it a control word) to the control register of the 8255. We
must first find the port addresses assigned to each of ports A, B, C, and the control
register. This is called mapping the I/O port.
The 8255 is connected to an 8051 as if it is RAM memory. Notice the use of RD
and WR signals. This method of connecting an I/O chip to a CPU is called Memory;
mapped I/O, since it is mapped into memory space. In other words, we use memory
space to access I/O devices. For this reason we use instructions such as MOVX to
access the 8255. We used MOVX to access RAM and ROM. For an 8255 connected to
the 8051 we must also use the MOVX instruction to communicate with it.
EPROM 27C256
EPROM was invented to allow making changes in the contents of PROM after
it is burned. In EPROM, one can program the memory chip and erase it thousands of
times. This is especially necessary during development of the prototype of a
microprocessor-based project. A widely used EPROM is called UV- EPROM where
UV stands for ultra-violet. The only problem with UV – EPROM is that erasing its
contents can take up to 20 minutes. All UV-EPROM chips have a window that is
used to shine ultraviolet (UV) radiation to erase its contents. For this reason, EPROM
is also referred to as UV – erasable EPROM or simply UV-EPROM.
To program a UV-EPROM chip, the following steps must be taken:
1. Its contents mu7st be erased. To erase a chip, it is removed from its socket on
the system board and placed in EPROM erasure equipment to expose it to UV
radiation for 15 – 20 minutes.
2. Program the chip. To program a UV-EPROM chip, place it in the ROM burner
(programmer). To burn code or data into EPROM type. This voltage is referred
to as Vpp in the UV-EPROM data sheet.
3. place the chip back into its socket on the system board
As can be seen from the above steps, in the same way that there is an
EPROM programmer (burner), there is also separate EPROM erasure
equipment. The main problem, and indeed the major disadvantage of
UV-EPROM, is that it cannot be programmed while in the system
board.
SRAM 62256
Storage cells is static RAM memory are made of flip-flops and therefore do not
require refreshing in order to keep their data. This is in contrast to DRAM, discussed
below. The problem with the use of flip-flops for storage cells is that each cell
requires at least 6 transistors to build, and the cell holds only 1 bit of data. In recent
years, the cells have been made of 4 transistors, which still is too many. The use of 4-
transistor cells plus the use of CMOS technology has given birth to a high-capacity
SRAM, but its capacity is far below DRAM. WE are write enable, and OE is output
enable, for read and writes signals respectively.
SERIAL INTERFACE MAX 232
Serial interface is required to communicate with 8051. We need line driver to
convert RS232 signal to TTL voltage levels that will be acceptable to the 8051,TXD
and RXD pins. One such converter is MAX 232 we are using in our circuit. One
advantage of the MAX 232 chip is that it uses a +5V power source same as 8051.
The MAX 232 has two sets of line drivers for transferring and receiving the data. For
many applications,only one set is used. MAX 232 requires four capacitors ranging
from 1 to 22 mfd. Most widely used capacitor is 22mfd.
DECODER 74138
The simplest method of decoding is the usage of NAND gate. The 74138 is 3-8
decoder. The three inputs are A,B and C generates 8 active low output of Y0 to Y7.
each y output is connected to cs of a memory chip allowing control of 8 memory
blocks by a single 74138 IC.
ADDRESS/DATA MULTIPLEXING 74373
The PC of 8051 is 16 bit which is capable of accessing 64kb of program code.
Pins PO 0 to PO 7 are used for both address and data path. This is called address/data
multiplexing for decoding these we are using 74373 as an I/O Interface. So this 74373
receives data from 8051 and demultiplexer.
BLOCK DIAGRAM OF ADC 804
ADC 804 CHIPS
The ADC 804 IC is an analog-to-digital converter it works with +5 volts and
has a resolution of 8 bits. In addition to resolution, conversion time is another major
factor in judging an ADC. Conversion time is defined as the time it takes the ADC to
convert the analog input to a digital (binary) number. In the ADC 804, the
conversion time varies depending on the clocking signals applied to the CLK R and
CLK IN pins, but it cannot be faster than 110 mS. The ADC 804 pin descriptions
follow.
CS
Chip select is an active low input used to activate the ADC 804 chip. To access
the ADC 804, this pin must be low.
RD (read)
This is an input signal and is active low. The ADC converts the analog input
to its binary equivalent and holds it in an internal register. RD is used to get the
converted data out of the ADC 804 chip. When
CS = 0, if a high-to-low pulse is applied to the RD pin, the 8-bit digital output shows
up at the D0 – D7 data pins. The RD pin is also referred to as output enable.
WR (write; a better name might be “start conversion”)
This is an active low input used to inform the ADC 804 to start the conversion
process. If CS = 0 when WR makes a low-to-high transition, the ADC 804 starts
converting the analog input value of Vin to an 8-bit digital number. The amount of
time it takes to convert varies depending on the CLK IN and CLK R values explained
below. When the data conversion is complete, the INTR pin is forced low by the
ADC 804.
CLK IN AND CLK R
CLK IN is an input pin connected to an external clock source when an external clock
is used for timing. However, the 804 has an internal clock generator. To use the
internal clock generator (also called self-clocking) of the ADC 804, the CLK In and
CLK R pins are connected to a capacitor and a resistor. In that case the clock
frequency is determined by the equation:
F = 1/1.1 RC
Typical values are R = 10K ohms and C = 150 pF. Substitution in the above equation,
we get f = 606 k Hz. In that case, the conversion time is 110 µs.
8051 INTERFACING TO ADC 804, SENSORS
This section will explore interfacing ADC (analog-to-digital
converter chips and temperature sensors to the 8051. First, we describe ADC chips,
and then show how to interface an ADC to the 8051.
ADC devices
Analog-to-digital converters are among the most widely used devices for data
acquisition. Digital computers use binary (discrete) values, but in the physical world
everything is analog (continuous). Temperature, pressure, humidity, and velocity are a
few examples of physical quantities that we deal with every day. A physical quantity
is converted to electrical (voltage, current) signals using a device called a transducer.
Transducers are also referred to as sensors. These sensors are converting natural
quantities to an output that is voltage (or current). Therefore, we need an analog-to-
digital converter to translate the analog signals to digital numbers so that the
microcontroller can read them. A widely used ADC chip is the ADC 804.
ADC CONNECTION TO THE 8255
The following is a program for the ADC connected to the 8255 as shown in the
diagram.
MOV A, # 80H ; control word for PA=OUT, PC=IN
MOV R1, K#CRPORT ; control reg port address
MOVX @R1, A ; configure PA=OUT AND PC=IN
Back: MOV R1, #CPORT ; Load port C address
MOVX A, @R1 ; read port c to see if ADC is ready
ANL A, #00000001B ; mask all except PC0
JNZ Back ; keep monitoring PCO FOR EOC
; end of conversation, now get ADC data
MOV R1, # APORT ; load PA address
MOVX A, @R1 ; A=analog data input
LCD CONNECTION TO THE 8255
In the following diagram shows how to issue commands and data to an LCD
connected to an 8255. In the diagram, we must put a long delay before issuing any
information (command or data) to the LCD. A better way is to check the busy flag
before issuing anything to the LCD.
Two-Terminal IC Temperature Transducer
AD590
FEATURES:
1. Linear Current Output: 1 mA/K
2. Wide Range: –558C to +1508C
3. Probe Compatible Ceramic Sensor Package
4. Two Terminal Device: Voltage In/Current Out
5. Laser Trimmed to 60.58C Calibration Accuracy (AD590M)
6. Excellent Linearity: 60.38C Over Full Range (AD590M)
7. Wide Power Supply Range: +4 V to +30 V
8. Sensor Isolation from Case
9. Low Cost
PRODUCT DESCRIPTION
The AD590 is a two-terminal integrated circuit
temperature transducer that produces an output current proportional to
absolute temperature. For supply voltages between +4 V and +30 V the
device acts as a high impedance, constant current regulator passing 1 mA/K.
Laser trimming of the chip’s thin-film resistors is used to calibrate the
device to 298.2 mA output at 298.2K (+25°C). The AD590 should be used in
any temperature sensing application below +150°C in which conventional
electrical temperature sensors are currently employed. The inherent low
cost of a monolithic integrated circuit combined with the elimination of
support circuitry makes the AD590 an attractive alternative for many
temperature measurement situations. Linearization circuitry, precision
voltage amplifiers, resistance measuring circuitry and cold junction
compensation are not needed in applying the AD590. In addition to
temperature measurement, applications include temperature compensation
or correction of discrete components, biasing proportional to absolute
temperature, flow rate measurement, level detection of fluids and
anemometry. The AD590 is available in chip form making, it suitable for
hybrid circuits and fast temperature measurements in protected
environments. The AD590 is particularly useful in remote sensing
applications. The device is insensitive to voltage drops over long lines due
to its high impedance current output. Any well insulated twisted pair is
sufficient for operation hundreds of feet from the receiving circuitry. The
output characteristics also make the AD590 easy to multiplex: the current
can be switched by a CMOS multiplexer or the supply voltage can be
switched by a logic gate output.
PRODUCT HIGHLIGHTS
1. The AD590 is a calibrated two terminal temperature sensor
requiring only a dc voltage supply (+4 V to +30 V). Costly transmitters,
filters, lead wire compensation and linearization circuits are all
unnecessary in applying the device.
2. State-of-the-art laser trimming at the wafer level in
conjunction with extensive final testing ensures that AD590 units are
easily interchangeable.
3. Superior interface rejection results from the output being a
current rather than a voltage. In addition, power requirements are low (1.5
mWs @ 5 V @ +25°C.) These features make the AD590 easy to apply as a
remote sensor.
4. The high output impedance (>10 MW) provides excellent
rejections of supply voltage drift and ripple. For instance, changing the
power supply from 5 V to 10 V results in only a 1 mA maximum current
change, or 1°C equivalent error.
5. The AD590 is electrically durable: it will withstand a
forward voltage up to 44 V and a reverse voltage of 20 V. Hence, supply
irregularities or pin reversal will not damage the device.
The 590H has 60 m inches of gold plating on its Kovar
leads and Kovar header. A resistance welder is used to seal the nickel cap to
the header. The AD590 chip is eutectically mounted to the header and
ultrasonically bonded to with 1 MIL aluminum wire. Kovar composition:
53% iron nominal; 29% ±1% nickel; 17% ± 1% cobalt; 0.65% manganese max;
0.20% silicon max; 0.10% aluminum max; 0.10% magnesium max; 0.10%
zirconium max; 0.10% titanium max; 0.06% carbon max. The 590F is a
ceramic package with gold plating on its Kovar leads, Kovar lid, and chip
cavity. Solder of 80/20 Au/Sn composition is used for the 1.5 mil thick
solder ring under the lid. The chip cavity has a nickel underlay between the
metallization and the gold plating. The AD590 chip is eutectically mounted
in the chip cavity at 410°C and ultrasonically bonded to with 1 mil
aluminum wire. Note that the chip is in direct contact with the ceramic
base, not the metal lid. When using the AD590 in die form, the chip
substrate must be kept electrically isolated, (floating), for correct circuit
operation.
In the AD590, this PTAT voltage is converted to a PTAT
current by low temperature coefficient thin-film resistors. The total current
of the device is then forced to be a multiple of this PTAT current. Referring
to Figure 1, the schematic diagram of the AD590, Q8 and Q11 are the
transistors that produce the PTAT voltage. R5 and R6 convert the voltage to
current. Q10, whose collector current tracks the collector currents in Q9 and
Q11, supplies all the bias and substrate leakage current for the rest of the
circuit, forcing the total current to be PTAT. R5 and R6 is laser trimmed on
the wafer to calibrate the device at +25°C.
SCHEMATIC DIAGRAM OF AD590
Figure 2 shows the typical V–I characteristic of the circuit at +25°C and the
temperature extremes.
CIRCUIT DESCRIPTION
The AD590 uses a fundamental property of the silicon
transistors from which it is made to realize its temperature proportional
characteristic: if two identical transistors are operated at a constant ratio of
collector current densities, r, then the difference in their base-emitter
voltage will be (kT/q)(In r). Since both k, Boltzman’s constant and q, the
charge of an electron, are constant, the resulting voltage is directly
proportional to absolute temperature (PTAT).
The above block diagram shows our component hook up. The
temperature transducer converts the heat energy into electrical energy. The
temperature sensor is in the form of IC which requires biasing and
additional driver. The driver circuit is made up of Operational amplifier
which functions as a comparator as well as an amplifier and power supply
unit for the sensor. This circuit is also called as measuring circuit. This
converts the changing signal from the sensor in the form of mV and
amplifies and feeds as input for the ADC.
The temperature calibration can be done by adjusting the VR1
and VR2 by varying the biasing voltage of OPAMP U1 and U3. The
temperature sensor output is fed to U1 as an input and compared with the
comparator and inverted amplified and the output is taken from U3 and
given as input to ADC as per the circuit. Calibration of the input further
explained below.
EXPLANATION OF TEMPERATURE SENSOR
The way in which the AD590 is specified makes it easy to
apply in a wide variety of different applications. It is important to
understand the meaning of the various specifications and the effects of
supply voltage and thermal environment on accuracy. The AD590 is
basically a PTAT (proportional to absolute temperature)1 current regulator.
That is, the output current is equal to a scale factor times the temperature of
the sensor in degrees Kelvin. This scale factor is trimmed to 1 mA/K at the
factory, by adjusting the indicated temperature (i.e., the output current) to
agree with the actual temperature. This is done with 5 V across the device at
a temperature within a few degrees of +25°C (298.2K). The device is then
packaged and tested for accuracy over temperature.
CALIBRATION ERROR
At final factory test the difference between the indicated
temperature and the actual temperature is called the calibration error. Since
this is a scale factory error, its contribution to the total error of the device is
PTAT. For example, the effect of the 1°C specified maximum error of the
AD590L varies from 0.73°C at –55°C to 1.42°C at 150°C. Figure 3 shows how
an exaggerated calibration error would vary from the ideal over
temperature.
The calibration error is a primary contributor to maximum
total error in all AD590 grades. However, since it is a scale factor error, it is
particularly easy to trim. Figure 4 shows the most elementary way of
accomplishing this. To trim this circuit the temperature of the AD590 is
measured by a reference temperature sensor and R is trimmed so that VT =
1 mV/K at that temperature. Note that when this error is trimmed out at one
temperature, its effect is zero over the entire temperature range. In most
applications there is a current-to-voltage conversion resistor (or, as with a
current input ADC, a reference) that can be trimmed for scale factor
adjustment.
CALIBRATION ERROR TRIMMED OUT
Each AD590 is tested for error over the temperature range with
the calibration error trimmed out. This specification could also be called the
“variance from PTAT” since it is the maximum difference between the
actual current over temperature and a PTAT multiplication of the actual
current at 25°C. This error consists of a slope error and some curvature,
mostly at the temperature extremes. Figure 5 shows a typical AD590K
temperature curve before and after calibration error trimming.
ERROR VERSUS TEMPERATURE:
Using the AD590 by simply measuring the current, the total
error is the “variance from PTAT” described above plus the effect of the
calibration error over temperature. For example the AD590L maximum total
error varies from 2.33°C at –55°C to 3.02°C at 150°C. For simplicity, only the
large figure is shown on the specification page.
NONLINEARITY
Nonlinearity as it applies to the AD590 is the maximum
deviation of current over temperature from a best-fit straight line. The
nonlinearity of the AD590 over the –55°C to +150°C range is superior to all
conventional electrical temperature sensors such as thermocouples. RTDs
and thermistors. Figure 6 shows the nonlinearity of the typical AD590K
from Figure 6.
Figure 7A shows a circuit in which the nonlinearity is the major contributor
to error over temperature. The circuit is trimmed by adjusting R1 for a 0 V
output with the AD590 at 0°C. R2 is then adjusted for 10 V out with the
sensor at 100°C. Other pairs of temperatures may be used with this
procedure as long as they are measured accurately by a reference sensor.
Note that for +15 V output (150°C) the V+ of the op amp must be greater
than 17 V. Also note that V– should be at least –4 V: if V– is ground there is
no voltage applied across the device.
VOLTAGE AND THERMAL ENVIRONMENT EFFECTS
The power supply rejection specifications show the
maximum expected change in output current versus input voltage changes.
The insensitivity of the output to input voltage allows the use of
unregulated supplies. It also means that hundreds of ohms of resistance
(such as a CMOS multiplexer) can be tolerated in series with the device.
It is important to note that using a supply voltage other than 5 V does not
change the PTAT nature of the AD590. In other words, this change is
equivalent to a calibration error and can be removed by the scale factor trim
(see previous page). The AD590 specifications are guaranteed for use in a
low thermal resistance environment with 5 V across the sensor. Large
changes in the thermal resistance of the sensor’s environment will change
the amount of self-heating and result in changes in the output which are
predictable but not necessarily desirable. The thermal environment in
which the AD590 is used determines two important characteristics: the
effect of self heating and the response of the sensor with time.
Figure 8 is a model of the AD590 which demonstrates these characteristics.
As an example, for the TO-52 package, qJC is the thermal resistance
between the chip and the case, about 26°C/watt. qCA is the thermal
resistance between the case and the surroundings and is determined by the
characteristics of the thermal connection. Power source P represents the
power dissipated on the chip. The rise of the junction temperature, TJ,
above the ambient temperature TA is: TJ -TA = P (qJC + qCA )
The time response of the AD590 to a step change in temperature
is determined by the thermal resistances and the thermal capacities of the
chip, CCH, and the case, CC. CCH is about 0.04 watt-sec/°C for the AD590.
CC varies with the measured medium since it includes anything that is in
direct thermal contact with the case. In most cases, the single time constant
exponential curve of Figure 9 is sufficient to describe the time response, T
(t). Table I shows the effective time constant, t, for several media.
Applying the AD590 (GENERAL APPLICATIONS)
Figure 10 demonstrates the use of a low cost Digital Panel Meter for the
display of temperature on either the Kelvin, Celsius or Fahrenheit scales.
For Kelvin temperature Pins 9, 4 and 2 are grounded; and for Fahrenheit
temperature Pins 4 and 2 are left open. The above configuration yields a 3
digit display with 1°C or 1°F resolution, in addition to an absolute accuracy
of ±2.0°C over the –55°C to +125°C temperature range if a one-temperature
calibration is performed on an AD590K, L, or M.
Connecting several AD590 units in series as shown in Figure 11 allows the
minimum of all the sensed temperatures to be indicated. In contrast, using
the sensors in parallel yields the average of the sensed temperatures.
The circuit of Figure 12 demonstrates one method by which differential
temperature measurements can be made. R1 and R2 can be used to trim the
output of the op amp to indicate a desired temperature difference. For
example, the inherent offset between the two devices can be trimmed in. If
V+ and V– are radically different, then the difference in internal
dissipation will cause a differential internal temperature rise. This effect
can be used to measure the ambient thermal resistance seen by the sensors
in applications such as fluid level detectors or anemometry.
Figure 15 is an example of a variable temperature control circuit
(thermostat) using the AD590. RH and RL are selected to set the high and
low limits for RSET. RSET could be a simple pot, a calibrated multiturn pot
or a switched resistive divider. Powering the AD590 from the 10 V reference
isolates the AD590 from supply variations while maintaining a reasonable
voltage (~7 V) across it. Capacitor C1 is often needed to filter extraneous
noise from remote sensors. RB is determined by the b of the power
transistor and the current requirements of the load.
OPERATION OF ANALOG TO DIGITAL CONVERTER
CIRCUIT
The conversion of analog to its digital equivalent is of utmost important .
One of the reason is its easy interfacing facility with the micro processor.
Outputs from load-cell, Thermocouple etc. can be easily interfaced to the
processor.
The ADC card provided permits the user to have access between external
analog circuitry with the processor. The ADC input is given through a
potentiometer. This output is fed to ADC - 0804 to provide an equivalent
digital value corresponding analog input. The digital output which is 8bits
wide is tied to port A bits of 8255. Port A bits are defined as input port in
the control word i.e., data in port A bits are read by the processor. Logic
gates are used of chip selection purpose for the 8255 IC. The data along
with the control signals are carried to the trainer kit via the 50 pin flat
ribbon cable.
8255 control register address - 6063H
8255 Port A address - 6060H
8255 Port B address - 6061H
8255 Port C address -6062H
ADC PROGRAM
; port A receives digital o/p from adc
; port B for r/w
;"ADC AND DAC PROGRAM"
;port A receives digital o/p from adc
;port c for r/w
9000 main:
9000 906063 mov dptr,#6063
9003 7490 mov a,#90h;define port A as
i/p,remaining as o/p
9005 F0 movx @dptr,a
9006 906062 mov dptr,#6062
9009 74FF mov a,#ffh ;start of
conversion
900B F0 movx @dptr,a
900C 906062 mov dptr,#6062
900F 7400 mov a,#0h
9011 F0 movx @dptr,a
9012 906062 mov dptr,#6062
9015 74FF mov a,#ffh ;end of conversion
9017 F0 movx @dptr,a
9018 129022 lcall delay
901B 906060 mov dptr,#6060 ;port A
901E E0 movx a,@dptr ;getting digital
values
901F 120BBB lcall 00bbh
;DELAY SUBROUTINE
9022 delay:
9022 79FF mov r1,#ffh
9024 Loop:
9024 00 nop
9025 00 nop
9026 00 nop
9027 00 nop
9028 00 nop
9029 00 nop
902A 00 nop
902B D9F7 djnz r1,loop
902D 22 ret
;Note RESULT STORED IN ACCUMULATOR
MEASURING AND DISPLAY
This voltage after suitable amplification is given to ADC
804 which converts into digital form. This digital output of the ADC is
given to the Microcontroller 8051 by interfacing through 8255 with I/O
address chip. The Microcontroller calculates the change in temperature
with suitable interfacing through 8255 via decoder and displays the
temperature in the LCD matrix module. The function of each
I/O,EPROM,RAM,Decoder , Memory mapping ,Memory address are
explained in detail in the component description.
DISPLAY PANEL PROGRAM
1.initlcd: initialises the lcd
;2.putchar: displays the char. in A at the current cursor
pos.
;3.disadr: displays the hex.address (content of the
adr.buffer)
; in the 1st line (like 8100:)
;4.disopb: displays the content of the o/p buff.
(disassemble)
;5.gotoxy:
;6.clrscr:
;
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
;main: call initlcd
; call disadr
; rst 1
;
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;initlcd:
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
INITLCD: LXI D,0EA6H ;for 15msec
CALL DELAY
MVI A,38H ;functionset (useless)
OUT LCDCMD
LXI D,0401H ;for 4.1msec
CALL DELAY
MVI A,38H ;functionset (useless)
OUT LCDCMD
LXI D,0019H ;for 100usec
CALL DELAY
MVI A,38H ;fuction set{0011 1000}
OUT LCDCMD
LXI D,0014H ;for 40usec + 40us
CALL DELAY
MVI A,0fH ;Display ON/OFF{0000 1111}
OUT LCDCMD
LXI D,0014H ;for 40usec + 40us
CALL DELAY
MVI A,06H ;entry mode{0000 0110}
OUT LCDCMD
LXI D,0014H ;for 40usec + 40us
CALL DELAY
MVI A,01H ;Clear Display{0000 0001}
OUT LCDCMD
LXI D,019AH ;for 1.64msec
CALL DELAY
LXI D,000AH ;for 40usec
CALL DELAY
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;DELAY FUNCTION
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;250 msec for count FFFF
DELAY: DCX D ;total no. of T
states=24*(count-1)+31
MOV A,E
ORA D
JNZ DELAY
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;PUTCHAR:
; I/P:A-HAVE THE ASCII VALUE
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
PUTCHAR: PUSH H
PUSH D
PUSH B
MOV D,A
LDA FLGSERIAL ;to check serial mode
CPI 01H
JNZ LOCALD
MOV A,D
CALL TRACHA ;to disp. char on pc
monitor
JMP RET10
LOCALD: MOV A,D
OUT LCDDIS
LXI D,000AH ;for 40usec
CALL DELAY
RET10: POP B
POP D
POP H
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;DISPLAY ADDRESS ---in first line (like 8100: )
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
DISADR: LDA ADRBUF
CALL PUTBYTE
LDA ADRBUF+1H
CALL PUTBYTE
MVI A,3AH ;ascii of ':'-to display
after the addr
CALL PUTCHAR
MVI A," "
CALL PUTCHAR
RET
;***********************************************
;ASCII
;***********************************************
ASCII1: ANI 0FH
CPI 0AH
JC ADD
ADI 07H
ADD: ADI 30H
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;DISPLAY OUTPUT BUFFER ----after disassemble
; It displays addr,opcodes in first line and
; mnemonics in second line.
; line 1: xxxx: xx xx xx
; line 2: lxi h,5050(mnemonics)
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
DISOPB: MVI A,06H ;DDRAM addr.06--(1000 0110)=86H
CALL GOTOXY
LXI H,OPBUF
MVI C,03H
CNDIS: MOV A,M ;Display the opcodes in the
first line
CALL PUTCHAR
INX H
MOV A,M
CALL PUTCHAR
INX H
MVI A,20H ;SPACE CHARACTER
CALL PUTCHAR
DCR C
JNZ CNDIS
LDA FLGSERIAL
CPI 01H
JZ GIVESPACE
MVI A,40H ;DDRAM addr.40--(1100 0000)=C0H
CALL GOTOXY
JMP CNDIS1
GIVESPACE:MVI A," "
CALL PUTCHAR
CALL PUTCHAR
CNDIS1: MOV A,M
CPI 00H
RZ
CALL PUTCHAR
INX H
JMP CNDIS1
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
CUROFF: MVI A,0CH ;{0 0 0 0 1 D C B}=00001100
OUT LCDCMD
LXI D,0014H ;for 40usec + 40us
CALL DELAY
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
CURON: MVI A,0FH ;{0 0 0 0 1 D C B}=00001111
OUT LCDCMD
LXI D,0014H ;for 40usec + 40us
CALL DELAY
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
LCDOFF: MVI A,08H ;{0 0 0 0 1 D C B}=00001000
OUT LCDCMD
LXI D,0014H ;for 40usec + 40us
CALL DELAY
RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;GOTOXY FUNCTION
; MOVES LCD CURSOR POSITION
;I/P: A-DDRAM ADDR 00H-27H for 1st line
; 40h-67h for 2nd line
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
GOTOXY: MOV D,A
LDA FLGSERIAL
CPI 01H
JNZ LGOTO
MOV A,D
CPI 40H
JC ENDGOTO
MVI A,0AH
CALL PUTCHAR
JMP ENDGOTO
LGOTO: MOV A,D
ORI 80H
OUT LCDCMD
LXI D,000AH ;delay for 40us
CALL DELAY
ENDGOTO: RET
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;CLRSCR FUNCTION
;
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
CLRSCR: LDA FLGSERIAL
CPI 01H
JNZ LCDCLR
MVI A,0AH
CALL PUTCHAR
RET
LCDCLR: MVI A,01H
OUT LCDCMD
LXI D,01BAH ;for 1.64ms (019AH) for extra
delay (01BAH)
CALL DELAY
RET
BIBLIOGRAPHY
WEBSITES
1. http://www.atmel.com
2. http://www.google.com
3. http://www.8052.com
BOOKS
1. THE 8051 MICROCONTROLLER AND EMBEDDED
SYSTEMS (Muhammad Ali Mazidi )
2. MICROPROCESSOR AND ITS APPLICATIONS
(S.Rajasekar,D.Madhavan)
3. MICROPROCESSOR BASED TEMPERATURE INDICATOR
(C.Rameshu, A.P.Sivaprasad)
4. INDUSTRIAL INSTRUMENTATION
(C.Dhanasekaran)
HARDWARE AND TECHNICAL SUPPORT
Durga Electricals,Chennai
CONCLUSION
AN OVERVIEW
Temperature measurement system using
microprocessor/microcontroller has been described in this
report. The system consists of a combination of hardware and
software. The system has relatively fast response and high
accuracy. The overall system is also quite simple to implement
and relatively cheap.
APPLICATION
This method has got a wide variety of industrial,
domestic, powerplant, school and colleges and research
institutes application. This system plays a major role in deciding
the quality of petro-chemical industry product e.g.oil, fertilizer,
and de-salination and space research. This controller can accept a
variety of inputs to measure different variables such as
temperature transducer, strain gauges, load cells, flow, pressure,
level, speed, time, by way of suitable interfacing and
Programming.
We have experienced very many difficulties in
carrying out the project which was overcome by suggestions and
guidance given by our parents, friends and well-wishers. We
have gained more knowledge about the sections involved in our
project. We feel very happy and proud to completed this project.
We thank one and all who helped for the successful completion
of the course.
ELECTRONIC THERMOMETER USING MICROCONTROLLER

More Related Content

What's hot

INTRODUCTION TO LVDT,RVDT and Potentiometer
INTRODUCTION TO LVDT,RVDT and Potentiometer INTRODUCTION TO LVDT,RVDT and Potentiometer
INTRODUCTION TO LVDT,RVDT and Potentiometer SACHINNikam39
 
ELECTRICAL MEASUREMENT & MEASURING INSTRUMENTS [Emmi- (NEE-302) -unit-1]
ELECTRICAL MEASUREMENT & MEASURING INSTRUMENTS [Emmi- (NEE-302) -unit-1]ELECTRICAL MEASUREMENT & MEASURING INSTRUMENTS [Emmi- (NEE-302) -unit-1]
ELECTRICAL MEASUREMENT & MEASURING INSTRUMENTS [Emmi- (NEE-302) -unit-1]Md Irshad Ahmad
 
Temperature Controlled DC fan using Thermistor
Temperature Controlled DC fan using ThermistorTemperature Controlled DC fan using Thermistor
Temperature Controlled DC fan using ThermistorZaheer Basha
 
INFRARED TEMPERATURE DETECTOR
INFRARED TEMPERATURE DETECTORINFRARED TEMPERATURE DETECTOR
INFRARED TEMPERATURE DETECTOR HITESH Kumawat
 
Remote patient monitoring system
Remote patient monitoring system Remote patient monitoring system
Remote patient monitoring system Rahul Singh
 
Electrical and electronics engineering projects list
Electrical and electronics engineering projects listElectrical and electronics engineering projects list
Electrical and electronics engineering projects listGaurav Mishra
 
Arduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorArduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorEdgefxkits & Solutions
 
PLC Based Elevator, Power Electronic Project
PLC Based Elevator, Power Electronic Project PLC Based Elevator, Power Electronic Project
PLC Based Elevator, Power Electronic Project Mahamudul karim Khondaker
 
Basic transducer principles
Basic transducer principlesBasic transducer principles
Basic transducer principlesGhansyam Rathod
 
AUTOMATIC FAN CONTROLLER USING THERMISTOR
AUTOMATIC FAN CONTROLLER USING THERMISTORAUTOMATIC FAN CONTROLLER USING THERMISTOR
AUTOMATIC FAN CONTROLLER USING THERMISTORPankaj Jagadale
 
Photoelectric transducer
Photoelectric transducerPhotoelectric transducer
Photoelectric transducervickeysv
 
Arduino based health monitoring system
Arduino based health monitoring systemArduino based health monitoring system
Arduino based health monitoring systemYousuf Shaikh
 

What's hot (20)

Physiological transducers
Physiological transducersPhysiological transducers
Physiological transducers
 
INTRODUCTION TO LVDT,RVDT and Potentiometer
INTRODUCTION TO LVDT,RVDT and Potentiometer INTRODUCTION TO LVDT,RVDT and Potentiometer
INTRODUCTION TO LVDT,RVDT and Potentiometer
 
ELECTRICAL MEASUREMENT & MEASURING INSTRUMENTS [Emmi- (NEE-302) -unit-1]
ELECTRICAL MEASUREMENT & MEASURING INSTRUMENTS [Emmi- (NEE-302) -unit-1]ELECTRICAL MEASUREMENT & MEASURING INSTRUMENTS [Emmi- (NEE-302) -unit-1]
ELECTRICAL MEASUREMENT & MEASURING INSTRUMENTS [Emmi- (NEE-302) -unit-1]
 
Temperature Controlled DC fan using Thermistor
Temperature Controlled DC fan using ThermistorTemperature Controlled DC fan using Thermistor
Temperature Controlled DC fan using Thermistor
 
Classification of Transducer
Classification of TransducerClassification of Transducer
Classification of Transducer
 
INFRARED TEMPERATURE DETECTOR
INFRARED TEMPERATURE DETECTORINFRARED TEMPERATURE DETECTOR
INFRARED TEMPERATURE DETECTOR
 
Remote patient monitoring system
Remote patient monitoring system Remote patient monitoring system
Remote patient monitoring system
 
Electrical and electronics engineering projects list
Electrical and electronics engineering projects listElectrical and electronics engineering projects list
Electrical and electronics engineering projects list
 
Energy meter
Energy meterEnergy meter
Energy meter
 
Arduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulatorArduino based automatic temperature controlled fan speed regulator
Arduino based automatic temperature controlled fan speed regulator
 
RTD
RTDRTD
RTD
 
Thermocouples
ThermocouplesThermocouples
Thermocouples
 
Thermistor
ThermistorThermistor
Thermistor
 
PLC Based Elevator, Power Electronic Project
PLC Based Elevator, Power Electronic Project PLC Based Elevator, Power Electronic Project
PLC Based Elevator, Power Electronic Project
 
Basic transducer principles
Basic transducer principlesBasic transducer principles
Basic transducer principles
 
Automatic street light based on vehicles movement report
Automatic street light based on vehicles movement reportAutomatic street light based on vehicles movement report
Automatic street light based on vehicles movement report
 
AUTOMATIC FAN CONTROLLER USING THERMISTOR
AUTOMATIC FAN CONTROLLER USING THERMISTORAUTOMATIC FAN CONTROLLER USING THERMISTOR
AUTOMATIC FAN CONTROLLER USING THERMISTOR
 
Instrumentation
InstrumentationInstrumentation
Instrumentation
 
Photoelectric transducer
Photoelectric transducerPhotoelectric transducer
Photoelectric transducer
 
Arduino based health monitoring system
Arduino based health monitoring systemArduino based health monitoring system
Arduino based health monitoring system
 

Viewers also liked

DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERChirag Lakhani
 
Speed control of dc motor using 89c51
Speed control of dc motor using 89c51Speed control of dc motor using 89c51
Speed control of dc motor using 89c51Pawan Gupta
 
Mni projects sc
Mni projects scMni projects sc
Mni projects scindiaesys
 
Solar tracking system using 8051 microcontroller
Solar tracking system using 8051 microcontrollerSolar tracking system using 8051 microcontroller
Solar tracking system using 8051 microcontrollerVISHAL NAGAR
 
Proposal format
Proposal formatProposal format
Proposal formatMr SMAK
 
Traffic light controller
Traffic light controllerTraffic light controller
Traffic light controllerRkrishna Mishra
 
10 Project Proposal Writing
10 Project Proposal Writing10 Project Proposal Writing
10 Project Proposal WritingTony
 

Viewers also liked (8)

DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
 
abhilashcv
abhilashcvabhilashcv
abhilashcv
 
Speed control of dc motor using 89c51
Speed control of dc motor using 89c51Speed control of dc motor using 89c51
Speed control of dc motor using 89c51
 
Mni projects sc
Mni projects scMni projects sc
Mni projects sc
 
Solar tracking system using 8051 microcontroller
Solar tracking system using 8051 microcontrollerSolar tracking system using 8051 microcontroller
Solar tracking system using 8051 microcontroller
 
Proposal format
Proposal formatProposal format
Proposal format
 
Traffic light controller
Traffic light controllerTraffic light controller
Traffic light controller
 
10 Project Proposal Writing
10 Project Proposal Writing10 Project Proposal Writing
10 Project Proposal Writing
 

Similar to ELECTRONIC THERMOMETER USING MICROCONTROLLER

Embedded system 8051 Microcontroller
Embedded system 8051 MicrocontrollerEmbedded system 8051 Microcontroller
Embedded system 8051 Microcontrollerankitsharmaj
 
4 Way traffic controll new
4 Way traffic controll new4 Way traffic controll new
4 Way traffic controll newMainak Nandi
 
Precise kilometer calculation by underground cable fault detector
Precise kilometer calculation by underground cable fault detectorPrecise kilometer calculation by underground cable fault detector
Precise kilometer calculation by underground cable fault detectorvivekmv716
 
MPC of TWT based Transmitter
MPC of TWT based TransmitterMPC of TWT based Transmitter
MPC of TWT based TransmitterAbhishek Sutrave
 
ELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECTELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECTvasav2204
 
electrical engineering project
electrical engineering projectelectrical engineering project
electrical engineering projectvasav2204
 
AUTOMATIC WIRELESS POWER GRID CONTROL
AUTOMATIC WIRELESS POWER GRID CONTROLAUTOMATIC WIRELESS POWER GRID CONTROL
AUTOMATIC WIRELESS POWER GRID CONTROLshiv kapil
 
INTELLIGENT HELMET FOR COAL MINERS
INTELLIGENT HELMET FOR COAL MINERSINTELLIGENT HELMET FOR COAL MINERS
INTELLIGENT HELMET FOR COAL MINERSARUN P S
 
Microprocessor project
Microprocessor projectMicroprocessor project
Microprocessor projectprapyapokharel
 
BHH POWER PLANT ppt.pptx
BHH POWER PLANT ppt.pptxBHH POWER PLANT ppt.pptx
BHH POWER PLANT ppt.pptxAnil764767
 
Report on Embedded Based Home security system
Report on Embedded Based Home security systemReport on Embedded Based Home security system
Report on Embedded Based Home security systemNIT srinagar
 
Instrumentation Interview Q&A EMERSON EDUARDO RODRIGUES
Instrumentation Interview Q&A EMERSON EDUARDO RODRIGUESInstrumentation Interview Q&A EMERSON EDUARDO RODRIGUES
Instrumentation Interview Q&A EMERSON EDUARDO RODRIGUESEMERSON EDUARDO RODRIGUES
 
Visiter counter doc
Visiter counter docVisiter counter doc
Visiter counter docPrem Kumar
 
IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...
IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...
IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...DeepakK547422
 
IRJET- IoT based Industrial Automation
IRJET-  	  IoT based Industrial AutomationIRJET-  	  IoT based Industrial Automation
IRJET- IoT based Industrial AutomationIRJET Journal
 

Similar to ELECTRONIC THERMOMETER USING MICROCONTROLLER (20)

Embedded system 8051 Microcontroller
Embedded system 8051 MicrocontrollerEmbedded system 8051 Microcontroller
Embedded system 8051 Microcontroller
 
4 Way traffic controll new
4 Way traffic controll new4 Way traffic controll new
4 Way traffic controll new
 
Precise kilometer calculation by underground cable fault detector
Precise kilometer calculation by underground cable fault detectorPrecise kilometer calculation by underground cable fault detector
Precise kilometer calculation by underground cable fault detector
 
MPC of TWT based Transmitter
MPC of TWT based TransmitterMPC of TWT based Transmitter
MPC of TWT based Transmitter
 
ELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECTELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECT
 
electrical engineering project
electrical engineering projectelectrical engineering project
electrical engineering project
 
AUTOMATIC WIRELESS POWER GRID CONTROL
AUTOMATIC WIRELESS POWER GRID CONTROLAUTOMATIC WIRELESS POWER GRID CONTROL
AUTOMATIC WIRELESS POWER GRID CONTROL
 
INTELLIGENT HELMET FOR COAL MINERS
INTELLIGENT HELMET FOR COAL MINERSINTELLIGENT HELMET FOR COAL MINERS
INTELLIGENT HELMET FOR COAL MINERS
 
Microprocessor project
Microprocessor projectMicroprocessor project
Microprocessor project
 
Pin 8085
Pin 8085Pin 8085
Pin 8085
 
Smart home
Smart homeSmart home
Smart home
 
Smart home copy
Smart home   copySmart home   copy
Smart home copy
 
Smart home
Smart homeSmart home
Smart home
 
BHH POWER PLANT ppt.pptx
BHH POWER PLANT ppt.pptxBHH POWER PLANT ppt.pptx
BHH POWER PLANT ppt.pptx
 
Report on Embedded Based Home security system
Report on Embedded Based Home security systemReport on Embedded Based Home security system
Report on Embedded Based Home security system
 
Instrumentation Interview Q&A EMERSON EDUARDO RODRIGUES
Instrumentation Interview Q&A EMERSON EDUARDO RODRIGUESInstrumentation Interview Q&A EMERSON EDUARDO RODRIGUES
Instrumentation Interview Q&A EMERSON EDUARDO RODRIGUES
 
Visiter counter doc
Visiter counter docVisiter counter doc
Visiter counter doc
 
IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...
IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...
IOT BASED AIR QUALITY INDEX MONITORING SYSTEM – MONITOR PM2.5, PM10, AND CO U...
 
Automatic irrigation system
Automatic irrigation systemAutomatic irrigation system
Automatic irrigation system
 
IRJET- IoT based Industrial Automation
IRJET-  	  IoT based Industrial AutomationIRJET-  	  IoT based Industrial Automation
IRJET- IoT based Industrial Automation
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

ELECTRONIC THERMOMETER USING MICROCONTROLLER

  • 1. THIRU SEVEN HILLS POLYTECHNIC COLLEGE MADURAVOYAL, CHENNAI – 600095. DEPT. OF ELECTRONICS & COMMUNICATION ENGINEERING PROJECT REPORT 2003-2004 PROJECT REPORT ON ELECTRONIC THERMOMETER USING MICROCONTROLLER SUBMITTED BY R.ANAND BALAN S.BALAJI D.RAJESH PANDIYAN K.B.RAJKUMAR T.SUBRAMANIA SIVA S.SUNIL
  • 2. THIRU SEVEN HILLS POLYTECHNIC COLLEGE CHENNAI – 600 095 DEPT. OF ELECTRONICS & COMMUNICATION ENGINEERING BONAFIDE CERTIFICATE This is to certify that this ELECTRONIC THERMOMETER USING MICROCONTROLLER is a bonafide record of project work carried out by Mr. D.RAJESH PANDIYAN REG.NO: 2143127 of III year, Sixth Semester in Electronics & Communication Engg. had successfully Completed the entitled. In partial fulfillment for the award of Diploma in Electronics & Communication Engg. Under my supervision during the academic year 2003-2004. Guide H.O.D Submitted for the exam held on______________________________________ Internal Examiner External Examiner.
  • 3. ACKNOWLEDGEMENT We render our profound and heart felt gratitude to our principal Mrs. Premalatha Kanikannan, B.E., M.B.A., Thiru Seven Hills Polytechnic College, Chennai for the encouragement and co-operation for accomplishing our project entitled ELECTRONIC THERMOMETER USING MICROCONTROLLER. We thank our H.O.D. Mr.V.ELANGOVAN, D.E.C.E., MISTE for allowing us to under take the object. We thank our Internal guide Mr.V.ELANGOVAN, for his sustained guidelines and encouragement. His constant enthusiasm showed us the path to achieve this cherished goal. We express our sincere thanks to Mr.G.SARAVANAN who provided us with his expertise. We also reveal our sincere thanks to all faculty members of E.C.E. Department whose suggestions and teaching brought the comprehensive in us to complete this project. We would like to take this opportunity to thank our friends for their endurance, patience and support in achieving our ambition. We will remain with gratitude to our parents, lecturers, non-teaching staff and management forever.
  • 4. CONTENTS  INTRODUCTION  REGULATED POWER SUPPLY  OVERVIEW OF MICROCONTROLLER  PERIPHERAL INTERFACE  ADC 804  DISPLAY INTERFACE  TEMP. TRANSDUCER  FUNCTIONAL BLOCK DIAGRAM OF CIRCUIT  OPERATION OF ADC CIRCUITS  ADC PROGRAM  MEASURING,PROGRAM AND DISPLAY  BIBLIOGRAPHY  CONCLUSION
  • 5. INTRODUCTION Temperature is the most important variable in industrial processing, primarily because it is the fundamental condition characteristic of the thermal state of the body. Consequently it is most important that the various ways of measuring temperature be well mastered and the advantages and disadvantages of each method we well understood and the operating limitation in terms of time of response, temperature range distance of operation and compatibility with other control etc. should be considered for each installation and measurement. There are two types of measurement 1. Non-electrical method (e.g. Glass thermometer) and 2. electrical method (e.g. Digital thermometer, thermo couples and RTDs) THERMO COUPLES Thermocouple is a device that converts thermal energy to electric voltage when there is a temperature difference between the ends of a pair of dissimilar metals. One end of the pair is fused together to form a hot junction, and the other end called the cold junction is connected to the measuring instrument. The open circuit voltage developed is a function of the Seebeck coefficient for the two metals and is proportional to the temperature difference. The Seebeck effect refers to the set conversion of thermal energy to voltage under zero current conditions. The direction and magnitude of the voltage depends on the metals making up the junction and the temperatures of the junctions. As opposed to the Seebeck effect if a current is passed through junctions made of two dissimilar metals, heat is absorbed in one junction and liberated in the other. When current is flowing in the same direction as the seebeck current heat is absorbed at the hot junction and liberated at the cold junction. This is known as peltier effect and is utilized in thermoelectric refrigeration and heating. Peltier thermoelectric heating is different from Joule heating. Joule heating is given by i²R and so depends on the resistance of the wires making up the circuit. In our project we are using encapsulatedAD590 temperature transducer as an input device.
  • 6. REGULATED POWER SUPPLY Since a power supply is a vital part of all electronic system, it has to be discussed. Most digital IC, including microprocessor and memory ICs, operate on a ±15 supplies. Therefore, the power supply presented in this section will have ±5 and ±12v. Consider how the ± 12V supply voltage are obtained in circuit as shown in the diagram, the 7812 is a +12V regulator, 7912 is a -12V regulator and both can deliver output current excess of 1.0A. They will hence perform satisfactorily in the circuit as shown in the diagram by providing ±12V at 0.500A. However since the drop out voltage (Vin-V0) is 2V, the input voltage for these 7812 must be at least +15v and -15v for 7915. This means that the rectified peak voltage must be greater than +15V and -15V which in turn implies that the secondary voltage must be greater than 30V peak or 24V rms. Since we are using center-tapped (CT) transformer, the voltage across them will be satisfied. Finally, the size of the filter capacitor depends on the secondary current of the transformer. As per thumb rule, a 1500 μfd capacitor should be used for each ampere of current. The working voltage rating (WVDC) of the capacitor, depends on the peak rectified output voltage and must be at least 20% higher than the peak value of the voltage it is expected to charge to. The circuit arrangement of ±5V is similar as ±12V except the regulator 7805 and the power supply transformer (0-9) V additional filter capacitor provided at the regulator output.
  • 7.
  • 8. MICRO CONTROLLER A By – product of microprocessor development was the microcontroller. Microcomputers are also known as single chip microcontrollers. Nowadays the conventional pneumatic controllers are replaced by electronic controllers built using high speed microprocessors and personal computers. Microcontroller / Microcomputers offer more advantages than the conventional microprocessors for performing dedicated jobs. These ICs are also cost effective and could be used for any applications such as process control equipments, dot matrix Printers, PLCs etc., For the Present work, microcontroller 8051 is made use of. This has timers and I/O ports needed for the work. INTRODUCTION TO 8051: The 8051 is one of the most popular microcontrollers in use today. Many derivative microcontrollers have since been developed that are based on—and compatible with--the 8051. Thus, the ability to program an 8051 is an important skill for anyone who plans to develop products that will take advantage of microcontrollers. The 8051 has three very general types of memory. To effectively program the 8051 it is necessary to have a basic understanding of these memory types. On-Chip Memory refers to any memory (Code, RAM, or other) that physically exists on the microcontroller itself. On-chip memory can be of several types External Code Memory is code (or program) memory that resides off- chip. This is often in the form of an external EPROM. External RAM is RAM memory that resides off-chip. This is often in the form of standard static RAM or flash RAM. Register Banks The 8051 uses 8 "R" registers which are used in many of its instructions. These "R" registers are numbered from 0 through 7 (R0, R1, R2, R3, R4, R5, R6, and R7). These registers are generally used to assist in manipulating values and moving data from one memory location to another. For example, to add the value of R4 to the Accumulator, we would execute the following instruction:
  • 9. ADD A, R4 However, as the memory map shows, the "R" Register R4 is really part of Internal RAM. Specifically, R4 is address 04h. This can be see in the bright green section of the memory map. Thus the above instruction accomplishes the same thing as the following operation: ADD a, 04 h This instruction adds the value found in Internal RAM address 04 h to the value of the Accumulator, leaving the result in the Accumulator. Since R4 is really Internal RAM 04h, the above instruction effectively accomplished the same thing. But watch out! As the memory map shows, the 8051 has four distinct register banks. When the 8051 is first booted up, register bank 0 (addresses 00h through 07h) is used by default. However, your program may instruct the 8051 to use one of the alternate register banks; i.e., register banks 1, 2, or 3. In this case, R4 will no longer be the same as Internal RAM address 04h. For example, if your program instructs the 8051 to use register bank 3, "R" register R4 will now be synonymous with Internal RAM address 1Ch. The concept of register banks adds a great level of flexibility to the 8051, especially when dealing with interrupts. However, always remember that the register banks really reside in the first 32 bytes of Internal RAM. Special Function Register (SFR) Memory Special Function Registers (SFRs) are areas of memory that control specific functionality of the 8051 processor. For example, four SFRs permit access to the 8051’s 32 input/output lines. Another SFR allows a program to read or write to the 8051’s serial port. Other SFRs allow the user to set the serial baud rate, control and access timers, and configure the 8051’s interrupt system. When programming, SFRs have the illusion of being Internal Memory. The Program Counter (PC) The Program Counter (PC) is a 2-byte address which tells the 8051 where the next instruction to execute is found in memory. When the 8051 is initialized PC always starts at 0000h and is incremented each time an instruction is executed. It is important to note that PC isn’t always incremented by one. Since some instructions require 2 or 3 bytes the PC will be incremented by 2 or 3 in these cases. The Program Counter is special in that there is no way to directly modify its value. That is to say, you can’t do something like PC=2430h. On the other hand, if you execute LJMP 2340h you’ve effectively accomplished the same thing. It is also interesting to note that while you may change the value of PC (by executing a jump instruction, etc.) there is no way to read the value of PC.
  • 10. Interrupts An interrupt is a special feature which allows the 8051 to provide the illusion of "multitasking," although in reality the 8051 is only doing one thing at a time. The word "interrupt" can often be substituted with the word "event." An interrupt is triggered whenever a corresponding event occurs. When the event occurs, the 8051 temporarily puts "on hold" the normal execution of the program and executes a special section of code referred to as an interrupt handler. The interrupt handler performs whatever special functions are required to handle the event and then returns control to the 8051 at which point program execution continues as if it had never been interrupted. Interrupt Priorities The 8051 offers two levels of interrupt priority: high and low. By using interrupt priorities you may assign higher priority to certain interrupt conditions. For example, you may have enabled Timer 1 Interrupt which is automatically called every time Timer 1 overflows. Additionally, you may have enabled the Serial Interrupt which is called every time a character is received via the serial port. However, you may consider that receiving a character is much more important than the timer interrupt. In this case, if Timer 1 Interrupt is already executing you may wish that the serial interrupt itself interrupts the Timer 1 Interrupt. When the serial interrupt is complete, control passes back to Timer 1 Interrupt and finally back to the main program. You may accomplish this by assigning a high priority to the Serial Interrupt and a low priority to the Timer 1 Interrupt. Instruction Set, Timing, and Low-Level Info In order to understand--and better make use of--the 8051, it is necessary to understand some underlying information concerning timing. The 8051 operates based on an external crystal. This is an electrical device which, when energy is applied, emits pulses at a fixed frequency. One can find crystals of virtually any frequency depending on the application requirements. When using an 8051, the most common crystal frequencies are 12 megahertz and 11.059 megahertz--with 11.059 being much more common. Why would anyone pick such an odd-ball frequency? There’s a real reason for it--it has to do with generating baud rates and we’ll talk more about it in the Serial Communication chapter. For the remainder of this discussion we’ll assume that we’re using an 11.059 MHz crystal. Microcontrollers (and many other electrical systems) use crystals to synchronize operations. The 8051 uses the crystal for precisely that: to synchronize its operation. Effectively, the 8051 operates using what are called "machine cycles." A single machine cycle is the minimum amount of time in which a single 8051 instruction can be executed. Although many instructions take multiple cycles. A cycle is, in reality, 12 pulses of the crystal. That is to say, if an instruction takes one machine cycle to execute, it
  • 11. will take 12 pulses of the crystal to execute. Since we know the crystal is pulsing 11,059,000 times per second and that one machine cycle is 12 pulses, we can calculate how many instruction cycles the 8051 can execute per second: 11,059,000 / 12 = 921,583 This means that the 8051 can execute 921,583 single-cycle instructions per second. Since a large number of 8051 instructions are single-cycle instructions it is often considered that the 8051 can execute roughly 1 million instructions per second, although in reality it is less--and, depending on the instructions being used, an estimate of about 600,000 instructions per second is more realistic. For example, if you are using exclusively 2-cycle instructions you would find that the 8051 would execute 460,791 instructions per second. The 8051 also has two really slow instructions that require a full 4 cycles to execute--if you were to execute nothing but those instructions you’d find performance to be about 230,395 instructions per second. It is again important to emphasize that not all instructions execute in the same amount of time. The fastest instructions require one machine cycle (12 crystal pulses), many others require two machine cycles (24 crystal pulses), and the two very slow math operations require four machine cycles (48 crystal pulses). Timers The 8051 comes equipped with two timers, both of which may be controlled, set, read, and configured individually. The 8051 timers have three general functions: 1) Keeping time and/or calculating the amount of time between events, 2) Counting the events themselves 3) Generating baud rates for the serial port. The three timer uses are distinct so we will talk about each of them separately. A timer is always incremented by the microcontroller. USING TIMERS AS EVENT COUNTERS We've discussed how a timer can be used for the obvious purpose of keeping track of time. However, the 8051 also allows us to use the timers to count events. Temperature sensor placed on a hot surface that would send a pulse every time depends upon the change in temperature. This could be used to determine the temperature. We could attach this sensor to one of the 8051's I/O lines through proper interface and constantly monitor it, detecting when it pulsed high and then incrementing our counter when it went back to a low state. Writing to the Serial Port Once the Serial Port has been properly configured as explained above, the serial port is ready to be used to send data and receive data. If you thought that configuring the serial port was simple, using the serial port will be a breeze. To write a byte to the serial port one must simply
  • 12. write the value to the SBUF (99h) SFR. For example, if you wanted to send the letter "A" to the serial port, it could be accomplished as easily as: MOV SBUF, #’A’ Upon execution of the above instruction the 8051 will begin transmitting the character via the serial port. Obviously transmission is not instantaneous--it takes a measurable amount of time to transmit. And since the 8051 does not have a serial output buffer we need to be sure that a character is completely transmitted before we try to transmit the next character. The 8051 lets us know when it is done transmitting a character by setting the TI bit in SCON. When this bit is set we know that the last character has been transmitted and that we may send the next character, if any. Consider the following code segment: CLR TI; be sure the bit is initially clear MOV SBUF, #’A’; Send the letter ‘A’ to the serial port JNB TI, $; Pause until the RI bit is set. The above three instructions will successfully transmit a character and wait for the TI bit to be set before continuing. The last instruction says "Jump if the TI bit is not set to $"-- $, in most assemblers, means "the same address of the current instruction." Reading the Serial Port Reading data received by the serial port is equally easy. To read a byte from the serial port one just needs to read the value stored in the SBUF (99h) SFR after the 8051 has automatically set the RI flag in SCON. For example, if your program wants to wait for a character to be received and subsequently read it into the Accumulator, the following code segment may be used: JNB RI, $; Wait for the 8051 to set the RI flag MOV A, SBUF; Read the character from the serial port The first line of the above code segment waits for the 8051 to set the RI flag; again, the 8051 sets the RI flag automatically when it receives a character via the serial port. So as long as the bit is not set the program repeats the "JNB" instruction continuously. Once the RI bit is set upon character reception the above condition automatically fails and program flow falls through to the "MOV" instruction which reads the value.
  • 14.
  • 15. MEMORY MAPPING The 8051 memory register map is shown in the diagram. The 8051 internal 4K ROM and 128 byte RAM, including the special function registers, are shown in the diagram. The 8051 can address external memory if there is not enough internal RAM and /or ROM. When used to address external memory, two ports provide the memory addressing. The 8051 addresses two separate memory spaces. The 8051 uses one memory space for storing programs and the other for storing variable data. The program memory space is a read only space. One can read program instructions from this space, but the processor cannot write data into or read data from these memory locations. The 8051 internal ROM is in program memory space. All instruction fetches are taken from the program memory space. The data memory space is read-write memory space. The processor can read data from this memory space and can write data to this memory space. It cannot execute program functions from this memory space. The 8051 internal RAM is in this memory space. The 128 bytes of internal RAM (memory locations 00H to 7 FH) provide general read write data storage. Although we say the 8051 has 128 bytes of internal RAM. Part of this memory space is often referred to as general-purpose registers. It is important that the 8051 internal RAM is often referred to as registers. The 8051 also has 22 special –function registers which are not part of the 128 byes of internal RAM. The 8051 special – function registers occupy data memory space from 80H to F8H. Although addressable as memory locations, these registers must be used for their intended purpose. If more program memory is needed, the 4-Kbyte, memory can be expanded by an additional 60 K bytes giving the 8051 a full 64-K bytes program memory space. If the 8051 EA pin is asserted (Connected to ground) the 8051 does not use the internal 4K ROM. The external memory must start at memory location 0000H and can be up to a full 64 K bytes. If more RAM are needed add external data memory. AS shown in the diagram full use of all 64 Kbytes of the external memory address space also possible. This is, this memory is addressed separately from the internal 128 bytes of RAM. Although the 8051 normally operates with separate program memory and data memory space, there are applications where it is desirable to have these work as common memory when this is done, the 8051 only has 64 K bytes of total external memory. However, when used in this configuration, the 8051 can input a block of data through its serial communications port, load that data into memory, and then execute that data as a program. This is called a downloaded program. It is a very common technique used to change the program operating in a remote microprocessor-based controller.
  • 16. PROGRAMMABLE PERIPHERAL INTERFACE 8255 A PPI (Programmable peripheral Interface) is a multi port device. The ports may be programmed in a variety of ways as required by the programmer. The device is very useful for interfacing peripheral device. The INTEL 8255 is a PPI. It has 2 versions namely the INTEL 8225A and the INTEL 8225A-5. General descriptions of both are same. There are some differences in their electrical characteristics. Hereafter they will be referred to as 8255. Its main functions are to interface peripheral devices to the microcomputer. It has three 8 bit ports namely, port A, Port B and Port C. The port C has been further divided into two 4 ports. Port C upper and port C lower. Thus a total of 4 ports are available, tow 8 bit ports and two 4 bits ports. Each can be programmed as either input port or an output port.
  • 17. FEATURES OF 8255 The 8255 is a 40-pin DIP chip. It has three separately accessible ports. The ports are each 8-bit, and are named A, B, and C. The individual ports of the 8255 can be programmed to be input or output, and can be changed dynamically. In addition, 8255 ports have handshaking capability, thereby allowing interface with devices that also have handshaking signals, such as printers. PA0 –PA7 The 8-bit port A can be programmed as all input, or as all output, or all bits as bidirectional input/output. PB0 – PB7 The 8-bit port B can be programmed as all input or as all output. Port B cannot be used as a bidirectional port. PC0 – PC7 This 8-bit port C can be all input or output. It can also be split into two parts, CU (upper bits PC4 – PC&) and CL (Lower bits PC0 – PC3). Each can be used for input or output. In addition, any of bits PC0 to PC7 can be programmed individually. RD and WR These two active-low control signals are inputs to the 8255. The RD and WR signals from the 8031/51 are connected to these inputs. D0 – D7 data pin The data pins of the 8255 are connected to the data pins of the microcontroller allowing it to send data back and forth between the controller and the 8255 chip. RESET This is an active-high signal input into the 8255 used to clear the control register. When RESET is activated, all ports are initialized as input ports. In many designs this pin is connected to the RESET output of the system bus or grounded to make it inactive. Like all IC input pins, it should not be left unconnected.
  • 18. A0, A1, and CS While CS (Chip Select) selects the entire chip, it is A0 and A1 that select specific ports. These three pins are used to access ports A, B, C or the control register according to the pin diagram. Note that CS is active low. CONTROL WORD According to the requirement, a port can be programmed to act either as an input port or an output port. For programming the ports of 8255 a control word is formed. The bits of control word. The word is written into the control word register which is within 8255. No read operation of the control word register is allowed. The control word bit corresponding to a particular port is set to either 1 or 0 depending upon the definition of the port. MODE SELECTION OF THE 8255 While ports A, B, and C are used to input or output data, it is the control register that must be programmed to select the operation mode of the three ports. The ports of the 8255 can be programmed in any of the following modes. 1. Mode 0, simple I/O mode. In this mode, any of the ports, A, B, CL, and CU can be programmed as input or output. In this mode, all bits are out or all are in. In other words, there is no such thing as single-bit control as we have seen in P0 – P3 of the 8051. Since the vast majority of applications involving the 8255 use this simple I/O mode, we will concentrate on this mode in this chapter. 2. Mode 1. In this mode, ports A and B can be used as input or output ports with handshaking capabilities. Handshaking signals are provided by the bits of port C. The details of this mode are discussed in the third section of this chapter. 3. Mode 2. In this mode, port A can be used as a bidirectional I/O port with handshaking capabilities whose signals are provided by port C. Port B can be used either in simple I/O mode or handshaking mode1. This mode will not be explored further in this book. 4. BSR (bit set/reset) mode. In this mode, only the individual bits of port C can be programmed. This mode is discussed further in the third section of this chapter
  • 19. CONNECTING THE 8051 TO 8255 The 8255 chip is programmed in any of the 4 modes mentioned earlier by sending a byte (Intel calls it a control word) to the control register of the 8255. We must first find the port addresses assigned to each of ports A, B, C, and the control register. This is called mapping the I/O port. The 8255 is connected to an 8051 as if it is RAM memory. Notice the use of RD and WR signals. This method of connecting an I/O chip to a CPU is called Memory; mapped I/O, since it is mapped into memory space. In other words, we use memory space to access I/O devices. For this reason we use instructions such as MOVX to access the 8255. We used MOVX to access RAM and ROM. For an 8255 connected to the 8051 we must also use the MOVX instruction to communicate with it. EPROM 27C256 EPROM was invented to allow making changes in the contents of PROM after it is burned. In EPROM, one can program the memory chip and erase it thousands of times. This is especially necessary during development of the prototype of a microprocessor-based project. A widely used EPROM is called UV- EPROM where UV stands for ultra-violet. The only problem with UV – EPROM is that erasing its contents can take up to 20 minutes. All UV-EPROM chips have a window that is used to shine ultraviolet (UV) radiation to erase its contents. For this reason, EPROM is also referred to as UV – erasable EPROM or simply UV-EPROM. To program a UV-EPROM chip, the following steps must be taken: 1. Its contents mu7st be erased. To erase a chip, it is removed from its socket on the system board and placed in EPROM erasure equipment to expose it to UV radiation for 15 – 20 minutes. 2. Program the chip. To program a UV-EPROM chip, place it in the ROM burner (programmer). To burn code or data into EPROM type. This voltage is referred to as Vpp in the UV-EPROM data sheet. 3. place the chip back into its socket on the system board As can be seen from the above steps, in the same way that there is an EPROM programmer (burner), there is also separate EPROM erasure equipment. The main problem, and indeed the major disadvantage of UV-EPROM, is that it cannot be programmed while in the system board.
  • 20. SRAM 62256 Storage cells is static RAM memory are made of flip-flops and therefore do not require refreshing in order to keep their data. This is in contrast to DRAM, discussed below. The problem with the use of flip-flops for storage cells is that each cell requires at least 6 transistors to build, and the cell holds only 1 bit of data. In recent years, the cells have been made of 4 transistors, which still is too many. The use of 4- transistor cells plus the use of CMOS technology has given birth to a high-capacity SRAM, but its capacity is far below DRAM. WE are write enable, and OE is output enable, for read and writes signals respectively. SERIAL INTERFACE MAX 232 Serial interface is required to communicate with 8051. We need line driver to convert RS232 signal to TTL voltage levels that will be acceptable to the 8051,TXD and RXD pins. One such converter is MAX 232 we are using in our circuit. One advantage of the MAX 232 chip is that it uses a +5V power source same as 8051. The MAX 232 has two sets of line drivers for transferring and receiving the data. For many applications,only one set is used. MAX 232 requires four capacitors ranging from 1 to 22 mfd. Most widely used capacitor is 22mfd. DECODER 74138 The simplest method of decoding is the usage of NAND gate. The 74138 is 3-8 decoder. The three inputs are A,B and C generates 8 active low output of Y0 to Y7. each y output is connected to cs of a memory chip allowing control of 8 memory blocks by a single 74138 IC. ADDRESS/DATA MULTIPLEXING 74373 The PC of 8051 is 16 bit which is capable of accessing 64kb of program code. Pins PO 0 to PO 7 are used for both address and data path. This is called address/data multiplexing for decoding these we are using 74373 as an I/O Interface. So this 74373 receives data from 8051 and demultiplexer.
  • 21.
  • 22. BLOCK DIAGRAM OF ADC 804
  • 23. ADC 804 CHIPS The ADC 804 IC is an analog-to-digital converter it works with +5 volts and has a resolution of 8 bits. In addition to resolution, conversion time is another major factor in judging an ADC. Conversion time is defined as the time it takes the ADC to convert the analog input to a digital (binary) number. In the ADC 804, the conversion time varies depending on the clocking signals applied to the CLK R and CLK IN pins, but it cannot be faster than 110 mS. The ADC 804 pin descriptions follow. CS Chip select is an active low input used to activate the ADC 804 chip. To access the ADC 804, this pin must be low. RD (read) This is an input signal and is active low. The ADC converts the analog input to its binary equivalent and holds it in an internal register. RD is used to get the converted data out of the ADC 804 chip. When CS = 0, if a high-to-low pulse is applied to the RD pin, the 8-bit digital output shows up at the D0 – D7 data pins. The RD pin is also referred to as output enable. WR (write; a better name might be “start conversion”) This is an active low input used to inform the ADC 804 to start the conversion process. If CS = 0 when WR makes a low-to-high transition, the ADC 804 starts converting the analog input value of Vin to an 8-bit digital number. The amount of time it takes to convert varies depending on the CLK IN and CLK R values explained below. When the data conversion is complete, the INTR pin is forced low by the ADC 804. CLK IN AND CLK R CLK IN is an input pin connected to an external clock source when an external clock is used for timing. However, the 804 has an internal clock generator. To use the internal clock generator (also called self-clocking) of the ADC 804, the CLK In and CLK R pins are connected to a capacitor and a resistor. In that case the clock frequency is determined by the equation: F = 1/1.1 RC Typical values are R = 10K ohms and C = 150 pF. Substitution in the above equation, we get f = 606 k Hz. In that case, the conversion time is 110 µs.
  • 24. 8051 INTERFACING TO ADC 804, SENSORS This section will explore interfacing ADC (analog-to-digital converter chips and temperature sensors to the 8051. First, we describe ADC chips, and then show how to interface an ADC to the 8051. ADC devices Analog-to-digital converters are among the most widely used devices for data acquisition. Digital computers use binary (discrete) values, but in the physical world everything is analog (continuous). Temperature, pressure, humidity, and velocity are a few examples of physical quantities that we deal with every day. A physical quantity is converted to electrical (voltage, current) signals using a device called a transducer. Transducers are also referred to as sensors. These sensors are converting natural quantities to an output that is voltage (or current). Therefore, we need an analog-to- digital converter to translate the analog signals to digital numbers so that the microcontroller can read them. A widely used ADC chip is the ADC 804. ADC CONNECTION TO THE 8255 The following is a program for the ADC connected to the 8255 as shown in the diagram. MOV A, # 80H ; control word for PA=OUT, PC=IN MOV R1, K#CRPORT ; control reg port address MOVX @R1, A ; configure PA=OUT AND PC=IN Back: MOV R1, #CPORT ; Load port C address MOVX A, @R1 ; read port c to see if ADC is ready ANL A, #00000001B ; mask all except PC0 JNZ Back ; keep monitoring PCO FOR EOC ; end of conversation, now get ADC data MOV R1, # APORT ; load PA address MOVX A, @R1 ; A=analog data input
  • 25. LCD CONNECTION TO THE 8255 In the following diagram shows how to issue commands and data to an LCD connected to an 8255. In the diagram, we must put a long delay before issuing any information (command or data) to the LCD. A better way is to check the busy flag before issuing anything to the LCD.
  • 26. Two-Terminal IC Temperature Transducer AD590 FEATURES: 1. Linear Current Output: 1 mA/K 2. Wide Range: –558C to +1508C 3. Probe Compatible Ceramic Sensor Package 4. Two Terminal Device: Voltage In/Current Out 5. Laser Trimmed to 60.58C Calibration Accuracy (AD590M) 6. Excellent Linearity: 60.38C Over Full Range (AD590M) 7. Wide Power Supply Range: +4 V to +30 V 8. Sensor Isolation from Case 9. Low Cost PRODUCT DESCRIPTION The AD590 is a two-terminal integrated circuit temperature transducer that produces an output current proportional to absolute temperature. For supply voltages between +4 V and +30 V the device acts as a high impedance, constant current regulator passing 1 mA/K. Laser trimming of the chip’s thin-film resistors is used to calibrate the device to 298.2 mA output at 298.2K (+25°C). The AD590 should be used in any temperature sensing application below +150°C in which conventional electrical temperature sensors are currently employed. The inherent low cost of a monolithic integrated circuit combined with the elimination of support circuitry makes the AD590 an attractive alternative for many temperature measurement situations. Linearization circuitry, precision voltage amplifiers, resistance measuring circuitry and cold junction compensation are not needed in applying the AD590. In addition to temperature measurement, applications include temperature compensation
  • 27. or correction of discrete components, biasing proportional to absolute temperature, flow rate measurement, level detection of fluids and anemometry. The AD590 is available in chip form making, it suitable for hybrid circuits and fast temperature measurements in protected environments. The AD590 is particularly useful in remote sensing applications. The device is insensitive to voltage drops over long lines due to its high impedance current output. Any well insulated twisted pair is sufficient for operation hundreds of feet from the receiving circuitry. The output characteristics also make the AD590 easy to multiplex: the current can be switched by a CMOS multiplexer or the supply voltage can be switched by a logic gate output. PRODUCT HIGHLIGHTS 1. The AD590 is a calibrated two terminal temperature sensor requiring only a dc voltage supply (+4 V to +30 V). Costly transmitters, filters, lead wire compensation and linearization circuits are all unnecessary in applying the device. 2. State-of-the-art laser trimming at the wafer level in conjunction with extensive final testing ensures that AD590 units are easily interchangeable. 3. Superior interface rejection results from the output being a current rather than a voltage. In addition, power requirements are low (1.5 mWs @ 5 V @ +25°C.) These features make the AD590 easy to apply as a remote sensor. 4. The high output impedance (>10 MW) provides excellent rejections of supply voltage drift and ripple. For instance, changing the power supply from 5 V to 10 V results in only a 1 mA maximum current change, or 1°C equivalent error. 5. The AD590 is electrically durable: it will withstand a forward voltage up to 44 V and a reverse voltage of 20 V. Hence, supply irregularities or pin reversal will not damage the device.
  • 28. The 590H has 60 m inches of gold plating on its Kovar leads and Kovar header. A resistance welder is used to seal the nickel cap to the header. The AD590 chip is eutectically mounted to the header and ultrasonically bonded to with 1 MIL aluminum wire. Kovar composition: 53% iron nominal; 29% ±1% nickel; 17% ± 1% cobalt; 0.65% manganese max; 0.20% silicon max; 0.10% aluminum max; 0.10% magnesium max; 0.10% zirconium max; 0.10% titanium max; 0.06% carbon max. The 590F is a ceramic package with gold plating on its Kovar leads, Kovar lid, and chip cavity. Solder of 80/20 Au/Sn composition is used for the 1.5 mil thick solder ring under the lid. The chip cavity has a nickel underlay between the metallization and the gold plating. The AD590 chip is eutectically mounted in the chip cavity at 410°C and ultrasonically bonded to with 1 mil aluminum wire. Note that the chip is in direct contact with the ceramic base, not the metal lid. When using the AD590 in die form, the chip substrate must be kept electrically isolated, (floating), for correct circuit operation. In the AD590, this PTAT voltage is converted to a PTAT current by low temperature coefficient thin-film resistors. The total current of the device is then forced to be a multiple of this PTAT current. Referring to Figure 1, the schematic diagram of the AD590, Q8 and Q11 are the transistors that produce the PTAT voltage. R5 and R6 convert the voltage to current. Q10, whose collector current tracks the collector currents in Q9 and Q11, supplies all the bias and substrate leakage current for the rest of the circuit, forcing the total current to be PTAT. R5 and R6 is laser trimmed on the wafer to calibrate the device at +25°C.
  • 29. SCHEMATIC DIAGRAM OF AD590 Figure 2 shows the typical V–I characteristic of the circuit at +25°C and the temperature extremes.
  • 30. CIRCUIT DESCRIPTION The AD590 uses a fundamental property of the silicon transistors from which it is made to realize its temperature proportional characteristic: if two identical transistors are operated at a constant ratio of collector current densities, r, then the difference in their base-emitter voltage will be (kT/q)(In r). Since both k, Boltzman’s constant and q, the charge of an electron, are constant, the resulting voltage is directly proportional to absolute temperature (PTAT). The above block diagram shows our component hook up. The temperature transducer converts the heat energy into electrical energy. The temperature sensor is in the form of IC which requires biasing and additional driver. The driver circuit is made up of Operational amplifier which functions as a comparator as well as an amplifier and power supply unit for the sensor. This circuit is also called as measuring circuit. This converts the changing signal from the sensor in the form of mV and amplifies and feeds as input for the ADC. The temperature calibration can be done by adjusting the VR1 and VR2 by varying the biasing voltage of OPAMP U1 and U3. The temperature sensor output is fed to U1 as an input and compared with the comparator and inverted amplified and the output is taken from U3 and given as input to ADC as per the circuit. Calibration of the input further explained below.
  • 31. EXPLANATION OF TEMPERATURE SENSOR The way in which the AD590 is specified makes it easy to apply in a wide variety of different applications. It is important to understand the meaning of the various specifications and the effects of supply voltage and thermal environment on accuracy. The AD590 is basically a PTAT (proportional to absolute temperature)1 current regulator. That is, the output current is equal to a scale factor times the temperature of the sensor in degrees Kelvin. This scale factor is trimmed to 1 mA/K at the factory, by adjusting the indicated temperature (i.e., the output current) to agree with the actual temperature. This is done with 5 V across the device at a temperature within a few degrees of +25°C (298.2K). The device is then packaged and tested for accuracy over temperature. CALIBRATION ERROR At final factory test the difference between the indicated temperature and the actual temperature is called the calibration error. Since this is a scale factory error, its contribution to the total error of the device is PTAT. For example, the effect of the 1°C specified maximum error of the AD590L varies from 0.73°C at –55°C to 1.42°C at 150°C. Figure 3 shows how an exaggerated calibration error would vary from the ideal over temperature.
  • 32. The calibration error is a primary contributor to maximum total error in all AD590 grades. However, since it is a scale factor error, it is particularly easy to trim. Figure 4 shows the most elementary way of accomplishing this. To trim this circuit the temperature of the AD590 is measured by a reference temperature sensor and R is trimmed so that VT = 1 mV/K at that temperature. Note that when this error is trimmed out at one temperature, its effect is zero over the entire temperature range. In most applications there is a current-to-voltage conversion resistor (or, as with a current input ADC, a reference) that can be trimmed for scale factor adjustment. CALIBRATION ERROR TRIMMED OUT Each AD590 is tested for error over the temperature range with the calibration error trimmed out. This specification could also be called the “variance from PTAT” since it is the maximum difference between the actual current over temperature and a PTAT multiplication of the actual current at 25°C. This error consists of a slope error and some curvature, mostly at the temperature extremes. Figure 5 shows a typical AD590K temperature curve before and after calibration error trimming.
  • 33. ERROR VERSUS TEMPERATURE: Using the AD590 by simply measuring the current, the total error is the “variance from PTAT” described above plus the effect of the calibration error over temperature. For example the AD590L maximum total error varies from 2.33°C at –55°C to 3.02°C at 150°C. For simplicity, only the large figure is shown on the specification page. NONLINEARITY Nonlinearity as it applies to the AD590 is the maximum deviation of current over temperature from a best-fit straight line. The nonlinearity of the AD590 over the –55°C to +150°C range is superior to all conventional electrical temperature sensors such as thermocouples. RTDs and thermistors. Figure 6 shows the nonlinearity of the typical AD590K from Figure 6. Figure 7A shows a circuit in which the nonlinearity is the major contributor to error over temperature. The circuit is trimmed by adjusting R1 for a 0 V output with the AD590 at 0°C. R2 is then adjusted for 10 V out with the sensor at 100°C. Other pairs of temperatures may be used with this
  • 34. procedure as long as they are measured accurately by a reference sensor. Note that for +15 V output (150°C) the V+ of the op amp must be greater than 17 V. Also note that V– should be at least –4 V: if V– is ground there is no voltage applied across the device. VOLTAGE AND THERMAL ENVIRONMENT EFFECTS The power supply rejection specifications show the maximum expected change in output current versus input voltage changes. The insensitivity of the output to input voltage allows the use of unregulated supplies. It also means that hundreds of ohms of resistance (such as a CMOS multiplexer) can be tolerated in series with the device. It is important to note that using a supply voltage other than 5 V does not change the PTAT nature of the AD590. In other words, this change is equivalent to a calibration error and can be removed by the scale factor trim (see previous page). The AD590 specifications are guaranteed for use in a low thermal resistance environment with 5 V across the sensor. Large changes in the thermal resistance of the sensor’s environment will change the amount of self-heating and result in changes in the output which are predictable but not necessarily desirable. The thermal environment in which the AD590 is used determines two important characteristics: the effect of self heating and the response of the sensor with time. Figure 8 is a model of the AD590 which demonstrates these characteristics. As an example, for the TO-52 package, qJC is the thermal resistance between the chip and the case, about 26°C/watt. qCA is the thermal resistance between the case and the surroundings and is determined by the characteristics of the thermal connection. Power source P represents the power dissipated on the chip. The rise of the junction temperature, TJ, above the ambient temperature TA is: TJ -TA = P (qJC + qCA )
  • 35. The time response of the AD590 to a step change in temperature is determined by the thermal resistances and the thermal capacities of the chip, CCH, and the case, CC. CCH is about 0.04 watt-sec/°C for the AD590. CC varies with the measured medium since it includes anything that is in direct thermal contact with the case. In most cases, the single time constant exponential curve of Figure 9 is sufficient to describe the time response, T (t). Table I shows the effective time constant, t, for several media. Applying the AD590 (GENERAL APPLICATIONS)
  • 36. Figure 10 demonstrates the use of a low cost Digital Panel Meter for the display of temperature on either the Kelvin, Celsius or Fahrenheit scales. For Kelvin temperature Pins 9, 4 and 2 are grounded; and for Fahrenheit temperature Pins 4 and 2 are left open. The above configuration yields a 3 digit display with 1°C or 1°F resolution, in addition to an absolute accuracy of ±2.0°C over the –55°C to +125°C temperature range if a one-temperature calibration is performed on an AD590K, L, or M. Connecting several AD590 units in series as shown in Figure 11 allows the minimum of all the sensed temperatures to be indicated. In contrast, using the sensors in parallel yields the average of the sensed temperatures. The circuit of Figure 12 demonstrates one method by which differential temperature measurements can be made. R1 and R2 can be used to trim the output of the op amp to indicate a desired temperature difference. For example, the inherent offset between the two devices can be trimmed in. If V+ and V– are radically different, then the difference in internal dissipation will cause a differential internal temperature rise. This effect can be used to measure the ambient thermal resistance seen by the sensors in applications such as fluid level detectors or anemometry.
  • 37. Figure 15 is an example of a variable temperature control circuit (thermostat) using the AD590. RH and RL are selected to set the high and low limits for RSET. RSET could be a simple pot, a calibrated multiturn pot or a switched resistive divider. Powering the AD590 from the 10 V reference isolates the AD590 from supply variations while maintaining a reasonable voltage (~7 V) across it. Capacitor C1 is often needed to filter extraneous noise from remote sensors. RB is determined by the b of the power transistor and the current requirements of the load.
  • 38. OPERATION OF ANALOG TO DIGITAL CONVERTER CIRCUIT The conversion of analog to its digital equivalent is of utmost important . One of the reason is its easy interfacing facility with the micro processor. Outputs from load-cell, Thermocouple etc. can be easily interfaced to the processor. The ADC card provided permits the user to have access between external analog circuitry with the processor. The ADC input is given through a potentiometer. This output is fed to ADC - 0804 to provide an equivalent digital value corresponding analog input. The digital output which is 8bits wide is tied to port A bits of 8255. Port A bits are defined as input port in the control word i.e., data in port A bits are read by the processor. Logic gates are used of chip selection purpose for the 8255 IC. The data along with the control signals are carried to the trainer kit via the 50 pin flat ribbon cable. 8255 control register address - 6063H 8255 Port A address - 6060H 8255 Port B address - 6061H 8255 Port C address -6062H
  • 39.
  • 40. ADC PROGRAM ; port A receives digital o/p from adc ; port B for r/w ;"ADC AND DAC PROGRAM" ;port A receives digital o/p from adc ;port c for r/w 9000 main: 9000 906063 mov dptr,#6063 9003 7490 mov a,#90h;define port A as i/p,remaining as o/p 9005 F0 movx @dptr,a 9006 906062 mov dptr,#6062 9009 74FF mov a,#ffh ;start of conversion 900B F0 movx @dptr,a 900C 906062 mov dptr,#6062 900F 7400 mov a,#0h 9011 F0 movx @dptr,a 9012 906062 mov dptr,#6062 9015 74FF mov a,#ffh ;end of conversion 9017 F0 movx @dptr,a 9018 129022 lcall delay 901B 906060 mov dptr,#6060 ;port A 901E E0 movx a,@dptr ;getting digital values 901F 120BBB lcall 00bbh
  • 41. ;DELAY SUBROUTINE 9022 delay: 9022 79FF mov r1,#ffh 9024 Loop: 9024 00 nop 9025 00 nop 9026 00 nop 9027 00 nop 9028 00 nop 9029 00 nop 902A 00 nop 902B D9F7 djnz r1,loop 902D 22 ret ;Note RESULT STORED IN ACCUMULATOR
  • 42. MEASURING AND DISPLAY This voltage after suitable amplification is given to ADC 804 which converts into digital form. This digital output of the ADC is given to the Microcontroller 8051 by interfacing through 8255 with I/O address chip. The Microcontroller calculates the change in temperature with suitable interfacing through 8255 via decoder and displays the temperature in the LCD matrix module. The function of each I/O,EPROM,RAM,Decoder , Memory mapping ,Memory address are explained in detail in the component description. DISPLAY PANEL PROGRAM 1.initlcd: initialises the lcd ;2.putchar: displays the char. in A at the current cursor pos. ;3.disadr: displays the hex.address (content of the adr.buffer) ; in the 1st line (like 8100:) ;4.disopb: displays the content of the o/p buff. (disassemble) ;5.gotoxy: ;6.clrscr: ; ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ; ;main: call initlcd ; call disadr ; rst 1 ; ;
  • 43. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;initlcd: ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ INITLCD: LXI D,0EA6H ;for 15msec CALL DELAY MVI A,38H ;functionset (useless) OUT LCDCMD LXI D,0401H ;for 4.1msec CALL DELAY MVI A,38H ;functionset (useless) OUT LCDCMD LXI D,0019H ;for 100usec CALL DELAY MVI A,38H ;fuction set{0011 1000} OUT LCDCMD LXI D,0014H ;for 40usec + 40us CALL DELAY MVI A,0fH ;Display ON/OFF{0000 1111} OUT LCDCMD LXI D,0014H ;for 40usec + 40us CALL DELAY MVI A,06H ;entry mode{0000 0110} OUT LCDCMD LXI D,0014H ;for 40usec + 40us CALL DELAY MVI A,01H ;Clear Display{0000 0001} OUT LCDCMD LXI D,019AH ;for 1.64msec CALL DELAY LXI D,000AH ;for 40usec CALL DELAY RET ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;DELAY FUNCTION ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;250 msec for count FFFF DELAY: DCX D ;total no. of T states=24*(count-1)+31
  • 44. MOV A,E ORA D JNZ DELAY RET ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;PUTCHAR: ; I/P:A-HAVE THE ASCII VALUE ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ PUTCHAR: PUSH H PUSH D PUSH B MOV D,A LDA FLGSERIAL ;to check serial mode CPI 01H JNZ LOCALD MOV A,D CALL TRACHA ;to disp. char on pc monitor JMP RET10 LOCALD: MOV A,D OUT LCDDIS LXI D,000AH ;for 40usec CALL DELAY RET10: POP B POP D POP H RET ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;DISPLAY ADDRESS ---in first line (like 8100: ) ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ DISADR: LDA ADRBUF CALL PUTBYTE LDA ADRBUF+1H CALL PUTBYTE MVI A,3AH ;ascii of ':'-to display after the addr CALL PUTCHAR MVI A," " CALL PUTCHAR
  • 45. RET ;*********************************************** ;ASCII ;*********************************************** ASCII1: ANI 0FH CPI 0AH JC ADD ADI 07H ADD: ADI 30H RET ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;DISPLAY OUTPUT BUFFER ----after disassemble ; It displays addr,opcodes in first line and ; mnemonics in second line. ; line 1: xxxx: xx xx xx ; line 2: lxi h,5050(mnemonics) ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ DISOPB: MVI A,06H ;DDRAM addr.06--(1000 0110)=86H CALL GOTOXY LXI H,OPBUF MVI C,03H CNDIS: MOV A,M ;Display the opcodes in the first line CALL PUTCHAR INX H MOV A,M CALL PUTCHAR INX H MVI A,20H ;SPACE CHARACTER CALL PUTCHAR DCR C JNZ CNDIS LDA FLGSERIAL CPI 01H JZ GIVESPACE MVI A,40H ;DDRAM addr.40--(1100 0000)=C0H CALL GOTOXY JMP CNDIS1 GIVESPACE:MVI A," " CALL PUTCHAR
  • 46. CALL PUTCHAR CNDIS1: MOV A,M CPI 00H RZ CALL PUTCHAR INX H JMP CNDIS1 ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ CUROFF: MVI A,0CH ;{0 0 0 0 1 D C B}=00001100 OUT LCDCMD LXI D,0014H ;for 40usec + 40us CALL DELAY RET ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ CURON: MVI A,0FH ;{0 0 0 0 1 D C B}=00001111 OUT LCDCMD LXI D,0014H ;for 40usec + 40us CALL DELAY RET ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ LCDOFF: MVI A,08H ;{0 0 0 0 1 D C B}=00001000 OUT LCDCMD LXI D,0014H ;for 40usec + 40us CALL DELAY RET ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;GOTOXY FUNCTION ; MOVES LCD CURSOR POSITION ;I/P: A-DDRAM ADDR 00H-27H for 1st line ; 40h-67h for 2nd line ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ GOTOXY: MOV D,A LDA FLGSERIAL CPI 01H
  • 47. JNZ LGOTO MOV A,D CPI 40H JC ENDGOTO MVI A,0AH CALL PUTCHAR JMP ENDGOTO LGOTO: MOV A,D ORI 80H OUT LCDCMD LXI D,000AH ;delay for 40us CALL DELAY ENDGOTO: RET ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;CLRSCR FUNCTION ; ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ CLRSCR: LDA FLGSERIAL CPI 01H JNZ LCDCLR MVI A,0AH CALL PUTCHAR RET LCDCLR: MVI A,01H OUT LCDCMD LXI D,01BAH ;for 1.64ms (019AH) for extra delay (01BAH) CALL DELAY RET
  • 48. BIBLIOGRAPHY WEBSITES 1. http://www.atmel.com 2. http://www.google.com 3. http://www.8052.com BOOKS 1. THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEMS (Muhammad Ali Mazidi ) 2. MICROPROCESSOR AND ITS APPLICATIONS (S.Rajasekar,D.Madhavan) 3. MICROPROCESSOR BASED TEMPERATURE INDICATOR (C.Rameshu, A.P.Sivaprasad) 4. INDUSTRIAL INSTRUMENTATION (C.Dhanasekaran) HARDWARE AND TECHNICAL SUPPORT Durga Electricals,Chennai
  • 49. CONCLUSION AN OVERVIEW Temperature measurement system using microprocessor/microcontroller has been described in this report. The system consists of a combination of hardware and software. The system has relatively fast response and high accuracy. The overall system is also quite simple to implement and relatively cheap. APPLICATION This method has got a wide variety of industrial, domestic, powerplant, school and colleges and research institutes application. This system plays a major role in deciding the quality of petro-chemical industry product e.g.oil, fertilizer, and de-salination and space research. This controller can accept a variety of inputs to measure different variables such as temperature transducer, strain gauges, load cells, flow, pressure, level, speed, time, by way of suitable interfacing and Programming. We have experienced very many difficulties in carrying out the project which was overcome by suggestions and guidance given by our parents, friends and well-wishers. We have gained more knowledge about the sections involved in our project. We feel very happy and proud to completed this project. We thank one and all who helped for the successful completion of the course.