JANET LIUHow to Make (almost) Anything

## PCB Design This week, we were supposed to expand out of what we did in week 3 with electronics production. This meant designing the actual boards we were going to mill and solder, before actually building the board. This was my first time ever doing electronics design, and I ended up using KiCad because it was a more seamless download process. However, I ran into several bumps along the way with KiCad. To start, I imported the [KiCad library](https://gitlab.fabcloud.org/pub/libraries/electronics/kicad) and the [USB footprint](https://gitlab.cba.mit.edu/classes/863.21/site/-/issues/29) that Zach posted. After importing the library, I took inspiration from a lot of different boards ([echo hello](http://academy.cba.mit.edu/classes/embedded_programming/D11C/hello.D11C.echo.1.png) and [blink](http://academy.cba.mit.edu/classes/embedded_programming/D11C/hello.D11C.blink.png)). I went with the same SAM D11 C-14 chip that we used last time, since I don't have that much experience with microcontrollers and the section TFs said that was the simplest to use. The button and LED were all given to us, and I used the same 2x2 connector from our week 3 echo board. A lot of the other components were pulled directly from that board as well, with resistor and capacitor values pulled from the [KiCad](https://vimeo.com/625848785/cbcd8b5d3e) and [Eagle](http://mtm.cba.mit.edu/2021/2021-10_htmaa-demo/) recitations. Rob was also a big help here, to help me figure out what resistors/capacitors I actually needed. Once I laid out all of the symbols on my schematic (pressing a to add in the symbols before looking them up in the fab library), I had to actually wire them up. To do this, I followed the above mentioned boards. I wired up the voltage regular, capacitor, resistors, USB power source, and 2x2 connector like it was done in hello echo. To add in the button and LED, I just looked at the SAM D11 data sheet to figure out which pins I could use. It turned out that I could use most of the pins, so I just chose two random ones to wire up the button and LED. Per Rob's advice, I wired the button to a spearate pin from the LED. Thus, I could use my code to detect when a specific button got pressed, to then trigger the LED turning on and off. Then, I was left with the below schematic. I didn't have the libraries downloaded (somehow my KiCad library paths were not linked properly), so I used a 1x4 symbol for the USB. <figure><img src="../images/full/05/schema_pt1.png" width="500"/> </figure> Once I had my schema, that's when I ran into a large problem. For some reason, my KiCad was not letting me open up the PCB editor to actually set up the traces and footprints. When I opened it up, there was no black screen + I was unable to load in my netlink file. That's when I talked to Reuben and I realized I was also missing the builtin libraries. I thought this was an issue where I didn't download the Library Support folder, so I redownloaded KiCad. However, even after waiting to download both the application and the support files, my KiCad still didn't work. <figure><img src="../images/full/05/no_pcb.png" width="500"/> </figure> After fumbling around in KiCad and redownloading it multiple times with no success, Reuben kindly let me use his laptop (with a working KiCad program) to create my schematic and traces. He also had the built in libraries installed, so I was able to add in the actual USB connector. After a lot of routing and re-routing to fit things together, I was able to come up with a successful svg file: schematic | traces | :---------------:|:---------------: ![](../images/full/05/reuben_schema.png) | ![](../images/full/05/reuben_traces.png) ## Creating the SVG Files Now that I had the actual SVG files, I had to split the file apart into the copper trace cuts and the outline cut. I downloaded InkScape to do so, but had a lot of trouble with it. I was able to create the cu and outline layers easly, as described in the KiCad recitation. However, I was unable to join the polygon for the outline and fill it in as described. After combining/joining/uncombining/recombining the outline in many different iterations, I was still unable to fill the outline in using fill and stroke. When I manually used the paint bucket option, my fill had some white lines/patches in it: <figure><img src="../images/full/05/broke_outline.png" width="500"/> </figure> Finally, I somehow fiddled around enough + selected/joined things in the right order, and was able to use the paint bucket option to get a weird semblance of an outline. It was not exactly the shape I had originally imported (it had slightly bevelled corners), but I wasn't complaining at this point. The outline didn't cut into my traces anywhere, so I called it a day and exported the two layers as separate plain SVG files. final outline | final traces | :---------------:|:---------------: ![](../images/full/05/final_outline.png) | ![](../images/full/05/final_traces.png) ## Milling and Soldering I was feeling pretty good about milling and soldering, since we had done it already. However, I ran into a few issues. The first time I tried milling it out, I didn't put enough tape on the backside and the plate moved with the bit. Ater cancelling that, I also realized that I was cutting inside the traces, rather than cutting them out. After inverting it and fully securing the plate, I was able to mill out the traces. <figure><img src="../images/full/05/milled_traces.png" width="500"/> </figure> At first, I thought it was way too small. The pads looked pretty small, and the traces were all super tiny (compared to what I remembered from week 3). However, after looking at it a bit more and putting the actual components on the board, I realized it was the right size fit. Then, I swapped out the bit and milled out the outline. Finally, I was ready to solder! <figure><img src="../images/full/05/milled_part.png" width="500"/> </figure> Once my part was milled (and the size was confirmed to be correct), I went to solder. At first, I had a tough time soldering. I soon realized it was becuase I was using lead-free solder, which Nathan had said was harder to solder with than normal solder. This lead to some connections that had this werid frosty/white texture to it (circled red in the photo below). After switching to normal solder, I was able to continue like normal. It was still harder than last time -- last time, the pads were a little larger and easier to solder on. But, I was able to get everything on the board! <figure><img src="../images/full/05/final.png" width="500"/> </figure>