PCB ReTrace Guide

A local-first browser tool for reverse engineering, documenting, and inspecting printed circuit boards.

Privacy Note: This application runs 100% in your browser. All images and data are stored in your browser's local database (IndexedDB). No project data (photos, BOM, nets, schematics) is uploaded to any PCB ReTrace server. The pages do load libraries (OpenCV, zip.js, the routing engine) from public CDNs and use Google Analytics for usage statistics. The only way project content can leave your browser is the optional AI feature (section 6): if you set up an AI profile and press Send, the crops you selected go directly from your browser to the provider you chose, and that provider's terms apply. Identification without AI (marking and package databases) sends nothing anywhere.

1. Concept & Hierarchy

PCB ReTrace organizes data to match physical hardware:

  1. Device: The physical unit (e.g., "Multimeter Model X").
  2. Board: A specific PCB inside the device (e.g., "Mainboard", "Power Supply").
  3. Images: Photos of the board (Top, Bottom, Angled shots).

2. The Workflow

Step 1: Setup

Create a New Device and a New Board using the top menu. Then, add your images: upload files or take a photo with the camera (📷). Before saving, you can crop and rotate the picture. High-resolution, flat photos work best.

Step 2: Mapping Components (BOM)

Navigate to the Images tab. Click on a component in the photo to mark it.

Step 3: Tracing Nets

Use the Inspect and Nets tabs to document connectivity.

Step 4: Schematic Generation (Schema ReTrace)

Switch to the Schema tab to automatically generate a schematic diagram from your traced nets.

3. Computer Vision & Stitching

PCB ReTrace uses Computer Vision (CV) for Spatial Alignment. It allows you to synchronize the view across different images.

