Microcontroller I/O Studio
Arduino, ESP32, ESP8266 and Pico pins, trends and an oscilloscope over Web Serial or Bluetooth · standard firmware only
Pick a board, start the built-in simulator or plug in a real Arduino, ESP32, ESP8266 or Raspberry Pi Pico, and every pin on its header becomes a row you can configure, switch, drive and watch. Inputs stream onto trend charts and into an oscilloscope that measures frequency on the board's clock, not the browser's. The board runs only standard firmware: StandardFirmata from the Arduino IDE, or stock MicroPython with a small helper that the app starts from RAM and never writes to flash. A board with neither can have it installed from the same page.
1. Overview
This guide covers the Microcontroller I/O Studio: what a pin can do (digital input and output, ADC, PWM, servo and DAC), logic levels and why a 3.3 V pin must never see 5 V, sampling and aliasing, why a serial link limits the sample rate and how the app budgets it, where each sample's time stamp comes from, how to read the pinout, the trends and the oscilloscope, how to recognize the board that is plugged in, install standard firmware on it from the browser (or by hand) and connect over USB or Bluetooth, the simulated bench that makes all of it work with no hardware, and an honest list of what the app cannot do yet.
For faculty
Section 2 is lecture background on I/O, sampling and aliasing. The scenario table in section 3 and the exercises in section 6 run on the simulator, so a whole class can do them with no hardware. Section 5 says what not to claim.
For students
Start the simulator and work through the first-run steps in section 3 with the app open beside this page. Then section 4 explains every number the oscilloscope shows and where it comes from.
For practitioners
Section 3 covers firmware, wiring and connection for each board, section 4 gives the protocols, the link budget and the board clock, and section 5 is the gap list to read before trusting a measurement.
Three numbers decide what you can see
- The sampling period. 10 ms by default, so each input is read 100 times a second and nothing above 50 Hz (the Nyquist frequency) is seen as itself. A 70 Hz signal reads as 30 Hz, and a 100 Hz signal reads as a flat line.
- The link. StandardFirmata at 57,600 baud carries 5,760 bytes a second, every analog sample costs 3 bytes, and the app keeps a quarter of the link free. So one analog input can be read every 1 ms, six every 5 ms and sixteen every 20 ms, and no faster.
- The logic level. The Arduino Uno, Nano, Mega and Leonardo are 5 V boards. The ESP32, ESP8266 and Pico are 3.3 V boards, and their pins are not built for 5 V. Never wire a 5 V output to a 3.3 V pin.
2. Background
The engineering problem
A microcontroller meets the world through its pins. Each general-purpose pin (a GPIO) can be given one of a handful of jobs, and this app lets you give a pin a job and watch the result without writing a line of firmware:
- Digital input. The pin reads a voltage as one bit: HIGH above roughly half the supply, LOW below it. A pin with nothing connected floats and reads whatever it picks up, so an input needs something to hold it at a known level: an internal pull-up resistor (every board here has them), an internal pull-down (the ESP32 and Pico, under MicroPython), or an external resistor. A push button wired to ground with the pull-up switched on is the classic arrangement, and it is active LOW: pressed reads 0.
- Digital output. The pin drives HIGH (the supply, 5 V or 3.3 V) or LOW (0 V). It is a signal, not a power supply. An LED needs a series resistor, and a motor, relay or solenoid needs a transistor or driver between it and the pin. For scale, the ATmega328P on an Uno allows 40 mA per pin as an absolute maximum and about 20 mA in normal use, and the Pico's RP2040 drives 4 mA by default.
- Analog input (ADC). An analog-to-digital converter turns a voltage into an integer. With
bbits it has 2b levels between 0 V and its full scale, so one step (one LSB) is 4.9 mV for the Uno's 10-bit converter at 5 V and 0.8 mV for a 12-bit converter at 3.3 V. Full scale is set by a reference, and the boards differ: the Uno measures against its own 5 V supply (so its readings move if the USB supply does), the ESP32 under MicroPython is usable to about 3.1 V and is non-linear near both ends, the ESP8266 chip reads 0–1.0 V and the NodeMCU and D1 mini scale their single A0 pin to 0–3.2 V with a divider, and the Pico measures against its filtered 3.3 V rail. Only some pins have an ADC. - PWM output. Pulse-width modulation switches a pin between LOW and HIGH at a fixed
frequency. The fraction of each period spent HIGH is the duty cycle
D, and the average voltage isD·Vs. Anything slow compared with the switching (an LED as the eye sees it, a motor, a heater, an RC filter) responds to that average, which is why PWM is the usual way a microcontroller makes "half power". It is not an analog voltage, though: a meter or a slow filter sees the average, a fast ADC sees the switching. An Uno's PWM runs at 490 Hz (980 Hz on D5 and D6), and the app's MicroPython helper runs PWM at 1 kHz. - Servo. A hobby servo reads the width of a pulse repeated every 20 ms, not its duty cycle. The app maps 0–180° onto pulses of 544–2400 µs, the Arduino Servo library's defaults.
- DAC output. A digital-to-analog converter makes a true steady voltage. Of the boards here only the original ESP32 has one, on GPIO25 and GPIO26, with 8 bits (256 levels), and only under MicroPython.
Logic levels are not negotiable. The Uno, Nano, Mega and Leonardo run at 5 V. The ESP32, ESP8266 and Pico run at 3.3 V, and their pins are not built to accept more than their supply. A 5 V output, a 5 V sensor or a 5 V supply wired to one of those pins can damage it permanently. Going the other way is usually safe but not always reliable: a 3.3 V HIGH is above a 5 V board's threshold, but not by much. Use a level shifter or a resistor divider between the two families, and treat every pin on the 3.3 V boards as 3.3 V only.
Sampling turns a voltage into a sequence. Reading an analog pin once is a measurement.
Reading it every Ts seconds is a sampled signal at
fs = 1/Ts, and a sampled signal can only represent frequencies
up to fs/2, the Nyquist frequency. A faster signal does not
disappear. It aliases: its samples are exactly the samples of a slower signal, and nothing
after the ADC can tell the two apart. At the app's default 10 ms period, a 70 Hz sine
gives the same samples as a 30 Hz one, and a 100 Hz sine is sampled at the same point of
every cycle and looks like a constant. Seeing a waveform's shape takes more than two
samples per cycle, usually five to ten.
The link limits the sampling. A board can read its ADC far faster than it can tell you about it. A serial port at 57,600 baud sends a start bit and a stop bit around every byte, so it carries 5,760 bytes a second, and Firmata spends 3 bytes on every analog sample. Six analog inputs every millisecond would need 18,000 bytes a second, three times what the link can carry. The app works out the shortest period the link can carry with a quarter to spare and does not let you pick a faster one (The sampling period and the link budget).
The time of a sample is the board's, not the browser's. Bytes reach the browser in
batches. USB moves data in 1 ms frames, a USB-serial bridge may hold bytes for several
milliseconds before sending them (the FTDI chip's default latency timer is 16 ms), and the
browser handles them when its event loop gets there. Stamping each sample with its arrival time
would put tens of milliseconds of jitter into every period the oscilloscope measures. So the app
never does. StandardFirmata sends one set of analog values per sampling period, in
ascending channel order, from a loop paced by the board's millis() timer: the app
counts the sets, and the k-th set is k periods after the first. Because an
Uno's ceramic resonator can be half a percent out, the app also measures how long a counted period
really takes against the computer's clock, over a window that keeps growing, and stretches its time
base to match. The MicroPython helper starts every set with the microseconds elapsed since
the previous one, read from time.ticks_us() on the board's crystal, and the app adds
them up. Either way the samples are evenly spaced, free of the jitter of arrival times, and that is
what the oscilloscope needs to measure a frequency.
Where it sits in control theory
Every digital controller in this course, from the TCLab's PID loop to an MPC on a refinery, sits inside a sampled-data system: sensor, filter, ADC, computation, then a DAC or PWM output held until the next sample. This app is the I/O half of that loop with the controller taken out, so each stage can be looked at on its own:
- Sampling and the choice of rate. A loop can only respond to what its samples show. The usual guidance is several samples per closed-loop time constant for control and at least five to ten samples per cycle to see a waveform, and both rest on the same Nyquist limit the oscilloscope here warns about.
- Aliasing cannot be undone after the ADC. A disturbance faster than half the sample rate can become a slow, plausible-looking signal that a controller will happily try to correct. The only cure is an analog low-pass filter before the converter. The RC filter on the simulated bench is exactly that circuit, used here the other way round.
- PWM plus RC is a first-order lag. Driving an RC filter from a PWM pin gives
τ dV/dt = D·Vs − V, the same first-order model as every FOPDT fit in the course, with no dead time. A step in duty cycle reaches 63.2% of its final change after one time constant, and the bench lets you measure it. - Quantization is a noise source. An ADC rounds every reading to the nearest step, an error of up to half an LSB. Ten bits sounds like a lot until a signal only spans a tenth of full scale and is left with about 100 levels.
- The output is held between commands. A PWM duty or a DAC level stays where it was set until the next command, which is the zero-order hold every discrete controller assumes.
- Time stamps are part of the measurement. A derivative or an integral computed with the
wrong
Δtis wrong, and jittered timing looks like noise in exactly the terms that amplify noise. Taking time from the board's clock is the same discipline that sequence-of-events recorders and synchronized clocks bring to a plant. - A browser is soft real time. This app is an instrument, not a controller: it never closes a loop through the browser. The TCLab Control Studio does, and states plainly that the browser and the firmware are not hard real-time systems.
What this app teaches
- What a GPIO, an ADC, PWM, a servo pulse and a DAC each do, and which board offers which.
- Why a 3.3 V pin must never be driven from 5 V, and why an input needs a pull-up or pull-down.
- How ADC resolution and full scale set the smallest voltage step you can see.
- What a PWM duty cycle means as an average voltage, and how an RC filter turns it into one.
- What aliasing looks like: a confident, wrong frequency, and the sampling rates at which it appears.
- Why a serial link, not the ADC, limits how fast a board can be read, and how to budget it.
- Why time stamps must come from the board's clock rather than from when bytes arrive.
- How an oscilloscope triggers, measures frequency, duty cycle and RMS, and computes a spectrum.
- How to put standard firmware on an Arduino, ESP32, ESP8266 or Pico and connect to it from a browser.
The application in practice
Reading and driving pins is where every embedded and instrumentation project starts, and the questions this app makes visible are the ones that decide whether the numbers can be trusted:
- Bring-up and I/O checkout. Before writing firmware for a new board, an engineer checks every pin: does the input read, does the output drive, is the analog channel where the schematic says. On a plant the same step is a loop check, each I/O point verified end to end before commissioning. Doing it pin by pin from a browser, with no sketch to write, is the small version of that discipline.
- Data acquisition. Sensors in a teaching lab, a greenhouse or a test rig are usually read by exactly these boards. The first design decision is the sample rate, and the second is whether the link can carry it. The link budget here is the same arithmetic as a fieldbus loading calculation.
- Historians and slow scans. Industrial data historians sample many signals slowly. A pump vibration or a mains-frequency interference scanned once a second aliases into a slow wander that looks like process behavior. The 10 Hz trend rows in this app have the same weakness, which is why the oscilloscope exists.
- Teaching hardware. StandardFirmata is the firmware behind PyFirmata, Johnny-Five and Snap4Arduino, so a board set up for any of those works here unchanged, and MicroPython is the most common route into the ESP32 and the Pico. The TCLab itself is an Arduino with its own firmware.
- Web Serial as delivery. A browser that can open a serial port means a classroom of thirty machines needs no driver installs and no Python environment, only a cable and a supported browser.
Automation and its broader implications
Small as it is, this app runs into several of the questions that decide how real automation systems are built:
- Standard firmware is a design decision with a price. Using StandardFirmata or stock MicroPython means anyone can reproduce a setup from the Arduino IDE or a downloaded firmware file, with nothing custom to maintain. The price is the protocol's limits: Firmata has no buffered capture and spends three bytes on every ten-bit sample. Plants make the same trade when they choose a standard fieldbus over a proprietary one.
- Time belongs at the edge. The board knows when it took a sample, and the computer only knows when the bytes arrived. Plants solve the same problem with time-stamped I/O cards and synchronized clocks, so that the order of events survives the network.
- Every link has a budget, and the budget needs headroom. The app keeps a quarter of the link free for commands, replies and jitter. A link loaded to 100% does not fail cleanly. It falls behind, and the app warns when sample sets arrive more than 15% slower than the sampling period asks.
- A defined state on disconnect, and what happens without one. When you disconnect, the app releases the pins: on Firmata it writes outputs LOW, sets PWM to zero and returns every driven or pulled-up pin to a plain input, and the MicroPython helper returns every pin it configured to an input. But if the link simply disappears (a cable pulled from a board on external power, a crashed browser), nothing is sent and the outputs stay as they were. Industrial output cards have a configured fail-safe state for exactly that case. This app has no watchdog, which is the main reason not to drive anything hazardous from it.
- The browser is not a real-time system. A slider command is coalesced, sent when the browser gets to it, and carried by a link that may be busy. That is fine for an instrument and wrong for anything whose timing matters, which belongs in firmware on the board.
- Permission is explicit. A web page cannot open a serial port or a Bluetooth device on its own: the browser asks you to choose one, every time a new device is used. That user gesture is the security model, and it is worth knowing it is there.
3. Operating the app
The app runs entirely in your browser, and the simulator is always available: a simulated board running StandardFirmata or MicroPython, wired to a potentiometer, a function generator, a PWM-driven RC filter, a push button and an LED. All but one of the exercises in section 6 need nothing else.
Real hardware needs one of the twelve supported boards with standard firmware on it (the app can
install it, see Installing firmware from the browser), a USB data
cable (or a Bluetooth module), and a Chromium-based desktop browser (Chrome, Edge or Opera)
on an https:// or localhost page. Safari and Firefox have no Web Serial.
Your board, firmware, baud rate and sampling period, and the release and PWM-frequency
Options, are remembered in the browser for the next visit.
Interface anatomy
The screen has a header, a connection bar, a message strip, and three panels, the third of which holds either the oscilloscope or the Logic program:
- Header: the session clock (time since the connection started), Freeze / Resume for the trend charts, CSV export, this Instructions page, and the light/dark theme switch.
- Connection bar: the Board button (a small picture of the board and its name), Firmware, the Simulator / USB / serial / Bluetooth switch, Baud (serial only), Start simulator or Connect (Cancel while connecting), Install firmware, and Board setup. Its second line reports the firmware and the link once connected, with the Sample every menu and the live rate: sets per second, and kilobytes per second received out of what the link can carry.
- Message strip: the latest message. Log opens the last 50, newest first.
- Pinout panel (left): the board drawn in portrait, as seen from the component side, with a live row beside every header pin. Above it, the board's chip, logic level and ADC range, a count of the modes in use, All ADC pins → Analog in and Options. Below it, any header that is not on a long edge (the Mega's D22–D53 block), signals that are on the board but not on a header (the Pico's LED, VSYS monitor and temperature sensor), and on the simulator the Simulated bench.
- Trends panel (upper right): a Voltage chart and a Logic chart on one time axis, the time window, Clear, and under them Readings as a table.
- Oscilloscope panel (lower right): the channel, Stop/Run, Single, Auto and a download button for the raw samples, the screen, the timebase, scale and trigger controls, the measurements, the spectrum, and Fast capture.
- Logic panel (lower right, in the oscilloscope's place): Scope · Logic at its top switches between the two. It holds RUN/STOP with the status lamp and the scan period, the program's rows, Presets, Text, copy, import, export and clear, and the watch table of tags and variables. From 1900 px wide it has a column of its own. The Logic tab.
On a screen narrower than 760 px the panels become tabs: Pins, Charts, Scope and Logic. The scope button on a pin row then jumps to the Scope tab.
First run, step by step
Start the simulator. Leave the Board button on the Uno R3 (the Arduino Uno R3) and the connection on Simulator, and press Start simulator. A simulated Uno running StandardFirmata answers, and the app wires its bench: the potentiometer on A0, the function generator on A1, PWM on D9 at 50% driving an RC filter read on A2, the push button on D2 with its pull-up, and the LED on D13.
Read the status line. It shows StandardFirmata 2.5, 20 pins and 6 analog, and 100 sets/s · 1.8 kB/s of 5.8: six analog inputs, 3 bytes each, 100 times a second, on a link that carries 5.76 kB/s. StandardFirmata starts every analog-capable pin as an analog input, which is why A3–A5 stream too.
Look at the pins. A0 reads about 2.00 V (the potentiometer at 40%), A2 about 2.51 V (the 50% PWM, filtered), and D2 reads HIGH with the IN↑ chip of a pull-up. D0 and D1 carry no controls: they are the serial link to the computer.
Use the oscilloscope. It opens on the generator, A1. Read Frequency about 5.00 Hz, Vpp about 3.0 V and Sampling about 100 Hz with a Nyquist frequency of about 50 Hz. Press Auto to fit the timebase to three cycles.
Make it alias. In the Simulated bench, drag the generator's frequency to about 70 Hz. The scope reads about 30 Hz and warns that the signal is near the Nyquist limit. Now try 95 Hz: it reads 5 Hz and gives no warning, because an alias that slow looks perfectly reasonable. Put it back to 5 Hz.
Drive an output. Flick the switch on D13 and watch the LED on the drawing light. Hold Hold to press on the bench and watch D2 drop to LOW on the Logic chart: the button pulls the input to ground.
Watch a filter settle. Drag the D9 slider from 50% to 100%. On the Voltage chart A2 climbs toward 5 V along a first-order curve with the bench's 150 ms time constant. The dashed line is D9's average voltage.
See the link budget. Press Disconnect, choose Arduino Mega 2560 Rev3 with the Board button, and start the simulator again. The log says the sampling period was raised to 20 ms, because 16 analog inputs at 3 bytes each do not fit in 10 ms.
Try MicroPython. Disconnect and choose Raspberry Pi Pico / Pico 2 with the Board button. Firmware switches to MicroPython by itself, because the Pico is from another family. Start the simulator. The app soft-resets the simulated board, starts its helper, and enables Fast capture on the oscilloscope. Set the generator to 300 Hz: the stream shows a flat line, because 300 Hz is exactly three times the 100 Hz sample rate. Press Capture and the 300 Hz sine appears, sampled on the board at tens of kilohertz.
Keep the data. CSV in the header downloads the trend history: one row every 0.1 s for the last ten minutes. The download button on the oscilloscope saves the raw, board-timed samples of the pin it is showing.
Run a program. Choose Logic at the top of the oscilloscope panel, then Hold the RC voltage with PID, and press RUN. D9 gets a LOGIC chip, and A2 settles from 2.51 V to the potentiometer's 2.00 V in about 5 s. Drag the potentiometer on the bench and A2 follows. STOP returns D9 to 0 %. The Logic tab.
Then use real hardware. Plug the board in, press the Board button and Detect a connected board. If it already runs Firmata or MicroPython, Connect uses the port you just chose. If it runs neither, Install firmware writes it. See Choosing or detecting the board.
The connection bar
Which board, which firmware and which link are all chosen here. While a board is connected only the board can still be changed, and only on Firmata, to correct the drawing.
- Board opens the board picker (Choosing or detecting the board) and so chooses the pinout: Arduino Uno R3, Arduino Nano, Arduino Mega 2560 Rev3, Arduino Leonardo, Espressif ESP32-DevKitC V4 (ESP32-WROOM-32), DOIT ESP32 DevKit V1 (ESP32-WROOM-32, 30-pin), the generic ESP32-WROOM-32 38-pin dev board, Espressif ESP32-S3-DevKitC-1, NodeMCU DevKit v1.0 (ESP8266), LOLIN (Wemos) D1 mini, Raspberry Pi Pico / Pico 2, and Raspberry Pi Pico W / Pico 2 W. The button shows the board's picture and short name ("Uno R3", "ESP32-DevKitC", "Leonardo"), with the full name as its tooltip. Each board is drawn from a published pinout, linked under Board setup.
- Firmware offers what the board can run. The four Arduinos run Firmata only. The ESP32, ESP8266 and Pico boards default to MicroPython and can also run Firmata. Choosing a board from another family (an Arduino after an ESP32, a Pico after an Arduino) switches the firmware to that board's usual one. Within one family, or during a session, your choice is kept.
- Simulator, USB / serial or Bluetooth chooses the link. USB / serial also covers a paired Bluetooth Classic module, which the computer presents as a serial port. Bluetooth is Bluetooth Low Energy (see Bluetooth).
- Baud (serial only) must match the firmware: 57,600 for StandardFirmata (the Arduinos and the ESP8266), 115,200 for ConfigurableFirmata (the ESP32 boards and the Pico) and for the MicroPython REPL. Choosing the board and firmware sets the usual rate for you. The app also uses this number for the link budget, as baud ÷ 10 bytes a second.
- Install firmware writes standard firmware onto the board (Installing firmware from the browser). Board setup opens the same steps by hand, the Bluetooth and browser notes, and the board's own notes (Setting up a real board).
While connecting the status line says what the app is waiting for: "Choosing a device…", "Opening the port…", then "Waiting for Firmata (an Uno restarts when the port opens)…" or "Entering the MicroPython REPL…", and Cancel abandons the attempt. Once connected it shows the firmware (StandardFirmata 2.5, ConfigurableFirmata 3.3, MicroPython v1.24.1), the pin count or the board's own name for itself, and the link.
The board recognizes itself where it can. MicroPython reports a machine name such as "Raspberry Pi Pico W with RP2040". If it matches another profile the app switches the pinout and says so in the log, which is also why the Board menu is locked during a MicroPython session. Firmata reports only how many pins and analog inputs it has, so if those counts match a different board the app offers Show the … pinout rather than switching on its own. Changing the board during a Firmata session redraws the pinout, sets the ADC full scale to that board's default and clears the oscilloscope's buffers.
Sample every appears once connected: 1, 2, 5, 10, 20, 50, 100, 200 or 500 ms, 10 by default. Choices faster than the link can carry with the inputs you have are greyed out and marked "over the link budget" (The sampling period and the link budget). Under MicroPython 1 ms is greyed out as "below the helper's fastest loop". Beside it the live rate reads, for example, 100 sets/s · 1.8 kB/s of 5.8: sampling periods received per second, then the bytes per second arriving out of the link's capacity, both averaged over the last two seconds.
The pinout: modes, values and controls
Every header pin has a row beside it on the drawing, in the order it sits on the board. Power and ground pins show what they carry ("5 V out", "3.3 V out, 50 mA", "7–12 V in", "0 V"). A GPIO row reads, from the board outward: the label as printed on the silkscreen with small badges (the ADC channel, ~ for PWM, DAC, and functions such as SDA, TX or LED), the mode chip and menu, the value, and the control.
The mode menu lists only what that pin offers on that firmware. Before connecting it comes from the board profile. Once connected to Firmata it comes from the firmware's own capability report, which is authoritative. A pin switched to Output starts LOW, on both firmwares. Under MicroPython the board's reply to a mode change is applied whenever it arrives, and if the board refuses one (an ADC on a pin without one, for example) the pin is left released, its row shows —, and the board's error is in the log.
| Mode | Chip | Value shown | Control | Where |
|---|---|---|---|---|
| Input | IN | HIGH / LOW with a lamp | scope button | Every digital pin. |
| Input pull-up | IN↑ | HIGH / LOW | scope button | Every digital pin except the ESP32's GPIO34–39 and the ESP8266's GPIO16. |
| Input pull-down | IN↓ | HIGH / LOW | scope button | ESP32 and Pico, under MicroPython. Firmata has no pull-down mode. On early Pico 2 boards (RP2350 stepping A2) erratum E9 can stop the pull-down pulling LOW. |
| Output | OUT | HIGH 5 V (or 3.3 V) / LOW 0 V | switch | Every pin that can drive. Not the ESP32's input-only GPIO34–39. |
| PWM | PWM | duty and its average, "50% ≈2.50 V" | slider, 0–100% in 1% steps | Pins marked ~. Every output GPIO on the ESP32 and Pico. |
| Servo | SRV | angle | slider, 0–180° | Every output pin on Firmata, every PWM pin under MicroPython. It starts at 90°. |
| Analog in | ADC | volts, or a derived quantity | scope button | Pins with an ADC channel. |
| DAC out | DAC | volts | slider, 0–255 | ESP32 GPIO25 and GPIO26, MicroPython only. |
| Other | … | — | none | A mode the app does not drive (I2C, serial, one-wire), reported by the firmware. It stays until you choose another mode. |
The scope button on an input row sends that pin to the oscilloscope, and the small colored bar beside it is the pin's color on the charts. On the drawing, each pad lights with its level, the scoped pin is ringed, and the board's LED glows with its output or PWM level.
Pins you cannot drive are drawn but have no controls, and their row says why: reserved pins carry the link to the computer (D0 and D1 on the Uno, Nano and Mega, TX and RX on the ESP boards, the S3's native USB pair) or the module's flash memory (the ESP32's GPIO6–11), or do a job on the board (the Leonardo's pin 17, which only flashes its RX LED). The Leonardo talks to the computer over its own USB, so its D0 and D1 are a free serial port. Pins marked ! are usable with a caution shown on hover: the ESP32 strapping pins that decide how it boots, the ADC2 pins that stop reading while Wi-Fi is on, the Uno's D5 and D6 whose PWM runs at 980 Hz. An alias row is a second header position wired to the same signal: the Uno's SDA and SCL beside AREF are A4 and A5, and say "same as A4". On the Leonardo the same pair is D2 and D3.
The Leonardo's extra analog inputs. Its D4, D6, D8, D9, D10 and D12 can also be read by the ADC as A6 to A11, and Firmata gives those readings pin numbers of their own. Each header row keeps the digital controls (with an A6 … A11 badge), and the analog readings are listed under On the board, not on a header. Its ICSP header is drawn below the board, with the SPI pins MISO, SCK and MOSI that appear nowhere else.
Derived readings. The Pico's VSYS/3 monitor (GP29) shows the supply voltage rather than
a third of it, and its temperature sensor (ADC4) shows degrees Celsius from the RP2040 datasheet's
formula, T = 27 − (V − 0.706)/0.001721.
All ADC pins → Analog in sets every ADC-capable pin you have not configured yourself to Analog in. It leaves alone reserved and alias pins, every pin you have touched, and pins the firmware already has doing something other than plain input or output.
Options: releasing pins, ADC full scale and PWM frequency
Options, beside All ADC pins → Analog in, holds three settings that rarely change:
- Release pins on disconnect (on by default). On Firmata, disconnecting writes every output LOW, sets every PWM pin to zero, and returns every output, PWM, servo and pull-up pin to a plain input. Turned off, the pins stay as they are. Either way the board stops streaming. Under MicroPython the helper always returns its pins to inputs when it stops, whatever this setting says, and the panel says so.
- ADC full scale (V), 0.5 to 12 V, with Reset to the board's default (5 V on the Arduinos, 3.3 V on the ESP32 and Pico, 3.2 V on the ESP8266 boards). Change it when AREF carries another reference, or when a divider scales the signal into the pin, so that readings come out in the voltage you care about. It applies to new readings, it returns to the default when you change the board, and it is not used by an ESP32 under MicroPython, whose helper reads calibrated microvolts.
- PWM frequency: 50, 100 or 490 Hz, or 1, 2, 5, 10 or 20 kHz, 1 kHz by default. MicroPython only: it applies to every PWM pin at once and to each new one. On the Pico, each even and odd pair (GP0 and GP1, GP2 and GP3, and so on) shares one PWM slice and so one frequency, as do GPn and GPn+16, and the helper leaves a slice's frequency alone when another PWM pin is already using it. A servo sets its own pin to 50 Hz, which on a shared slice moves its neighbor too, and the log warns when a servo and a PWM pin end up on one slice. MicroPython's ESP8266 port has a single frequency for all PWM pins, from 1 Hz to 1 kHz, so on the ESP8266 boards the menu stops at 1 kHz. On Firmata the menu is disabled: the board runs PWM at its own frequency, which the panel names (490 Hz on an Uno).
The sampling period and the link budget
Sample every sets one period for every input on the board. Each period the board sends one set: a reading of every analog input and, under MicroPython, every digital input. The rule the app applies is simple and it is the same on every link:
shortest period = bytes per set ÷ (0.75 × link bytes per second), rounded up to a
whole millisecond and then to the next choice in the menu.
- Bytes per set. Firmata spends 3 bytes on every analog input. Its digital inputs are reported only when they change, so they cost nothing per period. The MicroPython helper sends one text line per set: about 9 bytes of overhead, 8 per analog input on boards that report microvolts (the ESP32) or 6 on boards that report 16-bit counts, and 2 per digital input.
- Link bytes per second. Baud ÷ 10 on a serial port, because each byte travels with a start and a stop bit: 5,760 at 57,600 baud (StandardFirmata), 11,520 at 115,200 (ConfigurableFirmata and MicroPython). About 2,000 for a Bluetooth LE Nordic UART and 960 for an HM-10 module. A Pico running MicroPython over its native USB is not limited by a baud rate at all, and the app does not limit it.
- The 0.75 keeps a quarter of the link free for commands, replies and jitter.
- The floor is 1 ms on Firmata and 2 ms on MicroPython, where the helper is an interpreted loop.
On StandardFirmata at 57,600 baud that gives:
| Analog inputs | Bytes per set | Exact limit | Shortest choice | Samples per second per input |
|---|---|---|---|---|
| 1 | 3 | 0.69 ms | 1 ms | 1,000 |
| 2 | 6 | 1.39 ms | 2 ms | 500 |
| 3 – 7 | 9 – 21 | 2.1 – 4.9 ms | 5 ms | 200 |
| 8 – 14 | 24 – 42 | 5.6 – 9.7 ms | 10 ms | 100 |
| 15 – 16 | 45 – 48 | 10.4 – 11.1 ms | 20 ms | 50 |
So an Uno, whose StandardFirmata streams all six analog pins from the start, can go no faster than 5 ms until some of them are given another mode, and a Mega, with sixteen, starts at 20 ms. The app checks the budget whenever a pin changes mode. If the period is too short it raises it and says so in the log ("Sampling period raised to 20 ms so the link can carry 16 analog inputs."). Choosing a period that is too short gives "1 ms is faster than the link can carry with these inputs; using 5 ms." Freeing inputs never shortens the period by itself: it only makes the faster choices available again.
If the link falls behind anyway (a Bluetooth link slower than assumed, a busy USB hub), sample sets arrive less often than the sampling period asks. On Firmata the app notices it while calibrating its clock, and when sets arrive more than 15% slower than they should it warns: "Samples arrive slower than the sampling period asks: the link cannot carry this rate. Lengthen the sampling period or read fewer analog pins."
The oscilloscope
The oscilloscope shows one sampled pin at a time, analog or digital, from a buffer of the last 65,536 samples of that pin (about a minute at 1 kHz, eleven minutes at 100 Hz). Pick the pin from Channel, with the scope button on its row, or by clicking it in a chart's legend. Until you pick one it shows the function generator on the simulator, or the first analog input on a real board.
The screen is ten divisions across and eight up, like a bench scope. The trigger point sits at the center (the small marker at the top) and the dashed line is the trigger level. When there are fewer than twelve samples per division each sample is drawn as a dot, so you can see how coarsely the signal is sampled. Digital inputs are drawn as steps, and a digital input that has not changed is drawn from its last report, held up to the present. The status in the corner reads TRIG'D (locked to a trigger), AUTO (no trigger found, showing the newest data), WAIT (Normal mode, holding the last triggered frame), ARMED, STOP or CAPTURE.
- Time/div: 100 µs to 2 s per division in 1-2-5 steps, 100 ms by default, so the screen spans one second.
- Volts/div: Auto (fits the swing in about six divisions and follows the signal's center), or fixed from 10 mV to 2 V per division.
- Trigger: Auto or Normal, on a rising or falling edge. Auto shows the newest data when nothing triggers. Normal waits and holds the last triggered frame. The trigger has hysteresis (8% of the signal's swing, at least 5 mV), so noise riding on a slow edge triggers once.
- Level: the trigger level, 0 to full scale. It starts at (mid), halfway between the minimum and maximum on screen. Double-click the slider to return to mid.
- Stop / Run freezes the screen. Single arms the trigger and stops on the first trigger newer than the moment you pressed it. Auto measures the signal and sets the timebase for three cycles, the scale and level to automatic, and the trigger to Auto.
- Spectrum shows or hides the amplitude spectrum.
- The download button saves the channel's raw samples as a CSV file: everything the oscilloscope still holds for that pin, with the board-timed time of each sample, or the fast capture if one is on screen (Logged data and CSV export).
The measurements refresh four times a second:
- Frequency and Period from the times of rising crossings of the mid level, interpolated between samples, over at least the last two seconds of data so that slow signals still span several cycles. They use the samples' board-timed spacing, not their arrival times.
- Duty: the fraction of each period spent above the mid level.
- Vpp, Min / Max, Mean and RMS (analog only) over the samples on screen. The RMS includes the mean, so a 3 Vpp sine on a 2.5 V offset reads about 2.71 V, not the 1.06 V of its AC part alone.
- FFT peak: the strongest component of the spectrum, interpolated between bins.
- Sampling: the sample rate and the Nyquist frequency, half of it. For an analog input the rate comes from the median spacing of the samples. For a digital input it is the session's sampling period, because Firmata reports a digital input only when it changes, and the spectrum of a digital input is computed on that period too.
The Nyquist warning appears when the measured frequency is above 40% of the Nyquist frequency, that is, when there are fewer than five samples per cycle. It can only judge the frequency it measures, and an alias is a low frequency. A 95 Hz signal sampled at 100 Hz reads 5 Hz with twenty samples per cycle and no warning at all. The warning catches signals near the limit, not signals far beyond it. Its advice is a fast capture where one is available, otherwise a shorter sampling period (and, for an analog input, fewer analog pins).
The spectrum covers 0 Hz to Nyquist on a decibel scale spanning 60 dB below the strongest component, with the peak marked. It is computed from the samples behind the screen (at least two and a half seconds of them, at most 4,096), using the largest power of two that fits, so its resolution is the sample rate divided by that count: about 0.4 Hz at 100 samples a second and 100 ms per division (256 points), but 163 Hz for a 1,000-sample capture at 83 kHz (512 points). When the bins are coarse, trust the frequency from the crossings over the FFT peak.
Fast capture on MicroPython
The continuous stream is limited by the link to somewhere between a few hundred and a thousand samples a second. A fast capture asks the board to fill a buffer on its own clock, as fast as its ADC and its interpreter allow, and only then send it. That reaches tens of kilohertz, enough to see an audio tone or the edges of a slow PWM signal.
- Samples: 250, 500, 1,000, 2,000 or 4,000 (1,000 by default). The helper captures at most 4,000, and at most 1,000 on the ESP8266, whose memory is small.
- Spacing: Fastest (back to back), or 20, 50, 100, 200, 500 or 1,000 µs
between samples, paced by
ticks_us(). - Capture runs it on the selected analog channel. The screen shows CAPTURE and the line under the controls reports, for example, "1000 samples, 12.0 µs apart (83.33 kHz), board-timed". The board measures the time from the first reading to the last, and the app divides it by the number of gaps (one fewer than the samples), so the spacing reported is the real one, whatever the request.
- Back to live returns to the stream.
All the measurements, the trigger and the spectrum work on a capture as they do on the stream. While the board is capturing it sends no stream samples, and the stream's clock carries on correctly across the gap.
Fast capture needs MicroPython. StandardFirmata has no buffered capture: on a Firmata board the oscilloscope works from the stream alone, and the panel says so. On the simulator the fastest spacing is modeled as 12 µs on a Pico, 30 µs on an ESP8266 and 50 µs on an ESP32. On a real board it is whatever the helper's loop achieves, and the app reports what the board measured.
The Logic tab: tags, calculations and blocks
The Logic panel runs a small program on the computer, the way a PLC scans its
rungs. Every pin is a tag named after its pin row (A0, D9,
GP15), and each row of the program assigns one tag from a calculation or a standard
block. A row that assigns a pin makes the board drive it, and a row that mentions a pin makes the
board read it. Nothing else has to be set up.
SP = A0 # the potentiometer, in volts
D9 = PID(sp: SP, pv: A2, Kc: 20, tauI: 1) # hold the RC filter's voltage at SP
D13 = abs(A2 - SP) > 0.2 # LED while off target
Where it is. The lower-right panel holds the oscilloscope or the Logic panel, switched by Scope · Logic at the top of the panel. Below 760 px it is a fourth tab, Logic, and from 1900 px wide it gets a column of its own beside the trends and the scope. A green dot on the switch and on the tab means a program is running. The panel and its library load the first time it opens.
Tags. A tag is the label on the pin row, made into a name: a label of digits only gets
IO in front (IO4 on the ESP32-S3), and a character that cannot be in a name
becomes an underscore (VSYS_3 on the Pico). An alias is the same pin (SDA
is A4 on the Uno). Names are case-insensitive, and the panel rewrites them as the board
prints them. A tag's value is the number its pin row shows, in that row's units:
| Pin mode | Read by the program | Written by the program |
|---|---|---|
| Analog in | volts, or the row's own quantity (the Pico's TEMP in °C) | — |
| Input, pull-up, pull-down | 1 (HIGH) or 0 (LOW) | — |
| Output | the commanded level | HIGH when the value is 0.5 or more |
| PWM | the commanded duty, 0–100 % | duty in %, clamped to 0–100 |
| Servo | the commanded angle | degrees, clamped to 0–180 |
| DAC out | the commanded volts | volts, clamped to 0–Vcc |
A row whose target is not a pin defines a variable (SP, Temp_C):
letters, digits and underscores, starting with a letter, at most 24 characters. Variables start at
0 at RUN.
Read and written. The panel never says input or output, because a pin the program drives
is an Output on its pin row. A pin a row assigns is written: the board drives it as an
Output when the row gives an on/off value (an OnOff, Timer, Edge, Toggle or Latch block, or an
expression such as a comparison, and/or/not or
square()), and otherwise in the pin's best analog-type mode (DAC where there is one,
else PWM, else Output). Write as chooses another, and the editor shows the mode in use.
So GP15 = square(1) blinks an LED, and GP15 = 50 dims it to half. Its pin row shows a LOGIC chip in place of its switch or slider, its mode menu
is locked, and its value cell shows what the program writes. A pin the rows only mention is
read: if nobody configured it, RUN sets it to Analog in when it has an ADC, else to Input
pull-up. A pin you configured by hand keeps its mode, and a pin no row mentions is left alone. Two
enabled rows may not write the same tag.
The scan. RUN puts the pins in their modes and scans the enabled rows top to
bottom every 20, 50, 100 (the default), 200, 500 or 1,000 ms. A tag assigned further down, or
by the same row, reads its value from the previous scan, so Count = Count + 1 counts
scans. dt is the measured time since the last scan, not the nominal one. A pin is
written only when its command changes. The strip shows the lamp (gray stopped, green running, amber
with a faulted row, red when the connection was lost), the last scan time and how long the
arithmetic took.
Blocks. Each row is one block. Every field takes an expression, so a setpoint can be
A0 * 20 and a limit can be a variable. The ? in a row's editor lists the
block's fields with their units and defaults.
| Block | Fields (in text-form order) | Value | Typical use |
|---|---|---|---|
| Calc | expr | the expression | scaling, thresholds, square(1) to blink |
| PID | sp, pv, Kc, tauI, tauD, uMin, uMax, action, mode, manual, bias, dFilter | the output, uMin–uMax (0–100) | hold a voltage, a temperature, a speed |
| Filter (first-order lag) | input, tau | 63 % of a step after one τ | smooth a noisy reading |
| Ramp (rate limiter) | input, rate | moves at most rate · dt a scan | move a servo gently |
| OnOff (hysteresis) | input, on, off | 1 or 0; on < off is a thermostat | heater, fan, alarm |
| Timer | input, seconds, type (TON, TOF, TP) | 1 or 0 | debounce, hold on, one pulse |
| Edge | input, edge (rising, falling, both) | 1 for one scan | detect a press |
| Toggle | input | flips on each rising input | a button toggles an LED |
| Latch (SR) | set, reset, priority | 1 or 0, held | an alarm until acknowledged |
| Counter (CTU) | count, reset, max | the count of rising inputs | count presses |
| Totalizer | input, reset, min, max | ∫ input dt, trapezoid rule | energy, volume |
Expressions are parsed by the app itself, never by the browser's JavaScript, so a name such
as window is just an unknown name. An error names its position: "Unknown tag A7; this
board has A0 to A5", "Expected ) to close the ( at position 7".
| Kind | Written as | Notes |
|---|---|---|
| Numbers | 2, 2.5, 1e-3 | |
| Arithmetic | + - * / %, ^ (or **) | ^ binds tightest and groups to the right: -2 ^ 2 is −4 |
| Comparison | < <= > >= == != | give 1 or 0 |
| Logic | and or not (or && || !) | nonzero is true; give 1 or 0 |
| Choice | if(c, a, b), c ? a : b | only the chosen side is evaluated |
| Functions | abs min max clamp(x, lo, hi) scale(x, x0, x1, y0, y1) round(x[, digits]) floor ceil sqrt pow exp ln log10 sin cos tan atan2 | scale is the straight line through two points, not clamped |
Waves of t | square(period[, duty]), triangle(period), sawtooth(period) | from 0 to 1, the bench generator's shapes |
| Constants | pi e Vcc Vref t dt true false | Vcc the logic voltage, Vref the ADC full scale, t seconds since RUN |
The PID faceplate. A PID row's editor shows AUTO / MAN, the setpoint, the measured value, the manual output and Kc, τI and τD, with the live PV, SP and MV and a bar for the output. The limits, the action (reverse by default: a rising measurement lowers the output), the bias and the derivative filter are under More. Left empty, the upper limit is the written pin's range (100 % for PWM, 180° for a servo, Vcc for a DAC, 1 for an output), so the integral cannot wind up beyond what the pin can take. The equations are in section 4. The controller starts from the pin's present output and switches between AUTO and MAN without a bump, and a gain typed while it runs takes effect as soon as you press Enter.
Faults, STOP and Force. A program with an error cannot RUN; the errors are on their rows and fields as you type. Right after RUN a read pin may not have a reading yet: its rows, and the rows that use their results, wait ("waiting for the first reading of A1") and write nothing. A pin that sends no reading for 3 s faults its row. While running, a row whose result is not a number (a division by zero) holds its last value, shows the message, and turns the lamp amber; the other rows carry on. While the program runs, a field you edit is a draft, outlined in amber: its errors show as you type, Enter or moving to another field applies it, and Esc undoes it, so typing Kc 20 never briefly runs Kc 2. An edit that does not compile is not applied, and the last good program keeps running. STOP writes every written pin's stop value: 0 by default, the last value with On STOP: hold last values, or the row's own Stop value (a servo to 90°). Disconnecting stops the program first. A lost connection stops it with a red lamp, and nothing more is written. Under Tags, variables, constants and functions a running program's read tags can be forced: the program sees the forced value, the pin row says FORCED, and STOP releases every force. Written pins cannot be forced.
Presets. Presets loads a program made from the board's bench wiring, asking first whether to replace the rows or add after them:
- Blink the LED:
D13 = square(1)(GP15 on a Pico). - Button toggles the LED: an Edge on the button's falling edge (pressed reads LOW) feeding a Toggle.
- Hold the RC voltage with PID: the potentiometer as setpoint, the PWM pin as output, the RC filter's ADC pin as the measurement, tuned for the filter at τ = 1 s. On the simulator loading it sets the filter's τ to 1 s. Needs the potentiometer and the filter, so not on the ESP8266 boards.
- Thermostat with hysteresis: the RC filter as a small oven. The PWM pin is the heater, fully on or off, the filter's ADC pin reads as 0–100 °C, and the potentiometer sets the setpoint (40 % is 40 °C). An OnOff block turns the heater on 5 °C below the setpoint and off 5 °C above it. Loading it sets the filter's τ to 1 s. Needs the potentiometer and the filter, so not on the ESP8266 boards.
- Alarm with acknowledge: a filtered potentiometer over 80 % of Vcc latches the LED until a button press.
- Count presses: an Edge and a Counter that starts again at 10.
Text, import and export. Text shows the whole program as lines you can edit, paste into a message or print in a hand-out, and Apply reads it back. Copy, import and export (JSON) are the icons beside it. The program is saved in the browser for each board on every edit.
@scan 100 # the scan period, ms
@stop zero # or: hold
Level = Filter(input: A0, tau: 0.2)
High = Level > 0.8 * Vcc
D5 as Servo stop 90 = Ramp(input: Level * 36, rate: 30)
// D13 = High # a row starting with // is present but off
Variables are drawn on a third chart, Variables, with an axis of their own, and on/off variables as dotted lanes on the Logic chart. Readings as a table lists them, and the CSV has a column for each.
Choosing or detecting the board
The Board button opens Choose your board: a card for each of the twelve boards with a drawing of it, its chip, its logic level and the firmware it can run, and under each card a button to install that firmware. The drawings are made by the app, not photographs: each board in its usual landscape view with the USB connector on the left, in its real proportions, with its headers, its main chip or radio module, and the buttons that the installation steps refer to by name (RESET, BOOT, FLASH, BOOTSEL). During a MicroPython session the other cards are locked, because the session is tied to its board's pin names.
Detect a connected board asks the board itself. Plug it in by USB, press the button and choose its port. The app then works from the least intrusive question to the most:
- The USB identity. The vendor and product numbers the port reports name an Arduino Uno, Mega or Leonardo directly (the Leonardo has one number for its sketch and another for its boot loader), and otherwise name the USB bridge: a CP210x (ESP32-DevKitC, NodeMCU), a CH340 (Nano clones, D1 mini, many ESP boards), a CH9102 (newer ESP32 boards), an FTDI chip, Raspberry Pi's own USB, or Espressif's native USB.
- The firmware. Does the board answer Firmata (at 57,600 or 115,200 baud, in an order that depends on the bridge), or a MicroPython REPL at 115,200? A board that restarts when its port opens announces Firmata by itself, so the app listens first (up to four seconds, less behind an ESP bridge or on a board's own USB) and then asks. Either answer names the board: Firmata by its pin and analog counts (20 and 6 on an Uno, 40 and 16 on an ESP32 running ConfigurableFirmata, 30 and 4 on a Pico), MicroPython by its machine name. Boards that share those numbers, such as the three ESP32-WROOM-32 boards, are ordered by the USB bridge.
- The chip's own boot loader, which is there even on a blank board. On an Uno, Nano or Mega the STK500 boot loader reports the chip's signature (ATmega328P or ATmega2560). A Leonardo's boot loader (Caterina) can only be asked while it is running, on its own port. On an ESP board the ROM boot loader, asked through esptool-js, names the chip (ESP32, ESP32-S3, ESP8266). The board restarts afterwards.
The order of the questions depends on the USB identity (section 4 lists it), and the first answer ends the search. Nothing is written to the board's flash. The result lists what each question found and offers the most likely board. If the board already runs working firmware, Connect to the … connects at once, on the port you just chose. If not, it offers the right Install button. Some boards share a chip and are told apart only by their USB bridge (an Uno and a Nano, the three ESP32-WROOM-32 boards, a NodeMCU and a D1 mini), so the alternatives are offered as buttons beside the best guess.
When an ESP board does not answer. Many ESP boards are reset into their boot loader by
the USB bridge's DTR and RTS lines, and on some boards (often behind a CH9102 or CH340, depending
on the board and the driver) that automatic reset does not work. If nothing answers behind an
ESP-style bridge, the result says so ("Probably an ESP board (CH9102 bridge), but neither its
firmware nor its boot loader answered") and reads esptool's own boot log for the reason: a boot
mode such as 0x13 means the chip restarted into its own program instead of the boot
loader, and nothing at all means it did not restart. It then says "Try again with the BOOT button
held": hold BOOT (it may be labelled BOOT, IO0 or FLASH) and keep holding it, press Ask the boot
loader again, and let go when the board is named. The app resets the board on the same port,
and with BOOT held the chip restarts into its boot loader instead of its own program. A board found
that way is reported "(found with BOOT held)" and needs BOOT held the same way when its firmware is
installed. If even that fails, the result says "The ESP boot loader did not answer, even with BOOT
held".
A Leonardo is asked for Firmata only. If none answers, press RESET twice quickly: its boot loader appears for 8 s as a second port, and detecting on that port reads its chip.
Installing firmware from the browser
Install firmware (in the connection bar, on every card of the board picker, and at the top of Board setup) writes standard firmware onto the board with the board's own boot loader, so it works on a board that has never been programmed:
| Board | Image | How it is written |
|---|---|---|
| Uno, Nano | StandardFirmata 2.5 | Over USB through the Arduino boot loader (STK500 v1): Optiboot at 115,200 baud, or the older Nano boot loader at 57,600, tried in that order. Written page by page, then read back and compared. |
| Mega 2560 | StandardFirmata 2.5 | Over USB through the Mega's STK500 v2 boot loader at 115,200 baud, written and read back the same way. |
| Leonardo | StandardFirmata 2.5 | Restarted into its USB boot loader (Caterina, AVR109) with a 1200-baud touch, then erased, written and read back over the boot loader's own port. |
| ESP32-DevKitC, DOIT DevKit V1, ESP32 38-pin | MicroPython 1.29.0, or ConfigurableFirmata 3.3 | Over USB through the chip's ROM boot loader with Espressif's esptool-js, optionally after erasing the whole flash. The Firmata image is one file written at 0x1000: boot loader, partition table and sketch. |
| NodeMCU, D1 mini | MicroPython 1.29.0, or StandardFirmata 2.5 built for the ESP8266 | The same way, each as one image written at 0x0. |
| ESP32-S3-DevKitC-1 | MicroPython 1.29.0 | The same way. A selector picks the build for the module's PSRAM. No Firmata (see below). |
| Pico, Pico W | MicroPython 1.29.0, or ConfigurableFirmata 3.3 | Copied as a UF2 file onto the drive the board shows in BOOTSEL mode. |
| Pico 2, Pico 2 W | MicroPython 1.29.0 | The same way, with the RP2350 image picked in Which board exactly?. No Firmata (see below). |
The images ship with the app. StandardFirmata comes from the Firmata library 2.5.9, compiled for each Arduino and for the ESP8266. ConfigurableFirmata 3.3 is the library's own example sketch, built with Wi-Fi and Bluetooth off, for the ESP32-WROOM-32 boards and the RP2040 Pico and Pico W. And there are the official MicroPython 1.29.0 builds (ESP32_GENERIC, ESP32_GENERIC_S3 and its SPIRAM_OCT variant for octal-PSRAM modules, ESP8266_GENERIC, RPI_PICO, RPI_PICO2, RPI_PICO_W, RPI_PICO2_W). Download the file saves any of them for installing by other means. The app's licence notes list every version and source.
Choosing the firmware. On a board that can take both, the dialog shows a switch between the two images (for example MicroPython 1.29.0 and ConfigurableFirmata 3.3), set to whatever the connection bar's Firmware menu says. Installing Firmata over MicroPython says so: "This replaces the firmware on the board, MicroPython included if it has it."
Two boards cannot be given Firmata from the browser. On the ESP32-S3, ConfigurableFirmata 3.3 numbers the pins as if the chip were the original ESP32: it leaves out GPIO 1, 3, 6–11 and 40–48 and offers pins that are wired to the flash, and a build of your own has the same limits. With Firmata chosen on the S3, the Install firmware button and the dialog say "Firmata cannot be installed from the browser on the …", give that reason, and offer MicroPython instead, which works with every feature of the app. On the Pico 2 and Pico 2 W, ConfigurableFirmata 3.3 does not build for the RP2350, so the Firmata image is for the RP2040 Pico and Pico W only, and the dialog says so. The installer refuses to copy it onto an RP2350 drive.
- Uno, Nano and Mega. Press Install: choose the port. The app pulses the DTR and RTS lines to reset the board into its boot loader, as the Arduino IDE does, reads the chip's signature and stops if it does not match the chosen board, writes 128-byte pages (256 on the Mega), reads every page back and compares it, and leaves the boot loader, which starts StandardFirmata. This replaces the sketch on the board.
- Leonardo. It has no USB bridge, so it is two steps. Press Install: choose the port and choose the Leonardo's port: the app opens it at 1200 baud and closes it (the "1200-baud touch" the Arduino IDE uses), and the board restarts into its boot loader, which appears as a second USB port for 8 s. Then press Choose the boot-loader port, which counts the seconds down, and pick "Arduino Leonardo (bootloader)" (the chooser lists only Arduino, SparkFun and Adafruit devices). The app checks the chip is an ATmega32U4, erases the program area, writes it, reads it back and compares, and starts the sketch. If the boot-loader port never appears, press RESET twice quickly and choose it within the 8 s.
- ESP boards (MicroPython, or Firmata on all but the S3). Press Install: choose the port. esptool-js resets the chip into its ROM boot loader, the app checks it is the chip the board should have, erases the whole flash if Erase the whole flash first is ticked (the default, recommended for a first install, and it also removes files saved on the board), writes the image at 460,800 baud and restarts the board. If the automatic reset does not work on your board, hold the BOOT button (FLASH on a NodeMCU) before pressing Install and keep holding it until the progress bar starts to move: the reset then lands the chip in its boot loader. While it connects, the dialog says "Nothing after a few seconds? Hold BOOT now, and keep holding it until the bar starts to move", and the app keeps trying for a while. When the connection fails, the error explains what esptool's boot log showed.
- Picos (MicroPython, or Firmata on the RP2040 Pico and Pico W). Put the board in BOOTSEL
mode, press Install: choose the BOOTSEL drive and choose the drive (RPI-RP2 for an RP2040,
RP2350 for a Pico 2). The app reads the drive's
INFO_UF2.TXTto confirm it is a boot drive and which chip it belongs to, refuses an image for the other chip, and copies the file. The board restarts into MicroPython as the copy finishes, often before the browser has closed the file, which is the normal ending. A MicroPython install keeps the files on the board's MicroPython filesystem. A Pico already running MicroPython can be sent into BOOTSEL by the app: Restart this Pico into BOOTSEL, no button needed.
When it is done, Connect with Firmata or Connect with MicroPython connects. On the Uno, Nano, Mega and the ESP boards that is the same port. A Leonardo and a Pico come back as new USB devices, so the port chooser opens again.
The buttons on the board. Most boards enter their boot loader by themselves when the app asks. When one does not, the dialog shows the steps for that board, and highlights them while the app is waiting:
| Board | By itself? | If it does not |
|---|---|---|
| Uno, Nano, Mega | Yes | Press and release RESET just as the app says "Waiting for the boot loader". On the Nano it is the button in the middle of the board. |
| Leonardo | Yes, with the 1200-baud touch | Press RESET twice quickly: the L LED pulses for 8 s while the boot loader waits. Within those 8 s, press Choose the boot-loader port and pick "Arduino Leonardo (bootloader)". |
| ESP32-DevKitC | Yes | Hold the BOOT button (labelled BOOT or IO0) and keep holding it, press Install and choose the port, and let go when the progress bar starts to move. |
| DOIT ESP32 DevKit V1 | Often not: plan on holding BOOT | The same three steps: hold BOOT, press Install and choose the port, let go when the bar moves. Many clones lack the capacitor on EN that makes the automatic entry reliable. |
| ESP32 38-pin (generic) | Often not: plan on holding BOOT | The same three steps (the button may be labelled BOOT, IO0 or FLASH). On many of these boards, especially those with a CH9102 or CH340 bridge, the browser cannot reach the boot loader by itself. |
| ESP32-S3-DevKitC-1 | Yes, on the UART port | The same three steps. Use the port labelled UART (or COM) if you can. On the port labelled USB, if no serial port appears to choose, hold BOOT while plugging the cable in. |
| NodeMCU | Yes | Hold the FLASH button and keep holding it, press Install and choose the port, and let go when the progress bar starts to move. |
| D1 mini | Yes | It has no button: connect D3 (GPIO0) to G with a jumper wire instead, press Install and choose the port, and remove the wire when the progress bar starts to move. |
| Pico, Pico W (and Pico 2) | No | Unplug the board, hold the white BOOTSEL button while plugging it back in, release it, and choose the drive that appears. Or use Restart this Pico into BOOTSEL while MicroPython runs. |
Installing needs the same Chromium-based desktop browser as connecting. The Pico install also needs the browser's File System Access API, and without it the dialog says so: download the file and copy it onto the drive yourself.
Setting up a real board
Install firmware does all of this for you. Board setup in the connection bar shows the same steps by hand for the selected board and firmware, with the board's own notes and a link to the pinout it is drawn from, and starts with a button that opens the installer.
StandardFirmata on an Uno, Nano, Mega or Leonardo
- In the Arduino IDE (or the Arduino Cloud Editor), open File → Examples → Firmata → StandardFirmata. If the Firmata menu is missing, install the Firmata library from the Library Manager.
- Select the board and its port under Tools and Upload. Many Nano clones need Tools → Processor → ATmega328P (Old Bootloader).
- Close the IDE's Serial Monitor, choose USB / serial at 57,600 baud, and Connect. Opening the port resets an Uno, Nano or Mega, and Firmata announces itself a few seconds later, once the boot loader has handed over. A Leonardo's USB is its own chip's, so opening the port does not reset it: the sketch is already running and answers at once.
Firmata on an ESP8266, ESP32 or Pico
Install firmware writes these for you: StandardFirmata 2.5 built for the ESP8266, and ConfigurableFirmata 3.3 built from the library's example with Wi-Fi and Bluetooth off for the ESP32-WROOM-32 boards and the RP2040 Pico and Pico W. The steps by hand are only needed for a build of your own. On the ESP8266, install the ESP8266 boards package, load the same StandardFirmata example, and connect at 57,600 baud. On the ESP32 and Pico StandardFirmata does not support the chip: install the board package (esp32 by Espressif, or Raspberry Pi Pico/RP2040 by Earle Philhower) and the ConfigurableFirmata library, upload its ConfigurableFirmata example, and connect at 115,200 baud, ConfigurableFirmata's rate. ConfigurableFirmata 3.3 does not build for the RP2350, so a Pico 2 needs MicroPython. On the ESP32-S3 it numbers the pins as the original ESP32's, so neither the installer nor a build of your own gives a usable S3: use MicroPython there. MicroPython also adds fast capture on every one of these boards.
MicroPython on an ESP32, ESP8266 or Pico
- Download the firmware for your board from micropython.org/download: ESP32_GENERIC, ESP32_GENERIC_S3, ESP8266_GENERIC, or RPI_PICO, RPI_PICO2, RPI_PICO_W, RPI_PICO2_W.
- On a Pico, hold BOOTSEL while plugging in the USB cable and copy the
.uf2file onto the drive that appears. On the ESP boards, flash with esptool (the dialog shows the exact commands for the chip) or Thonny's Install or update MicroPython (esptool). - Close Thonny or mpremote, choose USB / serial at 115,200 baud, and Connect.
What happens when you connect to MicroPython. The app interrupts whatever is running
(Ctrl-C), enters the raw REPL (Ctrl-A), and soft-resets the board (Ctrl-D), which clears
any state an earlier program left. It asks the board for its name and MicroPython version, refuses
CircuitPython, and then sends the helper, agent.py with its comments stripped (about
7.5 kB), through raw-paste mode, the flow-controlled transfer that mpremote
uses. The helper runs from RAM. Nothing is
written to the board's files, your main.py does not run while the app is connected,
and it runs again at the next reset. Under MicroPython every pin starts unconfigured, so nothing
moves until you choose a mode.
What happens when you connect to Firmata. The app first listens, for up to
4.5 s (0.3 s on a board with its own USB, such as the Leonardo, which does not reset),
because a board that resets when the port opens announces its firmware by itself once the sketch
starts. The listening ends early only on Firmata's own traffic (a status byte of 0x80
or above, or the firmware report), so an ESP32's text boot messages do not start the questions too
soon, while a board already streaming Firmata is asked at once. Asking straight away is not harmless: the Mega 2560's
STK500 v2 boot loader takes any byte in its first 0.84 s as the start of an upload, and then
holds the sketch back until about 9 s of silence. Only then does the app ask, once a second, for
up to 10 s in all. It asks for the firmware's name and version, its capability report (the modes and resolutions of every pin), its analog mapping, and
the current state of every pin. It then sets the sampling period, enables reporting on every
digital port and on every pin already in analog mode that the board's drawing shows and does not
reserve, and applies the link budget. (On a Pico W, ConfigurableFirmata lists GP29 as an analog
input, but reading it would take the wireless chip's SPI clock, so it is left quiet.)
StandardFirmata starts every analog-capable pin as an analog input and every other pin as a LOW
output, and the pinout shows exactly that.
When you disconnect, the app releases the pins unless you have turned that off under
Options. On Firmata it writes every output LOW, sets every PWM pin to zero,
returns every output, PWM, servo and pull-up pin to a plain input, switches reporting off, and
waits for those bytes to reach the board before it closes the port. It does not use Firmata's SYSTEM_RESET, because StandardFirmata's reset makes pins
outputs again without clearing the AVR's output latch: a HIGH output would stay HIGH, and a pull-up
input would become a HIGH output. On MicroPython the helper returns every pin it configured to an
input, stops, and the board goes back to its normal REPL. Closing the tab attempts the same, on a
best-effort basis.
If the board restarts on its own (its reset button, a dip in the supply), its pins are back at their power-up defaults and no longer match the app. The app notices (on Firmata the board announces its firmware unasked, on MicroPython a boot banner appears) and ends the session with "The board restarted (reset button or power dip). Its pins are back at their defaults; connect again."
On Linux, your account must be allowed to open serial ports: run
sudo usermod -aG dialout $USER, then log out and in again.
Bluetooth
Two kinds of Bluetooth module can stand in for the USB cable, and they connect in different ways:
- Bluetooth Classic (HC-05, HC-06, an ESP32 running BluetoothSerial). Pair the module with
the computer first, in the operating system's Bluetooth settings. It then appears as a serial port
(Chromium 117 and later), so choose USB / serial. The module talks to the board's RX/TX pins
at its own baud rate, 9,600 by default on the HC-05 and HC-06, so the sketch must use the same rate:
change
Firmata.begin(57600)toFirmata.begin(9600), or set the module to 57,600 with its AT commands. Set the app's Baud menu to the module's rate as well: it does not affect the radio, but it is what the app budgets the link on. - Bluetooth LE: an HM-10, AT-09, MLT-BT05 or CC41 module on the board's RX/TX pins (same baud-rate rule), StandardFirmataBLE on a board with built-in BLE, or any bridge exposing the Nordic UART Service, such as MicroPython's BLE UART example. Choose Bluetooth in the connection bar. The chooser lists devices advertising either serial service or named HM, BT05, MLT, mpy, ESP32 or Firmata. Writes go in 20-byte packets, one at a time.
Bluetooth LE is slow. The app budgets a Nordic UART link at 2,000 bytes a second and an
HM-10 at 960, against 5,760 for a USB cable. Six analog inputs over an HM-10 need at least a
50 ms period. Web Bluetooth on Linux may need
chrome://flags/#enable-experimental-web-platform-features.
Wiring safely
The simulator cannot be damaged. A real board can, and most damage comes from a handful of mistakes:
- Never put 5 V on a 3.3 V board's pin. No ESP32, ESP8266 or Pico pin should see more than its 3.3 V supply. A 5 V sensor needs a divider or a level shifter.
- Limit the current. An LED needs a series resistor (a few hundred ohms). A motor, relay, solenoid or long LED strip needs a transistor or a driver. A pin is a signal.
- Wire buttons to ground and use the pull-up, as the simulated bench does. Never wire a button straight to the supply on a pin that might become an output: StandardFirmata makes every digital pin a LOW output at start-up, and a pressed button would then short the supply to ground through the pin.
- Know that a pin remembers its last level. An AVR keeps each pin's output latch when the pin changes mode, and turning on a pull-up sets that latch HIGH. So a pin that was a pull-up input would start driving HIGH the moment it became an output. The app writes LOW explicitly whenever it switches a pin to Output, and releases pins on disconnect without Firmata's reset for the same reason (Setting up a real board). Firmware you write yourself needs the same care.
- Mind the strapping pins. Several ESP32 and ESP8266 pins are read at reset to choose the boot mode. The pinout marks them with !, and wiring that holds one at the wrong level stops the board booting.
- Leave reserved pins alone. D0 and D1 on the Uno, Nano and Mega are the link to the computer, and the ESP32's GPIO6–11 are its flash memory.
- Do not drive anything hazardous. Outputs set from a browser are not hard-timed, and if the link drops without a disconnect they stay where they were. A heater, a motor that can trap a finger, or anything on mains voltage needs its own protection in hardware.
When the connection will not work
Almost every failure to connect is in the plumbing rather than the app. In rough order of likelihood:
- The USB / serial button is unavailable. The connection bar says why: "USB needs the page over HTTPS or localhost", or "This browser has no Web Serial. Use Chrome, Edge or Opera on a desktop."
- No port appears in the chooser. Usually a charging cable rather than a data cable. On
Linux, the
dialoutgroup. Some clone boards' CH340 bridges need a driver on older systems. - The port will not open. Another program has it: the Arduino IDE's Serial Monitor, Thonny, mpremote, or this app in another tab. Only one program can hold a serial port.
- "No Firmata reply." The board is not running Firmata, or the baud rate does not match the sketch (57,600 for StandardFirmata, 115,200 for ConfigurableFirmata), or it is running MicroPython and you chose Firmata.
- "The board did not enter MicroPython's raw REPL. It printed: …" The quoted text says what the board is doing instead: a boot loop, a program that does not answer Ctrl-C, or a different firmware. "No reply from the board" usually means the wrong baud rate or no MicroPython at all.
- "This board runs CircuitPython." The helper needs MicroPython's
machinemodule. Load MicroPython, or use Firmata. - It hangs on "Waiting for…". Press Cancel, check the baud rate and the firmware, and connect again.
- "The board restarted (reset button or power dip)." The board reset during the session, so its pins went back to their defaults. Connect again. If it happens without anyone touching the reset button, suspect the supply: a USB port that sags when a motor, relay or long LED strip switches on.
- The pinout does not match the board. For Firmata, follow the Show the … pinout hint, or pick the right board yourself. Only the counts of pins and analog inputs can be checked, so two boards that share them look alike to the app.
Controls reference
Ranges and defaults below are the values the app ships with. Pin controls act on the next command the browser sends: a switch at once, a slider at most once every 40 ms while it is being dragged.
| Control | Symbol | Units | Range | Default | What it does |
|---|---|---|---|---|---|
| Connection | |||||
| Board | — | — | 12 boards | Arduino Uno R3 | A button with the board's picture and short name (the full name is its tooltip). Opens Choose your board, which sets the pinout and what each pin offers. Locked during a MicroPython session, which switches it to match the board's own name. Choosing or detecting the board. |
| Detect a connected board | — | — | button | — | In the board picker. USB identity, then Firmata or MicroPython, then the chip's boot loader. Writes nothing. |
| Ask the boot loader again | — | — | button | — | Shown when an ESP-style port stayed silent. Press it while holding BOOT: the app resets the board on the same port, into its boot loader, and asks it again. |
| Firmware | — | — | Firmata · MicroPython | per board | Firmata only on the Arduinos. MicroPython by default on the ESP32, ESP8266 and Pico boards. A board from another family brings its own default. |
| Connection | — | — | Simulator · USB / serial · Bluetooth | Simulator | USB / serial covers paired Bluetooth Classic modules too. Bluetooth means Bluetooth LE. |
| Baud | — | baud | 9,600 – 921,600 | 57,600 StandardFirmata, 115,200 ConfigurableFirmata and MicroPython | USB / serial only. Must match the firmware. Also sets the link budget, as baud ÷ 10 bytes a second. |
| Start simulator / Connect / Cancel / Disconnect | — | — | button | — | Cancel abandons an attempt still connecting. Disconnect releases the pins unless Options says otherwise. Setting up a real board. |
| Install firmware | — | — | button | — | Also on each picker card and in Board setup. Writes the firmware chosen in the Firmware menu: StandardFirmata or ConfigurableFirmata, or MicroPython. With Firmata chosen on an ESP32-S3 it explains why it cannot and offers MicroPython instead. Installing firmware from the browser. |
| Board setup | — | — | button | — | The same steps by hand, with Bluetooth and browser notes, the board's notes, and the pinout it is drawn from. |
| Install firmware dialog | |||||
| Firmware to install | — | — | MicroPython · Firmata (the two images by name) | the Firmware menu's choice | Shown on boards that can take both: the ESP32-WROOM-32 boards, the ESP8266 boards, and the Pico and Pico W. |
| Which board exactly? | — | — | Pico (RP2040) · Pico 2 (RP2350), the same for the W, and the S3's PSRAM type | the first | Picos and the S3: the image must match the chip, or on the S3 the module's PSRAM (none or quad, or octal). |
| Erase the whole flash first | — | — | on · off | on | ESP boards only. Recommended for a first install. Also removes files saved on the board. |
| Install: choose the port / the BOOTSEL drive | — | — | button | — | Starts the install. The board's button steps are shown above it. |
| Choose the boot-loader port | — | — | button | — | Leonardo only: the second step, within 8 s of the 1200-baud touch (or of a double press of RESET). Counts the seconds down. |
| Restart this Pico into BOOTSEL | — | — | button | — | Shown while a Pico runs MicroPython: sends it to BOOTSEL without the button. |
| Download the file | — | — | link | — | The image itself, to install by other means. |
| Sample every | Ts | ms | 1, 2, 5, 10, 20, 50, 100, 200, 500 | 10 | Shown once connected. Choices over the link budget, and 1 ms under MicroPython, are greyed. The sampling period and the link budget. |
| Pins | |||||
| Mode menu | — | — | what the pin offers | as the firmware reports | Input, Input pull-up, Input pull-down, Output, PWM, Servo, Analog in, DAC out. The pinout. |
| Output switch | — | 0/1 | LOW · HIGH | LOW | Sent at once. |
| PWM slider | D | % | 0 – 100, 1% steps | 0 | The row shows the duty and its average voltage. On the simulator D9 (or its equivalent) starts at 50%. |
| Servo slider | θ | ° | 0 – 180 | 90 | Pulse 544–2400 µs every 20 ms. |
| DAC slider | — | level | 0 – 255 | 0 | ESP32 GPIO25 and GPIO26, MicroPython only. |
| Scope button | — | — | sampled pins | — | Sends the pin to the oscilloscope. |
| All ADC pins → Analog in | — | — | button | — | Every ADC pin you have not configured becomes an analog input. |
| Options | |||||
| Release pins on disconnect | — | — | on · off | on | Firmata: outputs LOW, PWM to zero, driven and pulled-up pins to plain inputs. The MicroPython helper always releases its pins. Options. |
| ADC full scale | VFS | V | 0.5 – 12 | the board's | For AREF or a divider. Reset returns to the board default. Not used by an ESP32 under MicroPython. |
| PWM frequency | — | Hz | 50, 100, 490, 1k, 2k, 5k, 10k, 20k | 1 kHz | MicroPython only, every PWM pin. Firmata uses the board's own frequency. |
| Logic | |||||
| Scope · Logic | — | — | Scope · Logic | Scope | Which panel the lower-right cell shows; remembered. A fourth tab below 760 px, its own column from 1900 px. |
| RUN / STOP | — | — | button | stopped | RUN configures the pins and scans; STOP writes the stop values. A program with an error cannot RUN. The Logic tab. |
| Scan | — | ms | 20, 50, 100, 200, 500, 1,000 | 100 | How often the rows are evaluated. The measured interval is dt. |
| On STOP | — | — | written pins to 0 · hold last values | to 0 | What STOP writes to a written pin with no stop value of its own. |
| Presets | — | — | six programs | — | Built from the board's bench wiring. Asks before replacing rows. |
| Text / Rows | — | — | button | Rows | The program as lines of text, with Apply. Copy, import, export and clear are the icons beside it. |
| Row on/off | — | — | switch | on | An off row is kept but not scanned; its variable keeps its value. |
| Assigns | — | — | a tag or a new name | — | A pin is written; any other name is a variable. |
| Write as | — | — | what the pin offers: Output, PWM, Servo, DAC | Output for an on/off row; else DAC, else PWM, else Output | For a written pin. The editor shows the mode in use. |
| Block | — | — | Calc, PID, Filter, Ramp, OnOff, Timer, Edge, Toggle, Latch, Counter, Totalizer | Calc | The ? beside a block lists its fields. |
| Stop value | — | the pin's unit | a number | the program's | For a written pin: what STOP writes. |
| Chart | — | — | Variables · Logic lane · not charted | by block | For a variable. On/off blocks default to a lane. |
| Force | — | the tag's unit | a read tag and a value | — | While running: the program sees the value instead of the reading. STOP releases it. |
| Charts and data | |||||
| Time window | — | — | 10 s · 30 s · 1 min · 5 min | 30 s | Ten minutes of trend rows are kept whatever the window. |
| Clear | — | — | button | — | Empties the trend history and so the next CSV. The oscilloscope keeps its buffer. |
| Freeze / Resume | — | — | button | — | Stops the trend charts' time axis. Data keeps arriving. |
| CSV | — | — | button | — | The trend history, one row every 0.1 s, one column per pin and mode. |
| Log | — | — | button | — | The last 50 messages, newest first. |
| Oscilloscope | |||||
| Channel | — | — | any sampled pin | the generator, or the first analog input | Also chosen from a pin row's scope button or a chart legend. |
| Stop / Run, Single | — | — | buttons | Run | Single arms the trigger and stops on the next triggered frame. |
| Auto | — | — | button | — | Timebase for three cycles, automatic scale and level, Auto trigger. |
| Download | — | — | button | — | The channel's raw, board-timed samples, or the capture on screen, as CSV. |
| Time/div | — | s/div | 100 µs – 2 s, 1-2-5 | 100 ms | Ten divisions across. |
| Volts/div | — | V/div | Auto · 10 mV – 2 V | Auto | Eight divisions up. |
| Trigger | — | — | Auto · Normal, rising · falling | Auto, rising | Normal holds the last triggered frame when nothing triggers. |
| Level | — | V | 0 – full scale | mid | Double-click to return to mid. |
| Spectrum | — | — | on · off | on | Amplitude spectrum, 0 Hz to Nyquist, 60 dB range. |
| Fast capture (MicroPython) | |||||
| Samples | n | — | 250, 500, 1,000, 2,000, 4,000 | 1,000 | One analog channel. At most 1,000 on the ESP8266. |
| Spacing | — | µs | Fastest · 20, 50, 100, 200, 500, 1,000 | Fastest | Paced on the board. The achieved spacing is reported. |
| Capture / Back to live | — | — | buttons | — | Fast capture on MicroPython. |
| Simulated bench (simulator only) | |||||
| Potentiometer | — | V | 0 – Vs | 0.4 Vs | Wiper on A0 on the Arduinos, GP26 on the Pico, GPIO34 on the ESP32 boards, GPIO4 on the S3. |
| Generator shape | — | — | Sine · Square · Triangle · Sawtooth | Sine | On A1, GP27, GPIO35 or GPIO5, and on A0 of the ESP8266 boards. |
| Generator frequency | f | Hz | 0.1 – 500, logarithmic | 5 | Up to ten times the default Nyquist frequency, so aliasing is easy to reach. |
| Generator amplitude | Vpp | V | 0 – Vs | 0.6 Vs | Peak to peak. |
| Generator offset | Voff | V | 0 – Vs | 0.5 Vs | The output is clipped to 0–Vs. |
| RC filter | τ | ms | 10 – 1,000 | 150 | From the PWM pin (D9 on the Arduinos) to its ADC pin (A2). |
| Push button | — | — | hold to press | released | To ground, on a pin set to Input pull-up: pressed reads LOW. |
Disturbances
This app has no plant to disturb. What disturbs it is the measurement chain itself, and each of these is something a real board will show you sooner or later. The simulator shows the first and the last, and the link budget. The rest need a real board.
| Disturbance | Kind | Units | Range | Default | Effect |
|---|---|---|---|---|---|
| ADC noise | Simulated | V (1σ) | — | Vs/2048 | Half a 10-bit step of Gaussian noise on every reading, so a steady level flickers across two or three codes. Real converters add more, and an ESP32 a good deal more. |
| A floating input | Wiring | — | — | — | An input with nothing holding it reads whatever it picks up. On a real board a finger near the wire is enough to make it follow the mains at 50 or 60 Hz. The simulator's floating pins simply read LOW. |
| The supply as reference | Board | % of reading | — | — | The Uno measures against its own 5 V rail, so every reading scales with the USB supply. A different computer or a long cable shifts them all together. Measure the rail and enter it as the ADC full scale under Options. |
| ESP32 ADC non-linearity and ADC2 | Board | — | — | — | Usable to about 3.1 V and curved near both ends, and the ADC2 pins stop reading while Wi-Fi is on. |
| USB batching and browser timing | Link | ms | — | tens of ms | Bytes arrive in bursts. This does not jitter the sample times, which are spaced by the board's clock, but it delays the screen and every command. The Firmata clock calibration uses only the earliest arrivals, so only the link's minimum latency enters it, and that is constant. |
| Link congestion | Link | B/s | — | — | More data than the link carries: sets arrive less often than asked, and on Firmata the app warns when they arrive more than 15% slower. Lengthen the period. Typical over Bluetooth LE. |
| The board's oscillator | Board | % | — | — | The Uno's ATmega328P runs from a ceramic resonator, good to about half a percent, so on Firmata the app calibrates its period count against the computer's clock (by up to ±3%). MicroPython times come from the ESP and Pico boards' crystals. |
| Aliasing | Sampling | Hz | — | — | Not a disturbance of the signal but of its meaning: anything above half the sample rate arrives as something slower. The cure is a faster rate or an analog filter before the pin. |
Scenarios
There is no scenario selector. These are set-ups to make by hand, in order, and every one except 11 and 12 runs on the simulator with the default Uno unless it says otherwise.
| # | Scenario | What it sets up and what to look for |
|---|---|---|
| 1 | The bench, wired | Sets: Uno, Simulator, Start simulator. Look for: A0 near 2.00 V, A1 swinging, A2 near 2.51 V (50% PWM through the filter), D2 HIGH on its pull-up, and 100 sets/s · 1.8 kB/s of 5.8. |
| 2 | Measure the generator | Sets: the oscilloscope on A1, then Auto. Look for: about 5.00 Hz and 200 ms, about 3.0 Vpp, a mean of 2.5 V and Sampling about 100 Hz, Nyquist about 50 Hz. |
| 3 | Alias it | Sets: generator to 70, then 95, then 100 Hz. Look for: 30 Hz with a Nyquist warning, then 5 Hz with no warning, then a flat line. Three wrong answers, two of them silent. |
| 4 | Undo it with a faster rate | Sets: A0 and A2–A5 to Input, then Sample every 1 ms, generator at 70 Hz. Look for: 1,000 sets a second and the scope reading about 70 Hz. One analog input is all the link allows at 1 ms. |
| 5 | Watch a filter settle | Sets: RC τ = 1 s, D9 from 0% to 100%. Look for: A2 rising along a first-order curve, 63% of the way (3.16 V) about one second after it starts to move. |
| 6 | PWM is an average | Sets: D9 at 0, 25, 50, 75 and 100%. Look for: A2 settling at D × 5 V each time, with 50% giving 2.51 V because the Uno's PWM has 255 steps. |
| 7 | Active-low button | Sets: hold the bench button, then set D2 to plain Input. Look for: D2 LOW while pressed on the Logic chart. As plain Input it reads LOW whatever the button does: in the simulator a floating pin reads LOW, on a real board it would wander. |
| 8 | A comparator makes PWM | Sets: A1 to Input, generator Triangle at 2 Hz, 3.0 Vpp, offset 3.0 V. Look for: a square wave on the Logic chart and a duty near 67% on the scope, from ½ + (3.0 − 2.5)/3.0. |
| 9 | The Mega's budget | Sets: Board Mega 2560, Start simulator, then analog pins to Input one at a time. Look for: "Sampling period raised to 20 ms" at connect, and the shortest choice falling to 10, 5, 2 and 1 ms as inputs are freed. |
| 10 | Fast capture | Sets: Board Pico (MicroPython), generator at 300 Hz, then Capture. Look for: a flat stream (300 is three times 100 Hz), then a 300 Hz sine sampled 12 µs apart. |
| 11 | A real board | Sets: real hardware with standard firmware, USB / serial, Connect. Look for: the firmware's own name and pin count, the same rate figures as the simulator, and readings that move when you touch the circuit. |
| 12 | Mains on a floating pin | Sets: real board, one analog input with a loose jumper wire, 10 ms then 1 ms. Look for: 50 or 60 Hz pickup when you hold the wire, aliased at 10 ms (60 Hz reads 40) and correct at 1 ms. |
| 13 | Blink from one row | Sets: Logic, Blink the LED, RUN. Look for: D13 with a LOGIC chip, flipping every half second on the Logic chart; then edit the row to square(2, 0.1) while it runs. |
| 14 | A loop on the RC filter | Sets: Logic, Hold the RC voltage with PID (sets τ to 1 s), RUN. Look for: A2 settling from 2.51 V to within 0.02 V of the potentiometer's 2.00 V about 5 s after RUN, with no overshoot beyond the ADC noise; a drag of the potentiometer to 3.5 V followed within 0.02 V in about 4 s; then A2 holding within about ±0.01 V. |
| 15 | On/off control with hysteresis | Sets: Logic, Thermostat with hysteresis (sets τ to 1 s), RUN; the oscilloscope on A2. Look for: A2 cycling between about 31 and 50 °C around the 40 °C setpoint, one cycle every 0.7 s or so, with Heat as a dotted lane. The swing passes the 35/45 band by about 5 °C each way, because a reading, a scan and a write each take time. Narrow the band to ±0.5: the cycle quickens to about 0.45 s but the swing hardly shrinks. |
Reading the charts and the scorecard
The Voltage chart draws analog inputs as solid lines and PWM and DAC outputs
as dashed step lines at their average voltage (D·Vs for PWM). Its
axis runs from 0 to the board's full scale or logic level, whichever is higher, rounded up to a
whole volt.
The Logic chart gives each digital pin its own lane, as a logic analyser does: inputs solid, outputs dashed. Outputs appear once you have used them, so StandardFirmata's dozen idle LOW outputs stay off the chart, and out of the CSV.
Each trend row records every pin's mode as well as its value. A pin that changes mode starts a new line, and its earlier values keep the unit they were taken in.
The trends are sampled too. A trend row is taken every 0.1 s on the computer's clock, and the line is the last reading in each row. Anything faster than a few hertz aliases on the trend just as it would on a slow ADC. So the Voltage chart also shades the range of every sample that arrived during each tenth of a second, whenever that range exceeds 20 mV. A 5 Hz sine therefore draws as a ragged line inside a solid band, and the band is the truth. For anything that moves within a second, use the oscilloscope.
- Time window: 10 s, 30 s (the default), 1 min or 5 min. Ten minutes of rows are kept, and each chart draws at most 600 points, thinning longer windows.
- The legend shows each pin's latest value. Clicking a sampled pin sends it to the oscilloscope.
- Eight colors. The charts draw up to eight pins, each keeping its color for as long as it stays on the chart. Pins you configured come first: when all eight colors are taken, a pin the firmware reports on its own (StandardFirmata streams every analog pin from the start) gives its color up to one you set. Any pins left over are counted in a note under the charts and are still in the CSV. Servo outputs are not charted at all (their unit is degrees), but are in the CSV.
- Freeze stops the charts' time axis so you can read them. Samples keep arriving, and Resume catches up. The oscilloscope has its own Stop.
- Clear empties the trend history, which is also what the CSV exports. It does not touch the oscilloscope's buffers.
- Readings as a table lists every sampled pin, its mode, its latest reading and how many samples the oscilloscope holds for it, for anyone who prefers numbers to lines.
The status line and the log are the other reading surface. The rate beside Sample every should read the sets per second you asked for. If it reads fewer, the link or the board is not keeping up.
Logged data and CSV export
There are two exports, and they answer different questions.
CSV in the header downloads the trend history as <board>-<date and
time>.csv: one row every 0.1 s for up to the last ten minutes, and one column for
every pin and mode that appears in that history, named by the pin's silkscreen label. A
pin used two ways gets two columns (the three input modes share one), and StandardFirmata's default
LOW outputs are left out until you use them. Each cell is the last reading in that tenth of
a second, and a cell is empty where the pin had no reading, or was in another mode.
The oscilloscope's download button saves the raw stream of the channel on screen as
<label>-samples-<date and time>.csv: every sample the oscilloscope still
holds for that pin (up to 65,536, and none from before its last change of mode), each with its
board-timed time. With a fast capture on screen it
saves the capture instead, as <label>-capture-…csv, timed from its first
reading. This is the file to use for anything faster than the trend.
| Column | Meaning | Units |
|---|---|---|
| Trend CSV (header button) | ||
time_s | Session time when the row was taken, on the computer's clock. One row every 0.1 s. | s |
<label>_V | Analog input: the last reading in that row, for example A0_V or GP26_V. Four decimals. | V |
<label>_in | Digital input level, in any of the three input modes. | 0/1 |
<label>_out | Digital output level as commanded. | 0/1 |
<label>_pwm_pct | PWM duty cycle as commanded. | % |
<label>_dac_V | DAC level times the logic supply. | V |
<label>_servo_deg | Servo angle as commanded. | ° |
<variable> | A Logic program variable, after the pin columns, headed by its name: four decimals, or 0/1 for one charted as a lane. Empty while the program is stopped. | its own |
| Raw samples (oscilloscope button) | ||
t_s | Board-timed sample time: seconds since the connection started, or since the first reading of a capture. Six decimals. | s |
<label>_V | An analog sample, five decimals. | V |
<label>_level | A digital sample: on Firmata one row per reported change, on MicroPython one per sampling period. | 0/1 |
If something looks wrong
| Symptom | Most likely cause | What to do |
|---|---|---|
| The frequency reads lower than the generator's dial | Aliasing: the signal is above the Nyquist frequency, half the sample rate | Compare the dial with the Sampling figure. Shorten the period (read fewer analog inputs to make room), or use a fast capture on MicroPython. The oscilloscope. |
| A fast signal shows as a flat line | Its frequency is a whole multiple of the sample rate, so every sample lands at the same point of the cycle | The same cure as any alias. 100, 200 and 300 Hz all look like a constant at the default 10 ms. |
| No Nyquist warning, but the reading is wrong | The warning judges the frequency it measures, and an alias far beyond Nyquist measures low | Know the signal's bandwidth before trusting a sampled frequency. That is the lesson of exercise E2. |
| "Sampling period raised to … ms" | The link cannot carry that many analog inputs at the period you had | Expected on a Mega (16 inputs) and over Bluetooth. Give unused analog pins another mode, then choose a faster period. The sampling period and the link budget. |
| "Samples arrive slower than the sampling period asks" | The link cannot carry the rate, usually over Bluetooth | Lengthen the sampling period or read fewer analog pins. |
| "The board restarted (reset button or power dip)" | The board reset during the session, and its pins went back to their defaults | Connect again. If nobody pressed reset, suspect the supply sagging when a load switches on. |
| A pin's mode shows — right after you chose one (MicroPython) | The board refused the mode and released the pin | The board's error is in the log. Choose a mode the pin offers. |
| The trend looks jagged but the scope looks clean | Trend rows are taken every 0.1 s and show the last reading, so a fast signal aliases on the trend | Read the shaded band, which is the full range of samples, or use the oscilloscope. |
| A pin is configured but not on the charts | All eight colors are held by pins you configured. Servo outputs are never charted | The note under the charts counts what was left out. Use the oscilloscope, the readings table or the CSV. |
| An input reads random values with nothing connected | A floating input | Use Input pull-up (or pull-down), or wire a resistor. The simulator's unconnected pins read LOW, a real board's do not. |
| An ESP32 analog pin reads nothing while Wi-Fi is on | ADC2 pins cannot be read while the radio is active | Use an ADC1 pin: GPIO32–39 on the ESP32, GPIO1–10 on the S3. The pinout marks ADC2 pins with !. |
| An ESP32 reading stops rising near 3.1 V | The ADC's widest range ends there and is non-linear near both ends | Keep signals away from both ends of the range, scaling them down with a divider if necessary. |
| Arduino readings are a few percent off | The Uno measures against its own 5 V supply, and USB supplies vary | Measure the 5V pin with a meter and enter it as the ADC full scale under Options. Do the same for a reference on AREF. |
| PWM on D9 or D10 of an Uno or Nano stopped working | Setting any pin to Servo starts the Servo library, which takes the timer behind D9 and D10 | Use other PWM pins while a servo is attached. The simulator does not model this. |
| A step on the trend starts later than the click | Slider commands are coalesced (at most one per pin every 40 ms) and then travel the link | Measure a response from where the trace starts to move, not from the click. |
| Outputs went LOW, or to inputs, on disconnect | The app releases pins when it disconnects | By design. On Firmata it can be turned off under Options. The MicroPython helper always returns its pins to inputs. |
| The PWM frequency menu is greyed out | The board runs Firmata | Firmata uses the board's own PWM frequency. Under MicroPython the menu sets every PWM pin. |
| The ESP32 or ESP8266 will not boot with the circuit attached | A strapping pin is held at the wrong level at reset | Move that connection to a pin without the ! caution, or release it during reset. |
| An ESP install stops at "Connecting to the ESP boot loader", or fails to connect | The chip did not enter its ROM boot loader by itself. The error says what esptool's boot log showed | Hold the BOOT button (FLASH on a NodeMCU, a D3–G jumper wire on a D1 mini) before pressing Install, and keep holding it until the progress bar moves. On a DOIT DevKit V1 or a generic 38-pin board, plan on it. Installing firmware. |
| Detection says "Probably an ESP board (… bridge), but neither its firmware nor its boot loader answered" | The board's automatic reset into the boot loader does not work here, often behind a CH9102 or CH340 | Hold the BOOT button, press Ask the boot loader again, and let go when the board is named. Hold BOOT the same way when installing. |
| The Leonardo's boot-loader port never appears, or "This port is not the boot loader" | The 1200-baud touch did not restart it, or the 8 s window closed before the port was chosen | Press RESET twice quickly, then Choose the boot-loader port at once and pick "Arduino Leonardo (bootloader)". |
| "Firmata cannot be installed from the browser on the …" | The board is an ESP32-S3, where ConfigurableFirmata 3.3 numbers the pins as the original ESP32's | Install MicroPython instead, which the dialog offers. A build of your own has the same limits. |
| The Firmata image is refused on a Pico 2 drive | ConfigurableFirmata 3.3 does not build for the RP2350, and the image is for the RP2040 | Install MicroPython on a Pico 2 or Pico 2 W. |
| "No Arduino boot loader answered at 115200 or 57600 baud" | Another program holds the port, the wrong port was chosen, or the board did not reset into its boot loader | Close the Arduino IDE, Thonny or another tab, choose the right port, and press RESET just as "Waiting for the boot loader" appears. |
| "This board has an ATmega2560, but the … uses an ATmega328P" (or the ESP equivalent) | The chosen board does not match the chip on the port | Choose the matching board, or let Detect a connected board choose it. |
| No Pico drive to choose, or "… is not a Pico in BOOTSEL mode" | The board is not in BOOTSEL mode, or another drive was chosen | Unplug it, hold BOOTSEL while plugging it back in, and choose the drive named RPI-RP2 or RP2350. Or use Restart this Pico into BOOTSEL while MicroPython runs. |
| "That drive is an RP2350 in BOOTSEL mode, but this image is for an RP2040" | A Pico 2 with the Pico image chosen, or the other way round | Change Which board exactly? to the matching chip. |
| "This browser cannot write to a drive" | No File System Access API | Use Chrome or Edge on a desktop, or Download the file and copy it onto the drive yourself. |
| Detection says "Nothing recognised on this port" | The wrong port, a charging cable, or an ESP board that needs BOOT held to reach its boot loader | Check the port and the cable, then hold BOOT while detecting, or choose the board by hand. |
| A Mega takes several seconds to connect | The app listens before asking, so as not to stall the Mega's boot loader | Expected. It connects once the sketch announces itself. |
| Connection problems | Cable, browser, permissions or firmware | Work through When the connection will not work. |
4. Model
There is no plant model in this app. What it has instead is a chain from a voltage on a pin to a number on the screen: the firmware's protocol, the link, the board's clock, the oscilloscope's arithmetic, and, when no hardware is connected, a simulated bench standing in for the circuit. This section gives each link of that chain exactly as the app implements it.
Firmata: the messages the app uses
Firmata is MIDI-shaped. A byte with its top bit set starts a message and the data bytes that follow carry 7 bits each, so a 10-bit reading travels as two data bytes after a command byte. The app speaks Firmata protocol 2.x as StandardFirmata and ConfigurableFirmata implement it:
| Message | Bytes | Used for |
|---|---|---|
REPORT_VERSION, REPORT_FIRMWARE | F9, sysex 79 | Identifying the firmware. The app first listens for up to 4.5 s for the board to send them unasked (only Firmata bytes, 0x80 and above, end the wait early, not boot text), then asks once a second, for up to 10 s in all. Sent unasked later in a session, they mean the board restarted, and the session ends. |
CAPABILITY_QUERY / RESPONSE | sysex 6B / 6C | The modes each pin supports and their resolution in bits (ADC 10 on an Uno, PWM 8). |
ANALOG_MAPPING_QUERY / RESPONSE | sysex 69 / 6A | Which pin carries which analog channel. |
PIN_STATE_QUERY / RESPONSE | sysex 6D / 6E | Each pin's mode and output state at connect. |
SAMPLING_INTERVAL | sysex 7A | The sampling period in milliseconds. |
REPORT_ANALOG, REPORT_DIGITAL | C0+channel, D0+port | Switching streaming on or off for an analog channel or an 8-pin port. All of it is switched off on disconnect. |
ANALOG_MESSAGE | E0+channel, LSB, MSB | An analog reading, 3 bytes. Also PWM duty and servo angle writes on pins 0–15. |
EXTENDED_ANALOG | sysex 6F | PWM and servo writes on pins above 15 (the Mega, the ESP boards). |
DIGITAL_MESSAGE | 90+port, LSB, MSB | Input changes from the board, one 8-pin port at a time. Output writes on firmware before 2.5. |
SET_PIN_MODE, SET_DIGITAL_PIN_VALUE | F4, F5 | Choosing a pin's mode and driving one output pin. A switch to Output is followed by an explicit LOW, and releasing pins on disconnect is a LOW, a zero duty and a switch to INPUT. |
SERVO_CONFIG | sysex 70 | Pulse range 544–2400 µs, sent the first time a pin becomes a servo. |
STRING_DATA | sysex 71 | Text from the firmware, shown in the log as "Board says: …". |
SYSTEM_RESET | FF | Deliberately not sent. StandardFirmata's reset makes pins outputs without clearing the AVR output latch, so a HIGH output would stay HIGH and a pull-up input would become a HIGH output. |
MicroPython: the helper's line protocol
Once agent.py is running it is a plain text protocol, one line per command or
report, readable in any serial terminal:
| Direction | Line | Meaning |
|---|---|---|
| to board | I <µs> | Sampling period in microseconds (500 at least). |
| to board | M <pin> <mode> | Mode: OFF IN PU PD OUT PWM ADC DAC. Outputs are built LOW and PWM at zero duty. A servo is PWM at 50 Hz. A mode that cannot be made leaves the pin an input. |
| to board | W, P, F, D | Output level 0/1, PWM duty 0–65535 (duty_u16), PWM frequency, DAC level 0–255. |
| to board | B <pin> <n> <µs> | Fast capture: n ADC readings (4,000 at most, 1,000 on the ESP8266), µs apart, 0 for back to back. |
| to board | R | Release every pin the helper configured. |
| from board | HELLO micropython <uv|u16> <Hz> | The helper started. uv means the ADC reports calibrated microvolts (read_uv, the ESP32), u16 16-bit counts (read_u16). |
| from board | CH <pin> … | The sampled pins, in the order the sample lines use. |
| from board | S <dt_µs> <v> … | One sample set, with the microseconds since the previous set. |
| from board | BS, BD, BE | A capture: start (pin, count, microseconds from the first reading to the last), data lines of 32 values, end. |
| from board | OK … / ERR … | Each command's reply, applied whenever it arrives. An error, such as an ADC on a pin without one, is shown in the log. |
| from board | MicroPython v…, rst:, ets …, MPY: soft reboot | Not the helper at all: a boot banner, meaning the board restarted. The session ends. |
The helper samples on a fixed period measured with ticks_us(). If it falls behind
it skips the missed periods rather than sending a burst of late ones, and the next
dt covers the gap, so the time base never loses time. On the ESP32 it sets every ADC
to 11 dB attenuation, the widest range. It starts every PWM pin at 1 kHz, except on an
RP2 board when another PWM pin already uses the same slice, whose frequency it then leaves alone.
Its finally block releases every pin it configured however it stops, including on
Ctrl-C.
The boot loaders: what Install firmware and Detect speak
On the Arduinos the app speaks the STK500 protocols as avrdude does. STK500 v1 (Optiboot
on the Uno and recent Nanos, ATmegaBOOT on older Nanos) uses one-byte commands ended by
CRC_EOP (0x20), each answered by STK_INSYNC
(0x14) … STK_OK (0x10): GET_SYNC,
READ_SIGN, ENTER_PROGMODE, LOAD_ADDRESS (in 16-bit words),
PROG_PAGE, READ_PAGE and LEAVE_PROGMODE. STK500 v2 (the
Mega 2560) frames every message as 1B, a sequence number, a two-byte length,
0E, the body and an XOR checksum of everything before it, and every reply carries a
status byte, 00 for OK. Addresses past 64 K words set bit 31 for extended
addressing. The Leonardo's boot loader, Caterina, speaks AVR109 over the chip's own USB:
single-letter commands, most answered by a carriage return. S returns its name
("CATERIN"), s the signature (low byte first), b its block size,
P and L enter and leave programming, e erases,
A sets a word address, B … F writes a block,
g … F reads one back, and E starts the sketch. It runs only
for 8 s after a reset, as a different USB device from the sketch, which is why the Leonardo
install needs a second port. The sketch arrives as Intel HEX, whose line checksums are checked before anything is
sent, and is written in whole pages padded with 0xFF. The ESP boards are written with
esptool-js and the Picos by copying a UF2 file, whose 512-byte blocks the app checks for the UF2
magic numbers and the chip family before writing.
Detect chooses the order of its questions from the USB identity, and stops at the first answer:
| USB identity | Questions, in order |
|---|---|
| Arduino, Leonardo boot loader (product 0036 or 0037) | The Caterina boot loader (AVR109) |
| Arduino, Leonardo sketch (product 8036) | Firmata |
| Arduino, any other (vendor 2341 or 2A03) | Firmata at 57,600, then the boot loader (STK500 v2 if the product id says Mega, else v1) |
| Raspberry Pi (2E8A) | MicroPython, then Firmata |
| Espressif native USB (303A) | MicroPython, Firmata at 115,200 then 57,600, the ESP ROM boot loader |
| CP210x, CH9102 | MicroPython, Firmata at 115,200 then 57,600, the ESP ROM boot loader |
| CH340 | Firmata at 57,600 then 115,200, MicroPython, the Arduino boot loader (STK500 v1, then the Mega's v2), the ESP ROM boot loader |
| FTDI | Firmata at 57,600, the Arduino boot loader |
| Adafruit | MicroPython |
| Anything else, or Bluetooth | Firmata at 57,600 then 115,200, MicroPython, the Arduino boot loaders (v1, then v2), the ESP ROM boot loader |
When nothing answers: an Arduino identity is offered as the board its product id names (for a Leonardo, with the advice to press RESET twice and detect again on the boot loader's port), an ESP-style bridge (CP210x, CH9102, CH340 or Espressif's native USB) as "Probably an ESP board" with the advice to hold BOOT and Ask the boot loader again, and a Raspberry Pi identity as the Pico family.
Modeling assumptions
The simulated bench is a teaching circuit, not a model of a particular board's analog front end. These are the places where it is simpler than the hardware it stands in for, and section 5 lists the consequences.
- A PWM pin is its average. The bench treats a PWM output as the steady voltage
D·Vs. There is no carrier, so neither the RC filter's output nor an ADC reading of a PWM pin shows ripple or switching edges. - The RC filter is an ideal first-order lag driven by that average, with no loading of the pin and no ADC input current.
- The ADC is ideal apart from noise and rounding. Readings are the pin voltage plus Gaussian noise of half a 10-bit LSB at the board's supply (2.4 mV on 5 V boards, 1.6 mV on 3.3 V boards), clipped to full scale and rounded. No ESP32 non-linearity, no ADC2 and Wi-Fi conflict, no reference drift.
- A digital input switches at exactly half the supply, with no hysteresis and no noise. An unconnected input reads LOW. A real one floats.
- The function generator is exact. Its waveform is evaluated at each sample's own time, so its frequency is as exact as the simulated board's clock. Its output is clipped to 0–
Vs, so it can never overdrive a pin. - The links are modeled by their speed only. The simulated Firmata link is budgeted at 5,760 bytes a second, MicroPython on an ESP board at 11,520, and on a Pico without limit. Bytes arrive in batches as they would from a USB port, but nothing is ever lost or corrupted.
- Some firmware details are not modeled. The Servo library's hold on D9 and D10, the Uno's 980 Hz PWM on D5 and D6, PWM resolution limits at high frequency, and the time a real ADC conversion takes.
Equations
ADC conversion and the size of one step
On Firmata, b comes from the capability report (10 on the AVR boards). VFS is the board's default unless changed under Options: 5 V on the Arduinos, 3.3 V on the ESP32 and Pico, 3.2 V on the ESP8266 boards. Under MicroPython read_u16 always returns 0–65535, so b = 16 in this formula whatever the converter's native resolution. On the ESP32 read_uv returns calibrated microvolts and the full scale is not used. One LSB is 4.89 mV for 10 bits at 5 V and 0.81 mV for 12 bits at 3.3 V.
PWM: average voltage and duty resolution
d is the slider's fraction and p the PWM resolution: 8 bits on the AVR boards, so 50% is really 128/255 = 0.502 and the RC filter settles at 2.51 V, not 2.50. The MicroPython helper writes 16-bit duty_u16. Firmata on the ESP and Pico boards uses whatever resolution the capability report gives.
Servo pulse
Firmata sends SERVO_CONFIG with these limits and then the angle, and the firmware's Servo library makes the pulse. The MicroPython helper makes it as 50 Hz PWM with this duty. A pin entering servo mode is sent 90°.
The simulated RC filter, stepped exactly
The update is the exact solution for a duty held constant over Δ, and the bench applies it whenever the filter is read or the drive changes, so the result does not depend on how often it is evaluated. A step reaches 63.2% of its change at t = τ, 86.5% at 2τ and 99.3% at 5τ. A real RC filter on a PWM pin also ripples, by about VsD(1−D)TPWM/τ peak to peak when τ is much longer than the PWM period: 17 mV for 50% duty at 490 Hz with τ = 150 ms. The simulator leaves that out.
The function generator
Read as a digital input, the generator crosses the half-supply threshold, so a triangle with its offset moved away from Vs/2 becomes a square wave whose duty cycle is ½ + (Voff − Vs/2)/Vpp. That is how a comparator makes PWM, and exercise E6 measures it.
Aliasing
At the default fs = 100 Hz: 70 Hz reads 30, 95 Hz reads 5, 130 Hz reads 30, and 100, 200 or 300 Hz read 0, a flat line. The oscilloscope warns when the measured frequency exceeds 0.4 · fs/2, fewer than five samples per cycle, which catches signals near the limit but not aliases that land low.
The link budget
na and nd are the analog and digital inputs. The result is raised to the next choice in the Sample every menu, with a floor of 1 ms on Firmata and 2 ms on MicroPython. Rlink is 5,760 B/s at 57,600 baud, 2,000 for a Nordic UART, 960 for an HM-10, and unlimited for MicroPython on a Pico's native USB. Firmata's digital inputs are reported on change, so they do not appear in Bset.
The board clock
On Firmata, k counts sample sets: a channel number not above the previous one starts a new set. The calibration c is the computer's time per counted period. A set can arrive late but never early, so the app takes, in each two-second window, the smallest value of the arrival time minus k·P: the board's clock plus the link's minimum latency, which is constant. The slope of that lower envelope against the first window's gives c. It is first applied once 8 s of board time separate the windows, recomputed every 2 s, clamped to ±3%, and applied as a rate from the current sample on, so it never moves a sample backwards. The windows start again whenever the period count is disturbed. If c exceeds 1.15 the app warns that samples arrive slower than the sampling period asks. On MicroPython, Δti are the microsecond deltas in the S lines. The anchor t0 is the computer's clock at the first sample. Firmata restarts the clock from the computer's after a channel is switched on (StandardFirmata sends that channel once out of schedule), after a gap in the data, or when the two are more than 2 s out of step. MicroPython does so when they differ by more than 1 s. A Firmata digital change is stamped at the middle of the sampling period in which it arrived while analog samples are flowing, and at its arrival time when none are.
Level crossings, frequency and duty cycle
Crossings of the mid level L = (min + max)/2 (0.5 for a digital input) are interpolated between samples. A rising crossing only counts after the signal has been below L − h, with hysteresis h = 10% of Vpp (0.25 for a digital input), so noise on a slow edge counts once. M rising crossings over at least the last two seconds give the frequency, and each of the P rising edges followed by a falling edge before the next rising one gives a high time. An analog signal needs more than 20 mV of swing to have a frequency at all.
Amplitude measurements
Over the samples on screen. Vrms includes the mean, as a true-RMS meter on DC+AC does. The AC part alone is √(Vrms² − v̄²). The 5 Hz default sine, 3 Vpp on 2.5 V, gives √(2.5² + 1.5²/2) = 2.716 V.
The spectrum
The newest samples are resampled onto a uniform grid at their median spacing (sample-and-hold for a digital input), the mean is removed, a Hann window w is applied, and a radix-2 FFT of n points is taken, n being the largest power of two up to 4,096 that fits the record. Ak is the amplitude in volts peak, corrected for the window's gain.
The Logic program's PID block
The velocity form the collection's controllers use. The running sum S of the proportional and derivative increments is never clamped, so it always equals P + D for the gains in force: a gain entered while the program runs applies at once, and a proportional-only loop cannot drift off a limit on noise. Only the integral I is limited, by back-calculation against the clamp with tracking time τI, and only when there is an integral. Δtk is the measured scan interval, b the bias, and P̃V the measurement through a first-order lag of time constant dFilter (none by default), so the derivative acts on the measurement and a setpoint step gives no kick. On its first scan the block sets S = P and I = u0 − b − P from the pin's present output u0, and in MAN it sets I = uman − b − S every scan, so both RUN and the return to AUTO are bumpless. The PID preset is tuned by IMC for the bench's RC filter at τ = 1 s: the plant gain is K = Vcc/100 volts per percent, so with τc = τ, Kc = τ/(K τc) = 20 %/V on a 5 V board (30 on 3.3 V boards) and τI = τ = 1 s.
Locating the peak between bins
A parabola through the logarithms of the strongest bin k* and its two neighbors, which places a clean tone to a small fraction of a bin. The search skips the two lowest bins, so a slow drift is not reported as the peak.
Variables
These are the quantities that move while a board is connected.
| Symbol | Meaning | Units | Where it appears |
|---|---|---|---|
| V | Pin voltage | V | What an analog input measures, and what an output drives. |
| N | ADC reading | counts | The integer the converter returns, before the app scales it to volts. |
| D | Duty cycle | 0–1 | Fraction of each PWM period spent HIGH. The pin row shows it as a percentage and an average voltage. |
| θ | Servo angle | ° | Sent as a pulse width, 544–2400 µs. |
| VRC | RC filter output | V | Simulator only: the PWM average after a first-order lag, read on an ADC pin. |
| tk | Sample time | s | On the board's clock, anchored to the computer's at the first sample. |
| fs | Sample rate | Hz | 1/Ts for the stream, 1/spacing for a capture. Shown as Sampling. |
| f, fa | Signal and apparent frequency | Hz | What the signal is, and what its samples show. Equal only below Nyquist. |
| Vpp, v̄, Vrms | Amplitude measurements | V | Over the samples on the oscilloscope screen. |
| Ak | Spectrum amplitude | V peak | One per FFT bin, from 0 Hz to Nyquist. |
Parameters and default values
These are fixed in the app or set from its menus. The default column is what the app loads with.
| Symbol | Name | Default | Range | Units | Meaning |
|---|---|---|---|---|---|
| Sampling and the link | |||||
| Ts | Sampling period | 10 | 1, 2, 5, 10, 20, 50, 100, 200, 500 | ms | One period for every input. Raised automatically when the link budget requires it. |
| — | Link headroom | 25 | fixed | % | Share of the link kept free for commands, replies and jitter. |
| Rlink | Serial link capacity | baud ÷ 10 | 960 – 92,160 | B/s | 5,760 at 57,600 baud, 11,520 at 115,200. Bluetooth LE: 2,000 (Nordic UART) or 960 (HM-10). |
| — | Shortest period | 1 / 2 | fixed | ms | Firmata / MicroPython. The helper itself accepts 0.5 ms, the app does not ask for it. |
| — | Slider command interval | 40 | fixed | ms | A dragged PWM, servo or DAC slider sends at most one command per pin this often. |
| — | Firmata handshake | 10 | fixed | s | In all. The first 4.5 s the app only listens (0.3 s on a board with its own USB), unless Firmata traffic arrives first. Then it asks once a second. Long enough for a Mega's boot loader to hand over. |
| Firmata clock calibration | |||||
| c | Calibration | 1 | 0.97 – 1.03 | — | Computer seconds per counted period, from the earliest arrival in each two-second window. Applied once 8 s of board time are measured, recomputed every 2 s. |
| — | Slow-link warning | 1.15 | fixed | — | Sets arriving more than 15% slower than the period asks. |
| — | Clock restart | 2 | fixed | s | Out of step by more than this (the tab slept, the link stalled), the clock restarts from the computer's. 1 s on MicroPython. |
| Options | |||||
| VFS | ADC full scale | board default | 0.5 – 12 | V | Returns to the default when the board changes. |
| — | PWM frequency | 1,000 | 50 – 20,000 | Hz | MicroPython only. Eight choices. |
| Buffers and charts | |||||
| — | Samples kept per pin | 65,536 | fixed | samples | The oscilloscope's buffer: about a minute at 1 kHz. |
| — | Trend row interval | 0.1 | fixed | s | On the computer's clock. Each row holds the last reading and, for analog pins, the range of samples in that row. |
| — | Trend history | 6,000 | fixed | rows | Ten minutes. Older rows are dropped, and the CSV exports what is kept. |
| — | Trend window | 30 | 10, 30, 60, 300 | s | At most 600 points drawn per chart. |
| — | Charted pins | 8 | fixed | pins | One color slot each, kept for as long as the pin stays on the chart. |
| — | Log | 50 | fixed | messages | The newest are kept. |
| Oscilloscope | |||||
| — | Time per division | 0.1 | 100 µs – 2 s, 1-2-5 | s/div | Ten divisions across. The trigger sits at the center. |
| — | Volts per division | Auto | 10 mV – 2 V, 1-2-5 | V/div | Eight divisions up. Auto fits the swing in about six. |
| h | Measurement hysteresis | 10 | fixed | % of Vpp | 0.25 for a digital input. The trigger uses 8% of the swing, at least 5 mV. |
| — | Frequency window | 2 | fixed | s | At least this much data, so slow signals span several cycles. |
| — | Smallest swing with a frequency | 20 | fixed | mV | Analog inputs. Below it a reading is treated as a steady level with noise. |
| n | FFT points | ≤ 4,096 | powers of two | points | The largest that fits the newest samples. Resolution fs/n. |
| — | Nyquist warning | 40 | fixed | % of Nyquist | Fewer than five samples per cycle of the measured frequency. |
| — | Fast capture length | 1,000 | 250 – 4,000 | samples | MicroPython only. At most 1,000 on the ESP8266. |
| — | Fast capture spacing | Fastest | Fastest, 20 – 1,000 | µs | Measured on the board and reported as it happened. |
| Simulated bench | |||||
| Vs | Supply and logic level | 5 or 3.3 | per board | V | The rail every bench signal lives between. |
| — | Potentiometer | 0.4 | 0 – 1 | × Vs | 2.00 V on a 5 V board, 1.32 V on a 3.3 V board. Not on the ESP8266 boards, which have one ADC. |
| f | Generator frequency | 5 | 0.1 – 500 | Hz | Logarithmic slider, three significant figures. |
| Vpp | Generator amplitude | 0.6 | 0 – 1 | × Vs | 3.0 Vpp on a 5 V board, 1.98 Vpp on 3.3 V. |
| Voff | Generator offset | 0.5 | 0 – 1 | × Vs | The waveform is clipped to 0–Vs. |
| τ | RC filter time constant | 150 | 10 – 1,000 | ms | Not on the ESP8266 boards. |
| σ | ADC noise | Vs/2048 | fixed | V | Half a 10-bit LSB: 2.4 mV at 5 V, 1.6 mV at 3.3 V. |
| — | Fastest simulated capture | 12 / 30 / 50 | fixed | µs | Pico / ESP8266 / ESP32. |
Numerical method and timing
The board sets the time, the browser only displays it. Every stream sample carries a time from the board's clock (equations above), and every oscilloscope measurement uses those times. The browser's timers decide only when things are drawn, and when a trend row is taken: trend rows every 0.1 s on the computer's clock, the oscilloscope redrawn up to about 30 times a second with its measurements recomputed every 0.25 s. A slow or busy browser draws less often. It hardly touches the numbers: the Firmata clock calibration uses only the earliest arrival in each window, which a busy browser cannot make earlier.
The simulated StandardFirmata runs its loop once per simulated millisecond, checking digital inputs on every pass and sending analog inputs once per sampling period, exactly as the sketch does. It is driven from a 10 ms browser timer, so its bytes arrive in 10 ms batches, like a real USB link. It resets when the port opens and answers 1.2 s later on the AVR boards (0.3 s on the others). After the tab has been asleep for more than two seconds it resumes from the present rather than replaying the gap.
The simulated MicroPython board plays the friendly and raw REPLs with raw-paste flow
control and a soft reset, prints a boot log first on the ESP boards, and answers the
helper's line protocol from a 5 ms timer, writing each sample line at its exact scheduled time
on the board's microsecond clock. It does not run Python. It recognizes the two programs the app
sends and plays their part, and the real agent.py is tested separately.
The bench is evaluated at each sample's own time. The generator is a closed-form function of time, and the RC filter is advanced with the exact exponential update, so neither depends on the timer rates above.
How the model is checked
The app's unit tests check each link of the chain separately:
- The oscilloscope arithmetic on synthetic signals with known answers: the frequency of a sine within 0.1%, with its swing and mean, the duty cycle of a 25% pulse train, no frequency for noise on a steady level, each noisy edge counted once, a digital input measured from its change events alone, the trigger, a tone between FFT bins located within 0.05 Hz with its amplitude, and a 70 Hz tone sampled at 100 Hz appearing at 30 Hz.
- The Firmata codec against the protocol's documented byte layouts, including messages split across chunks, resynchronizing after noise, and abandoning a truncated sysex.
- Both sessions against the simulated boards: identification, board-clock streaming that recovers the generator's frequency, outputs, a pulled-up button, PWM through the RC filter, the raw REPL through a boot log, captures, refused modes, and releasing pins on disconnect.
- The board profiles: every pin numbered once, every alias pointing at a real pin, analog channels unique, no output offered on input-only pins, demo wiring on pins that can do the job.
- The transports with stand-ins for Web Serial and Web Bluetooth: unplugged cables, streams that end, HM-10 fallback and 20-byte packets.
- The real helper,
agent.py, run under Python bytests/agent_test.shagainst a fakemachinemodule, with its microsecond clock started just short of MicroPython's tick wrap so that the time arithmetic is exercised across it.
The firmware tools have their own tests: the Intel HEX reader (gaps, extended addresses and every checksum), the STK500 v1 and v2 conversations against stand-in boot loaders (sync, signature, padded pages, verify failures, writes beyond 64 KB), the Leonardo's AVR109 conversation against a stand-in for Caterina (identify, the ATmega32U4 signature, erase, write and verify, and no answer where there is no boot loader), the UF2 check, every board's image being present and what it claims, and detection naming an Uno, a Nano behind a CH340, an ESP32 behind a CP2102 and a Pico without MicroPython, offering ESP boards and the BOOT-held retry when a CH9102 port stays silent, and reading esptool's boot log.
Further checks run when their rigs are available: the Firmata client against the real StandardFirmata 2.5.9 firmware running on a simulated ATmega328P, the MicroPython session against the real MicroPython interpreter behind a pseudo-terminal, and detection and installation against the real Optiboot, ATmegaBOOT and Mega boot loaders on simulated chips with blank flash, ending in a Firmata connection on each, and the Firmata client against the app's own ConfigurableFirmata image running on an emulated ESP32 (Espressif's QEMU).
The check that matters most is yours. Connect a real board and compare its numbers with the simulator's, as in exercise E10.
5. Limitations
This app measures real boards as well as a simulated bench, so its limits are of two kinds: what the link, the firmware and the browser allow on real hardware, and what the simulator leaves out. Read them before quoting a number from it.
Measurement and timing
- The stream rate is limited by the link, not the ADC. StandardFirmata at 57,600 baud can carry one analog input every millisecond (about 1 kHz) and no more. Six inputs on an Uno stop at 200 samples a second each. Anything faster needs MicroPython's fast capture.
- StandardFirmata has no buffered capture, so on a Firmata board the oscilloscope can never see above half the stream rate: 500 Hz at best, 50 Hz at the default period.
- Bluetooth LE is slow. 2,000 bytes a second for a Nordic UART and 960 for an HM-10, against 5,760 for a USB cable.
- Firmata reports digital inputs only when they change, and the app stamps each change at the middle of the sampling period in which it arrived. Edge times on Firmata are therefore good to about one sampling period, which limits the precision of a duty cycle measured on a fast digital signal.
- The trend charts and the CSV are sampled at 10 Hz on the computer's clock and keep the last reading of each tenth of a second. They alias anything faster than a few hertz, and while the tab is in the background, where the browser slows its timers, they get a row a second or fewer. The raw, board-timed samples are exported from the oscilloscope instead, but only as far back as its buffer reaches: 65,536 samples per pin.
- The Firmata time base settles after about ten seconds. The calibration that corrects a resonator's half a percent of error needs 8 s of data before it is first applied, and starts again after the sampling period changes or a channel is switched on. Until then, frequencies on a board whose resonator is off read off by that error. Once settled it is good to about 0.1%: in the test suite, with every delivery delayed at random by up to 40 ms, a 5 Hz signal reads within 0.1% of 5 Hz on an exact clock and on one 0.5% fast. MicroPython times come from the board's crystal and are not calibrated.
- Readings are only as right as the full scale. The app assumes the board's default unless you set another under Options, and it cannot tell that AREF carries a different reference or that a divider sits in front of the pin.
What the app does not do yet
- No I2C, SPI or UART pass-through. A pin in one of those modes is shown as Other and cannot be driven. Sensors on a bus cannot be read.
- PWM frequency is set only under MicroPython, and for every PWM pin at once. Firmata runs at the board's own frequency: 490 Hz on most Arduino pins (980 Hz on D5 and D6 of the Uno and Nano, D4 and D13 of the Mega).
- Eight pins on the charts. More are counted but not drawn, and remain in the CSV and on the oscilloscope.
- Twelve boards. Another Firmata board will connect, but the app can only draw, and so only control, the pins of one of the twelve profiles.
- CircuitPython is detected and refused. The helper needs MicroPython's
machinemodule. - No Firmata on the ESP32-S3 or the Pico 2. ConfigurableFirmata 3.3 numbers the S3's pins as the original ESP32's and does not build for the RP2350. MicroPython works on both.
Outputs and safety
- A browser is not a real-time system. An output set from a switch or a slider is sent when the browser gets to it, coalesced to one command per pin every 40 ms while a slider moves, and carried by a link that may be busy. Nothing about its timing is guaranteed.
- The app releases the pins when it disconnects, by default. On Firmata, outputs are written LOW and every driven or pulled-up pin becomes a plain input. Pins left in analog mode stay there. The MicroPython helper always returns its pins to inputs. With release turned off, a Firmata board keeps driving whatever it was driving.
- There is no watchdog. If the link drops without a disconnect (a cable pulled from a board on external power, a browser that crashes), nothing is sent and outputs stay where they were.
- The app cannot protect hardware from wiring. It cannot tell that a 3.3 V pin has 5 V on it or that an output is shorted. The pinout's cautions are advice, not interlocks.
The Logic program
- It runs in the browser, not on the board. The firmware stays standard, so control stops when the tab closes, the computer sleeps or the link drops. A lost link stops the program with nothing written, and outputs stay where they were (there is no watchdog on the board). Anything that must keep running, or must fail safe, belongs in firmware.
- The loop's delay is the sampling period, plus the link, plus the scan. A reading reaches the program up to one sampling period after the ADC took it, the program uses it at its next scan, and a PWM, servo or DAC write rides the pin rows' 40 ms coalescing before the link carries it. A digital output goes out at once. On the simulated Uno at the defaults that is up to about 10 + 100 + 40 ms, which is why the PID preset is tuned for the RC filter at τ = 1 s and not 150 ms.
- A background tab slows the scan. Browsers throttle timers in a hidden tab to about once a second. The program keeps running with the real
dt, and the log says so once, but a loop tuned for 100 ms will not behave at 1 s. - The scan is not hard-timed. Intervals vary by a few milliseconds with the browser's load;
dtand every timer, filter, ramp, totalizer and PID use the measured interval, so the arithmetic stays right, but the sampling of fast signals does not. - Eleven blocks. No lead-lag, dead time, slow PWM for heaters or scheduler yet, no
Kp Ki Kdform of the PID, and no ladder view. Forcing is for read tags only.
Installing firmware and detection
- What has been verified. On emulated chips (simavr) running the real Arduino boot loaders (Optiboot, ATmegaBOOT and the Mega's STK500 v2) with blank flash, the app detected each blank board from its boot loader's chip signature, uploaded and verified StandardFirmata, detected it again as "running StandardFirmata 2.5", and connected with 20, 22 and 70 pins.
- The Leonardo install is checked against a model of the protocol only. Its AVR109 conversation (identify, signature, erase, write, read back) is tested against a stand-in for Caterina, not yet on a real Leonardo or an emulated ATmega32U4, and the 1200-baud touch and the second port depend on the operating system's USB handling.
- Not yet verified on hardware: ESP flashing through esptool-js, and the Pico install, which depends on Chrome's File System Access API writing to a removable drive. Both follow the vendors' documented procedures, and Download the file is the fallback.
- The ESP32 Firmata image has been run in an emulator, not on a board. On an emulated ESP32 (Espressif's QEMU) with the exact image the app ships, the app identified ConfigurableFirmata 3.3 (40 pins, 16 analog), was offered every pin the three ESP32-WROOM-32 pinouts draw with the right modes (input, output and PWM, and analog where the pinout says ADC), drove an output and a PWM pin, connected through the boot messages after a reset, and detection named it behind a CP2102. The production build was also run against the emulated chip's ROM boot loader: detection named the chip, and the installer named it, loaded esptool's flasher stub and uploaded it. Not covered: analog input (QEMU has no ADC model), the flash write itself (the stub does not run under QEMU), the ESP8266 and Pico Firmata images (built, not run), and any real hardware.
- Only the images that ship with the app. StandardFirmata 2.5 on the Uno, Nano, Mega, Leonardo and the ESP8266 boards, ConfigurableFirmata 3.3 on the three ESP32-WROOM-32 boards and the RP2040 Pico and Pico W, MicroPython 1.29.0 on every ESP and Pico board. No Firmata for the ESP32-S3 (ConfigurableFirmata 3.3 numbers its pins as the original ESP32's, and a build of your own has the same limits) or for the Pico 2 and Pico 2 W (it does not build for the RP2350). The ConfigurableFirmata images are the library's example with Wi-Fi and Bluetooth off, so they cannot be reached over the radio. On the ESP32-S3 the installer asks which module the board carries: the plain ESP32_GENERIC_S3 build for no or quad PSRAM, the SPIRAM_OCT build for N8R8 and N16R8 modules with octal PSRAM.
- Detection names chips, and boards only by inference. An Uno and a Nano share a chip, as do the three ESP32-WROOM-32 boards, and a NodeMCU and a D1 mini. The app tells them apart by the USB bridge, which clones vary, so it offers the alternatives beside its best guess. A board on its own native USB (a Pico, an ESP32-S3's USB port) is asked for MicroPython first and Firmata second. A Pico and a Pico W running ConfigurableFirmata report the same pin counts.
- An ESP board whose automatic reset does not work is found only with BOOT held. Detection reports it as "Probably an ESP board", and Ask the boot loader again, pressed with BOOT held, reads its chip. Asking the boot loader always restarts the board.
Browser and platform
- Web Serial and Web Bluetooth need a Chromium-based desktop browser (Chrome, Edge or Opera) on an
https://orlocalhostpage. Safari and Firefox have neither, and Web Bluetooth on Linux may need a browser flag. The simulator works everywhere. - One program per port. The Arduino Serial Monitor, Thonny, mpremote and this app cannot share a board.
- Native USB is budgeted as if it had a baud rate, except MicroPython on a Pico. Firmata on a Leonardo or a Pico, or MicroPython through an ESP32-S3's native USB port, are budgeted at baud ÷ 10 although the real link is faster.
The simulator
- PWM is modeled as its average. There is no carrier, so no ripple on the RC filter, no switching edges on an ADC pin, and nothing for a fast capture of a PWM pin to show.
- The analog front end is ideal. No ESP32 non-linearity, no ADC2 and Wi-Fi conflict, no reference drift, Gaussian noise of half a 10-bit step, and floating inputs that read LOW instead of wandering.
- The simulated links are exact. They are budgeted at their real speeds and deliver bytes in batches, but never lose or corrupt a byte, and the simulated boards' clocks are the computer's.
- Firmware side effects are not modeled, such as the Servo library taking over PWM on D9 and D10 of an Uno or Nano.
What this app is, and is not, evidence for
It is a sound way to check wiring pin by pin, to read and drive a board without writing firmware, and to see sampling, aliasing, ADC resolution, PWM averaging and the cost of a serial link on real signals. Its frequency measurements are honest because they use the board's clock. It is not a data-acquisition system of record: the trend export is a 10 Hz trend, the raw export reaches back only as far as the oscilloscope's buffer, the stream rate is set by the link, and there is no anti-alias filter unless you wire one. Its Logic program is a teaching controller, not a control system: it runs in the browser, its scan and its outputs are not hard-timed, and nothing fails safe if the link drops. Anything that must happen on time, or must stop safely, belongs in firmware on the board and in hardware around it.
6. Classroom and practice
E1–E9 and E12–E14 run on the simulator with no hardware, E10 and E15 need a real board, and E11 is a written exercise. Every exercise asks for numbers, and the oscilloscope's measurements plus the CSV are enough to get them.
E1 · Measure on the board's clock
On the simulated Uno, measure the generator at 2, 5, 10 and 20 Hz with the oscilloscope and tabulate the frequency, the period and the FFT peak against the dial. Then change Sample every to 20 ms and repeat. Report the largest error you see. Explain why the frequency does not jitter with the moments the bytes reach the browser, and why on Firmata it can still be a few tenths of a percent out (section 5). Say which of the frequency and the FFT peak you would quote and why.
E2 · Aliasing, predicted and measured
At the default 10 ms period, predict with fa = |f − k fs|
what the scope will read for generator frequencies of 30, 45, 55, 70, 95, 100, 130 and
205 Hz. Then measure all eight and note which ones raised the Nyquist warning. Report the table
and explain, in two sentences, why the warning cannot catch every alias. Finally, using only what
the app shows, describe an experiment that would tell you whether a 5 Hz reading is real or an
alias.
E3 · The time constant of the RC filter
Set the bench's RC filter to τ = 1 s and D9 to 0%. Wait for A2 to settle, press
Clear, set D9 to 100%, wait five seconds and export the CSV. From the file, find the time at
which A2 starts to move and the time at which it reaches 63.2% of its final change, and report
τ. Do it again from the oscilloscope's raw samples of A2 (its download button), which
are ten times closer together, and compare. Repeat for a step from 50% to 75%. Compare both with the dial, and explain why the
time constant is the same for both steps although the voltages are not. Then repeat at
τ = 150 ms and say which of the two files can still give an estimate, and
why.
E4 · PWM as an average voltage
With τ back at 150 ms, set D9 to 0, 10, 25, 50, 75, 90 and 100% and record A2's
settled voltage each time. Plot it against duty. Report the slope and intercept of a straight-line
fit, and compare the residuals with the Uno's 8-bit PWM step (5/255 V) and its 10-bit ADC
step (5/1023 V). Explain why 50% reads 2.51 V. Then estimate the ripple a real 1 kΩ
and 150 µF filter would show at 490 Hz and 50% duty, and say whether the Uno's ADC could
resolve it.
E5 · The link budget
Start the simulated Mega. Record the sampling period it chose and the log message. Then set the analog pins to Input one at a time, recording after each change the shortest period the Sample every menu allows, until one analog input is left. Plot that against the number of analog inputs. From the plot, recover the 3 bytes per sample and the 75% headroom rule. Then predict the shortest period for six analog inputs over an HC-05 at 9,600 baud, and for sixteen over StandardFirmata rebuilt at 115,200 baud.
E6 · Duty cycle from a comparator
Set A1 to Input and the generator to a 2 Hz triangle of 3.0 Vpp. For offsets of
2.0, 2.5, 3.0 and 3.5 V, predict the duty cycle the digital input will show from
½ + (Voff − Vs/2)/Vpp and measure it with the scope. Report
both. Explain what the half-supply threshold is doing, and why this circuit is how analog PWM
generators work. Then repeat at 20 Hz and explain why the measured duty gets less precise on
Firmata.
E7 · Fast capture and spectral resolution
On the simulated Pico, set the generator to 300 Hz. Report what the stream shows at 10 ms and why. Then capture 1,000 samples at Fastest and record the spacing, the frequency from the crossings, and the FFT peak. Repeat with 4,000 samples at 100 µs. For both captures compute the record length and the FFT bin width (the app uses the largest power of two that fits). Explain why the FFT peak improved and the crossing frequency did not need to.
E8 · Pull-ups and floating inputs
Watch D2 on the Logic chart while you press the bench button, then switch D2 to plain Input and press it again. Report what you see in each case and explain the circuit: where the button goes, what the pull-up does, and why the pressed state reads LOW. Then explain why the simulator's result for plain Input would not be repeatable on a real board, and which mode you would choose for a button wired to the supply instead of to ground, on which boards.
E9 · Resolution and noise
Set the potentiometer to 2.00 V and look at A0 on the oscilloscope at 10 mV per division. Report the Vpp and RMS of what is a steady voltage, and how many distinct levels you can see. Compare with one LSB of the Uno's ADC. Then do the same on the simulated ESP32-DevKitC and explain the difference in step size. Finally, compute the AC RMS from the RMS and the mean, and compare it with the simulator's noise of half a 10-bit step.
E10 · The real board against the simulator (needs hardware)
Load StandardFirmata on an Uno (or MicroPython on an ESP32 or Pico), connect, and repeat E1 and E5 with the board. For an input, use a potentiometer or a second board's PWM through an RC filter. Report the sets per second and kilobytes per second against the simulator's, any sampling period the app raised, and what a floating analog pin reads. Then hold a jumper wire in a floating analog input and measure the hum at 10 ms and at 1 ms (one analog input). Report both frequencies and explain the first from E2.
E11 · For practitioners: write the I/O plan
For a small rig of your choosing (a heater and two thermistors, a fan with a tachometer and a current sensor, a pump and a pressure transducer), write the one-page I/O plan you would hand to a technician: each signal's pin, mode, logic level and any level shifting, the bandwidth of each input and the sample rate it needs, the link budget for all of them together on the board and link you chose, where the time stamps come from, the anti-alias filter on each analog input, and the safe state of each output if the link drops. Then, from section 5, state which items this app could check for you and which must be checked in firmware or hardware.
E12 · Blink, toggle and count with the Logic tab
Load Blink the LED and run it. Change the row to square(2, 0.1) while it
runs and measure the LED's on time on the Logic chart. Then load Button toggles the LED
and press the bench button a few times. Change the Edge to rising: when does the LED now
change, and why? Finally add Count presses after the toggle rows (Add after), press
eleven times, and explain from the previous-scan rule why the count reads 10 for exactly one scan
before it starts again.
E13 · On/off control and the width of the band
Load Thermostat with hysteresis, which heats the RC filter (τ = 1 s), add
Switches = Counter(count: Heat), and run. With the oscilloscope on A2, measure the
cycle's period and its swing in °C for the band at ±5, ±2 and ±0.5 °C (edit the
Heat row's on and off), and count the switchings in 20 s.
Explain why the swing stops shrinking while the switching keeps getting faster: estimate the delay
from a reading to a write (the sampling period, the scan, and the 40 ms write coalescing) and
how far the temperature moves in that time. Repeat ±0.5 with the scan at 50 and at 200 ms.
Finally set on and off both to SP_C and explain why the heater
never comes on (the block's sense comes from on < off).
E14 · A PID loop on the RC filter
Load Hold the RC voltage with PID (it sets the filter's τ to 1 s) and run it. Step
the potentiometer from 40 % to 70 % and measure the time for A2 to come within 0.02 V
of the setpoint and the largest overshoot; take them from the CSV. Derive the preset's tuning from
the IMC rule in section 4. Then set the bench's τ back to 150 ms with
the same tuning and repeat: why is the response now slower, not faster? Retune by the same rule for
τ = 0.15 s and repeat once more. Finally try tauI: 0 and explain the steady
offset you measure.
E15 · The same program on a real board (needs hardware)
Wire a 10 kΩ resistor from D9 of an Uno to A2, a 100 µF capacitor from A2 to ground (τ = 1 s), and a potentiometer to A0. Load StandardFirmata, connect, and run the PID preset unchanged. Compare the settling time and overshoot with E14, report the scan statistics the status strip shows, and measure the PWM ripple on A2 with the oscilloscope. Then move the tab to the background for ten seconds and describe what the log and the trend show.
7. References and further reading
- Firmata protocol: protocol.md, capability-query.md, pin-state-query.md and the other message definitions the app implements
- Firmata for Arduino (StandardFirmata): the sketch the Arduino IDE ships, and Boards.h, which sets each board's pin count and analog inputs
- ConfigurableFirmata: the Firmata build the app installs on the ESP32-WROOM-32 boards and the RP2040 Pico and Pico W
- MicroPython: the REPL, raw REPL and raw-paste mode: how the app starts its helper without touching the board's files
- MicroPython: the machine module: Pin, ADC (read_u16, read_uv), PWM (duty_u16) and DAC as the helper uses them
- MicroPython: mpremote: the command-line tool built on the same raw REPL
- MicroPython downloads: ESP32_GENERIC, ESP32_GENERIC_S3, ESP8266_GENERIC and the RPI_PICO builds
- Web Serial API: the specification behind the USB / serial link
- Web Bluetooth: the specification behind the Bluetooth LE link
- Arduino Uno Rev3: official pinout and datasheet. Also the Nano, Mega 2560 and Leonardo
- Espressif ESP32-DevKitC V4 user guide: header layout, flash pins, strapping pins and ADC2, and the pin order the generic 38-pin boards copy
- Espressif ESP32-S3-DevKitC-1 user guide: header layout and board-variant notes
- DOIT ESP32 DevKit V1 pinout: the 30-pin board, checked against a second independent drawing
- NodeMCU DevKit v1.0: pin map and schematic, including the A0 divider
- LOLIN (Wemos) D1 mini: pin figure and schematic
- Raspberry Pi Pico and Pico 2 pinout: and the Pico W pinout
- Process Dynamics and Control course: the course this collection was built for
- esptool-js: Espressif's JavaScript port of esptool, which writes the ESP boards
- AVR061: STK500 communication protocol: the v1 protocol Optiboot and ATmegaBOOT speak
- AVR068: STK500 communication protocol, version 2: the framed protocol of the Mega 2560's boot loader
- Optiboot: the Uno's boot loader
- AVR109: Self programming: the protocol of the Leonardo's boot loader, Caterina
- UF2 file format: the block format the Pico's BOOTSEL drive accepts, with its family ids
- File System Access API: how the browser writes to the Pico's drive
- TCLab Control Studio: the companion app that closes a PID loop on an Arduino-based board over the same Web Serial link
- Clara, the APMonitor assistant: the chat bubble in the corner of this page. Ask it to check an alias calculation or a link budget
