Friday, 25 September 2020

Altium PCB Art

Summary
This blog outlines techniques 
to produce PCB visual art utilising a Printed Circuit Board (PCB) design package with image editing software. Below is an example of a PCB, with exposed copper, portraying a Monkeyface.

Monkeyface as PCB Artwork
Monkeyface as PCB Artwork

Preamble
During the pandemic lockdown, there was an opportunity to use a PCB design package, Altium Designer (Altium), for basic visual 'PCB' art. While Altium can be used independently to create visual art, utilising a free image editing package such as GIMP, Inkscape or a commercial package such as Photoshop or Corel will assist with altering images.

The image editing methods described in this blog are experimental; alternative techniques are welcomed!

Software Alternatives
Free PCB software design packages which include KiCad, Design Spark and PCBWeb are capable of creating similar PCB art.

Source Material
Source material, such as an image or a DXF file, are usually required with a PCB design package. Monochrome images can ordinarily be pasted directly into Altium however loss in greyscale images can occur with lighter tones. Colour images require conversion to black and white. Images can be converted into a DXF format and imported into Altium.

Example 1: Colour to Monochrome - Cloud Sun
All credit to the creator of the artwork
Sushant Wadte, for the example image below.

Colour images are changed into monochrome using various methods. The subsequent method, using filters in Inkscape, produces reasonable results in images with large objects.

Cartoon Sun Cloud
Cartoon Sun Cloud - Courtesy PNGItem. Creator - Sushant Wadte

Using the 'Greyscale' filter in Inkscape, the colour image was converted to monochrome. The colour channels and lightness were adjusted to improve the monochrome image.

Inkscape Greyscale Filter - Cartoon Sun Cloud
Inkscape Greyscale Filter - Cartoon Sun Cloud

For importing into Altium, the monochrome image background was changed to white and all other features were converted to black.

Inkscape Black and White Cartoon Sun Cloud
Inkscape Black and White Cartoon Sun Cloud

Filling the cloud and sun rays with black was performed using Inkscape's fill bounded areas tool. The image background was filled with white.

The converted image was saved as a BMP and PNG file.

Altium Script (Alternative Import Method)
The Altium script PCBLogoCreator was used to convert the bitmap image into a representation in tracks.

Inkscape Dialog Box Running PCBLogoCreator Script
Altium Dialog Box Running PCBLogoCreator Script

Running the Altium script on the black and white image for a PCB, yielded the resulting image shown below.

Altium Script Converted Cartoon Sun Cloud
Altium Script Converted Cartoon Sun Cloud 

The image converted by the script was useable, although there are two points to highlight. 
Firstly, converting the image results in hundreds of tracks which can load up the CPU when moving the tracks. Secondly, the tracks cannot be selected and converted to a polygon or region.

Altium Script Conversion Lines Cartoon Sun Cloud
Altium Script Conversion Lines Cartoon Sun Cloud

Placing Sun Cloud PNG Into Altium
The saved PNG image can make its way into Altium using two methods. One method is to cut and paste into an Altium PCB. Another method is to use the menu command, Place Object.

The same black and white image in the previous section was pasted into Altium onto the top layer (copper).


Altium Pasted PNG Cartoon Sun Cloud
Altium Pasted PNG Cartoon Sun Cloud

Selecting the cloud on the pasted image shows that the process of pasting into Altium converts the image dark areas to regions.

Object Tweaks
The image was initially pasted on the PCB top layer (copper) although it is possible to paste onto other layers such as the top overlay (silkscreen).

Altium 3D Top Silk Unmodified Cartoon Sun Cloud
Altium 3D Top Silk Unmodified Cartoon Sun Cloud

The cloud was changed to top layer silk and the sun and rays left as copper. To change the cloud from top copper to top silk, the cloud region was modified.

Altium Cloud Region Selection
Altium Cloud Region Selection

The Properties (legacy PCB Inspector) was opened to change the region from top copper to top silk. 

Altium Region Layer Change
Altium Region Layer Change

With the cloud changed to silk, the remaining objects required removal of the solder mask (green coating).

Altium Top Silk Cloud Region
Altium Top Silk Cloud Region 

To alter the solder mask of the remaining objects, each region was selected. The region 'Properties' (legacy PCB Inspector) was opened and the 'Solder Mask' rule changed.

Altium Object Solder Mask Expansion
Altium Object Solder Mask Expansion

The 'Solder Mask Expansion' setting was set to 'Manual'. Having a 'Solder Mask Expansion' value may be required depending on the capabilities of the PCB manufacturing house.

The resulting capture of the PCB, in 3D, shows the changes.

Altium 3D Modified Cartoon Sun Cloud
Altium 3D Modified Cartoon Sun Cloud

PCB Shape - Cloud Sun
The PCB outline was defined using tracks on Mechanical 1 layer as this layer is commonly used to define the shape of the PCB.

PCB Finish - Cloud Sun
For the example PCB displayed above, a green solder mask and ENIG copper finish (gold) were used. Some alternative solder mask colours are red, blue, yellow, white, black and purple. The copper can be left raw to discolour due to oxidisation or coated with a finish such as lead-free solder, tin, silver or gold.


Example 2: Colour to Monochrome - Monkey
Converting the monkey image for use as art in Altium used a similar method to the first example.

Monkey Face - Courtesy free.clipArtOf.com
Monkey Face - Courtesy Free.ClipArtof.com

Some additional work was required to remove the colour and gradients. Firstly, the Greyscale filter in Inkscape was used to convert the image to monochrome.


