Raspberry Pi RP2040

The Raspberry Pi RP2040 is the debut microcontroller from Raspberry Pi - and it's fully supported by Edge Impulse. You'll be able to sample raw data, build models, and deploy trained machine learning models directly from the studio. It's available for around $4 from Raspberry Pi foundation and a wide range of distributors.

To get started with the Raspberry Pi RP2040 and Edge Impulse you'll need:

The Edge Impulse firmware for this development board is open source and hosted on GitHub: edgeimpulse/firmware-pi-rp2040.

Two RP2040 microcontroller chips.

Installing dependencies

To set this device up in Edge Impulse, you will need to install the following software:

  1. If you'd like to interact with the board using a set of pre-defined AT commands (not necessary for standard ML workflow), you will need to also install a serial communication program, for example minicom, picocom or use Serial Monitor from Arduino IDE (if installed).

  2. On Linux:

    • GNU Screen: install for example via sudo apt install screen.

Problems installing the CLI?

See the Installation and troubleshooting guide.

Connecting to Edge Impulse

With all the software in place, it's time to connect the development board to Edge Impulse.

1. Connect the development board to your computer

Use a micro-USB cable to connect the development board to your computer while holding down the BOOTSEL button, forcing the Raspberry Pi Pico into USB Mass Storage Mode.

Flashing firmware to the Raspberry Pi Pico.

2. Update the firmware

The development board does not come with the right firmware yet. To update the firmware:

  1. Drag the ei_rp2040_firmware.uf2 file from the folder to the USB Mass Storage device.

  2. Wait until flashing is complete, unplug and replug in your board to launch the new firmware.

3. Setting keys

From a command prompt or terminal, run:

edge-impulse-daemon

This will start a wizard which will ask you to log in, and choose an Edge Impulse project. If you want to switch projects run the command with --clean.

Alternatively, recent versions of Google Chrome and Microsoft Edge can collect data directly from your development board, without the need for the Edge Impulse CLI. See this blog post for more information.

4. Verifying that the device is connected

That's all! Your device is now connected to Edge Impulse. To verify this, go to your Edge Impulse project, and click Devices. The device will be listed here.

Raspberry Pi Pico board connected to Edge Impulse Studio.

Next steps: building a machine learning model

With everything set up you can now build your first machine learning model. Since Raspberry Pi Pico does not have any built-in sensors, we decided to add the following ones to be supported out of the box, with a pre-built firmware:

There is a vast variety of analog signal sensors, that can take advantage of RP2040 10-bit ADC (Analog to Digital Converter), from common ones, such as Light sensor, Sound level sensor to more specialized ones, e.g. Carbon Dioxide sensor, Natural Gas sensor or even an EMG Detector.

Once you have the compatible sensors, you can then follow these tutorials:

Support for Arduino RP2040 Connect was added to the official RP2040 firmware for Edge Impulse. That includes data acquisition and model inference support for:

  • onboard MP34DT05 microphone

  • onboard ST LSM6DSOX 6-axis IMU

  • the sensors described above still can be connected

Looking to connect different sensors? The Data forwarder lets you easily send data from any sensor into Edge Impulse.

Using with other RP2040 boards

While RP2040 is a relatively new microcontroller, it was already utilized to build several boards:

  • The official Raspberry Pi Pico RP2040

  • Arducam Pico4ML (Camera, screen and microphone)

  • Seeed Studio XIAO RP2040 (extremely small footprint)

  • Black Adafruit Feather RP2040 (built-in LiPoly charger)

And others. While pre-built Edge Impulse firmware is mainly tested with Pico board, it is compatible with other boards, with the exception of I2C sensors and microphone - different boards use different pins for peripherals, so if you’d like to use LSM6DS3/LSM6DSOX accelerometer & gyroscope modules or microphone, you will need to change pin values in Edge Impulse RP2040 firmware source code, recompile it and upload it to the board.

Last updated

Revision created

fix