How to Install MicroPython on Your Microcontroller: A Step-by-Step Guide
MicroPython brings the simplicity and power of Python to microcontrollers, making it an ideal choice for a wide range of projects. Whether youâre a beginner or an experienced developer, installing MicroPython is a straightforward process.
This article will guide you through the general steps for installing MicroPython on most microcontrollers, followed by specific instructions for using Thonny, a popular Python IDE, to make the process even simpler.
How to Install MicroPython
Here are two methods for installing MicroPython on a microcontroller:
- Download the MicroPython firmware for your microcontroller
- Connect your microcontroller to your computer
- Flash the MicroPython firmware onto the microcontroller
- Verify the installation
Alternatively
- Install Thonny
- Open Thonny and connect your microcontroller
- Choose the version
- Write and run your first script
Downloading the MicroPython Firmware
The first step is to download the appropriate MicroPython firmware for your microcontroller. This can typically be found on the MicroPython website under the âDownloadsâ section. Ensure you select the firmware that matches your specific microcontroller model.
Picture of the MicroPython download page

Connecting Your Microcontroller
Connect your microcontroller to your computer using a suitable USB cable. Itâs important that your computer recognizes the device, which might require installing drivers depending on your operating system and the microcontroller.
Connecting the USB cable

Flashing the Firmware
Flashing the firmware for most modern micropython boards is really simply:
- Unplug the USB cable
- Press and hold the
boot
(bootsel
on some boards) button
- Plug in the USB cable
- Release the
boot
button
- Drag the firmware file onto the microcontroller from Finder (on macOS) or Explorer (on Windows) - the file will end in
.uf2
which is a special firm that the microcontroller knows how to install
- Voila, youâre done!
Verifying the Installation
After flashing, most microcontrollers will reboot automatically. You can verify the installation by connecting to the microcontrollerâs REPL (Read-Eval-Print Loop) interface, typically through a serial terminal program like PuTTY or an application like the Arduino IDE, or Thonny.
Installing MicroPython Using Thonny
Thonny is a beginner-friendly Python IDE that simplifies working with Python and MicroPython. Hereâs how you can use Thonny to install MicroPython:
Install Thonny
Download and install Thonny from its official website https://thonny.org. Itâs available for Windows, macOS, and Linux.
Open Thonny and Connect Your Microcontroller
- Launch Thonny
- Before connecting your microcontroller to your computer via USB, hold down the
boot
or bootsel
button on the microcontroller
- Thonny automatically detects the device and displays it in the âDeviceâ dropdown menu at the bottom right of the screen.
- Click
Install MicroPython...
Installing Thonny

Choose the Version
- Select the version of MicroPython you want to install (the Raspberry Pi Pico / Pico H is a good choice, in this scenario)
- Click the
Install
button
- The firmware will upload to the device and once its complete you can click the
Close
button
Selecting the MicroPython version

Writing and Running Your First Script
Once MicroPython is installed, you can write Python code directly in Thonnyâs editor. To run your script on the microcontroller, simply click the âRunâ button. Thonny executes the script on the device and displays any output in the built-in shell.
Your first MicroPython program

Conclusion: Getting Started with MicroPython
With MicroPython installed on your microcontroller, youâre ready to explore the vast possibilities of microcontroller programming with Python. The simplicity and power of MicroPython, combined with tools like Thonny, make it accessible for everyone, from hobbyists to professionals, to create amazing projects. Whether youâre building smart devices, experimenting with IoT, or learning the basics of electronics, MicroPython is an excellent starting point.
Where can I learn MicroPython?
We have a free course on MicroPython, which you can access here: