กลับไปหน้ารวมไฟล์
cave-exploration-support-using-nicla-sense-me-arduino-x-kway-project-b61395-en.md

When exploring a cave system, we do not have many geographic and visual references, especially when using artificial light, which is often dim. In addition, many other technologies we rely on, such as GPS and geolocation, do not work underground. Cave exploration is one of the most challenging activities for humans, as we must contend with environments lacking geographical reference and limited visibility. Artificial light sources are often dim and do not cover a wide area. Furthermore, everyday technologies like GPS or other Geolocation systems cannot function in dark underground conditions full of physical obstacles.

Concept

This project was born in response to the challenge of Arduino, K-Way and Edge Impulse: "Arduino and K-Way, with the support of Edge Impulse, are collaborating on a new idea for smart clothing." Its main objective is to support cavers with more accurate decision-making and cave mapping information, as well as to collect environmental data that is typically only gathered occasionally during specific explorations.

The main goal is to provide cavers with additional data to create more accurate maps of the cave and collect some environmental data that is usually only collected from time to time during certain expeditions.

The data are divided into two groups:

  1. Type of movement, inferred from a machine learning model to identify movement patterns within the cave.
  2. Air quality, or at least Co2 values, with an alert if the Co2 level is too high. Measures CO2 levels and provides alerts when gas levels exceed safety standards.

Smart clothing

The size of the Nicla Sense and the provided plastic case is very compact to be used as a wearable. The core of the device is the Nicla Sense ME, which is ultra-compact (only 22.86 x 22.86 mm). It's housed in a plastic case suitable for wearable applications. If used in muddy caves, it should have an additional protection since the usb port is not covered. However, since cave exploration often involves mud and high humidity, additional protection around the USB port is essential to prevent external damage.

As the challenge is in partnership with K-Way, it's a good opportunity to mention the importance of having proper clothing on outdoor activities. The jacket sent with the Nicla Sense ME is a light thin model. It's good to be used during the approach to the cave entrance or after exiting, but also compact enough to take inside the cave, in a small pouch, to be used during slower moments or pauses. Regarding the smart clothing, the lightweight K-Way jacket supplied with the Nicla Sense ME is ideal for wearing during the trek to the cave entrance or after exiting the cave to maintain body temperature. Moreover, due to its thin and packable nature, explorers can carry this jacket in a small bag for use during breaks in explorations where prolonged inactivity might lead to the risk of Hypothermia in high-humidity caves. For colder, more humid caves, or for projects that require longer time of measurements and stops, a warmer model may be better.

Training

The model was trained from two main datasets.

One was generated using a mobile phone and focused especially on the moves which are more particular inside a cave, such as crawiling. This custom dataset focuses on specific movements found in caves, which differ from regular walking on flat ground.

The other one, was taken from a public repository: https://www.kaggle.com/datasets/malekzadeh/motionsense-dataset (1). This public dataset was used to accelerate the initial model development process.

The main reason to use an existing public dataset was to speed up the initial version of the model.

Since the way we move in a cave is slightly slower and different than on a regular terrain, the idea is to retrain the model with data taken from actual cave explorations, on a later stage. On the first iteration I'm working only with the accelerometer data, but I believe it will improve a lot if using the gyroscope as well. Future approaches involve incorporating data from the Gyroscope for joint processing. This will add dimensions of rotation and tilt, which will help distinguish vertical movements and crawling through narrow passages more accurately.

The training data will most likely also require better cleaning, especially between the up/down actions and normal walking, as those features are appearing as a big cluster. In this first version, we primarily used data from the Accelerometer. Although initial tests on Edge Impulse showed an Accuracy of 78.5% during training and 65.8% during testing, we found that the data features for uphill/downhill walking and normal walking still had significant cluster overlap.

Ambient sense

Equipped with Bosch BME688, Nicla Sense ME can provide several ambient values besides the most common temperature, relative humidity and pressure. The Nicla Sense ME comes with the Bosch BME688 sensor, an intelligent gas sensor that uses AI to analyze various gas concentrations. It not only measures temperature, relative humidity, and atmospheric pressure, but can also calculate Indoor Air Quality (IAQ), bVOC (Breath Volatile Organic Compounds), and CO2-equivalents.

It can output an index for air quality (IAQ), bVOC and CO2-equivalents. At this stage, CO2 is the one we are most interested for several factors:

  1. Security - indicate the level through the LED and generate an alarm (if connected to a device via Bluetooth) if the value is considered risky. Alerts via an LED on the board and sends an alarm signal to Bluetooth-connected devices if gas levels are dangerous to the respiratory system.
  2. Further study - log the values for further study of the cave's ecosystem. Records data to study changes in cave ecosystems over time.

CO2 level indicator

The CO2 equivalent value is available directly through BLE to the application, if/when being used.

On top of that, the LED blinks in a color corresponding to each value interval. To facilitate observation, the system defines LED color ranges according to CO2 gas concentration levels as follows:

