ESP32-S3 Bench Guide
ESP32-S3 N16R8 bench guide: live pinout, lessons, simulators and the bench log.
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Interactive transmission electron microscope in the browser: TEM, STEM, 4D-STEM, diffraction, EDS, EELS, DPC and ptychography
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Live exhibit: https://advanced-em.github.io/TEM-view/
An interactive transmission electron microscope in the browser, built as a small science-museum exhibit.
3D cutaway column: gun, condensers, scan coils, objective, apertures, projector, fluorescent screen, direct electron detector, ADF/BF detectors, EDS detector, EELS prism. The beam path reconfigures for each mode.
Six specimens: gold nanoparticles on carbon, a Si/SiO₂ interface, a SrTiO₃ Σ5 grain boundary, the metal–organic framework UiO-66, and graphene (monolayer with a hole, a single Si dopant, a Stone–Wales defect, vacancies and a 5° twisted-bilayer moiré). Above ~86 kV the beam knocks carbon atoms out of graphene in TEM/STEM: watch holes nucleate and grow, then compare 60–80 kV. UiO-66 (Zr₆ clusters + BDC linkers, Fm3̄m, a = 20.7 Å, viewed along [110], with a missing-cluster defect patch) is destroyed by radiolysis: the dose accumulates while the beam is on, the critical dose (~12 e⁻/Ų at 300 kV) falls as β² at lower voltage, and high-order diffraction spots fade first. It opens with low-dose settings and a Move to a fresh area button. Proteins in ice: apoferritin and ferritin (with its iron-oxide core) and a lipid vesicle in vitreous ice across a hole in a carbon film, set up as for single-particle cryo-EM (300 kV, no corrector, ~1.5 µm underfocus, ~30 e⁻/Ų). The proteins are weak phase objects, radiolysis destroys their finest detail after ~20 e⁻/Ų when cold, and the ice sublimes if the holder is warmed.
Twelve modes: TEM, STEM, 4D-STEM, SAED, CBED/LACBED, EDS, EELS, Ronchigram/corrector tuning, off-axis and in-line electron holography, and Lorentz TEM and Lorentz STEM for magnetic materials. Each detector image is computed from a real atomic model: phase-object wave optics with a full contrast-transfer function, aberrated probes, CBED patterns per probe position, Bragg diffraction with Kikuchi lines, Fano-limited X-ray spectra, and Drude plasmons with core-loss edges.
Direct electron detector: record images and patterns in counting mode instead of on the phosphor screen, and synthesize virtual BF/ABF/ADF/dark-field, DPC, center-of-mass, and live ePIE ptychography from the 4D dataset. The 4D data are simulated multislice (3 slices with Fresnel propagation), so single-slice ptychography shows thick-specimen artifacts, while multislice ptychography (MS-ePIE) fits them and reconstructs each slice in depth.
Aberration correction: a Ronchigram computed from the aberrated probe on amorphous carbon; tune C1, A1, B2, A2, C3, A3 by hand (with a π/4 flat-phase readout) or run Auto-tune. Residual aberrations propagate to every probe and image.
CBED / LACBED: two-beam dynamical disks with a live Kossel–Möllenstedt thickness fit, HOLZ lines that shift with lattice strain and voltage, and large-angle patterns whose lines break across the grain boundary.
EELS spectrometer: a 2048-channel detector with selectable dispersion (0.01–1 eV per channel) and energy offset (drift tube). Presets for the zero loss, low loss, core loss and high loss. Each channel integrates the spectrum over its width and the detector smears it over ~2 channels, so coarse dispersion visibly broadens the zero-loss peak and edge onsets. The zero loss's width and position are measured live; in realistic mode it drifts by a few tenths of an eV per minute (smearing long acquisitions) until you press Align zero loss. The camera has a probe current, an exposure per readout and a full well (~16,400 electrons per channel per readout): the zero loss saturates within milliseconds at fine dispersion, and saturated channels are clipped (flat, in red) in both the expected and the recorded spectra, with read noise in each readout. Dual EELS records a short-exposure low-loss spectrum and a long-exposure core-loss spectrum together: the core loss is realigned frame by frame on the recorded zero loss (no drift smear), and the low loss gives the thickness t/λ, flagged as wrong when its zero loss saturates.
Acquire: the camera button above the detector (or I, or the panels) records what the detector shows as a numbered acquisition, with its data and settings; on beam-sensitive specimens it spends a dose. Acquisitions collect in a gallery for this session, each downloadable as PNG or NumPy .npz.
Specimen holders and temperature (all modes): room temperature, a liquid-nitrogen cryo holder (grid ~90–300 K), a liquid-helium cryo holder (tip 4.2 K, grid ~8–15 K with ±1.5 K fluctuations), and a MEMS heating holder (up to ~1470 K, reading accurate to ~1 %). The specimen's real temperature differs from the setpoint and fluctuates, and it drives:
Zernike phase plate (TEM): a π/2 plate in the back focal plane turns −sin χ into cos χ, so weak phase objects show strong contrast in focus, with the characteristic halos below the cut-on frequency.
Lorentz microscopy (magnetic materials): the objective lens is off and a Lorentz lens images the specimen at micrometre fields of view. Specimens:
The magnetic (Aharonov–Bohm) and electrostatic phases are computed from the magnetization and thickness. Lorentz TEM:
Lorentz STEM: differential phase contrast on a four-segment detector, with the probe-size versus sensitivity trade-off and segment saturation.
Electron holography: Off-axis: a Möllenstedt biprism overlaps the object wave with a vacuum reference wave; the hologram's Fourier transform shows the center band and sidebands, and the selected sideband is reconstructed into amplitude, phase and phase contours, with optional numerical removal of the lens aberrations. Biprism voltage trades fringe spacing and overlap width against fringe contrast, and the phase precision (2π/N) follows from contrast and dose. In-line: a focal series is recorded and the exit wave is recovered by iterative focal-series reconstruction, with a live convergence curve; the focal range controls how well slowly varying phase is recovered.
Results panel: enlarge it in place (X) or open it in a separate window for a second screen.
Digital twin, across all modalities:
Instrument profile: the parameters that belong to one particular microscope, each used by the modes it affects:
| Modes | Profile parameters |
|---|---|
| TEM, in-line holography | energy spread, Cc, Cs, illumination angle, HV and lens stability (focal spread, information limit) |
| TEM, STEM, spectrum-image maps | magnification calibration |
| STEM, EDS/EELS maps | effective source size, scan aspect ratio and shear |
| SAED, STEM detectors, 4D-STEM, CBED, Ronchigram | camera-length calibration; projector ellipticity (SAED) |
| EDS | detector resolution at Mn Kα |
| EELS | energy spread |
| Off-axis holography | fringe contrast μ₀ and coherence width |
Three generic presets (200 kV Schottky with corrector, 300 kV cryo-TEM, 300 kV cold-FEG STEM), plus an editor for your own values.
Calibrate from data, one fit per modality, in the browser (files never leave it):
| Modality | Data | Measures |
|---|---|---|
| TEM | image of an amorphous film (.mrc, .npy, .png, .jpg, .tif) | defocus, two-fold astigmatism (Thon rings) |
| TEM / STEM | atomic-resolution image of a single crystal with a known spacing | magnification; STEM scan aspect and shear |
| Diffraction | ring pattern of a gold, aluminum or silicon standard | camera length, projector ellipticity |
| 4D-STEM, CBED, Ronchigram | vacuum pattern at a known convergence angle | mrad per pixel (camera length) |
| EDS | spectrum with known, isolated lines | resolution at Mn Kα, energy gain and offset |
| EELS | zero-loss peak | gun energy spread |
| Off-axis holography | vacuum hologram | fringe spacing and contrast |
Every tab can also simulate data from a "mystery" instrument with hidden miscalibrations, so the fits can be tried and checked. On such data they recover magnification, scan aspect and shear to ~0.02 %, defocus to ~2 nm, camera length to <1 %, detector angles to <0.1 %, energy spread to ~0.01 eV, EDS resolution to ~4 % and fringe contrast exactly.
Control panel: a physical panel laid out like a microscope's hand panels (focus, magnification, intensity, multifunction knobs, stage joystick) drives the exhibit through the Gamepad API, with no drivers; ordinary game controllers work as a stand-in. Knob functions follow the mode (magnification becomes camera length in diffraction, a context knob sets convergence, selected area, biprism voltage or temperature). A heads-up display shows the multifunction mode and the last change; the panel dialog (gamepad icon) shows live input and remaps axes and buttons. Without hardware, the on-screen panel (key V, or the panel dialog) offers the same console with keyboard and mouse: Q/W focus, A/S magnification, Z/X intensity, H/L and K/J multifunction, O/P context knob, arrow keys for the stage, Tab for the multifunction mode (stigmator, image shift, tilt; in the Ronchigram with the corrector on also coma B2, three-fold A2, four-fold A3 and Cₛ, each as an X/Y vector), F fine/coarse, B wobbler, G optimal focus, ,/. mode (Shift = 5 detents); knobs also turn by dragging or scrolling. It docks over the page (draggable) or pops out into its own window, for a second screen. Protocol, reference RP2040 firmware, pin map and parts list: hardware/panel. The physical TEM-view Console (concept, in development for Kickstarter) has its own page at console/, linked from the help panel, the on-screen panel and the panel dialog; its 3D-printable prototype enclosure is in hardware/panel/enclosure.
Training scenarios and behavior telemetry (research pilot): The Training button at the top of the controls (or T) opens training scenarios: tasks that start a task with a hidden, seeded misalignment that the user must find: Focus and stigmate (TEM, gold: correct an unknown two-fold astigmatism and reach Scherzer defocus) and Tune the corrector (Ronchigram: null hidden C1, C3, A1, B2, A2, A3, up to a few µm of coma and three-fold, until the flat area reaches 30 mrad, with auto-tune disabled; corrector knobs cover C1 ±300 nm, Cₛ ±200 µm, A1 500 nm, B2 and A2 8 µm, A3 80 µm with 0.1° angles). The user only sees the image; the exhibit keeps the truth (wave-aberration phase error against the Rayleigh quarter-wave limit, residual terms, dose) and asks the user to rate the result and name the cues they used before revealing how good it really was. Recording is opt-in for each scenario, stores no personal data (an anonymous random id and a self-reported experience level) and never leaves the browser: the session downloads as JSON (tem-view-telemetry/1: every setting change with its input source, mouse, keyboard, panel or controller, snapshots every 0.5 s, acquisitions, judgments, hidden metrics). Replay a session plays a file back with a scrubber, the true score over time and the action log. python3 tools/analysis/sessions.py sessions/*.json --plot score.png --csv summary.csv summarizes sessions: duration, time to success, changes per setting and input, the order of operations (stigmate → focus → …) and how far the user's judgment was from the truth. To Hugging Face: hf/ turns sessions into a dataset (sessions and steps tables for imitation learning and judgment models), pushes it to a private dataset repo, and includes a session collector: a free Cloudflare Worker (hf/worker) or a Hugging Face Space on a paid plan (hf/space). Visitors who choose Record and share on the consent screen send their session automatically when the task ends; Record only keeps it local unless they send it from the result screen. js/config.js holds the collector address; leave it empty to keep everything local.
Voice and AI agents:
Typed commands: the command bar above the results, shown with the AI mode (brain) button at the top of the controls or with /, and hidden with Esc, takes the same commands, with history (↑/↓) and suggestions. Near misses ("swich to stm", "defocs minus 80") are spell-corrected against the microscope's vocabulary and confirmed before they run ("Did you mean switch to STEM?"): click, or say or type "yes", "no", or "the second one".
Analyses of what is on screen, compared with the simulator's true settings (js/analyze.js):
| Command | Analysis | emskills skill |
|---|---|---|
| "fit the CTF", "what is the defocus?" | fit_ctf | ctf-fitter |
| "index the rings", "measure the d-spacings" | fit_lattice | lattice-dspacing |
| "which edges are there?" | identify_edges | eels-edge-id |
| "fit the EDS peaks" | fit_eds | not in the registry (edax-phase-map is related) |
| "what is the energy spread?" | fit_zlp | not in the registry |
| "measure the fringes" | fit_hologram | not in the registry |
Voice commands: hold M (or the microphone button, the on-screen panel's Talk key, or the Console's talk key) and speak a command, such as "switch to STEM", "load graphene", "defocus minus fifty", "cool to 90 kelvin" or "acquire". The grammar is in js/voice.js. The browser's speech recognition does the listening; in Chrome and Edge that happens on Google's or Microsoft's servers, and the exhibit asks for consent the first time.
AI agents: tools/temview-mcp is an MCP server. With it, an agent (for example with ) can run the twin headlessly, or drive an open exhibit after the visitor clicks : read the state, change settings, acquire data, and answer spoken questions out loud. The twin is also the skill in the emskills registry.
Phones and tablets: below 1100 px the exhibit becomes one scrolling page: title, a sticky swipeable mode bar, the column, the results, then the explanation (folded to a few lines) and the controls (sections fold). Vertical swipes scroll the page; horizontal drags rotate the column or move the stage, and pinch zooms.
Educational ↔ realistic toggle: a clean, labeled, false-color view, or Poisson shot noise, grayscale detectors, accumulating counts and log spectra.
Voice narration: a speaker button on every component card and on the mode panel, plus an Auto-narrate toggle (N) that reads each mode and component as you open it. Two levels, General (for a broad audience) and Physics (equations, limits and metrology, in words), each in a female or male voice. Clips are generated with ElevenLabs into audio/narration/<voice>/<level>/ (ELEVENLABS_API_KEY=… node tools/narrate.mjs, which only regenerates changed scripts); any clip not yet generated falls back to the browser's speech synthesis.
Ruska 1933 (ruska/): a companion exhibit for the Electron Microscopy Museum Nuremberg, where visitors drive the first electron microscopes. Four missions: Knoll and Ruska's two-coil tube of 7 April 1931 (a platinum grid at 3.6 × 4.8 ≈ 17.4×, before the beam burns it), Ruska's November 1933 column (beat the light microscope on a carbonized cotton fibre, following his own setup procedure from Z. Physik 87, 580, 1934), Krause's 1937 diatom test, and free exploration with the 1935 fly wing. The physics: Busch lenses (f ∝ U/(NI)²), so the high voltage's drift and ripple defocus the image; magnetic image rotation; a cold-cathode gas discharge whose current pulls the voltage down and sometimes bursts out; an intermediate screen with a hole that bounds the final field; Earth's field, corrected with a hand magnet; brightness ∝ 1/M², so the condenser heats, chars and burns specimens; mercury-pump bumps and thermal drift that smear plates. Each plate is scored by Ruska's edge measure (d = 2z/M). A brass 3D column after the museum's model, with a live cutaway of the beam. In English and German (EN/DE switch, ?lang=de for a kiosk, otherwise the browser's language); the German text uses Ruska's own 1934 terms (Entladungsrohr mit Kühlkörper, Zwischenbildschirm, Bildbegrenzungskreis). The TEM-view Console (or a TEM-view panel or any game controller, same protocol as the main exhibit) drives it: focus dial → objective (fine/coarse), magnification → projector, intensity → condenser, context → high voltage, multifunction → hand magnet, joystick → stage, ACQUIRE → plate; the Console button shows live input and remaps every knob, and the on-screen-panel keys (Q/W, A/S, Z/X, O/P, H/L, J/K, arrows, I) work from a keyboard.
Scanning 1938–2002 (scanning/): the history of the scanning transmission electron microscope in three instruments, as a companion to Ruska 1933.
The physics:
There are seven missions plus free exploration. The page is in English. node scanning/test.mjs checks the physics.
Electron Explorer (kids/): a cartoon version for K-12 students. Four samples drawn to scale from shapes (pollen, a bacterium attacked by phages, gold nanoparticles, graphene with a silicon dopant) that reveal finer detail as you zoom, from ~400 µm down to single atoms. Only the basics: beam on/off, three lenses (brightness, focus, zoom), a stage and a camera. Some real behavior is kept: focus blur grows with magnification, a new sample needs refocusing, a dim beam gives a grainy picture, and squeezing the beam shrinks the lit spot and cooks pollen and bacteria. Six missions with a guide (Zip the electron), hints with an arrow to the target, a "How small is it?" ladder, a sticker book of snapshots (rated 1–3 stars, downloadable as PNG), cartoon / grey / phosphor-green colors, read-aloud, and notes for teachers. The TEM-view Console (or any game controller, or the keyboard: Q/W, A/S, Z/X, arrows, B, I) drives it, with an on-screen Console that mirrors it; ?kiosk restarts it after three idle minutes. In English and Spanish (EN/ES switch, ?lang=es, otherwise the browser's language). With Read aloud on, Zip speaks in a girl's or a boy's cartoon voice (ElevenLabs: Minnie and Little Dude in English, Betty and Junior in Spanish): ELEVENLABS_API_KEY=sk_… node tools/narrate-kids.mjs records every line from kids/lines.js into kids/audio/<lang>/<voice>/ (only new or changed lines; --sample records three lines per voice to audition them, --list shows the lines without calling the API); lines without a clip use the browser's most natural voice, raised in pitch.
Experiments: One electron at a time (watch the pattern build from single electron arrivals) and Fly down the column.
ES modules need to be served over HTTP (not opened as file://):
python3 -m http.server 8765
Then open http://localhost:8765. Three.js loads from jsDelivr, so the first load needs an internet connection.
To publish, push this folder to a GitHub repository and enable Pages on the main branch; no build step is needed. Before each release, run node tools/stamp.mjs: it stamps a version onto every module and the stylesheet in index.html and kids/index.html, so browsers load the new code instead of a cached copy.
Drag the column to orbit and scroll to zoom. Keys 1–9 and 0 switch modes, Space pauses, C toggles clarity, L toggles labels, R resets the view, N toggles narration, X enlarges the results panel, V opens the on-screen control panel, I acquires, T opens training, hold M to talk, [ and ] hide or show the explanation and controls panels (or the ‹ › buttons; a tab at the screen edge brings them back). Drag the detector image to move the stage and scroll it to change magnification (in diffraction, dragging tilts the crystal). In EDS, click a peak to map it; in EELS, drag the spectrum to move the energy window. In 4D-STEM, hover the image to read patterns and drag on the pattern to reshape the detector.
| File | Role |
|---|---|
js/physics.js | Electron optics, FFT, specimen models (Au/C, Si/SiO₂, SrTiO₃ Σ5, graphene, UiO-66), X-ray and EELS tables |
js/sim.js | Per-mode signal computation, 4D acquisition, DPC, ptychography, spectrum-image accumulation |
js/techniques.js | Ronchigram & corrector, CBED/LACBED |
js/holography.js | Off-axis and in-line (focal-series) electron holography |
js/lorentz.js | Lorentz TEM (Fresnel, Foucault, TIE) and Lorentz STEM (DPC) of magnetic specimens |
js/profile.js | Instrument profile, presets, focal spread |
js/state.js | Default state and the keys a session stores |
js/calibrate.js, js/calibui.js | Thon-ring and zero-loss fits, file readers (.mrc, .npy, images), calibration dialog |
js/export.js, js/npy.js | Data export to NumPy .npz |
tools/headless.mjs | Run the simulator in Node and save .npz |
js/panel.js | Hardware control panel and game controllers (Gamepad API) |
js/vpanel.js | On-screen control panel (keyboard, mouse, touch; docked or popped out) |
js/acquire.js | Acquisitions and their gallery |
js/voice.js, js/agent.js | Command grammar, spelling correction and confirmation, push-to-talk; bridge to an AI agent |
js/analyze.js | Analyses of the live data (CTF, indexed d-spacings, EELS edges, ZLP, EDS, hologram), named after emskills tools |
tools/temview-mcp/ | MCP server for agents: headless simulation and live control of the exhibit |
tools/temview-py/ | Python package temview: scripting, headless or live, with examples and tests |
js/scripting.js, js/ops.js, js/ide.js | the script calls shared by every backend, the instrument operations without a screen, and the in-browser Python IDE |
All rights reserved while the licenses for the software, documentation, hardware and firmware are decided. See LICENSE.
Sessions: save and load the complete state, profile and calibrations as JSON.
Export: what the detectors recorded in the current mode as a NumPy .npz (images, 4D datacube, spectra, holograms, focal series) with metadata.json (calibrated pixel sizes, optics, state).
Headless: the simulator runs without a browser: node tools/headless.mjs --mode tem --spec bio --cryo --df -1500 --out tem.npz (or --holder lhe --temp 4.2, --holder heat --temp 1000), or --session file.json to replay a saved session.
tem-view-twinPython scripting: tools/temview-py scripts the microscope from Python: set the optics, acquire NumPy data with calibrations, run analyses, and test automation against a hidden misalignment (challenges scored from the true optics). The same script runs in the exhibit's Python IDE (the terminal button at the top of the controls, or P; Python runs in the browser through Pyodide), headless on a desktop, or driving an open exhibit.
js/telemetry.js | Opt-in session recorder (tem-view-telemetry/1) |
js/scenarios.js | Training scenarios with hidden misalignments, judgment, reveal, replay |
js/config.js | Deployment settings (where shared sessions go; empty = local only) |
hf/build_dataset.py, hf/worker/, hf/space/ | Hugging Face dataset builder; session collector as a Cloudflare Worker or an HF Space |
tools/analysis/sessions.py | Summaries and plots of recorded sessions (with an example in sample/) |
hardware/panel/ | Panel protocol, reference firmware (RP2040), pin map, parts |
js/components.js | Instrument-physics cards for the column labels |
js/render2d.js | Detector views, spectra, overlays |
js/scene3d.js | Three.js column, beams, electrons, labels, tour |
js/explain.js | Plain-English explanations and instrument readout |
js/narration.js | Narration scripts and audio playback |
tools/narrate.mjs | Generates the narration clips with ElevenLabs |
js/main.js | State, controls, interaction, render loop |
ruska/ | Ruska 1933 exhibit: optics.js (lenses, blur budget, brightness, heating), specimens.js, screen.js (phosphor-screen shader), scene.js (3D column), main.js (state, panel, missions, plates), texts.js, i18n.js (English/German), console.js (TEM-view Console and keyboard) |
scanning/ | Scanning 1938–2002 exhibit: optics.js (probe model: brightness, flat-region core and halo, Ronchigram), specimens.js (ZnO crystals, U atoms on C, Si [112]), scene.js (three schematic columns, the HB501 inverted), main.js (state, panel, scan, missions, recordings), texts.js, ui.js, test.mjs |