Skip to content

Technik Blog

Programmieren | Arduino | ESP32 | MicroPython | Python | Raspberry Pi | Raspberry Pi Pico

Menu
  • About me
  • Contact
  • Deutsch
  • English
Menu

RP2040 microcontroller: small, powerful and ready for use directly in the USB port

Posted on 6. February 20255. February 2025 by Stefan Draeger

In this article, I would like to introduce you to a compact microcontroller featuring the RP2040 chip, which plugs directly into a USB port, eliminating the need for an additional data cable.

Mini USB RP2040 Development Board - Programmieren in der Arduino IDE & MicroPython
Watch this video on YouTube.

I purchased this microcontroller for approximately €5, including shipping, from AliExpress. In terms of price, it is comparable to the original Raspberry Pi Pico (without WiFi).

tiny Microcontroller with RP2040 Chip #1
tiny Microcontroller with RP2040 Chip #1
tiny Microcontroller with RP2040 Chip #2
tiny Microcontroller with RP2040 Chip #2
tiny Microcontroller with RP2040 Chip #3
tiny Microcontroller with RP2040 Chip #3
tiny Microcontroller with RP2040 Chip #4
tiny Microcontroller with RP2040 Chip #4
tiny Microcontroller with RP2040 Chip #5
tiny Microcontroller with RP2040 Chip #5

Table of Contents

  • Structure of the RP2040 Microcontroller for the USB Port
    • Pinout of the Microcontroller
  • Comparison with the Original Raspberry Pi Pico
  • Programming the Mini USB RP2040 Development Board in the Arduino IDE
    • Installing the Board Driver
    • Programming the RGB LED
    • Programming a Flame Sensor
  • Outlook on the Microcontroller with RP2040 Chip for the USB Port

Structure of the RP2040 Microcontroller for the USB Port

This microcontroller is based on the RP2040 chip with the following specifications:

  • Dual ARM Cortex-M0+ @ 133 MHz
  • 264 kB SRAM
  • 16 MB Flash memory

Additionally, it features a programmable RGB LED and a Qwiic interface for connecting I²C sensors and actuators.

There are also two buttons: RESET and BOOT, with the BOOT button used, for example, to flash a different firmware.

Pinout of the Microcontroller

Due to its compact size, not all pins provided by the RP2040 are accessible on the microcontroller. The available pins are labeled on the back of the device and can be accessed via pin headers or additional solder points.

The pinout corresponds to the designations of the original Raspberry Pi Pico, with pins 0 to 29 also present on this mini USB microcontroller.

Comparison with the Original Raspberry Pi Pico

The Raspberry Pi Pico has been on the market for several years and even offers support for WiFi and Bluetooth since 2023. In comparison, the small microcontroller for the USB port fares worse. Despite the nice RGB LED, I consider having many pins available for projects to be more important.

Comparison - Raspberry Pi Pico & Mini USB RP2040 Board
Comparison – Raspberry Pi Pico & Mini USB RP2040 Board
Comparison - Raspberry Pi Pico & Mini USB RP2040 Board
Comparison – Raspberry Pi Pico & Mini USB RP2040 Board

For smaller projects, however, the Mini USB RP2040 is better suited, so the choice of the best microcontroller ultimately depends on the specific application.

Programming the Mini USB RP2040 Development Board in the Arduino IDE

The microcontroller is prepared for programming in the Arduino IDE. After installing the appropriate board driver, you can get started right away.

Installing the Board Driver

Open the board manager in the Arduino IDE, search for “RP2040,” and install the “Arduino Mbed OS RP2040 Boards” package.

After successful installation, you will find the board under “Tools” > “Board: xyz” > “Arduino Mbed OS RP2040 Boards” > “Raspberry Pi Pico.”

Programming the RGB LED

The RGB LED is connected to GPIO 22 and can be easily programmed with the Adafruit NeoPixel library.

#include <Adafruit_NeoPixel.h>

#define PIN 22 // RGB LED connected to GPIO22
#define NUMPIXELS 1 // Number of built-in RGB LEDs

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

uint32_t colors[5] = {
  pixels.Color(0, 150, 0),     // green
  pixels.Color(150, 0, 0),     // red
  pixels.Color(0, 0, 150),     // blue
  pixels.Color(150, 150, 0),   // yellow
  pixels.Color(255, 255, 255)  // white
};

void setup() {
  // Start communication with the NeoPixels
  pixels.begin();
}

