Getting Started with the Raspberry Pi Pico (MicroPython)
Share
The Raspberry Pi Pico is a low-cost microcontroller board that you can program in MicroPython, a beginner-friendly version of Python. There is no driver hassle because the Pico shows up as a USB drive when you flash it. This guide takes you from a bare board to a blinking LED. If you are unsure how the Pico fits your project, Compoden's AI build assistant can read your idea and recommend the board, parts, wiring, and code as a single shipped kit.
1. What you need
You need a Raspberry Pi Pico, a Micro-USB cable (or USB-C for the Pico that uses it), and a computer. The Pico has a built-in LED, so you can run your first program without wiring anything. If your board is a Pico W, it has Wi-Fi too, but that does not change the basic setup.
2. Flash the MicroPython firmware
Hold down the small BOOTSEL button on the Pico, and while holding it, plug the board into your computer with the USB cable. The Pico appears as a USB drive named RPI-RP2. Download the MicroPython firmware file (a .uf2 file) for your exact Pico model from raspberrypi.com, then drag and drop that file onto the RPI-RP2 drive. The board reboots automatically and is now running MicroPython.
3. Install Thonny
Thonny is a simple Python editor that works well with the Pico. Download it from thonny.org and install it for your operating system. Thonny lets you write code on your computer and run it directly on the Pico, and it includes a shell where you can type commands and see results instantly.
4. Connect Thonny to the Pico
Open Thonny and look at the bottom right corner, where the interpreter is shown. Click it and choose "MicroPython (Raspberry Pi Pico)." Thonny will detect the board on its serial port. If it does not connect, click the Stop button or unplug and replug the Pico, then select the interpreter again. When connected, the shell at the bottom shows a MicroPython prompt, which means you are ready to run code.
5. Run your first program
In the Thonny editor, type a short blink program using the machine library: import machine and time, create a Pin object for the onboard LED ("LED" on the Pico W, or pin 25 on the original Pico), and toggle it inside a loop with a one-second delay. Click the green Run button. The onboard LED should start blinking. To save the program onto the board so it runs on power-up, save the file to the Pico and name it main.py.
6. Troubleshooting
If the RPI-RP2 drive does not appear, you did not hold BOOTSEL while plugging in, so unplug and try again while holding the button. If Thonny cannot find the board, confirm you flashed the MicroPython firmware first, since a fresh Pico has none. A charge-only cable will also stop the board being seen, so use a known data cable. If the LED pin seems wrong, remember the Pico W uses "LED" rather than pin 25.
Build it with Compoden's AI
With MicroPython running, the Pico is ready for sensors, motors, and displays. Describe your project to Compoden's AI build assistant and it recommends the components, shows how to wire them to the Pico, and provides MicroPython starter code, then ships the matching kit. For projects that need to program or debug other chips, an ST-Link V2 USB programmer is a handy companion tool. Browse boards and kits at /collections/all.
The Pico is one of the friendliest boards to start with because there is no driver to install and Python is easy to read. Flash the firmware, install Thonny, connect, and blink the LED. Then let the AI assistant plan and ship your next build from Compoden.
Do I need to install a driver for the Pico? No. The Pico appears as a USB drive for flashing and as a serial device for MicroPython, so no separate driver is needed on common systems.
How do I make my program run on power-up? Save your program to the Pico itself and name the file main.py. MicroPython runs main.py automatically every time the board powers on.
The onboard LED will not blink. What is wrong? Check the LED pin for your model. The original Pico uses pin 25, while the Pico W uses the name "LED" instead of a number.