If you're an experienced Python programmer looking to dive into embedded programming in 2025, here's my opinionated notes to ramping up quickly.
From Python to Pins
For years, I've thrived in the realm of high-level programming, comfortably abstracted from the hardware layer. But to climb the robots-meets-AGI pyramid, I’ve decided to roll up my sleeves and explore microcontroller programming. Like many developers, I’ve sidestepped hardware—relying on a few breadboard hacks during university—but now feels like the right time to step up.
After a weekend of rabbit-holing on google, reddit, youyube, and LLM-fueled explorations, I’ve tinkered into an optimum starting point for any Python programmer looking to do the same.
Your first microcontroller: Raspberry Pi Pico 2 Wireless
Arduino Uno? ESP32? Raspberry Pi Pico?
The options are endless, but my recommendation is the Pico 2 W from Raspberry Pi. It’s feature-rich, flexible, and fun to work with:
- For its price, it's packed with capabilities: offers WiFi/Bluetooth, dual-core processing, 520 KB RAM, and plenty of I/O pins. full specs here.
- Familiar Development Environment:
- MicroPython makes it easy to get started. If you know python, you are ready. If you hit a ceiling, you can switch to C.
- VS Code Integration: The official VS Code extension (launched in 2024) is actively maintained and eliminates the hassle of juggling unofficial or outdated tools.
- You’ll find older guides recommending Thonny or custom VS Code setups, but skip those for a more modern workflow.
- VS Code Integration: The official VS Code extension (launched in 2024) is actively maintained and eliminates the hassle of juggling unofficial or outdated tools.
- Strong Component Ecosystem: Seemingly? while I’m still testing this thoroughly, setting up basic components like LEDs, buzzers, and motion sensors was seamless. Advanced peripherals like camera modules might be more challenging, but that’s for another post.
Install the Micropython firmware on the board
Follow the official MicroPython installation guide and download the Pico 2 W UF2 file. Some older guides suggest using Thonny for this, but I’ve found that approach often grabs outdated firmware versions.
To test the waters and if everything is working as intended so far, quickly try the Thonny tutorial here.... after this I recommend permanently switch to VS Code.
Setup VS Code with the official extension
Skip the countless unofficial extensions and make sure you install the official Raspberry Pi Pico extension. (This extension silently also includes MicroPico, which is what adds MicroPython support seamlessly to the main extension.)
Try running the Blink example project with the steps in this guide.
Read this book, but follow the examples using VS Code (instead of Thonny)
"Get Started with MicroPython on Raspberry Pi Pico: The Official Raspberry Pi Pico Guide - 2nd Edition"
While it’s written for the Pico W series, most of it applies to the Pico 2 W. It’s concise, beginner-friendly, and includes a crucial chapter on WiFi connectivity—essential for leveraging the Pico’s wireless capabilities. For limitations and minor errata, check my Mastodon thread with the author. If you want a free PDF copy of this book, just send me a tweet - as the book is now creative commons licensed, I can send you a copy.
Bookmark these snippets - they will save you time later!
- awesome-micropython - curated list of awesome MicroPython libraries, frameworks, software and resources.
- pro tip: before buying more complex components like audio, camera, etc this is where you should check if there's a micropython driver available. If there is no micropython driver available, you will be stuck writing one yourself, or switching your entire pico to use the C/C++ SDK. There is no way to mix C/C++ code and micropython code in the same pico.
- picow.pinout.xyz is a better readable pin-out diagram than the official docs.
- Monkmaker breadboard - it can be tricky to work out which pin is which when the Raspberry Pi Pico is attached to solderless breadboard. The MonkMakes Breadboard for Pico solves this problem by labelling the Pico pins on the breadboard.
- How to quickly copy over files to your pico with the VS Code extension?
- you can type
.ls
in your micropython terminal to view all files
- you can type
- mpremote cli tool - officially-supported tool to remotely interact with, manage the filesystem on, and automate a MicroPython device over a serial connection. This is like your 'adb' if you have connected an android to your workstation before.
- micropython-lib - core Python libraries ported to MicroPython
- As of MicroPython v1.20 (and nightly builds since October 2022), boards with WiFi and Ethernet support include the
mip
package manager.
- As of MicroPython v1.20 (and nightly builds since October 2022), boards with WiFi and Ethernet support include the
- r/raspberrypipico subreddit - well, if you are learning something new, you should always join the subreddit for that topic :)
With that, welcome to the era of physical computing!