Skip to content
Studio

What the Astra Studio simulator does and does not do

Astra Studio runs your compiled sketch on an emulated microcontroller and connects it to simulated parts. It is built for learning and for automatic grading of digital behaviour, not for analysing circuits. This page lists the limits so a result that looks wrong can be checked against what the simulator is meant to do.

How the circuit is modelled

  • Every wire joins pins into one net. A net has one logic level (high, low or floating), decided by a fixed order: ground wins over supply, supply over a driving pin, a driving pin over a pull-up. There are no currents, no voltage drops and no loading.
  • Resistors act as wires. A resistor passes its level through unchanged and its value is only shown, never used. A 10 k pull-up to 5 V still reads high while the switch is open and loses to a closed switch to GND, but an LED with no series resistor does not burn out, and a resistor divider does not divide.
  • There is no analog circuit simulation. A voltage exists only where a part or a rail says so (0 V, 3.3 V, 5 V, or the analog output of a sensor part). Capacitors, inductors, transistors as amplifiers, op-amps and RC timing are not simulated.
  • Parts that need a bus pull-up supply it themselves, see the next section.

Pull-ups, 1-Wire and TM1637

  • The net model has no resistor that gives way to a pin, so a resistor to a rail would hold the net at that level for good. Parts that sit on a bus with an external pull-up therefore drive the idle level themselves.
  • 1-Wire (DS18B20): wire DQ straight to the microcontroller pin and leave out the 4.7 k pull-up to 5 V. The part drives DQ high while the bus is idle. With a pull-up resistor to a rail added, the net stays high and the sensor can never pull it low.
  • TM1637 display: the real module has pull-ups on CLK and DIO. The part drives both lines high while idle (a low from the microcontroller wins) and pulls DIO low only for the acknowledge bit. Do not add pull-ups.
  • Switches and buttons use the board's internal pull-up (INPUT_PULLUP) or an external resistor to a rail. Both work.
  • I2C devices are modelled at the protocol level: there is no electrical timing, so a missing SDA or SCL pull-up does not break the bus as it would on hardware.

Voltages and the ADC

  • Arduino (AVR) boards: analogRead is scaled to the board's ADC reference. With the default reference that is 5 V, so a sensor powered from 3V3 on an Uno reads at most 1023 × 3.3 / 5 = 675.
  • Raspberry Pi Pico, Pico W and Pico 2: the ADC reference is 3.3 V and the converter is 12 bits. arduino-pico's analogRead returns 10 bits unless the sketch calls analogReadResolution(12). A pin held at a 5 V rail clips at full scale; it is not flagged as a hazard.
  • STM32 Nucleo and Blue Pill: the ADC reference is VDDA = 3.3 V, 12 bits. The internal temperature sensor and VREFINT channels read 0 on the Nucleo boards.
  • Driving a 3.3 V board pin from a 5 V part does not damage anything in the simulator. Check voltage levels on paper before building the circuit.

Supported libraries per board family

The compile service has only the libraries below installed. A sketch that includes anything else fails to compile with a "library not installed" error. This list is generated from the compile images, so it is always the one in use.

