02Lesson
Robotics Lab: Raspberry Pi Pico Lesson and Pinout
Select a board in Robotics Lab to see its specifications, pin functions and component guide.
Board overview
Robotics Lab board guide · Raspberry Pi · 2021
A tiny, very cheap board built around the RP2040 — the first microcontroller chip Raspberry Pi designed in-house. You program it in MicroPython or C/C++: plug it into USB and it shows up like an ordinary flash drive. A great pick for learning and for building small robots.
- Clock
- 133 MHz
- Flash
- 2 MB
- RAM
- 264 KB
- GPIO pins
- 26
- Logic level
- 3.3 V
- Price
- ≈ $4
Specs
Compare the electrical specs with other Robotics Lab boards. See the hardware references.
- Microcontroller
- RP2040, dual-core Arm Cortex-M0+
- Clock speed
- up to 133 MHz
- Flash memory
- 2 MB (separate QSPI chip)
- RAM
- 264 KB
- GPIO pins
- 26 (GP0–GP22, GP26–GP28)
- Analog inputs
- 3 × 12-bit ADC + temperature sensor
- PWM
- 16 channels
- Interfaces
- 2 × UART, 2 × SPI, 2 × I2C, USB 1.1, PIO
- Logic level
- 3.3 V (not 5 V tolerant!)
- Power
- 5 V over USB or 1.8–5.5 V on VSYS
- Size
- 51 × 21 mm, 1 mm thick PCB
- Languages
- MicroPython, C/C++, Arduino
What’s on the board
12 parts match the numbered labels in Robotics Lab. Click one and the camera flies to it.
Strengths and pitfalls
Use these trade-offs when choosing a board in Robotics Lab.
Strengths
- Very low price for two cores and 264 KB of RAM
- No programmer needed: hold BOOTSEL, plug in USB and drag a .uf2 file onto the drive
- MicroPython out of the box: write code and see the result straight away
- PIO blocks: build your own precise protocols for addressable LEDs, encoders and servos
Watch out
- 3.3 V logic. A 5 V signal (from an Arduino Uno or an HC-SR04 sensor, for example) can burn an input — use a voltage divider or a level shifter.
- A single pin supplies only a few milliamps (4 mA by default, 12 mA at most). Power motors, servos and LED strips separately and switch them through a driver or a transistor.
- Draw no more than ≈300 mA from 3V3(OUT). Do not feed VSYS while USB is plugged in unless you add a protection diode.
- Headers are not soldered and there is no reset button: you will need a soldering iron and, if you want one, your own button between RUN and GND.
Pins
Learn which pins to use on the Robotics Lab workbench.
Power
VBUS is 5 V from USB. VSYS is the main power input (1.8–5.5 V): connect batteries here. 3V3(OUT) gives a ready 3.3 V for sensors. Ground (GND) pads are the square ones — there are eight of them.
Digital pins
GP0–GP22 and GP26–GP28 are 3.3 V inputs and outputs. Any of them can output PWM and trigger an interrupt. UART, I2C and SPI can be assigned to several different groups of pins.
Analog inputs
GP26, GP27 and GP28 are ADC inputs (ADC0–ADC2): they measure a voltage from 0 to 3.3 V with 12-bit resolution. ADC_VREF and AGND are the reference and ground for precise measurements.
Special pins
RUN is reset (short it to GND). 3V3_EN switches the regulator off. GP25 is not brought out to a pad — the on-board LED sits on it.
Numbering
On the top only pins 1, 2 and 39 are marked — all the names are printed on the underside. Pin 1 (GP0) is to the left of the USB connector when you hold the board with the connector pointing up.
Hover over a pin in the Robotics Lab viewer to see its name and function.
- Power
- Ground
- Digital
- Analog
- Buses: UART, I²C, SPI
- Control: RESET, EN, BOOT
- Not connected
First code
Try the Robotics Lab starter example on your physical board.
from machine import Pin # access to the pinsimport time # delaysled = Pin(25, Pin.OUT) # on-board LED on GP25, set as an outputwhile True: # repeat forever led.toggle() # flip it: on <-> off time.sleep(0.5) # wait half a second
Where it shines
Use the Robotics Lab workbench to plan the wiring for a project.
- Line-following robot: two motors through a driver and sensors on the analog inputs GP26–GP28
- Remote control or macro keypad: the Pico can pretend to be a USB keyboard or gamepad
- Driving a strip of addressable LEDs with PIO
- Weather station with an I2C sensor and a small display
- Servo controller for a robot arm or a walking robot (16 PWM channels)
Board background
See how this hardware fits into the Robotics Lab board collection.
The name RP2040 is a code: RP for Raspberry Pi, 2 for two cores, 0 for the Cortex-M0+ core type, 4 for the amount of RAM and 0 for no built-in flash memory.
The Pico launched in January 2021 for 4 dollars — cheaper than a cup of coffee. The board itself is marked "© 2020".
Edges with half-holes are called castellations — they look like the battlements on top of a castle wall.
Practice with this board
Try the same board in these Robotics Lab activities.
- Inspect the Robotics Lab 3D model to locate a component or connector.
- Try the Robotics Lab component quiz to check what you remember.
- Open the Robotics Lab workbench to simulate your wiring.
Sources
Manufacturer and hardware project documentation.
- Raspberry Pi Pico series documentation
Pico board specifications, pinout and links to the RP2040 documentation.