pcb-rnd knowledge pool


Tracing boards from imported photos

background_image by Tibor 'Igor2' Palinkas on 2020-05-26

Tags: howto, pixmap, gfx, reverse, engineering, reveng, photo, board, trace, background, image, datasheet, screenshot

node source



Abstract: How to use the pcb-rnd to reproduce a board by tracing copper tracks and vias importing a photo.



This technique is useful:

I. Howto

1. edit the input image

Use your favorite image editor to get your photo corrected for all sort of errors. The resulting board should be close to rectangular with zero rotation. Save it in jpeg or png.

2. measure the board

Take your caliper and measure the board. For rectangular boards it's best to measure the extents. This example board is 157.3mm * 63.5mm.

3. setup

Start pcb-rnd, optionally load your starting board template, edit the layer stack and resize the board (using the preferences dialog Sizes tab) to be bigger than the real size of the PCB; in our example I went with 200mm * 100 mm.

4. Import the pixmap

Import the pixmap using File menu, Import, Load pixmap... and place it on the top layer, in the middle of the drawing area from the buffer:

screenshot after the initial import

Do not zoom in too much, pixmap operations take a lot of memory at high zoom levels!

(For this example, for sake of simplicity, we pretend the photo is of the top of the board. In reality you will want to take a photo from the top and from the bottom, load them both, place the top photo on the top copper layer and place the bottom photo on the bottom copper layer so steps 4 and 5 are done twice then the two objects are aligned at the first via placed. Gfx objects, just like any object, can be moved to the current layer from the right click context menu. When there are pixmaps on multiple layers, it's useful to toggle layer visibility or flip the board using the tab key.)

5. Resize by measure

Set the grid to something very fine. Right click the green board and select the "Resize to measured" menu. This will ask for two points: click one on the left edge of the board and another one on the right edge, preferably on the same vertical position (like if you were drawing a horizontal line). Then a dialog box will come up to ask the measured length on the real board; enter 157.3mm - it is very important to specify the number with unit, it will not work without unit. When finished, the board will be stretched out in the horizontal direction.

Repeat the same on the vertical axis, around the middle of the board, entering 63.5mm. The board is now resized so it matches the real board size.

6. Align the grid

The grid origin shall be set too, assuming the original design placed components on a mil grid. Since there will be all sort of imaging errors on boards as large as this one when a photo is used as input, it's best to align around the center of the board. Pick one of the silvery pins (of a 100 mil jumper) that is located around the center vertically, and around 40% of the board horizontally from the left.

Set the grid to 100 mil, and use View, grid, realign grid (or {g r}); this will temporary switch grid to very fine. Click on the silvery jumper pin identified above. Try to click where the drill center on the board would be, not on the top of the pin sticking out from the board (that would introduce error because of the perspective). TIP: if you have the via tool selected while doing this, the xor-drawn via outline may help properly positioning the cursor.

Once done, switch back to 25 mil grid and verify that other header pins are approximately on the grid.

7. Set up the style and DRC

Measure signal trace, clearance and via parameters. With a low resolution photo like this one, take multiple measurements. On this board, signals seem to be 10mil with about 8 mil clearance, vias are 40 mil outer dia and 20 mil drill dia. Set this for the Signal style (top window bottom left, Edit button).

Since the clearance is smaller than the default, this must be tuned in the preferences dialog (DRC tab) to allow minimum copper spacing (gap) be as small as 8 mil.

8. Rendering order

Right click on the pixmap and select "Render level: under" menu. This makes sure the tracks we draw on the same layer will be shown above the pixmap.

9. Start tracing the board

Often the components are placed on a grid but the tracks and vias are not and they are just as dense as possible. This board looks like one of those, so for the test routing I've set grid to 1 mil and enabled enforce drc clearance (mode, routing, auto enforce drc clearances). I started to lay out the area to the right from the middle:

screenshot after a few tracks and vias placed

II. Closing notes

Board files with pixmaps in them can be quiet large. It's best practice to delete the pixmaps once the board is traced. You can download the example used above at its last state - it's almost 10 megabytes!

On this specific example board signal traces are not always 45 degrees, especially when connected to a via. With the key combination {m l a} you can enable or disable all-direction line to trace those.