This example implements the Ambient temperature and the Object temperature services. It enables a device to connect and receive the Object temperature values every second via Bluetooth.
This example showcases the implementation of two services: Ambient temperature and Object temperature. The system consists of a client device and a sensor device that periodically read data from an IR thermometer sensor.
If the Indication feature is enabled, the client will be notified about any updated values. Specifically, the client will receive Object temperature values via Bluetooth every second. This feature enhances convenience and efficiency by automatically delivering relevant data at regular intervals.
- GSDK v4.4.0
- Third Party Hardware Drivers v2.0.0.0
NOTE: Tested boards for working with this example:
Board ID | Description |
---|---|
BRD2703A | EFR32xG24 Explorer Kit - XG24-EK2703A |
BRD4108A | BG22 Bluetooth SoC Explorer Kit - BG22-EK4108A |
BRD4314A | BGM220 Bluetooth Module Explorer Kit - BGM220-EK4314A |
The IrThermo 3 Click board supports MikroBus; therefore, it can connect easily to the MikroBus header of the BGM220 Explorer Kit. Be sure that the 45-degree corner of the IrThermo board matches the 45-degree white line of the Silabs Explorer Kit. The Power LED on IrThermo 3 Click board will light when the kit is powered.
To test this application, you can either create a project based on an example project or start with a "Bluetooth - SoC Empty" project based on your hardware.
-
From the Launcher Home, add your product name to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project with filter "mlx90632".
-
Click Create button on Bluetooth - IR Thermometer 3 Click (MLX90632) example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-
Build and flash this example to the board.
-
Create a Bluetooth - SoC Empty project for your hardware using Simplicity Studio 5.
-
Copy the app.c file to the following directory of the project root folder (overwriting the existing file).
-
Install the software components:
-
Open the .slcp file in the project.
-
Select the SOFTWARE COMPONENTS tab.
-
Install the following components:
- [Services] → [Timers] → [Sleep Timer]
- [Services] → [IO Stream] → [IO Stream: USART] → vcom
- [Application] → [Utility] → Log
- [Platform] → [Driver] → [I2C] → [I2CSPM] → mikroe
- [Third Party Hardware Drivers] → [Sensors] → MLX90632 - IrThermo 3 Click (Mikroe)
- [Bluetooth] → [OTA] → [In-Place OTA DFU] → uninstall
- [Platform] → [Bootloader Application Interface] → uninstall.
-
-
Import the GATT configuration:
- Open the .slcp file in the project again.
- Select the CONFIGURATION TOOLS tab and open the "Bluetooth GATT Configurator".
- Find the Import button and import the gatt_configuration.btconf file.
- Save the GATT configuration (ctrl-s).
-
Build and flash this project to the board.
Note:
-
Make sure that the SDK extension already be installed and this repository is added to Preferences > Simplicity Studio > SDKs.
-
SDK Extension must be enabled for the project to install some components for the IR thermometer sensor.
-
Do not forget to flash a bootloader to your board, see Bootloader for more information.
The application is based on the Bluetooth - SoC Empty example. Since the example already has the Bluetooth GATT server, advertising, and connection mechanisms, only minor changes are required.
The GATT changes were adding a standard service Health Thermometer with UUID 0x1809
that has a Temperature characteristic with UUID 0x2A1C
with Read and Indicate properties. The Temperature characteristic shows the temperature value, which is measured by IR Thermometer 3 click.
After resetting, the application will periodically read the IR thermometer sensor. If the Indication is enabled, the client is indicated about the updated values.
Follow the below steps to test the example:
-
Open the EFR Connect app on your smartphone.
-
Find your device in the Bluetooth Browser, scan with the name "IR Thermo Example" and tap Connect.
-
Find the Health Thermometer service, try to read the Temperature measurement characteristic and check the value.
-
Enable Indicate the unknown characteristic. Now, you can cover the IR thermometer sensor by hand or other temperature source and check the value.
You can launch the Console that is integrated in Simplicity Studio or can use a third-party terminal tool like TeraTerm to receive the logs from the virtual COM port.