Designing interactive procedure steps for circuit experiments
Every electronics lab experiment follows the same structure. It has been the same structure for decades: aim, theory, apparatus, procedure, observations, conclusion. That structure isn't arbitrary — it mirrors how a real engineer approaches a circuit. You state what you're trying to find out, understand the underlying theory, gather your components, follow the build steps, record what you see, and draw a conclusion.
The challenge in making this interactive is that each section has different requirements. Theory needs formatted text and mathematical expressions. Procedure needs to be tightly coupled to the 3D scene — each step should reveal exactly the components relevant to that step, nothing more. Observations need structured tables. The whole thing needs audio narration for accessibility and independent study.
Here is how we built it.
The data schema
The first decision was to keep content completely separate from rendering. Every section of every experiment is a TypeScript data file — a plain object with typed fields. The renderer reads these; it never has experiment-specific logic baked in.
A procedure step looks like this:
// 04-procedure/01-place-the-breadboard.ts
export const step: ProcedureStep = {
title: "Place the breadboard",
body: "Your build surface. Columns share a node across the tie-point rows.",
show: ["bb"], // which component IDs to make visible
highlight: "bb", // which component gets the glow ring
};The show array is cumulative — each step progressively reveals more of the circuit. By step 5, show contains all five components placed so far. The 3D scene reads this list and updates visibility accordingly, with no per-step renderer code needed.
Coupling the step to the 3D scene
This was the most interesting engineering problem. The 3D scene is a Three.js canvas. The procedure sidebar is a React component. They need to stay in sync: advancing a step should animate the new component into view, highlight it with a pulsing ring, and pan the camera to a good viewing angle.
We solved this with a shared step index in React state, passed down to both the sidebar (which renders the step list) and the scene (which reads the current step's show and highlightfields). The scene subscribes to step changes via a ref callback and runs a Three.js animation — fade in the new component, scale it up briefly from 0.8 to 1.0, then glow the highlight ring.
Students see exactly the components relevant to the current step. A half-wave rectifier has 9 procedure steps. At step 1, only the breadboard is visible. At step 4 (wire source to diode), the breadboard, AC source, and diode are all present — and the wire being placed is highlighted. The full circuit only appears at the final step.
Early builds — first working prototypes
These clips from the @shubhamm069 X account show the procedure step system at different stages of development.
The floating info card
Below the 3D scene, a floating card shows the current step's title and body text. It fades and slides between steps. On mobile it sits below the scene; on desktop it overlaps the bottom edge of the canvas, anchored to the left.
The step indicator — a row of dots, one per step, the current one filled — gives students a sense of progress without breaking their focus on the 3D scene. It was a small detail but noticeably improved completion rates in early testing.
Audio narration
Each aim and theory section can ship a companion MP3 file. The naming convention is simple: a file at public/semesters/semester-01/01-analog-electronics/half-wave-rectifier/01-aim.mp3 is automatically picked up and shown as a play button in the lab page header for that section. No configuration needed — the path convention is the configuration.
The audio player is minimal — play/pause, a progress bar, current time. It doesn't autoplay. It doesn't interrupt the procedure. It's there for students who want to listen to an explanation before they start wiring, or who prefer audio over reading dense theory text.
Observations and conclusion
The observations section is a structured TypeScript object — a list of rows with expected value ranges, measurement fields, and pass/fail conditions. The renderer turns this into a table students can fill in. The conclusion is a short text block.
Both are static content sections — they render below the 3D scene and the procedure navigator, in the theory view rather than the step view. The lab page has two modes: theory mode (aim, theory, apparatus, observations, conclusion — all static sections) and procedure mode (the interactive 3D step-by-step). Students can switch between them at any point.
Adding a new experiment
Because every section is a data file, adding a new experiment doesn't require any renderer changes. A contributor fills in the data files, the renderer handles the rest. A UG student with an AI coding assistant can generate a full experiment definition — the quickstart guide walks through the exact process.