NDP.onMatch() does not work with the accelerometer sensor (Arduino Nicla Voice)

Hello, I have made a model that allows detecting falls using the accelerometer values ​​as data and uses the Syntiant processing block. The model was made in edge impulse.

I made a sketch in Arduino Ide to be able to obtain the result of the inference. The code shows through the serial monitor the label that was inferred

#include "NDP.h"
#include "Nicla_System.h"


const bool lowestPower = false;

void ledBlueOn(char* label) {
  if (!lowestPower) {
      Serial.println("Label received");
      nicla::leds.begin();
      nicla::leds.setColor(blue);
      delay(200);
      nicla::leds.setColor(off);
      Serial.println(label);
      nicla::leds.end();
  }
}

void setup() {
  Serial.begin(115200);
  nicla::begin();
  nicla::disableLDO();
  nicla::leds.begin();

  NDP.onError([]() {});
  NDP.onMatch(ledBlueOn);
  NDP.onEvent([]() {});
  Serial.println("Loading synpackages");
  Serial.println("This is a custom flash for sacha model");
  NDP.begin("mcu_fw_120_v91.synpkg");
  NDP.load("dsp_firmware_v91.synpkg");
  NDP.load("ei_model.synpkg");
  Serial.println("Packages loaded");
  NDP.getInfo();
  Serial.println("Configure mic");
  NDP.turnOnMicrophone();
  NDP.interrupts();

  nicla::leds.end();

  if (lowestPower) {
    NRF_UART0->ENABLE = 0;
  }
}

void loop() {
}

But no results appear on the serial monitor.

Packages loaded
dsp firmware version: 19.2.0
package version: Model generated by Edge Impulse
pbi version: 3.2.3-0
num of labels: 2
labels: NN0:ADL, NN0:FALL
total deployed neural networks: 1
Configure mic

I made another model to see if it was the board that was not working correctly, this model detected a predefined word through the microphone. In this model it did show me the inference on the serial monitor

Packages loaded
dsp firmware version: 19.2.0
package version: Model generated by Edge Impulse
pbi version: 3.2.3-0
num of labels: 4
labels: NN0:no_sacha, NN0:noise, NN0:si_sacha, NN0:unknown
total deployed neural networks: 1
Configure mic
Label received
NN0:unknown
Label received
NN0:noise
Label received
NN0:noise

I would like some help on how I can make the model used by the IMU sensor show the inference through the serial monitor, as I later want to send that value via Bluetooth to an App. Thank you.

Hi @pgudino,
Thank you for reaching out to us.
I do understand the use case.
To support you better I would like to know few aspects like:

  • The data collection for fall detection was done by Nicla Voice itself or from other source

  • NDP120 was selected on Edge Impulse platform not NDP101

By looking at the code I can see that the code is enabling the microphone but this is not needed when we are using IMU.
Can you please look at the IMUDemo code which is available in File->Examples->NDP->IMUDemo in Arduino IDE.

Regards.

Hi @agiri, thanks for your help. Responding to the aspects that you indicate to me:

The data collection for fall detection was done by Nicla Voice itself or from other source

First, I used the SisFall dataset to create a model and uploaded it to the Nicla. After uploading the sketch, the inference result did not appear. Thinking the Sisfall data might be the issue, I recorded my own data using Edge Impulse with the Nicla Voice, created the model, uploaded it to the Nicla, and loaded the sketch, but again, the inference result did not appear.

NDP120 was selected on Edge Impulse platform not NDP101

When deploying to edge impulse, I select the following option:

This gives me a zip that contains the following:

ndp120 folder:

Can you explain to me what senData does. What parameters does the function receive and what does it return?

extern "C" const unsigned char data_opensset_bin[];
extern "C" const unsigned char data_circ_bin[];
extern "C" const unsigned int data_opensset_bin_len;
extern "C" const unsigned int data_circ_bin_len;


void loop() {
  Serial.println("Sending openset data... (no match expected)");
  NDP.sendData((uint8_t*)data_opensset_bin, data_opensset_bin_len);
  delay(1000);

  Serial.println("Sending circular IMU data.... (match expected)");
  NDP.sendData((uint8_t*)data_circ_bin, data_circ_bin_len);
  delay(5000);
}

Hi @pgudino ,

Would you like to connect over call to troubleshoot the issue together.
We can connect over email agiri@syntiant.com to discuss further.

Regards.