MicroPython 
with the
esp32

With this video course, you will learn how to use the
MicroPython programming language with the ESP32 microcontroller.

MicroPython is a high-level programming language specifically designed for microcontrollers and resource-limited embedded devices. Think of MicroPython as "Python for Microcontrollers".

Course last updated in June and July 2022

We last updated this course in June 2022 to ensure that it is compatible with Thonny 4 and MicroPython 1.18. We have introduced new lectures to show you how to install and use Thonny 4, and how to upgrade your ESP32 devkit and Raspberry Pi Pico boards to use the MicroPython 1.18 firmware. We have also tested all experiments to ensure that they work with these versions of Thonny and MicroPython.

If you are using an ESP32 board that is unable to automatically enter upload mode, you will find a solution in a new lecture in Section 3.

What MicroPython has "taken" from Python is the language architecture, the programming philosophy for code readability, and millions of programmers that already know how to use Python.

MicroPython is as easy as Python to learn, and follows Python’s tradition for excellent development tools and documentation.

Who is this course for?

This course is for anyone looking for the easiest (yet still powerful) way to program a micro-controller.

Familiarity with Python is not necessary - with this course you will learn everything you need.

If you already know Python, then this course will help you get started with MicroPython and use it to program the ESP32.

Ideally, you have a basic understanding of electronics, and are familiar with the Arduino platform*.

* If you are not familiar with the Arduino platform and have a basic understanding of electronics, I recommend you consider Basic Electronics for Arduino Makers and Arduino Step by Step Getting Started first.

Once you learn the basics of MicroPython, you can use your skills across multiple hardware targets. 

At the time of publication of this course, MicroPython has support for the original Myboard v1 and D-series, as well as third-party boards such as the STM32  Nucleo and Discovery boards, the Espruino Pico, the Raspberry Pi Pico, the WiPy, the ESP8266 and ESP32, the TinyPico, and the BBC Micro:Bit.

And the list is growing.

What are the objectives of the course?


1. To introduce you to the MicroPython programming language.

2. To help you learn how to use MicroPython with common external devices.

3. To consolidate this knowledge with the help of two cap-stone projects.

MicroPython is borrows the syntax and and language attributes of Python 3.

Python 3 is a powerful high-level general-purpose language that is designed to be easy to learn and use. It is extremely popular, and among the top-5 most widely used programming languages.

As a result, has an extensive set of learning resources, excellent documentation, and code libraries that cover an amazing breadth of applications. 

MicroPython was modelled after Python to reduce the barrier to entry for people that want to write programs for microcontrollers or embedded devices that have limited resources.

What are the knowledge prerequisites?

1. You have basic understanding of electronics.

2. You have a basic understanding of microcontrollers.

3. You are familiar with related concepts, such as IoT.

4. You are comfortable with at least one programming language and programming tool.

5. You have a growth mindset.

* If you are not familiar with the Arduino platform and have a basic understanding of electronics, I recommend you consider Basic Electronics for Arduino Makers and Arduino Step by Step Getting Started first.

Hardware & Software

To complete this course, you will need an ESP32 board, and a few common components. See the red box below for details.

You will also need the Thonny programming editor, which is open-source and free to download and use.

This course does not include any hardware! Please source your own hardware from your preferred retailer. You can find a detailed list of hardware in the course hardware page.

What is this course about?

Please watch this video to learn about the learning outcomes of this course, and how it is structured, so that you know what to expect.

More information about this course

What is MicroPython?

Required software

Required hardware

Sample lectures

07.20 Blink an LED with timer

07.70 Read a potentiometer

08.40 ADXL335 accelerometer

5/5 stars!

youngw

Created on: July 2, 2022

Very good so far. I learned more about Thonny and like the functionality. I did load MicroPython using the ESPTOOL instead of Thonny for more learning on the ESP32.

I am still working on this course

Here's what you're getting:

  • MicroPython with the ESP32 video course.
  • Over 105 video lectures in 16 sections.
  • Tested with Thonny 4 and MicroPython 1.18.
  • Downloadable code all experiments.
  • Complete wiring instructions and links to relevant resources.
  • Dedicated community discussion space. (With Community Tier purchase)

Which option is best for you?

You can enroll to our courses in one of three options: Solo, Community, and Mentor. For more information, please see this explainer page.

Solo

Once-off payment, best for self-sufficient learners on a budget.

Price in your currency:
...
Once-off.
  • Access all course content.
  • Permanent access.
  • Study at your own pace.
  • Single payment.
  • Access to community discussion space.
  • Access to lecture comments.
  • One-on-one sessions with mentor.
Price in your currency:
...
Once-off.

Mentor

Get one-on-one live meetings with a mentor, learn to mastery.

US$299

  • Everything from Community Tier PLUS
  • Includes 2 hours of video one-on-one consultation sessions with an instructor.
  • One month of priority support via instant messaging.
  • Pay as you go: purchase more time with an instructor at any time.

US$299

This button will take you to Stripe, our payments processor.

New: Subscription