Board familyBoardsLibraries
AVRArduino Uno, Nano, Mega 2560, ATtiny85 (Franzininho)Servo, LiquidCrystal, LiquidCrystal I2C, Adafruit NeoPixel, Adafruit GFX Library, Adafruit SSD1306, Adafruit FT6206 Library, Adafruit ILI9341, DHT sensor library, RTClib, MPU6050, Keypad, HX711, IRremote, AccelStepper, SD, OneWire, DallasTemperature, TM1637, LedControl, MD_MAX72XX, Adafruit BMP085 Library, FastLED, Bounce2, ArduinoJson, MFRC522, Adafruit PCD8544 Nokia 5110 LCD library, GxEPD2, Adafruit BusIO, Adafruit Unified Sensor, Adafruit SH110X, Adafruit STMPE610, Adafruit TouchScreen, Adafruit TSC2007, TinyDebug, TinyWireM
Raspberry Pi Pico familyRaspberry Pi Pico, Pico W, Pico 2 (arduino-pico core)Servo, LiquidCrystal I2C, Adafruit NeoPixel, Adafruit GFX Library, Adafruit SSD1306, Adafruit ILI9341, DHT sensor library, Adafruit BusIO, Adafruit Unified Sensor
STM32Nucleo-C031C6, Nucleo-L031K6, Blue Pill (STM32duino core)Servo, LiquidCrystal I2C, Adafruit GFX Library, Adafruit SSD1306, Adafruit BusIO, STM32duino FreeRTOS
ESP32ESP32 DevKitC V4, S3, C3, C6, H2, P4, XIAO ESP32-C3/S3/C6 (arduino-esp32 core)ESP32Servo, PubSubClient, ArduinoJson, NTPClient, LiquidCrystal I2C, Adafruit NeoPixel, Adafruit GFX Library, Adafruit SSD1306, Adafruit ILI9341, Adafruit BusIO, Adafruit Unified Sensor, DHT sensor library, OneWire, DallasTemperature, FastLED

Wire, SPI, EEPROM, SoftwareSerial and the other libraries that ship with a board core are available on the boards whose core includes them. The Pico W adds the core's WiFi library.

Known limits of individual parts

Taken from the "Limits" paragraph in each part's source header. 68 parts document a limit; a part that is not listed has none recorded.

