Thermometer Example with EFR32 Internal Temperature Sensor


The attached example is an adaptation of the standard 'SOC - Thermometer' example. However, instead of accessing the Si7021 Temperature and Relative Humidity sensor through I2C, this example uses the EFR32's own internal temperature sensor. This sensor is measured during the production test. The temperature readout from the ADC at production temperature as well as the Celsius value are given in the device information page. Using these and the millivolts per degrees slope in the sensor data sheet, the current temperature can be calculated as follows:

T_Celsius = T_Calibration - (ADC_Calibration_Reading - ADC_Current_Reading) * V_Ref / (4096 * Slope)

For more information, see the ADC section of the reference manual of your chosen hardware, e.g., EFR32xG13.

These are the changes to the basic SoC-Thermometer example:

temperature_data = convert_to_millicelsius(read_adc());

Setting up

  1. Create an SoC - Empty sample app for your chosen hardware.

  2. Replace the existing app.c with the app.c attached to this article.

  3. Copy em_adc.c and em_adc.h from the SDK (e.g., C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.6\platform\emlib) to the project folder (if they aren't already in the platform>emlib>inc/src folders).

  4. Import the attached gatt.xml file in the GATT Configurator sidebar (open .isc file, "Import GATT from .bgproj file"). This will add the Health Thermometer service and Temperature Measurement characteristic and change Device Name to "IntTemp".

  5. Press Save and Generate.

  6. Build and flash.


Using the EFR Connect app, you can now read the temperature sampled from the internal temperature sensor.

  1. Open EFR Connect app on your phone.

  2. Select "Health Thermometer".

  3. Connect to the device called "IntTemp".

HTM Scan

HTM Reading