Buildings that are equipped with energy efficient elevators are now equipped with in-cab sensors as well. These sensors and accompanying software allow elevators to enter an idle mode when not in use. This means that the lights turn off, the ventilation system slows down, the music stops, and the video screens turn off when the elevator is empty. However it is equally important to monitor the environmental conditions of the cabin as well. Elevator cabins in particular, pause a more challenging Indoor environmental quality (IEQ) optimization and maintenance problem due to the confined space, the increased occupancy and the inability to use other means (i.e. windows) to improve air quality. Such parameters can be monitored by Environmental sensors for temperature, humidity, and air quality. Monitoring of these parameters can result in both optimal IEQ and enhanced energy saving HVAC functionality, not just ON-OFF HVAC control (cabin idle mode) depending on occupancy, but continuous regulation of HVAC depending on environmental parameters. In large office or commercial buildings with continuous use of elevators these "on line" HVAC adjustments can lead to significant savings.
The code provided here comes as an example of a MATTER application from nrf connect SDK 2.1. The required parts for this project are the BME688 sensor related code as it can be seen at lines:
397: int result = sensor_channel_get(sBme688SensorDev, SENSOR_CHAN_AMBIENT_TEMP, &sTemperature);
425: int result = sensor_channel_get(sBme688SensorDev, SENSOR_CHAN_PRESS, &sPressure);
453: int result = sensor_channel_get(sBme688SensorDev, SENSOR_CHAN_HUMIDITY, &sHumidity);
In order to provide feedback to external cabin systems such as the ventilation control we can utilize the code in 461 to 463
if (newValue > kHumidityMeasurementAttributeMaxValue ||
newValue < kHumidityMeasurementAttributeMinValue) {
/* Read value is out of accepted limits, so drive high a GPIO pin */
Pins are finely controlled by the structures and functions defined in nrfx_gpiote.c
the main pin configuration structure being:
NRF_STATIC_INLINE void nrf_gpio_cfg(
uint32_t pin_number,
nrf_gpio_pin_dir_t dir,
nrf_gpio_pin_input_t input,
nrf_gpio_pin_pull_t pull,
nrf_gpio_pin_drive_t drive,
nrf_gpio_pin_sense_t sense);
pin would be set as output by:
nrf_gpio_pin_dir_t dir = NRF_GPIO_PIN_DIR_OUTPUT;
The project can be easily build in VS Code as per the following NORDIC instructions:
- Open the nRF Connect extension by clicking its icon or pressing Ctrl+Alt+N.
- From the Applications View, click Add an existing application.
- In the prompt, navigate to the folder containing \v2.1.0\nrf\applications\matter_weather_station.
- Click Select folder to select the sample's or the application's folder. A new application is automatically added in the Applications View.
- If prompted, click Yes when asked if you trust the authors of the files.
- Verify the configuration of the sample or application you are planning to build based on the information in the Configuration section in the application or sample documentation in the nRF Connect SDK. This section might contain information about application-specific Kconfig fragments or CMake build fragments.
Click the Add Build Configuration button in the Application View, or click the text stating No build configurations. Click to create one. This opens the Add Build Configuration screen.
Click the Add Build Configuration button in the Application View and select
thingy 53 nrf5340 cpuapp as your board.
Comments