PartLimits
2:1 Multiplexer (mux-2)No supply pins modelled; one CPU instruction of delay per hop.
2.9" e-Paper Display (128x296) (epaper-2in9)No waveform / ghosting model, no red plane (tri-colour modules), no scan-direction flips from 01 / 11 beyond the address counters, no temperature compensation, no analogue behaviour beyond the poweredOn flag.
74HC165 Shift Register (74hc165)No setup/hold timing. Unwired PL reads LOW, so the register stays in load mode: wire PL to a GPIO.
74HC595 Shift Register (74hc595)The hardware SPI peripheral is not used as a data source (only the pin levels count, so wire DS/SHCP to any GPIO and use shiftOut); OE/MR left unwired read LOW, so outputs are enabled and the register is held in reset: wire MR to 5V as on a real board.
A4988 Stepper Driver (a4988)No current limit (VREF), thermal or short-to-ground model; VMOT and VDD are not checked; STEP pulse width and the 200 ns setup times are not enforced.
Analog Joystick (analog-joystick)SEL is driven LOW while pressed and released otherwise, so the sketch must use INPUT_PULLUP (as with the real module). The output voltage does not follow VCC.
AND Gate (gate-and-2)No supply pins are modelled; no propagation delay beyond one CPU instruction per hop (see protocols/logic.ts). Unwired inputs read LOW.
Biaxial Stepper Motor (biaxial-stepper)As stepper-motor.
Bipolar Stepper Motor (stepper-motor)No torque, speed or missed-step model; coil timing is not checked.
BMP180 Pressure Sensor (bmp180)No noise or temperature compensation of the pressure beyond the datasheet algorithm; the sensor answers only at 0x77; VCC / 3.3V are not checked.
Breadboard (breadboard)No contact resistance or capacitance; rails are continuous along the whole board.
Buzzer (buzzer)Needs two rising edges before a frequency is known; the first period of a tone is silent. Pitch changes are tracked per period. No volume.
Clock Generator (clock-generator)Duty cycle is fixed at 50 %. Above 100 kHz the simulation slows down, as in Wokwi (two scheduler events per period). The generator runs from power-on and ignores MCU resets, like an external oscillator.
D Flip-Flop (flip-flop-d)No supply pins; no setup/hold timing (inputs are read at the clock edge); power-up Q is LOW. Pin names are our best match to Wokwi's closed-source part.
D Flip-Flop with Reset (flip-flop-dr)No supply pins; no setup/hold timing (inputs are read at the clock edge); power-up Q is LOW. Pin names are our best match to Wokwi's closed-source part.
D Flip-Flop with Set/Reset (flip-flop-dsr)No supply pins; no setup/hold timing (inputs are read at the clock edge); power-up Q is LOW. Pin names are our best match to Wokwi's closed-source part.
DHT22 (dht22)No power-up delay, bus errors not modelled (a start signal during a response is ignored), no 1-wire jitter.
DIP Switch 8 (dip-switch-8)Contact bounce is not modelled.
DS1307 RTC (ds1307)The day-of-week register is derived from the date (the real chip just counts 1..7 from whatever the firmware wrote); writing an impossible date (month 13, Feb 31) is normalised by clamping; the oscillator halts at the second the CH bit was set.
DS18B20 Temperature Sensor (ds18b20)No parasite power, no overdrive speed, no Convert-T-with-pending-reset timing details, bus timing outside the windows in protocols/onewire.ts is not tolerated.
Flame Sensor (flame-sensor)No ambient IR/sunlight offset, no distance model, no hysteresis.
Grove OLED 128x128 (SH1107) (grove-oled-sh1107)Display offset and start line are stored but not applied to the picture (as ssd1306), no scrolling, no electrical brightness model, no SPI.
Half Breadboard (breadboard-half)No contact resistance or capacitance; rails are continuous along the whole board.
HC-SR04 Ultrasonic Sensor (hc-sr04)No temperature-dependent speed of sound, no noise, no minimum gap between measurements besides "not while one is running".
Heart Beat Sensor (heart-beat-sensor)No analog PPG waveform, no HRV/jitter, no amplitude changes.
HX711 Load Cell Amplifier (hx711)The chip is ready at t = 0 (no power-on settling). The returned raw value does not change with gain. A read that is abandoned part-way (fewer than 24 pulses) is not detected, as Arduino libraries read atomically.
ILI9341 TFT Display (ili9341)No partial/scroll/idle modes, gamma, frame-rate or interface-mode commands (ignored); no touch panel; RAMRD in 18-bit only; timing is not modelled (no 5/120 ms reset delays).
ili9341-cap-touch (ili9341-cap-touch)Single touch only, no gestures, no proximity / palm detection, the thresholds do not change anything, no touch noise or multi-touch.
IR Receiver (ir-receiver)No carrier, no ambient-light noise, no AGC; reception is instantaneous in range.
IR Remote (ir-remote)The remote does not pace itself, so a repeat sent while a previous frame is still on the wire is queued by the receiver. No carrier modelled.
JK Flip-Flop (flip-flop-jk)No supply pins; no setup/hold timing (inputs are read at the clock edge); power-up Q is LOW. Pin names are our best match to Wokwi's closed-source part.
LCD 1602 (lcd1602)No instruction timing (busy flag always 0), backlight in "full" mode is always on (A/K are not evaluated), V0 contrast ignored, glyphs are 5x8 only (the 5x10 font bit is stored). I2C reads return the last written port byte.
LCD 2004 (lcd2004)No instruction timing (busy flag always 0), backlight in "full" mode is always on (A/K are not evaluated), V0 contrast ignored, glyphs are 5x8 only (the 5x10 font bit is stored). I2C reads return the last written port byte.
LED (led)No current model (a series resistor is a wire), so a steady LED is always brightness 1. An unwired anode is never lit: the net model reads an unwired pin as LOW, which would light a LED whose cathode is on a high rail.
LED Bar Graph (led-bar-graph)Digital only (no PWM brightness). A segment whose anode pin is not wired is never lit; an unwired cathode reads LOW (ground) like in the other LED parts, so wire the cathodes to GND.
Logic Analyzer (logic-analyzer)No analog thresholds, no sample-rate limit (1 ns resolution is the event time as the net model delivers it: CPU-cycle granular, 62.5 ns at 16 MHz).
MAX7219 LED Dot Matrix (max7219-matrix)No scan limit dimming or brightness rendering (intensity is state only), no decode-mode 7-segment glyphs, shifting fewer or more bits than 16*chain latches whatever is in the register (as the chip does), no current limits.
MCP4921 12-bit SPI DAC (mcp4921)The settling time (4.5 us) and the output noise are not modelled; the 500 kOhm pull-down of the shut-down output is a perfect 0 V; the Wokwi element set has no MCP4921, so the visual is our own drawing.
Membrane Keypad (membrane-keypad)Labels are the default layout (custom keys labels of the element are not mirrored), no contact bounce.
mfrc522 (mfrc522)No Crypto1 (so sniffing / nested attacks are meaningless), no collisions between several cards (one card at a time), no increment / decrement / transfer / restore (NAK), no PCD_PerformSelfTest data, no 4K cards, no RxAlign / partial-bit anticollision, Transmit and Receive commands move no data to the card, no I2C / UART interface, no analogue RF effects.
microSD Card (microsd-card)No MBR (the volume starts at sector 0), no write protect, no timing beyond byte counts (busy is 0x00 bytes), no erase commands (CMD32/33/38), CMD6/CMD13 minimal.
Mini Breadboard (breadboard-mini)No contact resistance or capacitance; rails are continuous along the whole board.
mpu6050 (mpu6050)No noise, no FIFO, no DMP, no interrupts, no digital low-pass filter, no auxiliary I2C master (XCL/XDA unused), no CYCLE mode, no per-axis standby.
MQ2 Gas Sensor (gas-sensor)No heater warm-up, no humidity/temperature drift, no hysteresis.
NAND Gate (gate-nand-2)No supply pins are modelled; no propagation delay beyond one CPU instruction per hop (see protocols/logic.ts). Unwired inputs read LOW.
NeoPixel Meter (neopixel-meter)No model of voltage drop or LED efficiency, a frame longer than one burst is one frame, the power of a pixel is linear in its value (the chips PWM at 400 Hz-2 kHz; the average current is the linear value), reset codes shorter than 50 us do not split frames (as for the pixels).
NLSF595 LED Driver (nlsf595)SCLR left unwired reads LOW and holds the register cleared, exactly like the real chip. With hardware SPI, SQH changes only after the whole byte and chained chips cannot follow (the second chip would need the SCK edges); use shiftOut for chains. No output current limiting, no thermal behaviour.
Nokia 5110 Display (PCD8544) (nokia-5110-screen)Contrast does not dim the picture (Vop is state only), no refresh-rate or voltage effects, no multiplex-rate / charge-pump behaviour.
NOR Gate (gate-nor-2)No supply pins are modelled; no propagation delay beyond one CPU instruction per hop (see protocols/logic.ts). Unwired inputs read LOW.
NOT Gate (gate-not)No supply pins modelled; one CPU instruction of delay per hop.
NTC Temperature Sensor (ntc-temperature-sensor)No self-heating, no response lag; the 10-bit ADC limits resolution to about 0.1-0.3 degrees near room temperature and more at the extremes.
OR Gate (gate-or-2)No supply pins are modelled; no propagation delay beyond one CPU instruction per hop (see protocols/logic.ts). Unwired inputs read LOW.
Photoresistor Sensor (photoresistor-sensor)No response lag, no comparator hysteresis, no supply-voltage scaling.
PIR Motion Sensor (pir-motion-sensor)No power-up warm-up (real modules need ~30-60 s), no sensitivity or blocking time (the "lockout" after OUT falls), no ambient-light gating.
Relay Module (ks2e-m-dc5)No pull-in/release delay, no coil-current or flyback modelling. An unwired coil pin reads LOW, so wire COIL2 to GND when driving from one pin.
Relay Module (relay-module)No pull-in/release delay, no coil model. VCC and GND are not checked. An unwired IN is never reported to the part, so the relay rests on NC for both transistor types.
RGB LED (rgb-led)No current model (resistors are wires). A pin that no wire touches is treated as "not driven" (never lit), because the net model reads an unwired pin as LOW, which would light an anode channel.
Rotary Dialer (rotary-dialer)No mechanical dial-return speed variation or contact bounce.
Rotary Encoder (KY-040) (ky-040)No contact bounce, no detent-less (free-spin) mode.
Servo (servo)Pulse period (50 Hz) is not enforced; widths come from instruction-granular edge times, so software-timed pulses can jitter by a few microseconds.
Seven Segment Display (7segment)Digital only (no brightness from duty cycle). A pin no wire touches is treated as not driven (never lit), since an unwired pin reads LOW.
Slide Potentiometer (slide-potentiometer)The output does not follow VCC, and the wiper has no load model.
Slide Switch (slide-switch)Break-before-make is not modelled; the unused throw is simply open.
SSD1306 OLED (ssd1306)No scrolling animation (scroll commands are accepted, not rendered), no SPI mode, no contrast/brightness electrical effect, display offset and start line are stored but not applied.
Tilt Switch (tilt-switch)No ball-bounce chatter.
TM1637 7-Segment Display (tm1637-7segment)No key scan, no 6-digit modules (addresses 4 and 5 are stored, not shown), bit timing is not checked (any clock rate works), a transaction cut off by a new START is dropped.
XNOR Gate (gate-xnor-2)No supply pins are modelled; no propagation delay beyond one CPU instruction per hop (see protocols/logic.ts). Unwired inputs read LOW.
XOR Gate (gate-xor-2)No supply pins are modelled; no propagation delay beyond one CPU instruction per hop (see protocols/logic.ts). Unwired inputs read LOW.

