Anda di halaman 1dari 6

- 1575 -

Design of Smart Temperature Transmitter


Heping Hang1, Juan Song2, Fang Yang3 and Xiaobing Fan4
Department of Biomedical Engineering, Biochemical Engineering College of Beijing
Union University, Beijing, China
(Tel : +0086-27-52072039; E-mail: hang_heping@sina.com)
Abstract The design of digital temperature transmitter based on microcontroller
ADuC824 is introduced. With the
peripheral feature integrated in microcontroller ADuC824 the hardware is simplif
ied and reliability is improved. The
interface of thermocouple with A/D converter in ADuC824 and RS232 interface with
master computer is presented. The
non-linear compensation and cold-junction compensation of thermocouple is provid
ed.
KeyWords ADuC824, Thermocouple, Transmitter
1. INTRODUCTION
With quickly development of computer technique,
the huge change of transducer has happened. Intelligent
sensors have become more powerful, thanks to integrate
microcontroller with sensors.
In this time of strongly improvement of
information technique, there are two important aspects
about intelligence and integration of intelligent sensors.
However, the degree of intelligence and integration of
intelligent sensors mainly depend on capability of
microcontroller integrated with intelligent sensors.
ADuC824 is a complete smart and high capability
microcontroller produced by Analog Devices, Inc.
Integrating it with sensor, high compositive and
intelligent sensor is formed.
Thermoelectric potential signal measured by
K-type thermocouple is used. After the signal is aligned,
it is carried ADuC824 coring of signal acquisition
processor. Making use of amplifying circuit of
ADuC824 and sigma-delta A/D, the signal is converted
into digital signal. Then the exact value of physical
quantity is gained through digital signal processing. At
last, such parameters as temperature value are
transmitted into PC by RS232.
Development environment is based on Keil C. It is
a compositive development environment, which
integrates project management, source code
programming language and procedure debug. So C
source code and source assembler are compiled, and
object file and library file are linked or redefined, and
HEX file is created, and object file is debugged.
Comparing with assembler, C language has many
advantages, such as easily maintenance, easily
understand and suitable for big project so on.
2. FEATURES OF ADuC824
ADuC824 produced by American’s AD company
is a high capability microcontroller, and is a fully data
acquisition system-on-a-chip. All kinds of functional
units are integrated in a single chip, for example, -
ADC having two-channel high precision, temperature
sensors, PGA, 8-bit MCU, Flash MemoryRAM and
timers/counters. It is available in 52-pin PQFP packages.
The composition and features of ADuC824 are as
follows.
(1) The microcontroller core is an 8051 and therefore
8051-instructionset-compatible. The device operates
from a 32 KHz crystal with an on-chip PLL generating a
high-frequency clock of 12.58 MHz. This clock is, in
turn, routed through a programmable clock divider from
which the MCU core clock operating frequency is
generated. The ADC output resolution will vary with the
programmed gain and output rate. The microcontroller
core consists of three 16-Bit Timer/Counters, 26
Programmable I/O Lines, 12 Interrupt Sources and two
Priority Levels.
(2) 8 Kbytes of nonvolatile Flash/EE program memory
are provided on-chip. 640 bytes of nonvolatile Flash/EE
data memory and 256 bytes RAM are also integrated
on-chip.
(3) The two independent sigma delta ADCs include a
24-bit primary channel and a 16-bit auxiliary channel.
The ADC output data rates are programmable and the
ADC output resolution will vary with the programmed
ICROS-SICE International Joint Conference 2009
August 18-21, 2009, Fukuoka International Congress Center, Japan
PR0002/09/0000-1575 ¥400 © 2009 SICE
- 1576 -
gain and output rate. The ADuC824 also incorporates
additional analog functionality with a 12-bit DAC,
On-chip Temperature Sensor, dual exitation current
sources, a bandgap reference and time interval counter.
(4) The part operates from a single 3 V or 5 V supply.
It contains normal, idle and power down modes.
(5) The ADuC824 also contains three serial I/O ports
(SPI, UART, and I2C-compatible), a watchdog timer
(WDT) and a power supply monitor (PSM).
3. GENERAL DESIGN
Digital temperature transmitter system is composed
of sensor, data processing and display, communication
interface and source. The hardware framework is shown
in Fig. 1.
Fig. 1 Digital temperature transmitter circuit framework
Using thermocouple in sensor
Using ADuC824 in data processing
Using Liquid crystal display(LCD)
Using RS-232 duplex interface communicating
with upper monitor
Using DS18B20 measuring local temperature to
compensate cold-junction
The software of the sytem is compiled by Keil C
language, which are composed of modules, such as
signal acquisition, scale converter, non-linear
compensation, zero compensation, sensitivity
compensation, LCD display, order explanation and
processing and serial communication ISR. The main
program flowchart is shown in Fig. 2.
Digital temperature transmitter circuit
DS18B20
Voltage
adjustment
RS232/TTL
Level switch
LCM141 LCD
K-type
thermocouple
RS232 interface
6V~24VDC
ADuC824
microcontroller
UART interface I/O ports I/O ports
- 1577 -
Fig. 2 The main program flowchart of ADuC824
4. SIGNAL ACQUISITION AND
PROCESSING
Thermocouple is a small, firmly and very cheap
temperature sensor running in a widely temperature
range, especially in poor environment measuring
extremely temperature (to 2300°C). Moreover, current
source is not used in thermocouple. Therefore, it is very
attractive for many temperature collect system.
However, the output voltage of thermocouple is only
mV level. So it is necessary to exactly amplify for
further processing. In addition, CJC technique is
provided to cold-junction compensation. It has well
known about nonlinear thermocouple settled by
nonlinear compensation of digital method.
The double-end voltage of K type thermocouple
named analog input voltage are respectively linked to
positive input port and negative input port of primary
ADC (AIN1, AIN2), which is carried ADuC824 coring
of signal acquisition processor. Through amplifying
circuit of ADuC824 and sigma-delta A/D the signals are
converted into digital signals. At last, the exact
measured temperature is defined by digital processing.
4.1 Data Acquisition
It is necessary to join A/ D conversion chip for
conventional data acquisition based on microcontroller,
which integration is low. ADuC824 contains two
sigma-delta ADCs with digital filter (a 24-bit primary
channel and a 16-bit auxiliary channel). The primary
ADC collects K-type thermocouple electric potential
signals and employs A/D conversion. Moreover, The
primary ADC channel employs difference input and has
buffers.
For the reason that the signal transformed from the
A/D can be interfered by the external factors, it should
be filtered by digital filter, in order to filter the
interferential signal and enhance its authenticity. Digital
filter contains several methods, for instance, limited
amplitude filtering, averaging value filtering, medium
site filtering, and inertia filtering so on. In this system,
the averaging value filtering is selected, which can
obtain a stable digital quantities transformed from the
A/D.
4.2 Scaling Transform and Error Compensation
The millivolt signal exported from thermocouple
can be transformed into the digital quantities by A/D
conversion and digital filter. Scaling transform denotes
the process converting these digital quantities into
corresponding temperature values.
The formula for the scaling transform is
( )
0
0
0 0 N N
N N
A A A A
m
x
x m −

