`## Inspiration Every electrical engineer, student, and maker begins their journey the same way: doodling schematics on paper notebooks, napkins, or lab whiteboards. However, existing multimodal Vision AI models treat circuit diagrams like generic art. They hallucinate missing wires, ignore faint breaks, and invent connections that don't exist. In electrical engineering, hallucinating a connection can destroy expensive chips, cause short-circuits, or trigger fires. We asked ourselves: What if an Image AI system didn't guess? What if it could perceive hand-drawn ink with deterministic precision, expose its own uncertainty to the engineer, and instantly translate paper sketches into 60 FPS SPICE physics and 3D hardware digital twins?

That is why we created PaperSPICE.

What it does

PaperSPICE turns physical hand-drawn circuit sketches into live, verifiable circuit simulations and 3D hardware digital twins:

  1. Ink Perception & Component Detection: Extracts hand-drawn ink from photographs or camera feeds, classifying components like DC power supplies, SPST switches, resistors, diodes, and TTL logic gates (XOR, NOT, AND, OR).
  2. The Uncertainty Gate (Human-in-the-Loop): When a wire is faint or broken, PaperSPICE refuses to guess. It pauses simulation at $0.00\text{ mA}$ and alerts the user to open gaps, allowing them to inspect and bridge them with a single click.
  3. Real-Time SPICE Simulation: Runs 60 FPS electron flow and computes exact physical voltages and currents using Modified Nodal Analysis (MNA), Ohm's Law, and Kirchhoff's Laws.
  4. 3D Breadboard Digital Twin: Automatically translates the paper sketch into a physical breadboard layout on a lab benchtop, featuring benchtop DC supplies, jumper wires, through-hole components, and 14-pin DIP logic ICs.
  5. Burnout Safety Engine: Triggers realistic visual smoke and an audible pop when overcurrent exceeds $30\text{ mA}$, teaching circuit protection before anyone touches physical hardware.

6. Educational Challenges & PCB CAD: Includes gamified lab challenges (like "The Goldilocks Current" tuner) and generates one-click KiCad PCB CAD blueprints.

How we built it

We built PaperSPICE as a full-stack, hardware-grade simulation platform:

  • Computer Vision Pipeline (Python & OpenCV):
    • Adaptive Otsu thresholding and morphological skeletonization isolate hand-drawn ink from paper background gradients.
    • Contour moments, convexity defects, and bounding box geometry classify component symbols and detect wire gaps.
    • Wire continuity algorithms reconstruct the topological netlist matrix connecting circuit nodes.
  • Deterministic Physics Solver (FastAPI backend):
    • Implements Modified Nodal Analysis (MNA) to solve matrix circuit equations: $$\mathbf{G}\mathbf{v} = \mathbf{i}$$
    • For diode loops, branch current is calculated via piecewise forward-voltage drop ($V_f$): $$I = \begin{cases} \frac{V_s - V_f}{R}, & \text{if } V_s > V_f \text{ and loop is closed} \ 0, & \text{otherwise} \end{cases}$$
    • For combinational logic, a multi-gate propagation solver computes truth tables for inputs $A, B, \text{and } C$.
  • Frontend & 3D Twin (React 18, Vite, HTML5 Canvas, Tailwind CSS):
    • High-performance 60 FPS HTML5 Canvas animation engine for electron particle flow, dynamic glows, and thermal HUDs.
    • Interactive breadboard renderer mapping logical netlists into physical breadboard rows, power rails, and DIP chips.

    - Web Audio API synthesizer for realistic switch clicks, relays, and overcurrent burnout pops.

    Challenges we ran into

  • Discontinuity vs. Open Circuit: Differentiating between an intentional component gap (like an open switch) and accidental pencil breaks without hallucinating connectivity. We resolved this through topological skeleton tracing and our human-in-the-loop Uncertainty Gate.
  • Sub-100ms Latency with 60 FPS Physics: Connecting backend OpenCV image processing with reactive browser canvas physics without UI drops. We optimized state synchronization and pre-calculated netlist topologies.

3. Harmonizing Analog & Digital Domains: Building a single digital twin that dynamically morphs between analog passive components (resistors, switches, coils) and 14-pin DIP logic chips (74HC04N, 74HC86N) based on detected schematic symbols.

Accomplishments that we're proud of

  • Zero-Hallucination Circuit AI: Built a vision pipeline that refuses to make unsafe assumptions in engineering sketches.
  • Instant Digital Twin Generation: Transforming a raw pencil drawing into an interactive, photorealistic breadboard with jumper wires in milliseconds.
  • Gamified Engineering Education: Designing the "Goldilocks Current" challenge and live audio-visual feedback that makes circuit theory fun and intuitive for beginners.

- End-to-End Pipeline: Taking a project from raw paper ink to live SPICE simulation and KiCad PCB blueprint export in one unified dashboard.

What we learned

  • AI Must Know What It Doesn't Know: In safety-critical engineering, an AI that highlights uncertainty is vastly superior to an overconfident model that guesses.
  • Physics Anchors Vision: Computer vision should extract schematic topology, but deterministic physical laws (Ohm's and Kirchhoff's Laws) must govern the simulation.

- Bridging the Theory-to-Hardware Gap: Providing a physical breadboard twin alongside schematic diagrams bridges the gap between textbook formulas and real-world lab benches.

What's next for PaperSPICE: AI Circuit Twin

  • Real-Time Mobile AR Scanner: Live smartphone camera scanning that projects flowing currents directly onto notebook paper in Augmented Reality.
  • AC Phasors & Reactive Components: Simulating capacitors, inductors, transformers, and AC frequency responses for RF and audio filter design.
  • Microcontroller Integration: Expanding the digital twin to support Arduino and ESP32 pinouts and embedded code execution.
  • Direct PCB Fabrication: One-click Gerber file generation for ordering physical boards directly from manufacturers.

Built With

Share this project:

Updates

Submission history