SBAA588 April 2024 LM73 , LM75B , LM95071 , TMP100 , TMP101 , TMP102 , TMP103 , TMP104 , TMP107 , TMP1075 , TMP108 , TMP112 , TMP114 , TMP116 , TMP117 , TMP121 , TMP122 , TMP123 , TMP124 , TMP126 , TMP144 , TMP175 , TMP1826 , TMP1827 , TMP275 , TMP400 , TMP401 , TMP411 , TMP421 , TMP422 , TMP423 , TMP431 , TMP432 , TMP435 , TMP451 , TMP461 , TMP464 , TMP468 , TMP4718 , TMP75 , TMP75B , TMP75C
Digital temperature sensors are now an industry-standard due to accuracy and compatibility with various digital interfaces such as I2C, SPI, UART, 1-Wire, PWM, and the emerging I3C MIPI. These plug-and-play devices require no signal conditioning.
At the core, a digital temperature sensor consists of a bias or band-gap reference, integrated or remote temperature sensing transistors, and an integrated analog-to-digital converter (ADC). Note that ADCs in temperature sensors come in different resolutions. For example, a 12-bit ADC output commonly has an LSB of 0.0625°C. After the ADC processes the sensor data, the raw outputs are sent through the digital interface and must be converted into temperature values. These outputs typically use a 2’s complement signed fixed-point representation, which involves placing an implied binary point between two bit locations. This format maintains broad compatibility with various microcontrollers and processors, even those without floating-point support.
This application note provides an overview of the algorithm implementation using fixed-point mathematics. We use the ‘Q Format’ (also known as ‘Q Notation’ or ‘Q Point’) concept for fixed-point representation, to describe and differentiate typical output encodings for temperature sensors. The Qm.n labeling convention represents different temperature sensor output formats and encodings. These concepts are explained at a core quantitative level and then demonstrated using snippets of C code, JavaScript, Python and Microsoft® Excel.