Arduino Nano RP2040 help

Question/Issue:

How do I get the Edge Impulse to see the built in sensors (microphone/accelerometer/gyro) on the Arduino Nano RP2040? I have added the Arduino to devices using the Raspberry Pi RP2040 firmware, but the Arduino sensors do not show up for the device in the Data Acquisition page. I only see ADC and Sonic Ranging sensors.

Is the only option with this board to use the Data Forwarder?

Appreciate the help!

Project ID:

Context/Use case:

Hi @bcatch82,

The Arduino Nano RP2040 Connect is not an officially supported board. I’m guessing you loaded on the firmware for the Raspberry Pi Pico (https://docs.edgeimpulse.com/docs/development-platforms/officially-supported-mcu-targets/raspberry-pi-rp2040). If so, that firmware does not contain code for controlling sensors on the Arduino Nano RP2040. For now, I believe that the only option is to use the Data Forwarder or to collect your own samples (e.g. in CSV format).

I will ask our dev team to see if there are plans to support other sensors.

We’re actually working on RP2040 firmware upgrade and it is coming soon. I’m testing it right now, but it should be possible to use IMU and microphone on Arduino RP2040 Connect after the upgrade. I’ll notify you when it is out.

1 Like

Thank you very much for the response. That’s great news. I look forward to hearing when this is ready to go :slight_smile:

1 Like

for the impatient thats make your own Firmware from the last Version on Github

LSM6DSOX
in firmware-pi-rp2040/ThirdParty/Wire/src/Wire.h
define SDA (12u)
define SCL (13u)

this works for me

MP34DT05
in Firmware Nano BLE33 is the Microphone Example
/edgeimpulse/firmware-arduino-nano-33-ble-sense/tree/master/src/sensors/ ei_microphone.cpp

But on RP2040 there is a other PDM.h
C:\Users***\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.1.1\libraries\PDM\src

the Samplingfrequency of Microphone is 20kHz not 16kHz
The calculate of Clock with 32Mhz could be other

I think you have to adjust a few things with the microphone

Thanks RickdorDD, do you know if this works with the IMU? The project I am working on is for vibration detection. Cheers!

1 Like

This works with build my own firmware

MIC is a bit more complicated and I’m just starting the first experiments

Very nice. I have no idea about building my own firmware. Are you able to share it?
Thanks very much

you have a message here

Great thanks RickorDD. please send to wemanop271@giftcv.com
I will let you know if i have any success!

Works like a charm :slight_smile: thanks very much RickorDD!

Thats fine! :slightly_smiling_face:

I am currently trying to integrate the Arduino PDM into the project. There are already microphone examples for the original RP2040 but I can’t really get any further at the moment. I’ll go back to the community for support.

@RickorDD thanks for your tips, managed to build the firmware for arduino nano rp2040, connecting the built-in IMU sensor to edge impulse studio.

Can anyone give any points on what you needed modify the Raspberry Pi Firmware (assuming you both modified the Rpi firmware form Edge Impulse) to make this work? How do you compile the source code to uf2? Thanks gents

  1. Git clone the repo to your machine, https://github.com/edgeimpulse/firmware-pi-rp2040
  2. Go to firmware-pi-rp2040/ThirdParty/Wire/src/Wire.h and change the SDA & SCL pin, as remark by RickorDD above.
  3. If you read the readme in the firmware repo, it says you need to install the PICO_SDK in your machine, so git clone that repo in your machine, GitHub - raspberrypi/pico-sdk & set the path variable as where you put this pico sdk folder.
  4. Back to your firmware folder, run the lines as in the readme. The output uf2 file will be located in the firmware-pi-rp2040/build folder.

FYI, my machine is windows10, and i ran the above in WSL Ubuntu 18.04.

After done the dataset collection, training, validation & compiling the arduino library in edge impulse studio, i was trying to run the inference example with my nano rp2040, the static buffer example sketch works well, serial report the classifier correctly. The problem i face now is, i can’t get any respond in serial when i run the ‘nano_ble33_sense_accelerometer_continuous’ sketch, which i’d modified
line#25, replace

#include <Arduino_LSM6DSOX.h> //#include <Arduino_LSM9DS1.h>

& line#191, EI_CLASSIFIER_SENSOR_ACCELEROMETER to EL_CLASSIFIER_SENSOR_FUSION.

#if !defined(EI_CLASSIFIER_SENSOR) || EI_CLASSIFIER_SENSOR != EI_CLASSIFIER_SENSOR_FUSION   // EI_CLASSIFIER_SENSOR_ACCELEROMETER
#error "Invalid model for current sensor"
#endif

Any advice from anyone how to run inference with nano rp2040?