MakerLab
Raspberry PiRaspberry Pi Pico

Raspberry Pi Pico: A Deep Dive into the RP2040 Microcontroller Board

The Raspberry Pi Pico is a low-cost, high-performance microcontroller board built around the powerful RP2040 chip, offering a flexible platform for embedded projects.

Raspberry Pi Pico

The Raspberry Pi Pico is a departure from the single-board computers (SBCs) that made Raspberry Pi famous. Instead, it's a microcontroller board designed for embedded applications, akin to an Arduino or ESP32. It features the custom-designed RP2040 System-on-Chip (SoC), developed by Raspberry Pi in the UK. This chip is the heart of the Pico, providing its processing power and extensive peripheral set, making it a compelling choice for makers, students, and engineers looking for a capable yet affordable microcontroller.

At its core, the RP2040 is a dual-core ARM Cortex-M0+ processor clocked at up to 133 MHz. This dual-core architecture allows for parallel processing, a significant advantage for complex tasks or real-time control. The chip also boasts a generous amount of on-chip SRAM and supports external QSPI flash memory for program storage, enabling larger and more sophisticated applications. Its design prioritizes flexibility and ease of use, with a rich set of peripherals accessible through a straightforward pinout.

Released in early 2021, the Raspberry Pi Pico was Raspberry Pi's first foray into the microcontroller market. It was designed to be a low-cost, high-performance alternative to existing microcontrollers, leveraging Raspberry Pi's expertise in silicon design and its strong community support. The board is available in two main variants: the standard Pico and the Pico W, which adds Wi-Fi and Bluetooth connectivity. This makes it suitable for a wide range of projects, from simple blinking LEDs to more complex IoT devices and robotics.

The Pico is an excellent choice for hobbyists and students learning about embedded systems due to its accessible price point, extensive documentation, and support for multiple programming environments like MicroPython, CircuitPython, and the Arduino IDE. For more experienced engineers, the RP2040's performance, flexibility, and unique PIO (Programmable I/O) state machines offer advanced capabilities for custom hardware interfaces and high-speed control applications.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCRaspberry Pi RP2040
ArchitectureDual-core ARM Cortex-M0+
Clock speedUp to 133 MHz (default 125 MHz)
Flash / Storage2MB On-board QSPI Flash (external)
RAM / SRAM264KB On-chip SRAM
Operating voltage1.8V - 3.3V
Digital I/O pins26 (multifunction)
Analog / ADC3x 12-bit ADC inputs (on GPIO26, 27, 28)
PWMAll GPIO pins support hardware PWM
Connectivityโ€” (Pico W variant adds Wi-Fi 802.11n and Bluetooth 5.2)
USB1x USB 1.1 (Host/Device) - micro USB connector
Power input1.7V - 5.5V (via VSYS pin), 5V (via micro USB)
Dimensions51mm x 21mm

Pinout & pin functions

PinFunction
3V33.3V Power Output
GNDGround
G0GPIO 0 / ADC0 / SPI0 SCK / UART0 TX / PWM
G1GPIO 1 / ADC1 / SPI0 MOSI / UART0 RX / PWM
G2GPIO 2 / SPI0 MISO / PWM
G3GPIO 3 / PWM
G4GPIO 4 / PWM
G5GPIO 5 / PWM
G6GPIO 6 / PWM
G7GPIO 7 / PWM
G8GPIO 8 / PWM
G9GPIO 9 / PWM
G10GPIO 10 / PWM
G11GPIO 11 / PWM
G12GPIO 12 / PWM
G13GPIO 13 / PWM
G14GPIO 14 / PWM
G15GPIO 15 / PWM
G16GPIO 16 / PWM
G17GPIO 17 / PWM
G18GPIO 18 / PWM
G19GPIO 19 / PWM
G20GPIO 20 / PWM
G21GPIO 21 / PWM
G22GPIO 22 / PWM
G23GPIO 23 / PWM
G24GPIO 24 / PWM
G25GPIO 25 / PWM
G26GPIO 26 / ADC0 / PWM
G27GPIO 27 / ADC1 / PWM
G28GPIO 28 / ADC2 / PWM
G29GPIO 29 (ADC3 - not connected on Pico)
RUNReset Pin (active low)
VSYSSystem Voltage Input (1.7V - 5.5V)
3V3_EN3.3V Regulator Enable (active high)
VBUSUSB 5V Power Input

