Announcing Official Support for the Raspberry Pi Pico (RP2040)

Today, we are excited to announce official support of Raspberry Pi’s debut microcontroller, the RP2040, and the Raspberry Pi Pico development board.

The RP2040 is inexpensive and efficient, with a hardware footprint of just two square millimeters of 40 nm silicon. The chip has two Cortex-M0+ cores running at maximum clock frequency of 133 MHz, flexible I/O and plenty of on-chip RAM.

The Pico and other RP2040 boards, despite being relatively new, have captured a lot of interest from hobbyists and researchers, given the chip’s low-power/low hardware footprint profile and inexpensive price, combined with top-notch documentation from the Raspberry Pi Foundation. By supporting the Raspberry Pi Pico, Edge Impulse opens up new fields of application where each one of you can create your own custom machine learning solution, from collecting data to running inference on device.

How do I get started?

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.

To get started in just a few minutes, please have a look at our guide or watch the following video tutorial. It will walk through how to flash the default firmware to instantly begin data collection into your Edge Impulse project:

Since the Raspberry Pi Pico board has no built-in sensors, for a quick sanity check and to just try out your Pico RP2040 board with Edge Impulse, we can build a model utilizing NO SENSORS at all. Well, almost. as the Raspberry Pi Pico still has an analog-to-digital (ADC) converter, which can be used as an input - by touching the board pins, the voltage on analog input pins is temporarily lowered, and thus we can utilize that to build an SOS detector.

Note: While this experiment was tested extensively on Raspberry Pi Pico by a member of our team, use your best judgment if repeating the project. A proper way to collect the data with Raspberry Pi Pico is either by connecting it to sensors with breadboard/jumper wires or with Grove Expansion Shield for Pico.

After connecting Raspberry Pi Pico to Edge Impulse Studio via the edge-impulse-cli, go to the Data Acquisition tab and record about 20 five-second samples for the SOS and noise classes.

You can play around with different DSP blocks. The one that we used was Spectrogram, since to distinguish SOS signal from other noise we need both information about frequencies/amplitude of the signal and their change in the time window of the sample.

Train the model and test it with the Live Classification tab. Of course, 20 samples won’t be enough to create a very robust model, but you should be able to get right classification results to check if your Pico is properly set up to work with Edge Impulse.

Finally, once you are happy with your results, you can deploy your model back to your device. In order to do this, go to the Deployment tab of your Edge Impulse project to build and download a ready-to-go binary that includes your machine learning model for the Raspberry Pi RP2040.

What is supported?

To pave the road for developers, educators, and machine learning researchers, we decided to launch the first version of RP2040 support with Pico board as the main target. Having said that, other RP2040-based boards can run both data collection firmware and trained models, with some changes to the source code to account for differences between the boards. For more details check out “Using with other RP2040 boards."

Note: The RP2040 was benchmarked for common ML models. Latency calculations for RP2040 are available to choose in the dashboard under Project Info. You will notice that despite its 133 Mhz maximum clock rate, the latency numbers are higher, than for example for Cortex M4F boards with the same clock rate - that has to do with the fact that M0+ cores lack SIMD (Single Instruction Multiple Data) extensions and hardware floating-point units, therefore they are less efficient when it comes to DSP, but are comparable for running INT8 quantized models.

Since the Raspberry Pi Pico does not have any built-in sensors, we have decided to support the following sensors with a pre-built firmware:

There is a vast variety of analog signal sensors, that can take advantage of RP2040 10-bit ADC from common ones, such as light and sound level sensors to more specialized ones, e.g. carbon dioxide, natural gas, or even an EMG detector.

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

And of course, with the Data Forwarder tool from the Edge Impulse CLI, you can collect a vast variety of sensor data for training your own models.

Further plans

The Raspberry Pi Pico and its microcontroller chip, the RP2040, are making waves in the community and are at the top of the list of popular boards. We at Edge Impulse are committed to providing the best experience for our users and supporting them in building their embedded machine learning projects. Hence, in the future, the RP2040 boards and Pico in particular will receive feature updates to make them more efficient and convenient to be used together with the Edge Impulse platform!

Subscribe

Are you interested in bringing machine learning intelligence to your devices? We're happy to help.

Subscribe to our newsletter