Board limits

Arduino (AVR)

  • Cycle-accurate AVR cores. Typical sketches with parts run 5 to 12 times faster than real time; the engine skips idle loops where that cannot change the result.
  • ATtiny85 and Franzininho: the chip has no UART. Serial (ATTinyCore software serial, transmit only on PB0) and the TinyDebug library both reach the serial monitor. The baud rate is measured from the pin, so it has to be one of 2400 to 115200 (within 6 %). Typing into the monitor reaches TinyDebug only, not Serial. SoftwareSerial on other pins is not decoded.

Raspberry Pi Pico and Pico W (RP2040)

  • Both cores, PIO, PWM, ADC, I2C, SPI, UART and USB serial run. arduino-pico executes at 200 MHz, which needs about 200 MIPS to keep up with real time, so a sketch that never sleeps runs at roughly 0.15 to 0.3 times real time. A sketch that waits in delay() runs 10 to 20 times faster than real time.
  • Serial is the USB serial port. Its output appears once the serial monitor connects, so add while (!Serial) after Serial.begin() if you need what setup() prints.
  • Pico W: Wi-Fi station mode runs against a simulated network (a virtual internet, not the real one); Bluetooth is not modelled, and there is no radio model (no signal strength changes, no contention). Soft-AP cannot be joined.