Important: The CV engine does not automatically recognize components (it won't read "10k" off a resistor). Its purpose is to mathematically align coordinates between images so you can see through the board.

Auto-Stitch (Same Side)

When you upload a new image, PCB ReTrace automatically attempts to stitch it against existing images on the board in the background. If features match (e.g., a close-up vs. a wide shot), connections are created automatically.

You can also run this manually:

  1. Open Image Settings on your Main image.
  2. Select Stitch / Connections -> Run Auto-CV.

Manual Stitch (Top vs. Bottom)

To create an "X-Ray" view where clicking a pin on the Top automatically shows the corresponding pin on the Bottom:

  1. Select your Top Image.
  2. Go to Image Settings -> Connections.
  3. Find your Bottom Image and click "Edit Stitch".
  4. Flip Target: Click the button. This mirrors the bottom image horizontally.
  5. Match Points: Click 4 common features (Vias, Holes, Corners) visible on both images.
  6. Click Save Match.

4. Tools

PCB ReTrace includes standalone calculators accessible from the BOM editor:

5. Data Management

6. Identifying Components (with or without AI)

Click the ✨ button next to the Value field in the BOM editor. The component must have been placed on an image (click it on the Images tab). PCB ReTrace first cuts the same physical area out of every stitched photo of the same side of the board. You can then either send the crops to an AI, or look the part up without AI.

Identification without AI

Press Search by marking (no AI) on the first screen. Type the code printed on the part (for example W1M), optionally the package and the type. The list shows devices from the offline marking database, each with a picture of its package. Look-alike characters (0/O, 1/I, 5/S, 8/B, W/M) are tried too and marked, because several devices can share one code: compare the package picture and your photos before pressing Use. Nothing is sent anywhere.

Identification with AI

  1. Choose images: untick images you do not want to send, change the Area (S/M/L/XL or the slider), zoom with the wheel or a pinch and drag a preview to re-centre it. Images of the other side are available but not selected.
  2. Review: you see where the images will be sent (provider host, model, fallbacks), the exact crops and the exact prompt. Optionally add a hint such as "electrolytic capacitor". Nothing is sent until you press Send to AI.
  3. Result: check and edit the type, value, package, marking and the KiCad selector. The package is shown as a footprint picture with alternatives you can click. Apply to form only fills the Value and Description fields; you still press Save. If the model reports the part was cut off, Use suggested crop returns to step 1 with a tighter area.

Description selectors

For passive parts the Value holds the electrical value (10k, 100nF); for transistors, diodes, ICs and other named parts it holds the part name (PMBT3904), so it appears on the schematic.

The description gets a trailing bracketed selector that the Schema symbol picker uses as its default search, for example SOT-23 NPN General Purpose Transistor [name:PMBT3904 pins:3]. Supported keys: lib:, name:, ref:, desc: (substring match), fp: (package family, e.g. fp:SOT-23; also matches SOT-23-3, and symbols without footprint information are kept) and pins: (exact pin count). Without pins: the number of traced pins is used; with it, a symbol with more pins than were traced is accepted and the extra pins are added unconnected. You can type the same keys in the symbol search box.

Setting up AI and credentials

Privacy: a hosted AI service (Google, Anthropic, OpenAI, OpenRouter, ...) receives the crops and the prompt and handles them under its own terms. Retention, logging and use for model training differ by provider and plan, and free tiers often allow training use. Avoid sending sensitive boards unless you have checked the terms. Only a model running on a server you operate (Ollama, Open WebUI ...) keeps the images on your own machines.

Marking database and package catalogue

⚙ Settings → Part markings holds an offline table (CSV or ZIP with the columns marking, part_number, package, component_type, manufacturer, description). ⚙ Settings → Packages holds a catalogue of common packages (SOT-23, 0603, SOIC-8, TO-92 ...) taken from the KiCad footprint libraries: a 2D picture with pad numbers, pad count, pitch and size. Both are imported automatically in the background the first time they are needed (at startup, when the identify dialog opens, or when you open their Settings page) and then work offline. If you delete one, it is not downloaded again until you import it. They stay in your browser and are never part of exports. With AI, matching devices appear as clickable chips in the result, and Ask again with database matches sends them to the model as hints.

7. Symbol mapping: Resolve & Rules

A generated schematic first draws components as generic rectangles. The 🧩 Resolve symbols button in the Schema view replaces them with KiCad symbols. It shows a preview of what will be assigned (and what is left alone) and asks for confirmation; one Undo reverts the whole batch.

For every component that still has a generic symbol, PCB ReTrace decides in this order:

  1. A selector in the BOM description, for example [name:PMBT3904 pins:3], if it matches exactly one symbol.
  2. Your global rules (first match wins), for example Reference C → Device:C, or Reference C and description contains electrolytic/tantalum → Device:C_Polarized.
  3. The Value, if it equals a symbol name exactly (for example LM358).

Components that already have a KiCad symbol are never changed, and a symbol is only used if it has enough pins for the connected pins. The rotation of 2-pin parts is adjusted so a resistor that was horizontal stays horizontal.

Rules are edited in ⚙ Settings → Symbol mapping: reference letters, optional description words, an optional value pattern, and the symbol (searchable with lib:, name:, fp:, pins:; the symbols themselves are managed in ⚙ Settings → Symbol libraries). They apply to all devices and boards. Resolve newly generated components automatically is off by default; when you turn it on, only components that appear for the first time in a schematic are resolved, never existing diagrams.

8. Sharing & Deep Links

You can share a device setup by hosting the exported ZIP file on a public server and creating a "Deep Link" to it.

URL Format

Append `?import={URL}` to the studio address:

https://pcb.etaras.com/studio.html?import=https://example.com/my-device.zip

Server Requirements (CORS)

Crucial: The server hosting the ZIP file must allow Cross-Origin Resource Sharing (CORS).

The browser will block the download if the server does not send the header Access-Control-Allow-Origin: *.

Live Demo

See this feature in action at the official PCB ReTrace Examples Gallery. All projects there are hosted on GitHub Pages and load via Deep Links.