Arduino Nano BLE33 Rev2 Accelerometer Inference Not Working from Arduino IDE

Question/Issue:
I am running a simple example to detect when a motor is idle or running using the built in accelerometer on the Arduino Nano BLE33 Sense Rev 2 development board. While the Edge Impulse binary inference works, the Arduino IDE compilation does not produce inference that works.

Project ID:
771413

Steps Taken:

  1. Successfully deployed using the binary that Edge Impulse offers for the BLE33 - inference worked correctly.
  2. Successfully ran the static buffer Arduino example using raw features for both idle and run states.
  3. Uploaded the Arduino example “nano_ble33_sense_rev2_accelerometer”, but inference does not work as it did in step 1 (Only detects one state).

Expected Outcome:
Inference should work the same way when compiling from Arduino IDE as it does when using the Edge Impulse binary.

Actual Outcome:
When compiling from Arduino IDE, inference is not working. However, when compiling directly from the EI binary, inference works as expected.

Reproducibility:
Always reproducible

Has anyone encountered this issue before? Any suggestions for troubleshooting would be greatly appreciated.

Hello @mark.smith24 first of all welcome to the Edge Impulse community!

What you reported is a very good question! I have other questions for you:

  • did you collect the samples of training with the Arduino in the same position as it is now? I’m thinking if the raw accelerometer values are coming with a different units or orientation?
  • could you please confirm the sampling rate and window size of your features? Is the arduino code using the exact sampling frequency during inference?

Let us know if this can fix your issue!

Thanks

Thank you for the reply.

  • Yes, the board has maintained the same position and orientation during training and when running inference. The board has been attached to a bracket that attaches to the motor. I wanted to make sure that this was one less variable in my setup.

  • The frequency is set to 100Hz, window size to 300ms, window increase to 50ms with zero padding selected(I have tried other settings to no avail). The EI_CLASSIFIER_INTERVAL_MS is set to 10, which is correct for 100Hz.

Any other suggestions would be greatly appreciated.