Micropython Basics: Thonny IDE
Table of Contents
Before you can start writing and running MicroPython code, you need an environment that allows you to easily communicate with your development board. One of the most beginner-friendly tools for this is the Thonny IDE — a lightweight Python editor that includes built-in support for MicroPython boards such as the ESP32, ESP8266, and Raspberry Pi Pico.
Thonny simplifies the setup process by combining everything you need into a single interface: a code editor, a Python shell, and a tool for flashing MicroPython firmware onto your board. Let’s walk through the setup process step by step.
Step 1: Install Thonny
Visit the official website at https://thonny.org and download the latest version of Thonny for your operating system. Installers are available for Windows, macOS, and Linux.
Once the installation is complete, launch Thonny. You should see a clean interface with two main areas:
- Editor area — where you write and save your scripts.
- Shell (REPL) — the interactive console at the bottom of the window where you can type and test commands directly.

Step 2: Connect Your MicroPython Board
Plug your development board (ESP32, ESP8266, or Raspberry Pi Pico) into your computer using a USB cable. Make sure the cable supports data transfer, not just charging. If you are using Windows, your computer may automatically install the necessary USB drivers. If not, you might need to manually install the drivers for your board model.
Once connected, the board should appear as a serial device or COM port on your system. You don’t need to configure it manually yet—Thonny will detect it in the next step.
Step 3: Install MicroPython Firmware
MicroPython firmware is what allows your board to understand and execute MicroPython code. Thonny makes this installation process straightforward:
- Open Thonny and go to Tools → Options.
- Click the Interpreter tab.
- In the Interpreter dropdown, select your board type, such as MicroPython (ESP32) or MicroPython (Raspberry Pi Pico).
- Click the Install or update MicroPython button.
Thonny will automatically download the latest firmware and flash it to your board. This process usually takes less than a minute. Once it’s done, you’ll see a confirmation message indicating that the installation was successful.

Step 4: Select the Interpreter and Port
After flashing the firmware, you need to tell Thonny which interpreter and serial port to use:
- Go back to Tools → Options → Interpreter.
- Select your board again from the dropdown menu.
-
Under Port, choose the port where your board is
connected. It may look like:
COM3
on Windows/dev/ttyUSB0
or/dev/ttyACM0
on Linux/dev/tty.usbmodem*
on macOS
- Click OK to save your settings.
Step 5: Verify the Connection
Now that your board is connected and the firmware is installed, it’s time to confirm that everything works. In the Thonny Shell (the bottom pane), you should see a MicroPython prompt similar to the one below:
Try typing a simple command to ensure the interpreter responds correctly:
If you see the message Hello from MicroPython! printed in the console, congratulations — your setup is complete! 🎉 You now have a working MicroPython environment ready for programming and experimentation.
With Thonny and MicroPython set up, you’re ready to write your first hardware-interactive program in the next section — blinking an LED!