Reverse engineering PCBs with KiCAD 7

In this Article we will be looking at replicating a PCB using KiCAD 7, and it's new Background Bitmap image feature.

With the bitmap image feature it is much easier to replicate PCB designs. Before I have used sprint layout and kicad in a complicated process.

Capturing images

A scanner is hands down the best tool you can use for getting a good result. You can use a camera for smaller boards, but for larger boards you quickly run into problems.

Image scaling

Because KiCAD 7 not yet have separate x/y scaling, and x and y scaling is not equal usually, you have to scale them separately in a photo editor, like GIMP.

When the image is loaded, set the DPI of the image to the same as the settings of the scanner. It is usually 600, but sometimes 1200 (or even 300). When you have set the correct DPI, the ruler tool should yield distances close to the real thing.

  1. Find two points on the board in the X direction that you know the distance of. 
  2. Use the (GIMP) ruler tool to measure them. Take note of the distance.
  3. Scale the image in the X direction only. There is a chain symbol next to the scale value that you can de-select to be able to only scale in one direction.
  4. Repeat 2-3 until the measurement in 3 is what you know it should be.

Repeat the steps above for the Y direction.

You should now have an image with the correct DPI settings. In some cases, if something is wrong with the scanner, it can produce some uneven scaling at the ends of the image. You can select the ends of the image and use the transform tool to scale those manually. But lets not try to scare you away here.

Adding the image in KiCAD

  1. Click Place --> Add Image. Add the top image to User.1
  2. Use the ruler to check the distances again in both X and Y direction.

Repeat for the bottom image, and place it on User.2. 

Aligning the top and bottom layer

The images are normally semi transparent such that you can see both of them. However, when you select one of the images, they hide the one below. Press escape to de-select and to see the image below. The layer display options to the right does not help either.

You could move them iteratively, but there is a better way.

To find the error in the alignment i use the ruler tool on a pin on the top and to the same pin on the bottom that are supposed to align. Note down the error. Select the top layer, Right click, select Positioning tools --> Move Exactly (Shift-M). Enter the x and y errors (in the opposite direction) that you noted down, and the images should align.

Locking the images

Locking the images is useful because when you select stuff in your design, you will often get annoyed by accidentally selecting the background image and bringing it to the front. Sometime you even move it out of alignment by mistake. Select the background image, press E, now select "Locked". Repeat for both images.

Note. To be able to select locked items in KiCAD, in KiCAD 7 anyway, pay attention to the bottom right side. There you will find "Selection filters". Locked items are usually de-selected, and should be. selecting this option, now you should be able to select the locked images. Remember to de-select the locked-items selection filter again.

Reverse engineering

Creating a schematics from a PCB board.

There are many ways of doing this. If I have the schematics already, I like to start drawing it into KiCAD and adding the components. Then I import the design into PCBNew and place the components onto the background image and start tracing.

If you don't have the schematics you can start with adding parts. Place them in the schematics and start drawing connections. You don't have to draw everything at first. Then update PCBNew with the changes made in the schematics (button on top in PCBNew). Place the components. Run the DRC tool. The missing connections in the schematics will show up as errors. Add those connections to the schematics and repeat this process.

That is about it. When you are done you should have no DRC errors, and most of the warnings solved. Also you should see "unrouted 0" in the status bar at the bottom of your screen.

The C64C replica

I recently did a video series on using KiCAD6 nightly and KiCAD7 stable to replicate the Commodore 64 250469 motherboard. Please have a look:

https://www.youtube.com/playlist?list=PLtQOf_JULmrRxewUc_WUPFes85R2VS0OV

I have done other reverse engineering projects using KiCAD, and also SprintLayout. Please check my YouTube channel for more information.


Best regards,

BWACK


Kommentarer

Populære innlegg fra denne bloggen

The Videopac G7000 composite mod

Designing the Videopac SDCart. 2: The SD Cart demo