A BTHome v2 Bluetooth Low Energy temperature and humidity sensor for Nordic nRF52840 and nRF54L15 development kits, built with the nRF Connect SDK and Zephyr. It supports TMP112, DS18B20 and BME680 sensors and is automatically discoverable by Home Assistant.
This Zephyr application broadcasts measurements as unencrypted BTHome v2 service data. BTHome is an energy-efficient Bluetooth Low Energy (BLE) advertising format supported by home automation platforms such as Home Assistant. No BLE pairing or connection is required.
| Sensor | Interface | Measurements |
|---|---|---|
| Texas Instruments TMP112 | I2C | Temperature (default) |
| Maxim DS18B20 | 1-Wire | Temperature |
| Bosch BME680 | I2C | Temperature and humidity |
All three sensor configurations support the Nordic nRF52840 DK and nRF54L15 DK.
Key features:
- Advertises measurements using the BTHome v2 format
- Works with Home Assistant's automatic BTHome discovery
- Low power consumption suitable for battery-powered applications
- Selects the attached sensor through Zephyr Kconfig
After installing the nRF Connect SDK, clone this repository into the SDK workspace and build the default TMP112 configuration:
west build -b nrf52840dk/nrf52840
west flashChoose another supported sensor by adding one of the following CMake options to the build command:
-- -DCONFIG_SENSOR_DS18B20=y-- -DCONFIG_SENSOR_BME680=y
See Building for every board and sensor combination. Review Sensor Connections before powering the hardware.
- Nordic nRF52840 DK or nRF54L15 DK development board
- One of the supported temperature sensors:
- TMP112 (I2C address 0x48)
- DS18B20 (1-Wire)
- BME680 (I2C address 0x76)
- Breadboard and jumper wires for sensor connections
- BTHome compatible listener (e.g., Home Assistant with BTHome integration)
- nRF Connect SDK v2.4.0 or later
- West build tool
- nRF Connect for Desktop (for board configuration and flashing)
Connect to nRF52840 DK:
- VCC → 3.3V
- GND → GND
- SDA → P0.26 (Arduino A4)
- SCL → P0.27 (Arduino A5)
Connect to nRF52840 DK:
- VCC → 3.3V
- GND → GND
- DATA → P1.02 (Arduino D1) with 4.7kΩ pull-up resistor to 3.3V
Connect to nRF52840 DK:
- VCC → 3.3V
- GND → GND
- SDA → P0.26 (Arduino A4)
- SCL → P0.27 (Arduino A5)
Clone this repository under the samples folder in your nRF Connect SDK installation.
TMP112 sensor (default):
west build -b nrf52840dk/nrf52840 -- -DCONFIG_SENSOR_TMP112=yDS18B20 sensor:
west build -b nrf52840dk/nrf52840 -- -DCONFIG_SENSOR_DS18B20=yBME680 sensor (temperature + humidity):
west build -b nrf52840dk/nrf52840 -- -DCONFIG_SENSOR_BME680=yTMP112 sensor (default):
west build -b nrf54l15dk/nrf54l15/cpuapp -- -DCONFIG_SENSOR_TMP112=yDS18B20 sensor:
west build -b nrf54l15dk/nrf54l15/cpuapp -- -DCONFIG_SENSOR_DS18B20=yBME680 sensor (temperature + humidity):
west build -b nrf54l15dk/nrf54l15/cpuapp -- -DCONFIG_SENSOR_BME680=yAfter building, flash the application using west:
west flashOr use nRF Connect Programmer from nRF Connect for Desktop.
Before flashing firmware to the nRF54L15 DK:
- Use the Board Configurator
- Disable VCOM0
- Set VDD to 3.3V
- Apply the configuration before flashing
After flashing and powering on the device:
- The device will start advertising as "BTHome sensor"
- Temperature data is broadcast every ~1 second using BTHome format
- For BME680, both temperature and humidity data are advertised
You can monitor the device operation via RTT or UART:
Starting BTHome temp sensor
Bluetooth initialized
Sensor initialized
Temperature: 23.5°C
[BME680 only] Humidity: 45.2%- Ensure the BTHome integration is installed and configured
- The sensor should be auto-discovered as "BTHome sensor"
- Temperature (and humidity for BME680) will appear as sensor entities
- Data updates approximately every second
Any application supporting BTHome format can receive the sensor data. The device advertises:
- Service UUID: 0xFCD2 (BTHome)
- Data format: BTHome v2 (unencrypted)
- Temperature: 0.01°C resolution
- Humidity: 0.01% resolution (BME680 only)
- Check that the sensor is properly connected and powered
- Verify the correct sensor configuration is selected
- Monitor console output for initialization errors
- Ensure the device is not already connected to another BLE central
- TMP112/BME680: Check I2C connections and pull-up resistors
- DS18B20: Verify 1-Wire connection and 4.7kΩ pull-up resistor
- Check sensor power supply (3.3V)
- Verify sensor address matches overlay configuration
- Ensure BTHome integration is installed
- Check Bluetooth adapter range and interference
- Restart Home Assistant if discovery is delayed
- Check HA logs for BTHome-related errors
- Ensure nRF Connect SDK is properly installed
- Check that you're in the correct directory
- Verify the target board is supported
- Clean build directory:
west build -t clean
├── boards/ # Board-specific overlays
│ ├── nrf52840dk_nrf52840.overlay
│ └── nrf54l15dk_nrf54l15_cpuapp.overlay
├── include/
│ └── sensor.h # Sensor interface header
├── src/
│ ├── main.c # Main application and BLE advertising
│ └── sensor.c # Sensor initialization and reading
├── CMakeLists.txt # Build configuration
├── CONTRIBUTING.md # Contribution guidelines
├── Kconfig # Configuration options
├── LICENSE # Apache 2.0 license (default)
├── LICENSES/
│ └── LicenseRef-Nordic-5-Clause.txt # Nordic board overlay license
├── prj.conf # Project configuration
└── README.rst # This file
Bug reports, documentation improvements and support for additional Zephyr boards or sensor drivers are welcome. See CONTRIBUTING.md for the expected workflow and validation checklist.
Except where otherwise noted, this project is licensed under the
Apache License 2.0. The files in boards/ are licensed under the
Nordic Semiconductor 5-Clause License, as indicated by their SPDX license
identifiers.
For more information about BTHome format, visit https://bthome.io