below 5 000 ppm: green (Normal)
between 5 000 ppm and 10 000 ppm: yellow (Monitoring required)
between 10 000 ppm and 15 000 ppm: cyan
between 15 000 ppm and 25,000 ppm: blue (Dangerous)
above 25 000ppm : red (Severe danger, immediate evacuation required)

Battery management

Cave exploration can go from a couple of hours to the whole day. In such activity, autonomy is very important. We have designed the following power-saving strategies:

In order to save battery, we can disable the transmission via BLE of a few sensors which should not be necessary to be sent to the application, like accelerometer and gyroscope. This Selective BLE Transmission disables the transmission of raw data from the Accelerometer and Gyroscope via Bluetooth. Since these sensors are processed locally on the board (Local Inference), there's no need to constantly transmit large amounts of data. They are still needed, localy, for the inference, although the current model only uses the accelerometer data.

At the same time, as the movements in caving are quite slow, it is not needed run the inference every couple of seconds. A longer sleep/delay period makes more sense and allows to save battery. Five or ten seconds seems a reasonable value, to be tested in practice of course. This Adaptive Inference Timing adjusts the system to perform inference every 5 or 10 seconds instead of in real-time, significantly reducing processor workload.

Transport mode

The device does not have a power button and it's not practical to open the small case in order to unplug the battery.

It's possible to put the Nicla Sense in deep sleep until it's required, in the approximation to the cave or at it's entrance. Since the Nicla board lacks an on/off button and its case is small, making frequent battery unplugging difficult, we utilize the ShipMode feature of the PMIC (Power Management IC) on the board.

The current version accepts a command via serial port, "shutdown", to which the device passes to "ShipMode" if disconnected from any external power source within 30 seconds after the command. A simple connect to any power source, like a powerbank for example, wakes up the Nicla Sense. By sending a "shutdown" command via the Serial Port, the device enters a Deep Sleep state within 30 seconds after disconnecting external power. It will wake up again simply by plugging it into a Powerbank or USB power supply.

At the moment it's not implemented to accept the command via BLE.

The gas values (CO2, iAQ and bVOC) only output updated results about 5~10 minutes after the board boots. *Note:* The gas sensor (BME688) requires a warm-up period of approximately 5-10 minutes after booting to provide accurate readings.

Current issues or limitations

At this stage, I didn't manage to have a working example of an application, mobile or web, to read the inference results via bluetooth. Additionally, the system for reading results via the Bluetooth application is still under development to achieve maximum stability for field use.

When reading the inference results, via serial monitor, there are many idle status being detected as crawling and vice-versa, despite those 2 features were quite apart and with good accuracy values on both training and testing results. The cause is still be explored, most likely either quality of data or the chosen options within the model, which were the default on Edge Impulse. From initial tests, inaccuracies were found in classifying "Idle" and "Crawling" states, with the system sometimes detecting them interchangeably, even though the accuracy graphs showed good results. This issue likely stems from the quality of the training data or initial parameter settings in Edge Impulse that might not yet be suitable for real-world conditions.

Foot notes:

(1) MotionSense dataset credits:

@inproceedings{Malekzadeh:2019:MSD:3302505.3310068,
author = {Malekzadeh, Mohammad and Clegg, Richard G. and Cavallaro, Andrea and Haddadi, Hamed},
title = {Mobile Sensor Data Anonymization},
booktitle = {Proceedings of the International Conference on Internet of Things Design and Implementation},
series = {IoTDI '19},
year = {2019},
isbn = {978-1-4503-6283-2}

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x PlatformIO"
  - "1x Edge Impulse Studio"
  - "1x Arduino IDE 2.0 (beta)"
author: "sacp"
category: "Sensors & Environment"
components:
  - "1x Android Smartphone"
  - "1x Nicla Sense ME"
  - "1x Computer"
description: "Log ambient levels and use machine learning to assist spelunkers map a cave"
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles:
  - "https://projects.arduinocontent.cc/d7e8954c-871f-4258-a2d3-2624157590a5.cpp"
  - "https://projects.arduinocontent.cc/f976f4f4-6d8a-4278-a4af-52d05c849514.h"
encryptedPayload: "U2FsdGVkX195zERfdzTl2rNFvv9UtV3C+8m+bCkzWG/aXY3Jh84ezrt0CuVYdHD2wZhjRKqvfCT8vqEDJisoqzdFMLOrRv2oj3aWuGSO8ASxw1EI3ocv7fRIYu57NWppAZKnOtky2NChV1+PvtTmJ+Xj6rCx9ickiUF0Ft0ElI8="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/cave-exploration-support-using-nicla-sense-me-arduino-x-kway-project-b61395_cover.jpg"
lang: "en"
likes: 1
passwordHash: "fb6d7e6df9331d5800e3b1a5dbfa94a79f77c6e81a3da68491727b45e9b48ff7"
price: 2450
seoDescription: "Arduino project using Nicla Sense ME and machine learning to log ambient levels and assist spelunkers with cave mapping."
tags:
  - "Monitoring"
  - "Wearables"
  - "Environmental Sensing"
title: "Cave exploration support using Nicla Sense ME: Arduino x Kway project"
tools: []
videoLinks: []
views: 1500