MicroPython Programming Tutorial: Getting Started with the ESP32 Thing

Contributors: Shawn Hymel
Favorited Favorite 8


In this guide, we will walk through the process of setting up MicroPython on the ESP32 Thing and writing some example programs. Each "experiment" will show you how to wire up an example circuit and then control it using MicroPython.

Running MicroPython on the ESP32 Thing

What is MicroPython?

MicroPython is a lean implementation of the Python 3 programming language that has been pared down to run efficiently on microcontrollers. Python is a relatively simple (but powerful) language that is easy for beginners to pick up and has been gaining popularity in schools as an introductory language. MicroPython has nearly all of the features of Python, which means that interacting with hardware is now easily accessible to beginners and seasoned Python programmers alike.

Why the ESP32 Thing?

MicroPython is supported on many different microcontroller platforms, and more are being added all the time. The ESP32 is a great tool for learning MicroPython, as it has a powerful controller (240 MHz) with lots of RAM (520 kB). Additionally, the ESP32 has a built-in WiFi module, which makes networking and connecting to the Internet quite easy. All this is packaged up into a development board for you on SparkFun's ESP32 Thing.

Note: This guide uses MicroPython version: esp32-20180822-v1.9.4-479.

Required Materials

To work through the activities in this tutorial, you will need a few pieces of hardware:

Suggested Reading

If you aren't familiar with the following concepts, we recommend checking out these tutorials before continuing:

What is a Circuit?

Every electrical project starts with a circuit. Don't know what a circuit is? We're here to help.

Voltage, Current, Resistance, and Ohm's Law

Learn about Ohm's Law, one of the most fundamental equations in all electrical engineering.

How to Use a Breadboard

Welcome to the wonderful world of breadboards. Here we will learn what a breadboard is and how to use one to build your very first circuit.

ESP32 Thing Hookup Guide

An introduction to the ESP32 Thing's hardware features, and a primer on using the WiFi system-on-chip in Arduino.
Please note: If you have trouble seeing any of the images throughout this tutorial, feel free to click on it to get a better look!
Python Logo