Raspberry Pi Pico 2 and Pico 2 W (RP2350)

  • DMA runs: 16 channels with DREQ pacing from PIO, SPI, UART, I2C, ADC, PWM and the DMA timers, chaining, rings, IRQ0 to IRQ3 and the CRC sniffer. Not modelled: bus errors from unmapped peripherals, XIP stream, HSTX and SHA-256 requests, bus contention with the cores.
  • Pico 2 W: Wi-Fi station mode runs against a simulated network exactly as on the Pico W (the radio is driven through the real PIO and DMA gSPI bus); Bluetooth is not modelled. Starting the radio costs a few seconds of wall time, and a graded scenario is capped at 30 s of simulated time.
  • A sketch that never sleeps runs at about half of real time (0.55 times in the measured busy loop); sleeping sketches run 10 to 70 times faster. HSTX, TRNG, SHA-256 and OTP are register stores only.

STM32 (Nucleo-C031C6, Nucleo-L031K6, Blue Pill)

  • Modelled: Cortex-M0+ / M3 core, RCC clocks, GPIO, EXTI, USART, timers (up counting, PWM, output compare), I2C master, SPI master, ADC, IWDG, SysTick.
  • Not modelled: DMA, USB (so SerialUSB and USB CDC sketches do not run), CAN, RTC counting, flash programming and EEPROM, down and centre-aligned timer counting, timer input capture and slave modes, dead time, I2C slave and clock stretching, SPI slave, LPUART, ADC internal channels, hardware ADC triggers. Writes to an unmodelled register are logged once and ignored.
  • Speed: the Blue Pill at 72 MHz ran at 1.25 to 1.5 times real time when measured. The Nucleo boards need about 21 M (C031) or 14 M (L031) instructions per simulated second; on a busy development machine they ran at 0.5 to 1.7 times real time. Neither was measured in a browser.
  • The STM32duino Servo library raises its pin a fixed 96 CPU cycles after the timer update event and lowers it earlier, so a pulse is 2 µs short at 48 MHz (3 µs at 32 MHz, 1.3 µs at 72 MHz), as on the real board.

