Skip to content

app: add fetching data from bme280 sensor#8

Merged
nmpluta merged 3 commits into
mainfrom
4-add-fetching-data-from-bme280-sensor
Sep 4, 2025
Merged

app: add fetching data from bme280 sensor#8
nmpluta merged 3 commits into
mainfrom
4-add-fetching-data-from-bme280-sensor

Conversation

@nmpluta
Copy link
Copy Markdown
Owner

@nmpluta nmpluta commented Sep 4, 2025

Refs: #4

Refs: #4

Signed-off-by: Natalia Pluta <pluta.natalia.m@gmail.com>
@nmpluta nmpluta linked an issue Sep 4, 2025 that may be closed by this pull request
@nmpluta nmpluta requested a review from Copilot September 4, 2025 00:59

This comment was marked as outdated.

@nmpluta nmpluta force-pushed the 4-add-fetching-data-from-bme280-sensor branch from bcef88d to 05067e0 Compare September 4, 2025 18:28
@nmpluta nmpluta requested a review from Copilot September 4, 2025 18:28

This comment was marked as outdated.

@nmpluta
Copy link
Copy Markdown
Owner Author

nmpluta commented Sep 4, 2025

This pull request removes the custom example sensor driver and updates the application to use the standard BME280 sensor on the nRF9160 DK board. It also cleans up related configuration and overlay files, and improves logging and error handling in the main application loop.

Switch to BME280 sensor and cleanup of custom sensor:

  • Removed the entire custom example sensor driver and its configuration (drivers/sensor/example_sensor/*, drivers/sensor/CMakeLists.txt, drivers/sensor/Kconfig, drivers/sensor/example_sensor/CMakeLists.txt, drivers/sensor/example_sensor/Kconfig, drivers/sensor/example_sensor/example_sensor.c) [1] [2] [3] [4] [5].
  • Updated the nRF9160 DK overlay to enable and configure the BME280 sensor on i2c2, and removed the example sensor node (app/boards/nrf9160dk_nrf9160.overlay).
  • Removed the overlay file for the nRF54L15 DK, which referenced the example sensor (app/boards/nrf54l15dk_nrf54l15_cpuapp.overlay).

Application logic and logging improvements:

  • Updated main.c to use the BME280 sensor, fetch temperature, pressure, and humidity, and log these values. Improved error handling and switched to using LOG_INF/LOG_ERR instead of printk (app/src/main.c) [1] [2].
  • Changed the project configuration to enable logging and removed the generic sensor configuration (app/prj.conf).

Driver and build system cleanup:

  • Removed references to the example sensor and generic sensor driver from the build system and driver configuration (drivers/CMakeLists.txt, drivers/Kconfig) [1] [2].

Overall, these changes simplify the codebase by removing a custom sensor implementation and switching to a standard, supported sensor, while also improving maintainability and logging.

@nmpluta nmpluta force-pushed the 4-add-fetching-data-from-bme280-sensor branch 2 times, most recently from 68ff7a6 to 1b1a0f6 Compare September 4, 2025 18:54
@nmpluta nmpluta requested a review from Copilot September 4, 2025 19:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the fire detection system to use a BME280 sensor instead of a custom example sensor for environmental monitoring. The change improves the system by integrating a real environmental sensor that can measure temperature, pressure, and humidity.

  • Removes custom example sensor driver and infrastructure
  • Integrates BME280 sensor with I2C communication
  • Updates application to read and log temperature, pressure, and humidity data

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
drivers/sensor/example_sensor/* Removes custom example sensor driver files
drivers/Kconfig Removes sensor driver configuration
drivers/CMakeLists.txt Removes sensor driver build configuration
app/src/main.c Updates to use BME280 sensor and read environmental data
app/prj.conf Adds I2C and BME280 configuration options
app/boards/nrf9160dk_nrf9160.overlay Configures I2C2 interface and BME280 device
app/boards/nrf54l15dk_nrf54l15_cpuapp.overlay Removes example sensor configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread app/src/main.c Outdated
Comment thread app/src/main.c Outdated
- Remove example_sensor node and add BME280 sensor to nrf9160dk_nrf9160.overlay with correct I2C2 pinctrl and address
- Enable logging in prj.conf
- Update main.c to use BME280 sensor, fetch and log temperature, pressure, and humidity
- Remove unused variables and legacy proximity logic

Refs: #4

Signed-off-by: Natalia Pluta <pluta.natalia.m@gmail.com>
- Delete out-of-tree example_sensor driver and its Kconfig/CMake files
- Remove references to CONFIG_SENSOR and example_sensor from prj.conf,
  drivers/Kconfig, and drivers/CMakeLists.txt

Refs: #4

Signed-off-by: Natalia Pluta <pluta.natalia.m@gmail.com>
@nmpluta nmpluta force-pushed the 4-add-fetching-data-from-bme280-sensor branch from 1b1a0f6 to 5603b58 Compare September 4, 2025 19:10
@nmpluta nmpluta merged commit 3977398 into main Sep 4, 2025
10 checks passed
@nmpluta nmpluta deleted the 4-add-fetching-data-from-bme280-sensor branch September 6, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add fetching data from BME280 sensor

2 participants