Wiring & circuit basics

The Raspberry Pi Pico operates at a logic level of 3.3V. This means that any sensors or components you connect to its GPIO pins should also be 3.3V compatible. Connecting 5V components directly to GPIO pins can damage the RP2040 chip. If you need to interface with 5V logic devices, use a level shifter. Powering the Pico can be done via its micro USB port (which supplies 5V) or through the VSYS pin, which accepts a voltage range of 1.7V to 5.5V. The Pico has an onboard 3.3V regulator that can supply up to 500mA, suitable for powering small external components.

A common beginner project is to control an LED. To do this, connect the longer leg (anode) of an LED to a GPIO pin (e.g., GPIO15). Connect the shorter leg (cathode) of the LED to one end of a current-limiting resistor (typically 220-330 ohms for a standard LED). Connect the other end of the resistor to a GND pin on the Pico. When the GPIO pin is set to HIGH (3.3V), current flows through the LED and resistor, turning it on. Setting the pin to LOW (0V) turns it off.

For more advanced projects, you might connect an I2C sensor, such as a BME280 environmental sensor. This typically requires four connections: VCC to 3V3, GND to GND, SDA to a designated I2C SDA pin (e.g., GPIO14), and SCL to a designated I2C SCL pin (e.g., GPIO15). The Pico supports multiple I2C, SPI, and UART interfaces, which can be mapped to various GPIO pins, offering great flexibility in connecting peripherals.

Programming & getting started

The Raspberry Pi Pico is highly versatile in its programming options. For beginners, MicroPython and CircuitPython offer an accessible Python-based environment. You can flash a UF2 bootloader onto the Pico, and then simply drag and drop your Python script onto the Pico's drive that appears when connected via USB. For C/C++ development, the official Raspberry Pi Pico SDK, often used with CMake, provides a powerful and efficient way to program the RP2040. The Arduino IDE also has excellent support for the Pico, allowing users familiar with Arduino to leverage their existing knowledge and libraries. PlatformIO is another popular choice for managing projects and dependencies.

To get started with MicroPython, download the appropriate UF2 file for the Pico from the official Raspberry Pi website. Hold down the BOOTSEL button on the Pico while connecting it to your computer via USB. Release the button once connected, and the Pico will appear as a mass storage device. Drag and drop the UF2 file onto this device to flash the MicroPython firmware. You can then use an IDE like Thonny to write and run Python code directly on the Pico.

Project ideas

RGB LED ControllerControl the color and brightness of an RGB LED using PWM outputs on GPIO pins. This project teaches basic PWM control and color mixing, ideal for visual feedback or mood lighting.
I2C Temperature and Humidity SensorRead data from an I2C sensor like the DHT22 or BME280 and display it. This project introduces I2C communication and data logging, useful for environmental monitoring.
Simple Robot ControllerDrive two DC motors using motor driver ICs (like the L298N) connected to GPIO pins for direction and PWM for speed control. This project is a great introduction to robotics and motor control.
WS2812B LED Strip DriverControl a strand of addressable WS2812B LEDs using a single GPIO pin and the Pico's PIO (Programmable I/O) capabilities. This project explores high-speed, custom protocols and visual effects.
USB HID Device (Keyboard/Mouse)Program the Pico to act as a USB Human Interface Device, such as a custom keyboard or mouse. This project leverages the Pico's USB capabilities and teaches about HID protocols.
Networked Sensor Node (Pico W)Use the Wi-Fi capabilities of the Pico W to send sensor data (e.g., from an ADC pin) to a web server or MQTT broker. This project introduces IoT concepts and wireless communication.

Buying tips & gotchas

When purchasing a Raspberry Pi Pico, ensure you are buying from reputable sources to avoid counterfeit products, though clones are generally less common for the Pico than for some other popular microcontrollers. The standard Pico is excellent for wired projects, while the Pico W variant is ideal for IoT applications requiring Wi-Fi connectivity. Essential accessories include a micro USB cable for power and programming, a breadboard and jumper wires for prototyping, and a selection of basic electronic components like LEDs, resistors, and buttons. Consider a small heatsink for the RP2040 if running it at maximum clock speed under heavy load for extended periods, although it's generally not required for most applications.