This is an overview of the LM50B and the OSS-ECAL offering for the LM50B . The LM50B is a temperatures sensor IC (-40 °C to +125 °C) manufactured by Texas Instruments.
MCU interface : ADC
CAUTION:Please be sure to refer to the latest version of the Datasheet prior to actual design.
LM50B
General description
The LM50 device is a precision analog temperature sensor that can measure temperatures from -40°C to 125°C using a single positive supply. The output voltage of the device is linearly proportional to temperature (10mV/°C) and has a DC offset of 500mV at 0°C. The offset allows reading negative temperatures without the need for a negative supply. The output voltage of the LM50 ranges from 100mV (at –40°C) to 1.75V (at 125°C), simplifying analog-todigital converter (ADC) interfacing.
Unlike NTC thermistors, LM50 does not require any external calibration, trimming or software linearization leading to simplifying the circuitry requirements in a single supply environment. Due to low quiescent current of LM50 (typically around 95µA), self-heating is limited to a very low 0.2°C (in still air) and the device is designed for remote or battery-powered applications. Trimming and calibration of the LM50 at the wafer level provide long-term availability, low cost and consistent accuracy in two grades: LM50B (±2°C at 25°C, ±3°C over temperature range) and LM50C (±3°C at 25°C, ±4°C over temperature range).
Feature
- Industry-Standard Sensor Gain/Offset:
10mV/°C, 500mV at 0°C - LM50B Temperature Accuracy:
±2°C (Max) at 25°C
±3°C (Max) over temperature range - LM50C Temperature Accuracy:
±3°C (Max) at 25°C
±4°C (Max) over temperature range - Operating supply range: 4.5V to 10V
- Quiescent Current (Typ): 95μA
- Available in Standard SOT23-3 package
- Nonlinearity: ±0.8°C (Max)
- DC Output Impedance: 2kΩ/4kΩ (typ/Max)
Enables driving large capacitive loads - UL Recognized Component
Application
- Mobile phones, PC & notebooks
- Data storage
- Battery Management
- Home and Multifunction printers
- Medical and healthcare Instruments
- HVAC System
- Power Supply Modules
OSS-ECAL specification
API Function
OSS-ECAL API functions are basically assumed to be function calls from a periodic Thread (TASK).
etSTS oLM50B_START(void)
The oLM50B_START function is an API function to start AD conversion of the LM50B.
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_HAL_ADC | HAL ADC Error | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL (STM32F4) | ||
eSTS_ERR_ADC_OBJECT | AD conversion object selection error |
etSTS oLM50B_READ( float32* rlt )
The oLM50B_READ function is an API function that checks for the end of AD conversion of the LM50B, reads the AD conversion value, converts the AD conversion value to a characteristic temperature, and stores the temperature in rlt.
AD conversion value to temperature conversion equation
Voltage value = (AD conversion value × VDD) / ( 2AD bit )
Temperature = ((voltage value – voltage offset value) / gain) + Temperature offset value (Min, Max Limit)
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_MIN | Minimum temperature error (rlt is minimum temperature) | ||
eSTS_ERR_MAX | Maximum temperature error (rlt is maximum temperature) | ||
eSTS_ERR_HAL_ADC | HAL ADC Error (STM32F4 Timeout) | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_ADC_OBJECT | AD conversion object selection error | ||
Parameter OUT | float32* rlt | Temperature -40.0 to +125.0 [°C] |
etSTS oLM50B_START_READ( float32* rlt )
The oLM50B_START_READ function is an API function that starts an AD conversion of the LM50B, waits for the AD conversion to finish, reads the AD conversion value, converts the AD conversion value to a temperature characteristic, and stores the temperature in rlt.
AD conversion value to temperature conversion equation
Voltage value = (AD conversion value × VDD) / ( 2AD bit )
Temperature = ((voltage value – voltage offset value) / gain) + Temperature offset value (Min, Max Limit)
Return value | etSTS | OSS-ECAL status code | |
eSTS_FIN | Completed successfully | ||
eSTS_ERR_MIN | Minimum temperature error (rlt is minimum temperature) | ||
eSTS_ERR_MAX | Maximum temperature error (rlt is maximum temperature) | ||
eSTS_ERR_HAL_ADC | HAL ADC Error (STM32F4 Timeout) | ||
eSTS_ERR_OTHERS_RUN | Other components are executing the process | ||
eSTS_ERR_HAL_OTHERS_RUN | Other application is running HAL (STM32F4) | ||
eSTS_ERR_ADC_OBJECT | AD conversion object selection error | ||
Parameter OUT | float32* rlt | Temperature -40.0 to +125.0 [°C] |
HAL Support List
OSS-ECAL’s HAL support is as follows. Please note that even if the same HAL is used, different versions, MCUs, and development environments may not work together. The list is being expanded sequentially.
Manufacturer | SDK/IDE Tool | HAL Name | Ver | HALNAME | Support |
---|---|---|---|---|---|
Arduino | Arduino IDE | Arduino | 1.8.6 | ARDUINO | X |
Arm | Keil MDK v6 | Mbed OS | 6.17.0 | MBED | X |
Debian | – | GNU/Linux | 10.3 | Linux | – |
Infineon | ModusToolbox | mtb-hal-cat1 | 2.4.3 | ModusToolbox | X |
NXP | MCUXpresso SDK | SDK_2.x_EVKB-IMXRT1050 | 2.16 | iMXRT1051B1052B | X |
Renesas | Synergy Software Package | HAL | 2.6.0 | SSP | X |
STMicroelectronics | STM32Cube | STM32CubeF4 | V1.28.1 | STM32F4 | X |
Function Correspondence Table by HAL
HALNAME | oLM50B_START | oLM50B_READ | oLM50B_START_READ |
---|---|---|---|
ARDUINO | – | – | X |
MBED | – | – | X |
Linux | – | – | – |
ModusToolbox | – | – | X |
iMXRT1051B1052B | X | X | X |
SSP | X | X | X |
STM32F4 | X | X Time-out time: HAL_MAX_DELAY | X Time-out time: HAL_MAX_DELAY |
Development environment
The MCU and development environment during OSS-ECAL development are as follows.
HALNAME | Manufacturer | Board | MCU | IDE |
---|---|---|---|---|
ARDUINO | Arduino | 1.Mega 2560 Rev3 2.Arduino Pro Mini 3.3V | ATmega2560 ATmega328P | Arduino IDE 2.3.3 |
MBED | STMicroelectronics | STM32 Nucleo-64 boards | STM32F401RETx | Arm Keil Studio Cloud |
Linux | BeagleBoard | BeagleBone Black | TI AM335x | – |
ModusToolbox | Infineon | CY8CPROTO-063-BLE PSoC 6 BLE Prototyping Kit | CYBLE-416045-02 | ModusToolbox |
iMXRT1051B1052B | NXP | IMXRT1050-EVKB | i.MX RT1050 | MCUXpresso IDE |
SSP | Renesas | S7G2 SK | R7FS7G27H3A01CFC | e² studio for Renesas Synergy |
STM32F4 | STMicroelectronics | STM32 Nucleo-64 boards | STM32F401RETx | STM32CubeIDE |
Files
Folder* | File | Summary |
---|---|---|
LM50B_HALNAME_VERSION/sample | sample.c (.cpp) | Sample Application Program |
sample.h | Sample Application Header | |
LM50B_HALNAME_VERSION | oLM50B.c (.cpp) | OSS-ECAL Program for LM50B |
oLM50B.h | OSS-ECAL Header for LM50B | |
LM50B_ARDUINO.ino | Sample application programs for Arduino | |
oss_ecal.h | OSS-ECAL Common Header | |
user_setting.c (.cpp) | Const and Table of User setting | |
user_setting.h | Header of User setting | |
readme.md | Readme | |
OSS-ECAL Terms of Use.txt | OSS-ECAL Terms of Use |
* For HALNAME, please refer to HAL Support.
OSS-ECAL Download Contact
Please login before contacting us for downloads.
To register as a new user, click here.
Built-in How to
How to incorporate OSS-ECAL into user programs
How to incorporate multiple OSS-ECALs in a user program (same MCU function)
How to incorporate multiple OSS-ECALs in a user program (different MCU function)
How to incorporate multiple identical electronic components into a user program
How to reduce the impact on user programs by replacing electronic components
CAUTION
The sample version of OSS-ECAL is not intended to be used with Threads (Tasks) or interrupts of different priority. Please do not use it as in the example below.
Example: If each sensor is assigned to the same ADC group and the OSS-ECAL API is executed in processes with different priorities, correct values may not be obtained.
ADC Gr0 Ch0 Temperature sensor AD22100A 100ms cycle Thread (low priority) to take in temperature
ADC Gr0 Ch1 Pressure sensor MPX5999D Event interrupts (high priority) to take pressure