void loop() {
  // Clear the set color
  pixels.clear();
  // Loop from 0 to 4
  // Since arrays start with index 0, we need to start here
  // and loop up to a maximum of 4.
  for (int i = 0; i < 5; i++) {
    // Set the color from the array with the loop variable i at the
    // index 0 of the LED strip.
    pixels.setPixelColor(0, colors[i]);
    // Display the color
    pixels.show();
    // A short pause of 500 milliseconds
    delay(500);
  }
}

Programming a Flame Sensor

On my blog, I have already introduced the flame sensor for the Arduino. As the name suggests, this sensor reacts to a flame, such as from a lighter. The sensor has two pins (one analog and one digital) and two for power supply.

In the following code, I use the digital output of the sensor, and when it is HIGH, I change the color of the LED from green to red.

#include <Adafruit_NeoPixel.h>

#define PIN 22
#define NUMPIXELS 1 

#define flameSensor 0

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  Serial.begin(9600);
  pinMode(flameSensor, INPUT_PULLDOWN);
  pixels.begin();
}

void loop() {
  pixels.setPixelColor(0, pixels.Color(0, 150, 0));
  pixels.show();
  if (digitalRead(flameSensor) == 1){
    Serial.println("Flame detected");
    pixels.setPixelColor(0, pixels.Color(150, 0, 0));
    pixels.show();
    delay(500);
  } 
}

Outlook on the Microcontroller with RP2040 Chip for the USB Port

In the next article, I would like to present a small project with this mini USB microcontroller, so stay tuned…

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Fragen oder Feedback?

Du hast eine Idee, brauchst Hilfe oder möchtest Feedback loswerden?
Support-Ticket erstellen

Newsletter abonnieren

Bleib auf dem Laufenden: Erhalte regelmäßig Updates zu neuen Projekten, Tutorials und Tipps rund um Arduino, ESP32 und mehr – direkt in dein Postfach.

Jetzt Newsletter abonnieren

Unterstütze meinen Blog

Wenn dir meine Inhalte gefallen, freue ich mich über deine Unterstützung auf Tipeee.
So hilfst du mit, den Blog am Leben zu halten und neue Beiträge zu ermöglichen.

draeger-it.blog auf Tipeee unterstützen

Vielen Dank für deinen Support!
– Stefan Draeger

Categories

Links

Blogverzeichnis Bloggerei.de TopBlogs.de das Original - Blogverzeichnis | Blog Top Liste Blogverzeichnis trusted-blogs.com

Stefan Draeger
Königsberger Str. 13
38364 Schöningen

Tel.: 01778501273
E-Mail: info@draeger-it.blog

Folge mir auf

  • Impressum
  • Datenschutzerklärung
  • Disclaimer
  • Cookie-Richtlinie (EU)
©2025 Technik Blog | Built using WordPress and Responsive Blogily theme by Superb
Cookie-Zustimmung verwalten
Wir verwenden Cookies, um unsere Website und unseren Service zu optimieren.
Funktional Always active
Die technische Speicherung oder der Zugang ist unbedingt erforderlich für den rechtmäßigen Zweck, die Nutzung eines bestimmten Dienstes zu ermöglichen, der vom Teilnehmer oder Nutzer ausdrücklich gewünscht wird, oder für den alleinigen Zweck, die Übertragung einer Nachricht über ein elektronisches Kommunikationsnetz durchzuführen.
Vorlieben
Die technische Speicherung oder der Zugriff ist für den rechtmäßigen Zweck der Speicherung von Präferenzen erforderlich, die nicht vom Abonnenten oder Benutzer angefordert wurden.
Statistiken
Die technische Speicherung oder der Zugriff, der ausschließlich zu statistischen Zwecken erfolgt. Die technische Speicherung oder der Zugriff, der ausschließlich zu anonymen statistischen Zwecken verwendet wird. Ohne eine Vorladung, die freiwillige Zustimmung deines Internetdienstanbieters oder zusätzliche Aufzeichnungen von Dritten können die zu diesem Zweck gespeicherten oder abgerufenen Informationen allein in der Regel nicht dazu verwendet werden, dich zu identifizieren.
Marketing
Die technische Speicherung oder der Zugriff ist erforderlich, um Nutzerprofile zu erstellen, um Werbung zu versenden oder um den Nutzer auf einer Website oder über mehrere Websites hinweg zu ähnlichen Marketingzwecken zu verfolgen.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Einstellungen anzeigen
{title} {title} {title}