= + − ,
A0 : the lower limit of measured temperature
Am : the upper limit of measured temperature
Ax: the actual temperature value
N0 : the digital quantities corresponding to A0
Nm : the digital quantities corresponding to Am
Nx : the sampling digital quantities.
Because the thermoelectric potential has a
nonlinear relation with temperature, the correlation
should be linearized, that is, nonlinear compensation,
which can be realized by software. In order to ensure
the higher accuracy during the temperature
measurement within the measuring range and according
to scaling meter of the K type thermocouple, the
process are the following steps. Firstly, the function
N
Begin
initialization
operative interrupt
thermocouple sampling
DS18B20 sampling
scale converter
error compensation
cold junction
compensation
LCD display
Execute orders of
upper monitor
Y
uart_end=1
1578
between the input temperature and output millivolt is
calculated by a method of polynomial function fitting in
the data acquisition and processing system of sensors.
Then the section lines replace fitting function by the
sectional processing method. In the program, we judge
which section region the measured data belongs to
firstly, and calculate the value by the corresponding
linear formula. It can be seen that the bigger the number
of section is, the more accurate the linearization is. In
this system, the unit section is 100 degree, which can be
used to calculate the accurate temperature values.
Especially, the linearization emendation has very useful
effect at the higher temperature. The parameters of the
section lines are deposited in EEPROM of Aduc824,
which can be amended conveniently in the future.
As for the zero and sensitivity error of the
transmitter, it can also be emendated by software. In the
same way, the emendation parameters are deposited in
EEPROM of Aduc824. Through the RS232 interface,
the Upper machine sends the command to modify the
content in EEPROM, and amends the zero and
sensitivity error. In addition, the minimum, maximum
and other measured temperature data of the
thermocouple are deposited in EEPROM, therefore,
they can also be amended by the Upper machine to
meet the different needs.
Dual channel ADC module in ADuC824 contains
four special function registers for imbalance and gain
calibrations; these registers drive calibration logic,
which can lead to in power hardware calibration for
booting self inspection, and this ensures the ADC can
always get the best performance. In addition, users can
initialize the device's calibration conditions through
software, in order to adapt to the specific working
conditions.
4.2 Cold junction Compensation
The output voltage of thermocouple is a function
of the temperature difference between the two end
nodes. In order to guarantee the output popential of the
cold junction in a non zero state varies single valued
with the measured temperature, cold compensation is
required.
The output potential of a thermocouple is a
function of the temperature difference between the two
nodes, which can be expressed as:
E(t,0)=E(t,t0)+E(t0,0)
Here E(t,0) is the thermoelectric potential after
cold junction compensation. E(t,t0) is the measured
thermoelectric potential. E(t0, 0) is the thermoelectric
potential of the cold junction temperature relative to
that of 0°C.
The compensation principle is to artificially add an
environmental temperature t0 controlled temperature
sensor in the cold junction of the thermocouple, thus
producing the electrical parameters exactly offset the
changes of E(t,t0) caused by temperature changes at the
cold junction, maintaining E(t,0) unchanged, that is,
E(t,0)=f(t)
Here f(t) is the temperature function. This shows
that E(t,0) only correlates with the temperature t of the
heated end, eliminating effect of the temperature at the
cold junction on the E(t,0), so obtaining compensation
at the cold junction. The system takes room temperature
as the cold junction, which is measured by DS18B20.
The temperature corresponding to the thermocouple
thermoelectric potential adding to the environmental
temperature measured by DS18B20 at the cold junction
is the temperature of the heated end, that is the
temperature after compensation. The temperature
measurement process is as follows:
(1) Sample the A/D converting value of the
thermocouple temperature, corresponding to the
numerical value of E(t,t0);
(2) Sample the temperature value of DS18B20, get the
temperature at the cold junction;
(3) According to the previous broken line equation to
calculate the numerical corresponding to the
temperature at the cold junction, which is also the
numerical equivalent E(t0,0);
(4) Summarize the thermocouple temperature A/D
converting value and the value corresponding to the
cold junction temperature, that is, the summarization of
the quantities of E(t,t0) and E(t0,0), obtaining the value
of at E(t,0);
(5) According to the above broken line equation to
calculate the the exact value of the measured
temperature.
1579
4.4 Communication Interface
ADuC824 has the serial communication ports to
conduct serial communications. The RS232 is a
full duplex protocol, it can send and receive signals at
the same time. To achieve the standard RS232
communication, a ADM202 or MAX232 chip is
required to convert the TTL electric level of ADuC824
asynchronous communication protocol to the standard
RS232 electric level, wiring as Fig. 3.
Fig. 3 The principal of serial communication interface
AdcC824 communication software modules can be
divided into reception (interruption service procedures)
and sending at the node of signal acquisition processor.
Reception modules (interruption service
procedures): Reception is in the way of interruption.
ADuC824 gives out a communication interruption after
receiving a signal from the up PC, and then response by
implementing the interruption service procedures.
Transmit modules: Judge the TI (Send interruption)
state by inquiries, when TI is one that had been sent
completed, TI will be reset.
The up PC software written by using VB, serial
communications MSCOMM control is used for serial
communication. Baud Rate can be set, to send orders to
check returned values. ASCII code communication
method is used.
At the same time, the temperature measured by the
thermocouple is displayed on the LCD screen LCM141.
5. CONCLUSIONS
ADuC824 represents the development trend of
current SCM.Because of its rich resources in the chip,
integrated two way high precision sigma  type ADC,
and other functional components, it is particularly
applicable for the digital temperature transmitter of this
system, greatly simplifies the hardware structure. This
system uses digital compensation technology to
calibrate the error and cold junction compensation with,
improving the measurement accuracy and hardware
integration. The online programmable technology of
ADuC824 brings great convenience for development
and future system upgrades.
6. REFERENCES
[1] Li Gangthe Principle and Application Technology
of Single Chip Computer of ADuC8XX series”
Beihang University Press2002
[2]Yin Yong hongCheng Wanginstruction manual
of Single Chip Computer development environment
uVision2 and firmware programme & debug of
USB”Beihang University Press2004

Anda mungkin juga menyukai