Did you know, you can get a subscription for immediate access to this and 20+ of our courses. All for a low monthly payment, cancel anytime.

What's in this course?

Introduction
01.10 What is this course about?
01.20 What is uPython and why should you care?
01.30 Software you will need
01.40 Hardware you will need
01.50 How to get the most out of this course
01.60 Get the demo scripts for the course


The basics

Getting started with uPython
02.10 uPython vs Python
02.20 uPython resources
02.30 uPython microcontrollers

Working with Thonny IDE
03.10 Getting started with Thonny IDE for Python

03.11 Upgrade to Thonny 4
03.20 How to install the MicroPython firmware to your ESP32

03.21 Upgrade ESP32 to MicroPython 1.18
03.22 How to solve a failure to upload the firmware on an ESP32
03.30 Setting an interpreter
03.40 How to write and execute a MicroPython program
03.50 Other views in Thonny IDE
03.60 Thonny IDE with Raspberry Pi Pico

03.61 Upgrade RPi Pico to MicroPython 1.18
03.70 Using Thonny IDE with BBC Micro:bit
03.80 Thonny IDE Advanced configuration
03.90 Find Python Packages at PyPi

MicroPython on the ESP32
04.10 The MicroPython shell
04.20 Uploading and downloading files with Thonny
04.40 MicroPython Programming with files
04.50 How to interrupt a running program
04.60 How to run a program at boot
04.70 How to debug MicroPython program

A Python (and MicroPython) quick start
05.10 Introduction to this section
05.20 Keywords
05.30 Comments
05.40 Variables and types
05.50 Operators
05.60 Strings and formatting
05.70 Lists, tuples, ranges
05.80 Dictionaries
05.90 Loops
05.100 Control with if ..elif.. else
05.110 Functions
05.120 Objects and classes
05.130 MicroPython coding considerations

Libraries
06.10 About MicroPython modules
06.20 Build-in modules
06.30 Community modules
06.40 How to install an external module


Hands-on experiments

Simple pin operations
07.10 Blink an LED with loop
07.20 Blink an LED with timer
07.30 Fade an LED with PWM
07.40 Read a button with loop
07.50 Read a button with hardware interrupt
07.60 Read a button with timer interrupt
07.70 Read a potentiometer

Sensors
08.10 DHT22 environment sensor
08.20 BME280 environment sensor
08.30 ESP32 internal touch sensor (capacitance sensor)
08.40 ADXL335 analog accelerometer
08.50 HC-SR04 ultrasonic distance sensor

Displays
09.10 2x16 LCD display with PCF8574 - Part 1: hardware I2C
09.12 2x16 LCD display with PCF8574 - Part 2: software I2C
09.20 0.96" OLED SSD1306 I2C
09.30 1.3" OLED SH1106 I2C
09.40 0.96" OLED SSD1315 I2C
09.50 Neopixels
09.60 MAX7219 8x8 Matrix display - Part 1: random pixels
09.62 MAX7219 8x8 Matrix display - Part 2: text

Motors
10.10 Mini servo motor
10.20 DC motor with DRV8871

Wi-Fi
11.10 How to use Wi-Fi: an introduction
11.20 Read text from a file with HTTP GET
11.30 Make a POST request to Dweet
11.40 Make a POST request to IFTTT
11.50 Get current weather from OpenWeatherMap

Other capabilities
12.10 Hardware Timers
12.20 CPU clock frequency control
12.30 Hall effect sensor
12.40 Raw temperature sensor
12.50 Deep-Sleep and light-sleep - Part 1
12.52 Deep-Sleep and light-sleep - Part 2: experiments
12.60 Reset
12.70 RTC with manual setting
12.72 RTC with ntptime
12.80 Write-append sensor data to a CSV file
12.82 Read sensor data from a CSV file


Capstone projects

Sensor + LCD with the ESP32
13.10 What is this project about?
13.20 Wiring
13.30 Script

An example modular script
14.10 What is this mini-project about?
14.20 Wiring
14.30 Script v1: single file
14.40 Script v2: modular


Bonus content

Raspberry Pi Pico Sensor + LCD
15.10 What is this mini project about?
15.20 Quick introduction to the Raspberry Pi Pico
15.30 Install the MicroPython firmware
15.40 Wiring
15.50 Script

MicroPython on the Micro:Bit
16.10 What is this section about?
16.20 Quick introduction to the Micro:bit
16.30 Setup Microbit for Thonny and MicroPython
16.40 Blink internal LED
16.50 Blink external LED
16.60 LED matrix array
16.70 Neopixels
16.80 Buttons
16.90 Accelerometer and gestures
16.100 Magnetometer and compass
16.110 OLED SSD1306

The course instructor

The course instructor is Peter Dalmaris, PhD.

Peter has created over 20 other courses on technology education.

He is the author of Maker Education Revolution, a book on how making is changing the way we learn and teach.

He is also the host of Stemiverse, a podcast in which he discusses education and STEM with the shakers and movers of technology and science education from around the world.

Copyright 2022, Tech Explorations - Privacy