This is only a preview of the January 2010 issue of Silicon Chip. You can view 18 of the 104 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "A Multi-Function GPS Car Computer, Pt.1":
Items relevant to "A Balanced Output Board for the Stereo DAC":
Items relevant to "Precision Temperature Logger & Controller, Pt.1":
Articles in this series:
Items relevant to "Voltage Interceptor For Cars With ECUs, Pt.2":
Items relevant to "Web Server In a Box, Pt.3":
Purchase a printed copy of this issue for $10.00. |
A precision
Temperature Logger
and Controller, Pt.1
By LEONID LERNER
This Temperature Logger & Controller is based on the Dick Smith Electronics
Q1437 digital thermometer. It records & displays two temperature channels
once a second on a PC over a period of up to 12 hours. With appropriate
thermocouples, temperatures from -200°C to +1300°C can be recorded, with
the display range, resolution, and temperature program adjustable in real
time while the data is being logged.
A
S WELL AS PROVIDING precise temperature logging,
the project will control a 230V AC heater rated up to
10A, in response to the temperature readings in on/off
mode and a time-temperature regime set with up to four
set points.
The accuracy of the instrument is 0.1% (excluding probe
error) and its precision is 0.1°C over the entire range. The
logger/controller interfaces to your PC through the parallel
port using a standard DB25 connector.
The precursor to this project was the PID Temperature
Controller featured in the July 2007 issue which in turn
was based on the Digital Thermometer/Thermostat featured
in the August 2002 issue of SILICON CHIP and previously
available as a kit from Dick Smith Electronics.
That kit project has long been discontinued which made
this comprehensive update necessary.
This new project dispenses with the original microcontroller and its associated circuitry from the July 2007 design,
with all functions now performed by the attached PC. This
significantly simplifies hardware construction which now
62 Silicon Chip
involves soldering less than a dozen discrete components.
The down-side in eliminating the microcontroller is that
the device can no longer be operated stand-alone.
In practice, this is not a serious inconvenience since the
controller will mostly be used in the temperature logging
mode, with the operator observing variations in real time.
In this mode, the role of the microcontroller was, for the
main part, that of a communications device.
Its other functions, such as controlling the analog-todigital converter (ADC), are now performed by the DSE
Q1437 digital thermometer, while the Triac control signal
is generated by the PC.
The improvements arise from the fact that temperature
readings are now logged with the accuracy and precision
of the DSE Q1437 digital thermometer. This is a professional instrument and is based on modern microprocessor technology with a super low-noise ADC and custom
ambient temperature compensation circuitry, which will
be described in greater detail below.
The accuracy, reproducibility and noise level of this insiliconchip.com.au
strument have been found
to be much superior to
those available with the previous circuitry. Temperature
control to within fractions of
a degree is now possible in
many cases.
The fact that the Q1437 thermometer draws very little current enables it
to be battery powered, eliminating power supply
noise. This is a significant feature since a 0.1°C
temperature precision for a type K thermocouple
translates to a 4µV precise voltage measurement.
Another new feature associated with the use of the
Q1437 is that two temperature values can be logged
at the same time. This is useful when recording
the temperature of a fluid while controlling the
temperature of the oven heating it.
The device interfaces to the computer using the
parallel port of the PC, which is still available on
modern desktop machines.
Although the USB port is now more common,
this was deemed unsuitable because the interface
uses several signal lines and multiplexing them onto
a serial communication would require hardware which is
almost entirely absent in a parallel port design.
Moreover the logger captures data by running the PC for a
very short period in “real-time”(ie, by disabling interrupts).
siliconchip.com.au
The USB port is not designed to
operate in this fashion.
Circuit description
The circuitry consists of two
independent blocks: the thermometer section and the Triac
load controller.
Since the Q1437 digital thermometer does not have a suitable
interface we need to provide one by
soldering three wires and a couple
of capacitors to appropriate pins
and attaching a suitable socket on
the connection panel. This is connected to the parallel port of the PC.
To do this, an understanding of the
operation of the Q1437 is required,
as outlined below.
Fig.1 includes a block diagram of
the internal circuitry of the Q1437
digital thermometer. Although the
circuitry itself is complex, the basic
operation as well as the functioning of
the interface, can be easily understood.
Differing temperatures between the junctions of the
thermocouples TC1 and TC2 and their connections at the
instrument generate a voltage difference and this is apJanuary 2010 63
148H
THERMISTORS
9,10
5
THERMOCOUPLE
1
13
THERMOCOUPLE
2
22M
1
3
14
LTC2433
IN–
ANALOG
MULTIPLEXER
MSP430F
MICRO
11
12
9
680pF
T
24 12
CS
WR
32 x 4
LCD
HT1621
DATA
32 x4 LCD
CONTROLLER
2.5mm
STEREO
JACK PLUG
B
(SHIELDED STEREO CABLE)
25 13
(NEW)
2.5mm
STEREO
JACK SOCKET
B
R
T
R
680pF
22 10
230V AC
INLET (MALE)
CONTROLLER BOX
21 9
PC
PRINTER
PORT
F1 10A
20 8
19 7
18 6
17 5
16 4
130
(SHIELDED
MONO
CABLE)
390
6
1
DB9F
DB9M
5
5
15 3
14 2
3
OPTO1
MOC3041
3
A
2
E
A2
G
TRIAC1
BTA10A1 600B
39
1W
4
1k
10nF
250VAC
X2 CLASS
(BOX)
230V AC
OUTLET
(FEMALE)
1
E
N
23 11
8
ANALOG
TO DIGITAL
CONVERTER
12
DB25M
5
9
7
IN+
N
BIAS
NETWORK
4
74HC4052
22M
DSE Q1437 DIGITAL THERMOMETER
SPI
INTERFACE
A
CAUTION: ALL PARTS WITHIN RED SECTION OPERATE AT 230V AC
SC
2010
TEMPERATURE LOGGER & PWM LOAD CONTROLLER
Fig.1: the orange section at the top of this diagram is the (modified) DSE digital thermometer.
The remainder is the interface to your PC and the power switching circuitry. Note that the
parts & wiring in the red shaded section all operate at 230VAC.
plied via custom thermistors (148H) to the inputs of the
74HC4052 analog multiplexer.
If the thermistors were not present the thermocouple
circuit would give zero voltage when the thermocouple
junction is at ambient temperature, rather than at 0°C.
The four thermistors and associated bias circuitry act to
compensate for this by adding a potential difference with
increasing ambient temperature in such a way that the total
voltage behaves as if the reference end of the thermocouple
WARNING!
Most of the parts in this circuit operate at high voltage
(ie, 230V AC) and contact could be lethal. Do not touch
any part of the circuit while it is plugged into the mains
and do not operate it outside its earthed metal case (see
Pt.2 next month).
Do not build it unless you are experienced and know
exactly what you are doing.
64 Silicon Chip
BTA10-600B
A1
A2
G
circuit was held at a constant 0°C.
Next, the voltages generated by thermocouples 1 and
2 appear in turn at the outputs of the 74HC4052 analog
multiplexer in response to signals sent by the MPS430F
microcontroller. These voltages are applied differentially to
the IN+/IN- inputs of the LTC2433 low-noise (1.45µV RMS)
16-bit delta-sigma ADC (analog-to-digital converter). This
ADC can operate at reference voltages as low as 100mV
and has a correspondingly low 5µV offset.
In addition, it is ultra-linear with a maximum 0.16 LSB
full-scale error and also incorporates integral 87dB (factor
of 22,000) notch filters at mains frequency (50Hz and 60Hz).
The converted digital temperature signal is passed serially via a 3-pin interface (pins 7, 8 & 9 of the LTC2433) to
the MPS430F microcontroller. This is a very low power
(280µA active, 1.6µA stand-by, 0.1µA RAM-retention mode)
16-bit microcontroller in a 64-pin QFP (quad flat package). The controller has three main functions: it reads the
keyboard, gathers voltage data from the ADC, translates
the data to temperature and passes it for display to the
siliconchip.com.au
Fig.2: the GUI is quite intuitive and you should have no
problems driving it.
C
M
Y
CM
MY
CY
CMY
K
Triac load controller
The load controller is an opto-coupled Triac circuit with
an RC snubber to reduce overshoot for inductive loads. The
MOC3041 zero-crossing Triac driver minimises electrical
noise and surge current when loads are close to resistive.
The MOC3041 requires a current of 15mA to ensure turn-on
and this is easily sourced from a single pin of the parallel
port by a 130Ω resistor, dropping a nominal 2V.
Triac switching is achieved in software by toggling pin
siliconchip.com.au
W3926 Marque Magnetics Ad.ai
7/13/07
3:36:14 PM
Talk to a company
that speaks your
language
• Technical Engineering
support
• Custom Design
capability
• Direct
Replacement
of ‘standard’ parts
• Stocking options
• NZ manufacturing facility
• Company owned China
manufacturing facility
• ISO 9001 and ISO 13485 (medical) certified
And all available to you!
Ph: +64 9 818 6760
11 Culperry Road, Glendene, Auckland, New Zealand
www.marque-magnetics.com
W3926
HT1621 32-character 4-line LCD controller. This transfer
is performed by means of three lines acting as inputs on
the HT1621: the CS-bar (chip select) line, the WR-bar data
write line and the data line.
As evident from its 32x4 specification, the HT1621
contains a 128-bit RAM which it reads out sequentially at a
rate fixed by an internal clock and outputs on multiplexed
lines which drive the liquid crystal display (LCD). These
128 bits correspond to elements on the Q1437 LCD and
are distributed essentially randomly, as this display does
not correspond to a 32x4 format.
The input side of the HT1621, which is independent of
the output, is used to update the 128-bit data when new
values are required.
Different command modes are available to either update
the data as a single 128-bit block or as individual values.
The Q1437 uses the former mode exclusively, so the block
of data written to the HT1621 is always of a fixed size – 173
bits. The extra 45 bits sent in each frame take the form of
three 12-bit commands to initialise the HT1621 and a 9-bit
command to instruct single block update.
While the requisite bits are presented on the data line
(pin 12), the WR-bar line driven by the microprocessor acts
effectively as a clock, with a rising edge indicating good
data on the data line. This signal is used by the software
component of our interface to sense when to read the data.
Data update on the input side of the HT1621 occurs
fairly slowly at a rate of about eight updates per second,
however the data itself is transmitted quickly with each
data bit about 1.5µs wide. At this frequency, the effects of
reflections due to inductance on the line connecting the
Q1437 to the PC are significant and can result in false readings. The addition of 680pF capacitors between signal and
ground on both the DATA and WR-bar lines at the parallel
port input of the PC suitably damps the oscillations and
provides reliable operation, with no false readings using
a simple 2-core shielded cable connection.
January 2010 65
Parts List –Temperature Logger
and PWM Load Controller
1 Dick Smith Electronics Q1437 digital thermometer
1 PC board, 87 x 54mm, code 10101101
1 diecast aluminium case, Jaycar HB5040 to suit
1 IEC 3-pin male chassis-mount socket
1 IEC 3-pin female chassis mount socket
1 M205 safety fuse holder (Altronics S-5992,
Jaycar PP4005)
1 10A M205 fuse
1 25-pin DB25M plug
1 9-pin DB9M plug
1 9-pin DB9F socket
1 2.5mm stereo jack socket and matching jack plug
1 BTA10-600B 600V 10A insulated tab Triac (do not
substitute)
10 Nylon cable ties
1 MOC3041 zero-crossing Triac opto-isolator (OPTO1)
Capacitors
1 10nF 250VAC class X2
2 680pF ceramic
Resistors (0.25W, 1% unless stated)
1 1kΩ
1 390Ω
1 130Ω 1 39Ω 1W 5%
Miscellaneous
1 solder lug, mains-rated cable, ribbon cable, 2-core
shielded cable, sing-core shielded cable, heatshrink
tubing, screws, nuts, lockwashers, solder.
2 of the parallel port, which drives the MOC3041 optoisolator. The Triac on-period is nominally set to one second,
as established by the timer function of the Windows API.
Since Windows is not a real-time operating system,
precise timing can not be guaranteed, with a variation of
typically 10% occurring in pulse width from cycle to cycle.
This is not a problem for this present application since average duty cycle is still maintained to about 5%, while on/
off control is the main mechanism by which temperature
is controlled, with duty cycle being a secondary control
applied manually to reduce overshoot.
Software
There are two components to the project software. The
main component is written in Visual C++ and provides
the graphical user interface (GUI) to the device, which can
be seen in Fig.2. It also analyses the data block acquired
from the Q1437 digital thermometer, extracts the data corresponding to the two temperature channels, displays the
temperature on the screen and graphs the data using the
scales entered by the user.
In addition, it operates the Triac load controller in accordance with the time-temperature program entered in
the GUI.
The second component consists of the data block capture
routine and is written in assembly language. The reason for
this is that the bit-width of the data frame is about 1.5µs,
which is close to the 1µs response time of the standard
parallel port, hence speed is of the essence for proper
operation. In addition, code running under Windows is
periodically interrupted to perform task switching, which
if allowed in the course of data capture leads to missing
bits and data corruption.
Critical tasks can disable interrupts (except non-mask
able interrupts) during their execution and restore them
on completion and this does not interfere with Windows
provided the task is brief. In our case, field acquisition
takes up about 1ms with a period of about 1Hz, which is
acceptable.
For PCs running Windows 95/98, the above code presents
no particular problems and the low-level assembly routine
can be linked as part of the overall application.
However, in later Windows versions, in particular Windows NT, XP etc, ordinary applications cannot suspend
interrupts, while direct port access to individual applications can only be granted by code running at operating
system privilege (ring-0).
Moreover, in Windows XP, changes made to the IOPL
flag bits controlling port access at ring-0 level are restored
by the operating system upon return to the application,
making these flags essentially redundant.
For this reason, the assembler code is incorporated in
its entirety into a device driver file (.sys file), which is
installed and registered the first time the main program
is run, subsequently performing access to the ports and
passing data to the main routine.
What’s coming?
That’s all we have space for this month. Next month,
we’ll show you how to wire up the interface to the digital
thermometer and give the full construction details for the
SC
Temperature Logger & Controller.
into VIDEO/TV/RF?
Television & Video
Technology – by KF Ibrahim
New edition has a full and
compre-hensive guide to
video and TV tech-nology
including HDTV and DVD,
$
58 starting with fundamentals.
$
70
NEW LOW PRICE!
DVD Players and Drives
$
95
NEW LOW PRICE!
$
85
– by KF Ibrahim
DVD technology and applications - ideal for engineers,
technicians, students,
installation and sales staff.
Practical Guide To
Satellite TV – by Garry Cratt
The book written by an Aussie for
Aussie conditions. Everything you
need to know – including
what you cannot do! 7th ed.
$
49
Hands-On Zigbee – by Fred Eady
$
96
50
NEW LOW PRICE!
$
75
An in-depth look at the
clever little 2.4GHz wireless
chip that’s starting to be
found in a wide range of
equipment from
consumer to industrial.
There’s something to suit every
RF fan in the SILICON CHIP
reference bookshop: see the
bookshop pages in this issue
$
75
RF Circuit Design
– by Chris Bowick
A new edition of this classic RF
NEW LOW PRICE!design text - tells how to design
and integrate RF components
$
74 into virtually any circuitry.
Practical RF H’book
– by Ian Hickman
$
reference work for technic90 Aians,
engineers, students and
NEW LOW PRICE!
73
$
the more specialised enthusiast. Covers all the key topics in
RF that you need to understand.
! Audio ! RF ! Digital ! Analog ! TV ! Video ! Power Control ! Motors ! Robots ! Drives ! Op Amps ! Satellite
66 Silicon Chip
siliconchip.com.au
|