Skip to content

8. Electronics Design

This week there was both a group project and an individual project. The individual project was to design and mill a PCB board. The documentation for the group project can be found here.

Fusion360 Attempt

I began by following this tutorial and its accompanying series in addition to this clip from Adrian Torres which gives a brief and simple tutorial on creating a PCB board design in KiCAD, specifically with an ATTiny412 microcontroller to attempt to learn PCB board designing in Fusion360. I created the PCB board schematic shown below:

But when I went to the PCB editor, I came across a lot of problems with the auto-routing feature in Fusion360s electronics which is supposed to automatically route your traces based on your schematic without overlapping traces.


Eventually, I just chose one and tried it.


I then added a circular outline.

However, I then ran into another problem when I tried to export my board. Kabir Nawaz, who is very knowledgable about electronics and the only other person who used Fusion360 instead of KiCAD in my lab, helped me to understand Fusion360 PCB board design and troubleshoot my problem in exporting the file, as it would not appear as more than an outline on Bantam Software. Eventually, I decided to cut my losses and switch to KiCAD, as I have learned that it can waste a lot more time trying to continue on a troublesome path than just restarting on the well known and documented path.

KiCAD Attempt 1

I now began my designing my board in KiCAD. I first downloaded the fab library for KiCAD from here. I again watched Adrian Torres’ clip but followed along in KiCAD, adding a few additional components such as a button and additional LED that is connected to VCC instaead of a pin so as to be able to tell if a problem is involved in wiring and power or in coding. After creating this schematic, I realized that I had messed up some of the libraries. The fab.pretty file in the library download above is supposed to go in the PCB editor by going to Preferences>Manage Footprint Libraries, and selecting the small file icon. Similarily, the fab.kicad_sym file is supposed to be imported into the schematic editor. However, I did not import the correct libraries into the correct places (I had them switched around at first) until after I had finished the schematic. Additionally, I had accidentally used components outside of the library in the schematic. Likely because of these mistakes, my board could not be created in the PCB editor when I selected ‘Update PCB From Schematic’. Thus, I restarted my schematic.

KiCAD Attempt 2

On the second attempt, I ensured that I imported the correct libraries before beginning designing. Eventually, I ended up with this schematic:

I then went back to the PCB editor, updated it, and saw no significant errors. I then organized it a little so that I had this:

I then added in traces manually.

Now, I wanted to customize the board so that it included visual components in addition to the practical, electronic components. Taking inspiration from my exploration of the photo editor and 2D raster software Gimp, I wanted to add an engraving of Dr. Neil Gershenfeld’s face on the board in addition to either my name or “Fab Academy”. At first, I used the black and white image I had created with Gimp in week 2, as I thought this would be easiest to convert to an SVG, however, because of the lack of contrast between his hair and the white background, I could not make it work in any PNG to SVG converter, nor could I make work the original photo. Eventually, I found that Angelina Yang’s documentation referenced an image converter in KiCAD which I then decided to use. I again tried with my Gimp edited PNG, but chose a different picture after that did not work in which Neil was quite a few years younger. First, I downloaded the image and navigated to it in files. As shown below, I right clicked the file and opened it in Paint.

I then selected File>Save As>BMP Picture and changed the file type to Monochrome Bitmap. This would save a new file of this picture but in the form of a black and white bitmap. From here, I tried both Inkscape and the KiCAD image converter, both of which produced about the same result.

I copied this as a footprint from the KiCAD image converter and imported it into my PCB desin editor. From here, I played around with the scale, eventually choosing .3, as this was the best looking size. I then had to figure out how to get Neil’s face to appear as a layer that would be cut because at this point it was considered part of the “Silkscreen” layer, which I figured out does not show up on Bantam. After creating the Neil face design, I also added some text:

I took away my initials and had to inverse the other text so that it milled out the text and not the area around the text. I then had what I thought was a fully completed PCB design:

Below is the 3D model.

Milling this attempt

Now that I had a design ready, I exxported it as a .gbr and downloaded it on the milling computer, opened it in Bantam, and began configuring the settings.

Once I thought I was good to go, I milled the board.

However, when going through the process of selecting the appropriate settings in Bantam, I stupidly set both the trace depth and the trace clearance to 1.5mm. In addition, I had neglected to change the trace width in KiCAD, so it was incredibly thin. This left me with a board that took over 45 minutes to mill, had a trace depth of almost the depth of the board, and produced traces so infinitesimal they broke from the slightest touch. Further, the text and graphic fell off because of the trace depth. It was comically horrible.

Milling again

I went back to KiCAD, changed the trace width to .5 mil per Collin Kanofski’s recommendation, and put Neil’s face further from the edge, as this was part of the problem before. I then sent it back to the milling computer, put it in Bantam, and set trace clearance again to 1.5mm, but set trace depth to .15mm (what it is supposed to be) this time. I finished configuring all the settings, and milled again. This board came out much better looking.


Board after soldering and taking off components

Started soldering

I collected the necessary components for soldering my custom PCB, all of which are in the table below:

Component Image Quantity
ATTiny412 1
LED (any color) 2
Resistor (330ohms or 470ohms) 3
470 uf Capacitor 1
Conn Header SMD 1x3 Female (cut displayed piece in half) 1
Small Push Button 1

I began to solder this board, and I was already 3-4 components in when I realized I had messed something up. The female header for VCC was not connected through a trace to the ATTiny412 VCC pin. At first I asked Mr. Dubick if I could just solder on some jumper wires, to which he said I could, but I then decided that it could take a lot longer trying to make that board work, so I cut my losses and restarted, removing the components from the bad board so that I could reuse them.

KiCAD Attempt 3

The best way I could figure out to connect my VCC pin to the header was pretty sketchy. It went under the button to where the button had a trace connecting it to VCC so that it looked like this:

Final Milling, Soldering, and Programming

I milled this board with the same settings and soldered all the components on.

Then, I wired it to the Quentorres board I made in Week 6 using an adapter board. I connected the GND, VCC, and UPDI on the adapter to the corresponding pins on the header on my board using male to male jumper wires. After plugging in the Quentorres board to my computer, the LED connected to power lit up! This means that power was flowing through to the board and that there was no major problem with the wiring of the VCC, GND, or all the other traces connecting these pins to the header and the LED.

I uploaded the uf2 file found here to the board when I made it into a programmer. I then went through all of the settings detailed in my week 6 documentation before uploading the Arduino IDE blink code shown below which uses the pin my LED is connected to on my ATTiny412 board:

void setup() {
  // Initialize LED pins as outputs
  pinMode(2, OUTPUT); // LED 
}

void loop() {

    digitalWrite(2, HIGH);  // Turn on LED
    delay(1000);
    digitalWrite(2, LOW);  // Turn off LED
    delay(1000);
}

At first it gave the error UPDI Failed, but I soon realized that I was somehow missing a resistor on my Quentorres board. As a temporary solution, I found a resistor and held it on the board as the code uploaded. It blinked!

I soldered the resistor on and re-uploaded the code and it still worked just fine.

Reflection

This week was yet another which is very simple at its base and really only builds a marginal amount off of what we have learned previously, but you have to figure out what is going on for it to really be simple. However, through some tutorials, guidance from classmates, and lessons from instructors, this week taught me the basics of PCB board designing, along with reinforcing my confidence in milling, soldering, and programming custom PCB boards.

Files

The files for this week’s assignment can be downloaded using this link.


Last update: March 24, 2024