What is MicroPython? Learn how to make a robot using Micropython, the Python programming language for microcontrollers. 10 January 2024 10 minute read By Kevin McAleer Share this article on Table of Contents What is MicroPython?Why is it called MicroPython?What Microcontrollers can run MicroPython?What’s the difference between MicroPython and CircuitPython?Is MicroPython the same as Python?How long does it take to learn MicroPython?The history of MicroPythonWhere can I get MicroPython?Where can I learn MicroPython?Learn Micropython - the basics Tags Micropython Microcontrollers Python Raspberry Pi
What is MicroPython? MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments. MicroPython offers many sophisticated features like an interactive prompt, high-precision integers, closures, list comprehension, generators, and exception handling, all within a small footprint. It needs only 256k of code space and 16k of RAM to operate. Its design closely matches standard Python, making it easy to move code from a desktop to a microcontroller or embedded system. Why is it called MicroPython? MicroPython is a smaller version of the programming language Python, designed for use with MicroControllers, the name is a concatenation of the two words, Micro + Python where Micro refers to the MicroController. Micro + Python Python gets it name from a TV show… “When he began implementing Python, Guido van Rossum was also reading the published scripts from ‘Monty Python’s Flying Circus’, a BBC comedy series from the 1970s. Van Rossum thought he needed a name that was short, unique, and slightly mysterious, so he decided to call the language Python” What Microcontrollers can run MicroPython? MicroPython is versatile and can run on a wide range of microcontrollers from various manufacturers, catering to different requirements and applications. Key players include the ESP8266 and ESP32 from Espressif Systems, known for their Wi-Fi capabilities; the Pyboard series, developed by the creator of MicroPython himself, Damien George; STM32 microcontrollers from STMicroelectronics, renowned for their performance and range of features; and the Raspberry Pi Pico, which uses the RP2040 chip developed by Raspberry Pi Foundation, famous for its affordability and ease of use. Each of these microcontrollers brings unique features to the table, such as advanced connectivity, high processing power, or cost-effectiveness, making MicroPython suitable for a broad spectrum of projects and applications. Here’s a table listing some popular microcontrollers that can run MicroPython, along with their manufacturers and links for more information: Product Name Vendor Pyboard D-series SF2 George Robotics Pyboard D-series SF3 George Robotics Pyboard D-series SF6 George Robotics Pyboard Lite v1.0 George Robotics Pyboard v1.0 George Robotics Pyboard v1.1 George Robotics actinius_icarus Actinius Adafruit Metro M7 Adafruit F405 Express Adafruit Feather M0 Express Adafruit Feather M4 Express Adafruit Feather RP2040 Adafruit Feather nRF52840 Express Adafruit ItsyBitsy M0 Express Adafruit ItsyBitsy M4 Express Adafruit ItsyBitsy RP2040 Adafruit Metro M4 Express Airlift Adafruit QT Py RP2040 Adafruit Trinket M0 Adafruit Arduino Giga Arduino Arduino Nano 33 BLE Sense Arduino Arduino Nano ESP32 Arduino Arduino Nano RP2040 Connect Arduino Arduino Nicla Vision Arduino Arduino Portenta C33 Arduino Arduino Portenta H7 Arduino arduino_primo Arduino micro:bit v1 BBC ESP32 / WROOM Espressif ESP32-C3 Espressif ESP32-S2 Espressif ESP32-S3 Espressif ESP8266 Espressif Pico Espruino Cerb40 Fez HydraBus v1.0 HydraBus blueio_tag_evim I-SYST ibk_blyst_nano I-SYST idk_blyst_nano I-SYST Hub No.6 LEGO Hub No.7 LEGO LILYGO TTGO LoRa32 LILYGO dvk_bl652 Laird Connectivity LimiFrog LimiFrog M5 Stack Atom M5 Stack nrf52840-mdk-usb-dongle Makerdiary GARATRONIC_NADHAT_F405 McHobby GARATRONIC_PYBSTICK26_F411 McHobby PYBSTICK26 RP2040 McHobby SAMD21 Xplained Pro Microchip MikroE Clicker 2 for STM32 MikroElektronika MikroE Quail MikroElektronika Mikroe RA4M1 Clicker MikroElektronika Mini SAM M4 MiniFig Boards MIMXRT1010_EVK NXP MIMXRT1015_EVK NXP MIMXRT1020_EVK NXP MIMXRT1050_EVK NXP MIMXRT1060_EVK NXP MIMXRT1064_EVK NXP MIMXRT1170_EVK NXP Netduino Plus 2 Netduino pca10000 Nordic Semiconductor pca10001 Nordic Semiconductor pca10028 Nordic Semiconductor pca10031 Nordic Semiconductor pca10040 Nordic Semiconductor pca10056 Nordic Semiconductor pca10059 Nordic Semiconductor pca10090 Nordic Semiconductor E407 OLIMEX H407 OLIMEX Olimex ESP32 POE OLIMEX Olimex_RT1010Py OLIMEX Teensy 4.0 PJRC Teensy 4.1 PJRC Xenon Particle Pico LiPo (16MiB) Pimoroni Pico LiPo (4MiB) Pimoroni Tiny2040 Pimoroni Pololu 3pi+ 2040 Robot Pololu Pololu Zumo 2040 Robot Pololu WiPy Module Pycom Pico Raspberry Pi Pico W Raspberry Pi EK-RA4M1 Renesas Electronics EK-RA4W1 Renesas Electronics EK-RA6M1 Renesas Electronics EK-RA6M2 Renesas Electronics B_L072Z_LRWAN1 ST Microelectronics B_L475E_IOT01A ST Microelectronics Discovery F4 ST Microelectronics Discovery F411 ST Microelectronics Discovery F429 ST Microelectronics Discovery F7 ST Microelectronics Discovery F769 ST Microelectronics Discovery Kit H7 ST Microelectronics Discovery L476 ST Microelectronics Discovery L496G ST Microelectronics Nucleo F091RC ST Microelectronics Nucleo F401RE ST Microelectronics Nucleo F411RE ST Microelectronics Nucleo F412ZG ST Microelectronics Nucleo F413ZH ST Microelectronics Nucleo F429ZI ST Microelectronics Nucleo F439ZI ST Microelectronics Nucleo F446RE ST Microelectronics Nucleo F722ZE ST Microelectronics Nucleo F746ZG ST Microelectronics Nucleo F756ZG ST Microelectronics Nucleo F767ZI ST Microelectronics Nucleo G0B1RE ST Microelectronics Nucleo G474RE ST Microelectronics Nucleo H563ZI ST Microelectronics Nucleo H723ZG ST Microelectronics Nucleo H743ZI ST Microelectronics Nucleo H743ZI2 ST Microelectronics Nucleo L073RZ ST Microelectronics Nucleo L152RE ST Microelectronics Nucleo L432KC ST Microelectronics Nucleo L452RE ST Microelectronics Nucleo L476RG ST Microelectronics Nucleo L4A6ZG ST Microelectronics Nucleo WB55 ST Microelectronics Nucleo WL55 ST Microelectronics STM32F439 ST Microelectronics USBDONGLE_WB55 ST Microelectronics Arch Mix Seeed Studio SEEED XIAO nRF52840 Sense Seeed Studio Seeeduino XIAO (SAMD21) Seeed Studio Wio Terminal D51R Seeed Studio SIL WESP32 Silicognition RP2040-Shim Silicognition LLC Micromod STM32 Sparkfun Pro Micro RP2040 Sparkfun Sparkfun SAMD51 Thing Plus Sparkfun Thing Plus RP2040 Sparkfun Feather S2 Unexpected Maker Feather S2 Neo Unexpected Maker FeatherS3 Unexpected Maker NanoS3 Unexpected Maker ProS3 Unexpected Maker Tiny S2 Unexpected Maker TinyPICO Unexpected Maker TinyS3 Unexpected Maker TinyWATCH S3 Unexpected Maker F407VE VCC-GND Studio F407ZG VCC-GND Studio H743VI VCC-GND Studio VK-RA6M5 Vekatech WeAct Studio RP2040 WeAct C3 mini Wemos S2 mini Wemos S2 pico Wemos wt51822_s4at Wireless-Tag Wiznet W5100S-EVB-Pico Wiznet Wiznet W5500-EVB-Pico Wiznet Bit-C PRO nullbits evk_nina_b1 u-blox evk_nina_b3 u-blox Each link leads to the official page or a primary resource for the respective microcontroller, providing detailed specifications and purchase options. What’s the difference between MicroPython and CircuitPython? CircuitPython and MicroPython are both Python implementations for microcontrollers, but they have distinct focuses and features. MicroPython, the precursor to CircuitPython, is a lean and efficient version of Python 3 designed for microcontrollers, emphasizing broad compatibility with a range of hardware and performance in constrained environments. CircuitPython (https://circuitpython.org), developed by Adafruit, is a fork of MicroPython that prioritizes ease of use and simplicity, particularly for beginners and in educational settings. It focuses on Adafruit’s hardware but supports various other microcontrollers too. One key difference is that CircuitPython emphasizes strong support for USB devices and comes with a built-in USB HID (Human Interface Device) and MIDI support. Additionally, CircuitPython tends to have more frequent releases and updates, with a strong emphasis on community involvement and extensive documentation, making it particularly friendly for newcomers to programming and electronics. Is MicroPython the same as Python? MicroPython and Python are closely related but not identical. MicroPython is a streamlined implementation of Python 3, designed specifically for microcontrollers and embedded systems. It aims to maintain as much compatibility with standard Python as possible, meaning most Python code can run on MicroPython with minimal modifications. However, due to memory and processing constraints on microcontrollers, MicroPython omits some of Python’s features and libraries, focusing instead on core functionalities essential for embedded applications. Additionally, MicroPython includes specialized libraries and modules to interact with hardware, which are not found in standard Python. Therefore, while MicroPython shares Python’s syntax and many of its capabilities, it is tailored to the unique requirements of low-resource environments. How long does it take to learn MicroPython? The time it takes to learn MicroPython largely depends on your prior experience with programming and familiarity with Python. If you’re already versed in Python, you could get comfortable with MicroPython in a matter of days, as it retains much of the syntax and structure of Python. For those new to programming or coming from different programming languages, it might take a few weeks to grasp the basics. The learning curve is relatively gentle due to Python’s clear syntax and MicroPython’s extensive documentation and supportive community. Additionally, hands-on experimentation with microcontrollers can significantly accelerate the learning process, making it possible to create simple projects within a few hours of initial learning. The history of MicroPython MicroPython, a lean and efficient implementation of Python 3, was created by Damien George in 2013 to bring Python’s ease of use to microcontrollers and small embedded systems. It was initially funded through a successful Kickstarter campaign, reflecting the growing interest in combining Python’s simplicity with the world of embedded hardware. MicroPython’s design focuses on minimal resource usage while maintaining Python’s hallmark readability and functionality. Over time, it has gained popularity in the maker community and is now used in various applications, from educational tools to industrial equipment. This success is due in part to its wide support for different hardware platforms and its active, open-source community, which continually enhances its capabilities and reach. Where can I get MicroPython? MicroPython is available from the offiial website: https://micropython.org/ It is available for a wide range of microcontrollers, including the Raspberry Pi Pico, ESP32, the BBC Micro:bit, and the Adafruit Circuit Playground Express. Where can I learn MicroPython? We have a free course on MicroPython, which you can access here: Learn Micropython - the basics