Inkscape Greyscale Filter - Cartoon Monkey Face
Inkscape Greyscale Filter - Cartoon Monkey Face

Using the 'Fill Bounded Areas' tool in Inkscape, the areas with colour gradients were filled with white. There was a gradient (shadow) below the face which was also filled with white. 

Inkscape Monkey Face Monochrome No Shading
Inkscape Monkey Face Monochrome No Shading

Visible lines in the image may be imported by Altium and therefore these lines were removed. Using Inkscape's 'Brilliance' filter, the Brightness and Lightness settings were adjusted to remove the lines. Producing the desired results with this tool can take some tweaking.

Inkscape Brilliance Filter - Cartoon Monkey Face
Inkscape Brilliance Filter - Cartoon Monkey Face

Monkey Black and White
The cut and paste results in Altium are significantly improved when all colours are black. The 'Fill Bounded Areas' tool was used to ensure all regions were converted to black.

Inkscape Cartoon Monkey Face All Black Lines
Inkscape Cartoon Monkey Face All Black Lines

The image in Inkscape was exported as a PNG ready for import into Altium.

Placing Cartoon Monkey PNG Into Altium
Using the Place Object command in Altium, the Cartoon Monkey was added to a new blank PCB on the top copper layer.


Altium Cartoon Monkey Face Import
Altium Cartoon Monkey Face Import

Object Tweaks
For the Monkey design, all copper areas were changed to show exposed copper. The Solder Mask expansion changed to manual for all the copper areas.

Altium Cartoon Monkey Face Copper Selected
Altium Cartoon Monkey Face Copper Selected

Viewing in 3D showed that the solder mask was removed from the copper.

Altium Cartoon Monkey Face Exposed Copper
Altium Cartoon Monkey Face Exposed Copper

PCB Shape - Monkey
The PCB outline was defined using arcs around the Monkey head. These arcs were drawn on the Mechanical 1 layer as shown in the image below.

Altium Cartoon Monkey Face Mech1 Layer
Altium Cartoon Monkey Face Mech1 Layer

Setting the PCB shape was performed with the Mechanical 1 Layer arcs selected then using the Altium command Define PCB from Selected Objects.

Altium Cartoon Monkey Face Board Cutout
Altium Cartoon Monkey Face Board Cutout

Final Touches - Monkey
Holes were made for the Monkey eyes using two pads having a 3.8 mm holes.

Altium Cartoon Monkey Face Eye Holes
Altium Cartoon Monkey Face Eye Holes

Pictured below is the final PCB in 3D with exposed copper and holes for the eyes.

Altium Cartoon Monkey Face Final
Altium Cartoon Monkey Face Final

PCB Finish - Monkey
A black solder mask and ENIG copper finish (gold) were used for the PCB finish.

Example 2: Alternative Monkey
To achieve a PCB design similar to the image shown at the beginning of the blog, the black and white image required inversion. At the previous step 'Monkey Black and White', the image was inverted.

Monkey Head as PCB Artwork
Monkey Head as PCB Artwork

The Inversion Filter in Inkscape performed the conversion.

Inkscape Invert Cartoon Monkey Face
Inkscape Invert Cartoon Monkey Face

Adding a Border
After the Inversion, the image boundaries became the four extremities of the Monkeyface. Adding a black background using Inkscape assisted when importing the image into Altium.

Inkscape Monkey Face Inverted with Border
Inkscape Monkey Face Inverted with Border

With a black rectangle drawn in Inkscape, the inside area was filled with black. 

Inkscape Monkey Face Inverted with Background
Inkscape Monkey Face Inverted with Background

Placing Cartoon Monkey PNG Into Altium
Below is the PCB capture after using the Place Object command in Altium.

Altium Cartoon Monkey Face Alternate Import
Altium Cartoon Monkey Face Alternate Import

Object Tweaks
For the alternate Monkey design, the internal copper areas were changed to exposed copper.

Altium Cartoon Monkey Face Alternate Exposed Copper
Altium Cartoon Monkey Face Alternate Exposed Copper

PCB Shape - Monkey
The PCB outline comprised of two parts, a board cutout and the PCB shape on the Mechanical 1 layer. Firstly, the remaining copper region outside the Monkeyface was selected then changed into a 'Board Cutout'.


Altium Copper Region to Board Cutout
Altium Copper Region to Board Cutout

Viewing in 2D shows the board cutout.

Altium Cartoon Monkey Face 2D Cutout
Altium Cartoon Monkey Face 2D Cutout

Secondly, a Mechanical 1 Layer was added onto the PCB to define the physical PCB size. The Mechanical 1 Layer tracks were selected and the PCB shape was defined from the selected objects.

Altium Cartoon Monkey Face Alternate Mech 1 Layer
Altium Cartoon Monkey Face Alternate Mech 1 Layer

Viewing the PCB in Altium 3D.

Altium Cartoon Monkey Face Alternate Final
Altium Cartoon Monkey Face Alternate Final

Alternative PCB Shapes
Inkscape provides a tool called Trace Outline which can be useful when the shape of the PCB must be marginally different to the image shape. A modified outline can be imported into Altium as a separate object which would then be used to define the outline of the PCB.

Inkscape Monkey Face Trace Outline
Inkscape Monkey Face Trace Outline

Final Thoughts
The methods described in this blog can be used independently or partnered with electronic circuits to create visual PCB art. 

It should be noted that the placement of copper as art is not limited to either side of the PCB but internal copper layers also. Using only internal copper and a thinner PCB (1 mm or less) produces near translucent effects with the suitable backlighting.


No comments:

Post a Comment