Engineering and arts really do mix well together. The following tutorial will cover the entire process for designing and fabricating customized printed circuit boards (PCBs), that are perfectly functionally and aesthetically pleasing.
We will explore the ways in which we can use AI to create the graphic which we will then vectorize and insert in Kicad as a custom layout on which we will build our circuits.
Aesthetic choiceIn Norse mythology, Huginn and Muninn are Odin's ever-watchful eyes and ears, constantly journeying the world to bring back information for their master. In this tutorial we will use these two ravens as our source of inspiration to craft unique PCB shapes that can add to the aesthetics of Nicla Sense ME & Vision boards.
Hardware choiceThe Nicla Sense ME and Vision are powerful electronic boards with a multitude of capabilities. The Nicla Sense ME is equipped with sensors that measure temperature, humidity, and more while possessing the ability to control other devices via connectivity options. Meanwhile, the Nicla Vision's camera can capture images for image processing and computer vision applications in addition to running machine learning models on its own edge or through Edge Impulse platform integration for advanced AI features. All these features make this board an invaluable asset fit for a great array of projects.
Generating the graphics using MidjourneyWhile vector manipulation is a useful skill everyone designing PCBs should have, graphic design is a whole other beast and not being able to create intricate graphics should not stop anyone from being creative. Worry not, AI is here to help.
I believe that at this point everybody already knows what Midjourney AI is, but for those latecomers, Midjourney AI enables users to produce elegant but straightforward graphics. Users can quickly create logos, icons, and illustrations with it by providing a brief description of the desired graphic. The user can then select from a variety of design possibilities that the AI then generates, make variations on it and then upscale them for further use.
A trick to create simple yet beautiful graphics that can be easily vectorized and used in your project is to use the βstickerβ tag when issuing the prompt.
Some key takes before starting to generate graphics:
1. When creating a graphic design for PCB design keep in mind that you have 5 colors that can be used:
- The color of the solder mask
- The color of the silkscreen
- The color of the copper covered by soldermask
- The color of the copper layer
- Bare PCB color
2. The bare PCB color can be used as a transparent layer through which an LED can be shined.
Allright, with these out of the way let's move on to generating the graphics.
First up, I have started from the following prompt:
βsticker of a crow's head looking to the right, cartoon, logo, illustrator, --ar 1:1 --q 1 --v 4 β
While these are some great results, I am looking for a model that has a bigger eye and fewer colors, so I have started adding the βnijiβ and βanimeβ tags.
βsticker of a cute crow's head, logo, illustrator --nijiβ
This provided some great results. While 1, 2 and 4 were way too cartoonish for me, number 3 had great potential so I have decided to create a few more versions of it.
I found number 2 to really fit my needs so I have upscaled it, resulting in a 1024x1024px PNG. While not perfect, things can be easily fixed in the vector manipulation software.
Being done with Huginn, which will house the Nicla Vision board, itβs time to design Muninn.
βsticker of a cute raven head, norse mythology, blue eye, illustrator, vector art --v 4"
While I really like those, they have way too many colors to be represented on a pcb.
βsticker of a cute crow's head, logo, illustrator, minimalist, huginn, muninn --niji β
Now, this prompt led to some interesting results, especially number 4, for which I have created some variations and upscaled it, yielding the following result:
Yet again, not perfect and has too many colors but it can clearly be polished up.
Transferring the graphics to PCB1. Vectorize the graphic
The first step in transferring the graphics to our PCB design software is to vectorize them.
To do this, just upload the PNG in your favorite vector manipulation software and use the Image Trace or Trace bitmap function, making sure you do not have more than 4 colors in your design ( I have decided to not use the bare pcb as it does not fit my design).
In the case of Munnin, I had to give up on the color of its beak due to the restrictive color palette.
Before moving on, I like to define a color palette that is as close as possible to how the colors will look in reality and tweak the design accordingly.
Afterwards group together all the same colored shapes because each of them will be inserted on a different layer in KiCad.
2.Scale the graphic according to your hardware
Before splitting the graphic in the constituent layers, it is recommended to quickly sketch the hardware(if possible) to get a better idea on how it will fit your pcb and scale the graphics accordingly.
The Nicla Vision and Nicla Sense both have the same factor stated in their datasheet, of 22.85x22.86mm.
3.Split it in layers
This step is meant to greatly simplify your life when you intend to import the graphic in Kicad.
To do this, create 4 square artboards that will be corresponding to the following layers in Kicad:
Cutout = Edge Cuts Layer
!Solder Mask = F.Mask layer
Copper = F.Cu layer
Silkscreen= F.Silkscreen layer
To obtain the content for each individual layer, I like to paste the complete vector graphic in each artboard, make sure it is centered vertically and horizontally and then isolate each color.
The cutout layer must contain a path that defines the defining contour of the PCB board. The Copper layer will define the whole areas that will be filled with copper, whether they are covered or not by the soldermask. By default, the whole surface of the PCB is covered by a solder mask so we have to define it in the !Solder Mask layers the area which we wish to not be covered by it, aka the area in which we want copper to be exposed.
Another thing worth mentioning is that the graphic that will be pasted on the Edge Cuts layer must be a single closed contour. If you wish to add extra cutouts in your PCB, you must import them separately.
When you are done, export the layers as separate SVG files.
4.Inserting the graphics in Kicad
To do so, create a new Kicad Project and launch the board editor. For this tutorial, I have used Kicad 6.0.
Click on File -> Import -> Graphics and import each SVG or their designated layer, with the same scaling factor and same coordinates.
When you are done, it should look something like this ( of course it might vary based on the color theme you use for Kicad).
5.Verifying the dimensions of the board and rescaling the design
When importing SVG files in Kicad, some aberrations might happen. To check if anything fishy happened with your files, export them by clicking
Files -> Print -> Select All -> Print to PDF.
Afterwards, load the newly created file in your vector manipulation software and check the dimensions of the graphic element.
In my case, I have found that the graphic was rescaled with a factor of 1.33 so I had to re import everything while specifying the import scale as being 1.33.
Giving function to the PCBsBefore being able to create anything around the Nicla Vision and Nicla Sense ME development boards, I had to create custom footprints for them to import in Kicad. Because I do not want to mess with the front layer of the PCB where all the graphic elements are placed, I have decided to create a footprint compatible with SMD pins and use SMD components that can all be placed on the back of the PCB.
I will not go in detail about how that is done because that is beyond the scope of this tutorial, but I have followed a basic workflow of defining a symbol for the board and then measuring and creating a footprint for it.
For the Muninn PCB, I will be using the files provided in the documentation for Adafruit SPI Flash SD Card - XTSD 512 MB to wire the XTSD SPI Flash SD Card to the Nicla Vision to provide a way to locally store the information acquired by the on-board sensors. As for the Huggin PCB, no extra utility is added. The eye of the board will be just a hole that will be filled by the camera of the Nicla Vision board.
I will not go in detail about how that is done because that is beyond the scope of this tutorial, but I have followed a basic workflow of defining a symbol for the board and then measuring and creating a footprint for it.
The first step in ordering the PCBs is to generate the Gerber(.gbr) files and the Drill files(.drl). Make sure you have taken in consideration the limitations of the PCB manufacturer you are going to employ and that you have run the DRC on the board before exporting it.
Print the PCBs on paper before ordering them to see that everything fits:Before commiting the PCBs to fabrication, I like to save myself a lot of time by using a printer and some paper to check for any potential issues that might arise like incorrect dimensions, flipped components or other anomalies.
Nothing to add here, just order the PCBs from your favorite PCB manufacturer making sure the preview corresponds with your KicadFiles.
In conclusion, the fusion of AI-generated graphics with PCB design presents a compelling opportunity to revolutionize the aesthetics of electronic devices. By harnessing the power of AI, designers can effortlessly create visually striking PCBs that not only fulfill their functional requirements but also contribute to the overall appeal of the final product.
As we embrace the potential of AI in the realm of PCB design, it's essential to remember that this groundbreaking technology offers more than just efficiency and automation. It enables us to push the boundaries of creativity and innovation, transforming traditionally mundane circuit boards into captivating works of art.
Comments