Parallax, Inc. • DS2760 Thermocouple Kit (#28022) • 01/2004
3
BASIC Stamp Application
The following BASIC Stamp application will run on either the BS2p or BS2pe and demonstrates how easy
measuring wide-range temperatures can be when using the DS2760 Thermocouple Module. Other
Stamps will require a Serial-to-1-Wire protocol converter, as well as code to manage the large tables
across program slots, and are not covered in this document.
A little background: When two dissimilar metal wires are joined, a voltage will be developed across the
open end that is proportional to the temperature difference between the joined and open ends. This
effect was discovered by Thomas Seebeck in 1821. Through empirical testing, voltage tables have been
established that correspond to the thermocouple junction temperature. These tables, however, use a
cold junction (voltage measurement point) reference of zero degrees Celsius, forcing electronic devices to
employ cold junction compensation.
Using the DS2760 we can measure the Seebeck voltage from the thermocouple with a resolution of
15.625 microvolts, then measure the cold junction temperature with a resolution of 0.125 degrees
Celsius. A simple table look-up using the cold junction temperature will give us the cold junction
compensation voltage. This is combined with the Seebeck voltage and, using a modified binary search
algorithm, we can determine the compensated temperature from the thermocouple data table.
' =========================================================================
'
' File...... DS2760TC_Demo.BPE
' Purpose... Thermocouple temperature measurement using the DS2760
' Author.... Parallax, Inc. (Copyright 2004, All Rights Reserved)
' E-mail.... support@parallax.com
' Started...
' Updated... 19 JAN 2004
'
' {$STAMP BS2pe, KTablePos.BPE, JTablePos.BPE, TTablePos.BPE}
' {$PBASIC 2.5}
'
' =========================================================================
' -----[ Program Description ]---------------------------------------------
'
' This program lets a BS2p or BS2pe read the temperature from the Parallax
' DS2760 thermocouple module. User input of thermocouple type (K, J, or T)
' and temperature display is via the DEBUG window.
' -----[ Revision History ]------------------------------------------------
' -----[ I/O Definitions ]-------------------------------------------------
OW PIN 8 ' 1-Wire buss pin