MicroPython on the ESP32, right in the browser

Loading the simulator…

Esc or click to skip

Skip to content
Free IDE
F9 breakpoint · Ctrl+Enter run · Esc, Tab leaves the editor
Stopped ·

Learn MicroPython on the ESP32 without needing the board

PyPlaca is a free IDE that runs in the browser. You write the Python program on the left, build the circuit on the breadboard on the right and watch the ESP32 DevKit V1 react: the LED lights up, the servo turns, the sensor reads. You don't have to install anything or create an account. When you want, the same main.py goes to the real board.

See the 11 tracks Read the 52 articles

A complete first program

This is the program the IDE opens the first time. It blinks the blue LED that comes soldered onto the DevKit V1, connected to GPIO2, three times, and writes the count of each blink to the Serial.

Pin(2, Pin.OUT) turns the pin into an output; led.on() and led.off() change its level; time.sleep_ms(500) waits half a second. The simulator counts this time on the simulated board's clock, so the LED blinks at the right pace even if the computer is slow.

The Serial shows:

piscada 1
piscada 2
piscada 3
from machine import Pin
import time

led = Pin(2, Pin.OUT)

for i in range(3):
    led.on()
    print('blink', i + 1)
    time.sleep_ms(500)
    led.off()
    time.sleep_ms(500)

What you can do in the browser

Write and run MicroPython
The interpreter follows the ESP32's MicroPython v1.29.0: the same functions, the same error messages and the REPL (>>>) when the program ends.
Build the circuit
An 830-point breadboard and 21 parts to drag and connect with wires. The workbench warns you when the LED's resistor is missing or when a pin gets more voltage than it can take.
Watch the board react
The 3D workbench or the top view show LEDs, displays and motors changing while the program runs. You press the breadboard button with the mouse, and the sensor changes its value on a slider.
Walk through line by line
Breakpoints, step by step, stepping into and out of functions and even stepping back. The Variables tab shows the value of each variable at every line, like a desk check.
Internet of Things
Simulated Wi-Fi, HTTP requests and MQTT: the board joins the lab's network, queries a server and publishes to a broker, without depending on the school's network.
Take it to the real board
Export the project as a .zip with the bill of materials, or flash straight to the ESP32 over the USB cable (Chrome and Edge), including installing MicroPython on a new board.

The tracks

There are 11 tracks, with 48 lessons and 111 challenges with automatic grading. The logic-with-Python track and the first-steps-on-the-ESP32 track start open; the others open when the previous one ends. Each challenge is graded by running your code with inputs you can see and with hidden tests, like in an exam.

  1. Logic with Python 60 challenges
    Variables, input/print, decisions, loops, functions, lists and matrices: the 60 logic challenges from logicabr, now in Python.
  2. First steps with the ESP32 4 lessons and 4 challenges
    The blue LED on the board (GPIO2), time in MicroPython, external LEDs with a resistor, and your first traffic light.
  3. Digital inputs 4 lessons and 4 challenges
    Buttons, pull-up and pull-down, the floating pin, interrupts (Pin.irq) and debounce.
  4. PWM: brightness, color, sound and motion 5 lessons and 6 challenges
    Pulse-width modulation on the ESP32: the LED at half brightness, fading, colors on the RGB LED, notes on the passive buzzer and the SG90 servo.
  5. Analog: ADC, potentiometer and LDR 6 lessons and 6 challenges
    The ESP32 analog-to-digital converter: reading voltages, the potentiometer and the voltage divider, attenuation, mapping ranges, the LDR and the moving average.
  6. Sensors: temperature, distance and presence 4 lessons and 5 challenges
    The DHT22 (temperature and humidity), the HC-SR04 (ultrasonic distance) with the voltage divider on ECHO, and the PIR (presence).
  7. Displays: OLED, LCD and NeoPixel 5 lessons and 5 challenges
    The I2C bus and scan(), the SSD1306 OLED with ssd1306.py, the 16×2 LCD with the I2C module and the NeoPixel LED ring.
  8. Time without freezing 5 lessons and 5 challenges
    Why sleep() freezes the program, the ticks_ms/ticks_diff clock, several tasks at the same time, machine.Timer and the state machine.
  9. Wi-Fi and HTTP 5 lessons and 5 challenges
    The board joins the network with network.WLAN (DHCP, IP, status and scan), talks to servers over HTTP with requests, understands JSON, sends readings with POST and does not wait forever for a slow server.
  10. MQTT: publish and subscribe 5 lessons and 6 challenges
    The MQTT broker and the publish/subscribe model (and why it differs from the request and response of HTTP), topics, wildcards, retained messages and QoS, receiving commands without freezing with check_msg(), the DHT22 and the relay through the topic panel, Keep Alive, last will and reconnection.
  11. Final project: IoT weather station 5 lessons and 5 challenges
    A weather station built in steps: the DHT22 and the OLED in a loop that does not freeze, the configuration fetched over HTTP with a default for when the network fails, the readings published on MQTT with an online/offline state, the breadboard assembly and, at the end, the complete station that changes its interval through the broker.

Articles to get started

Long texts, with examples that open straight in the simulator, about the ESP32 and about Python from scratch. A few of the first ones:

See all 52 articles

Workbench parts

Each part has a datasheet card with its pinout, a ready example and the specifications with the source of every number: ESP32 DevKit V1 (DOIT, 30 pins), ESP32-C3 Super Mini (16 pins), 830-point breadboard, 5 mm LED, Resistor, 6 mm tactile button, 10 kΩ potentiometer, LDR (GL5528), Active buzzer, Passive buzzer, RGB LED (common cathode), SG90 servo, DHT22 (AM2302), DHT11, DS18B20 temperature sensor, HC-SR04 ultrasonic sensor, HC-SR501 PIR motion sensor, 1-channel 5 V relay module, SSD1306 OLED display 128×64 (I2C), 16×2 LCD with I2C module (PCF8574), WS2812B NeoPixel ring. The DevKit V1 pinout tells you what each pin does and which ones to avoid.

For teachers

The lab doesn't always have a board per student. With the teacher profile you create the class, share the invite code, choose the activities with deadlines and follow on a panel who has already done them, how many attempts they used and each one's grade. The official grading runs on the server, with the same simulated board, and the result doesn't depend on the student's computer.

Who makes it

PyPlaca is created and maintained by Prof. Rodrigo dos Santos Faustino, a programming teacher, under the FAUSTINOPSY brand. The platform was born in the classroom: students need to make mistakes, measure and try again without fear of burning a component. Learn more about PyPlaca or get in touch through the contact page.