The Raspberry Pi Pico is a compact, low-cost microcontroller board built around the RP2040 chip. It features dual ARM Cortex-M0+ cores, 264KB of SRAM, and 2MB of onboard flash memory. Designed for versatility, the Pico supports programming in C, C++, MicroPython, and CircuitPython, making it an excellent choice for embedded systems, IoT applications, and rapid prototyping.
The Raspberry Pi Pico has 40 pins, including power, ground, and GPIO pins. Below is a summary of the pin configuration:
Pin Number | Pin Name | Description |
---|---|---|
1 | GP0 | GPIO0, UART0 TX, I2C0 SDA, SPI0 RX |
2 | GP1 | GPIO1, UART0 RX, I2C0 SCL, SPI0 CSn |
3 | GND | Ground |
4 | GP2 | GPIO2, UART1 TX, I2C1 SDA, SPI0 SCK |
5 | GP3 | GPIO3, UART1 RX, I2C1 SCL, SPI0 TX |
36 | 3V3 | 3.3V Power Output |
39 | VSYS | Power input (1.8V to 5.5V) |
40 | GND | Ground |
For a complete pinout diagram, refer to the official Raspberry Pi Pico documentation.
Below is an example of how to blink an LED connected to GPIO25 using MicroPython:
import machine import time
led = machine.Pin(25, machine.Pin.OUT)
while True: led.value(1) # Turn the LED on time.sleep(1) # Wait for 1 second led.value(0) # Turn the LED off time.sleep(1) # Wait for 1 second
The following example demonstrates how to read an analog sensor connected to GPIO26 (ADC0):
import machine import time
adc = machine.ADC(26)
while True: value = adc.read_u16() # Read 16-bit ADC value (0-65535) print("ADC Value:", value) # Print the value to the console time.sleep(0.5) # Wait for 0.5 seconds
Pico Not Detected by Computer:
GPIO Pin Not Responding:
Program Not Running After Power Cycle:
main.py
to run automatically on boot.Can I use the Pico with Arduino IDE?
Yes, the Raspberry Pi Pico is compatible with the Arduino IDE. Install the RP2040 board package to get started.
What is the maximum current output of the 3.3V pin?
The 3.3V pin can supply up to 300mA, depending on the input power source.
Can I use the Pico for battery-powered projects?
Yes, the Pico can be powered via the VSYS pin using a battery (e.g., LiPo or AA batteries). Ensure the voltage is within the 1.8V to 5.5V range.
How do I reset the Pico to factory settings?
Reflash the original firmware by entering USB mass storage mode and copying the appropriate UF2 file to the Pico.
By following this documentation, you can effectively use the Raspberry Pi Pico for a wide range of projects and applications.