Source: https://mokxi.com/micropython-simulator

Simulator

# Free online MicroPython simulator for the Raspberry Pi Pico

Mokxi is a free MicroPython simulator that runs in your browser, with nothing to install and no account needed. The Pico runs the official MicroPython v1.29.0 firmware, byte for byte as micropython.org publishes it, on our own model of the RP2040. Your main.py is copied onto the board the way Thonny copies it, and machine.Pin, PWM, ADC, I2C and SPI drive the circuit. Nothing in the page interprets your Python.

Written by the Mokxi team

Start building free or see the full Pico board page

- 455 parts on the bench
- 43 boards running now
- 1.00x real time, on every board

Click to open it in the editor

The official MicroPython firmware, running main.py right now on our own RP2040. Click it to open the circuit in the editor.

What is modeled

## The numbers, not the marketing

Taken from the board's own contract document and put in plain words.

The firmware | The official UF2 for the Raspberry Pi Pico, MicroPython v1.29.0, pinned by its SHA-256 and booted through the RP2040’s boot ROM on our own Cortex-M0+ core at 125 MHz.

machine | Pin with interrupts, PWM on every GPIO pin, ADC on GP26 to GP28, I2C and SoftI2C, SPI and SoftSPI, with I2C and SPI on the RP2040’s own blocks and DMA.

Libraries | micropython-lib’s ssd1306.py draws on an SSD1306 OLED, and a BME280 driver reads the sensor, each as a tab of the project, as you would copy it onto a real Pico.

What is not there | Threads on the second core and machine.I2CTarget. A program that reaches for them stops rather than reading something made up. PIO runs, and on a Pico W the CYW43439 is modeled, so network.WLAN joins the simulated network.

Compared

## Other MicroPython simulators, honestly

If MicroPython is what you need, know where each simulator stops.

Wokwi Wokwi runs MicroPython on the Pico and the ESP32 too, and simulates the Pico’s PIO. Mokxi runs it on the Pico and the classic ESP32, and adds analog circuits, instruments and a class workflow.

Every simulator compared, side by side

Go further

## The full board page

Every peripheral area, every example and the wiring notes, in one place.

Raspberry Pi Pico simulator The RP2040 in detail, every Pico example and the wiring notes.

Examples

## Examples that already run

Each one is wired and coded. Open it, press Run, then change the code.

MicroPython knob dimmer ADC on GP26 sets the PWM duty of an LED on GP15. BME280 weather on an OLED machine.I2C, ssd1306.py and a BME280 on two buses. DHT11 temperature and humidity MicroPython’s own dht module reads a DHT11 on GP15. HC-SR04 distance sensor machine.time_pulse_us() times the echo, divided to 3.3 V.

Guides

## Step-by-step guides for the Pico

Each one has the parts, the wiring and the code, and ends in a circuit you can run.

- MicroPython on the Pico: blink, a knob, a button and the REPL
- MicroPython on the ESP32: blink, a button, PWM, a DHT22, an OLED and WiFi
- The Raspberry Pi Pico pinout: PWM slices, ADC and power

## Questions

Is this the real MicroPython?

Yes. It is the official firmware for the Raspberry Pi Pico, v1.29.0, the same file you would drag onto a real one, running instruction by instruction on a simulated RP2040. Nothing in the page interprets Python.

Which boards run MicroPython here?

The Raspberry Pi Pico and the Pico W (whose CYW43439 is modeled, so network.WLAN joins the simulated network), the ESP32-S3, ESP32-C3 and ESP32-C6 boards, and the classic ESP32 boards (the DevKit V1, the DevKitC and the LOLIN32 Lite), each on its official MicroPython v1.29.0 firmware.

How do I start?

Open one of the examples below, or put a Pico on the canvas and choose MicroPython (main.py) in its Firmware panel. Press Run: main.py is copied onto the board and runs, and print() shows in the Serial Monitor.

Is there a REPL?

Yes. When main.py ends, or after Ctrl-C, the Serial Monitor is the board’s REPL: type 6*7 and it says 42.

Can I use an OLED or other I2C parts?

Yes. machine.I2C drives the RP2040’s own I2C block, I2C.scan() finds the parts on the bus, and micropython-lib’s ssd1306.py draws on an SSD1306. A missing address raises OSError: [Errno 5] EIO, as on a desk.

Does it simulate PIO or the second core?

Not yet. rp2.PIO and rp2.StateMachine fault, and starting a thread on core 1 stops the board with a sentence saying it is not simulated.

Can I change the clock speed?

machine.freq(200_000_000) is accepted and reported, but the core keeps running at 125 MHz, so code does not get faster.

Is it free?

Yes, with no card and no account needed. The first Run downloads the firmware, 229 KB, and the browser keeps it for every later Run.

## Simulators for one kind of circuit

A servo, a display, a motor driver or a rectifier, each already running.

Online circuit simulator Breadboard simulator ESP32 simulator Op-amp simulator Logic gate simulator LED circuit simulator Servo simulator LCD simulator OLED simulator NeoPixel simulator 7 segment display simulator LED matrix simulator Stepper motor simulator Motor driver simulator Ultrasonic sensor simulator Rectifier simulator Digital circuit simulator Potentiometer simulator PWM simulator Relay simulator Shift register simulator DHT11 simulator RFID simulator Accelerometer simulator RGB LED simulator Buzzer simulator MOSFET simulator Circuit simulator for kids Flip-flop simulator Multiplexer simulator Full adder simulator I2C simulator UART simulator Thermistor simulator PIR sensor simulator Oscilloscope simulator Multimeter simulator DC motor simulator Traffic light simulator Diode simulator Capacitor simulator Series and parallel circuit simulator Wheatstone bridge simulator Voltage regulator simulator Soil moisture sensor simulator Zener diode simulator Solar panel simulator AC circuit simulator Thevenin simulator Decoder simulator Encoder simulator PID simulator Robot arm simulator Load cell simulator IR sensor simulator LM35 simulator HC-05 Bluetooth simulator nRF24L01 simulator

## Try your own main.py on the Pico

Choose MicroPython (main.py) in the Pico’s Firmware panel and press Run. Nothing to install and no account needed.

Start building free Open the editor