ESP32 (DevKitC V4, S3, C3, C6, H2, P4, XIAO ESP32-C3, S3, C6)

  • The ESP32 runs in an emulator on the Astra server, not in the browser: each Run starts a session, one per student at a time, and a busy server queues new sessions with a position.
  • Wi-Fi (classic ESP32, S3, C3, C6 and their XIAO boards): the open network Astra-GUEST and a WPA2 network are simulated; HTTP, HTTPS, MQTT and NTP reach simulated hosts, and a sketch's WebServer on port 80 opens in the Network tab for its owner only. The H2 and the P4 have no Wi-Fi radio. Soft-AP (WiFi.softAP) and mDNS are not modelled.
  • ESP32-P4 (Function-EV board): GPIO, UART0, USB serial/JTAG, LEDC, I2C, SPI, timers and analogRead run. RMT (NeoPixel), PCNT, touch and I2S are not modelled. Only the header pins of the Function-EV board can be wired.
  • C6, XIAO-C6 and H2: GPIO, serial, LEDC, I2C (SSD1306) and timers run; Wi-Fi works on the C6 and XIAO-C6; BLE, Thread and Zigbee are not modelled. XIAO ESP32-S3 is built with its 8 MB flash image.
  • I2S (classic ESP32 and S3): ESP_I2S / I2S transmit to a MAX98357A amplifier plays in the browser (16-bit and 32-bit samples, mono or stereo). The I2S receiver (microphones), PDM and TDM framing, 8-bit samples and I2S on the C3 are not modelled.
  • Servo with ESP32Servo: call setTimerWidth(16) after attach(): attach() resets the width to 10 bits, which moves the servo in steps of about 2°. With 16 bits, 90° and 180° read exactly: the emulator reports PWM duty in steps of 1/10000, rounded to the nearest (±1 µs at 50 Hz).

Simulation time and size limits for grading

LimitValue
Simulated time per scenario30 s
Wall-clock time to run all scenarios of one submission15 s (the run is stopped and reported as "Simulation timed out")
Scenarios per submission20
Steps per scenario500
Parts per diagram100
Connections per diagram400
Source files per project10
Source size200 KB

A scenario whose waits add up to more than the simulated-time limit is rejected before it runs. A slow board (a Pico or Pico 2 sketch that never sleeps) can reach the wall-clock limit before the simulated one; use delay() or wait for events instead of spinning.

Browser support

  • The simulation runs in a Web Worker in your browser. Use a current desktop version of Chrome or Edge, which is what the automated tests run in. Firefox and Safari are expected to work but are not tested.
  • The code editor (Monaco) loads from a content delivery network, so the first load needs internet access. After that the Studio works offline for examples whose firmware is precompiled; compiling always needs the server.
Simulator limits | Astra Studio | Electronics Astra