5. Electronics production¶
This week I learned how to use the milling machines in our lab and milled and soldered two boards that serve vastly different purposes. I had never milled a PCB board this week or used our desktop milling machines, and I am incredibly excited to have learned how to use the milling machines and design PCB boards over the past week and am incredibly excited for the amount of room there is to expand my knowledge of these processes in the future.
Assignment
- Make an in-circuit programmer by milling and stuffing the PCB, test it, then optionally try other PCB processes
- Group Assignment: characterize the design rules for your PCB production process
Learning to use our milling machines
Prior to this week, I had never milled a PCB board. Therefore, I first needed to learn how to use our school’s Bantam and Other Mill machines before I could begin creating any of the boards that I needed to mill and solder for this week’s assignment. Our milling machines and the Bantam software that is used to operate the machines, including a function to measure that thickness of the PCB and a function to switch the tool that is attached to the machine. I also learned how to remove and replace bits from the machines as well as which bits are optimal for performing certain tasks. One of our instructors, Dr. Taylor, told my peers and I that 1/64th” bits are the most useful for cutting small traces and 1/16th” bits are the most useful for cutting the outline of the board which does not need to be as accurate as the traces inside of the board. I then learned how to interact with several safety features of the board, including learning how to stop the machine via the software by hitting the escape key on a keyboard or by hitting the “stop” button which is a black square located to the left of the timer. I was also told the location of the emergency stop button on our machines, which is located on the bottom left corner of each machine, should I ever need to stop the machine quickly in the event of an emergency. After learning how to perform these basic functions I was ready to begin milling my board.
Milling my blinky board
Above is the workflow that we use in the CLS FabLab for our OtherMill PCB milling machines. I used the same process for the milling of both my blinky board and programmer throughout the course of my work for this week.
My first experience with milling PCB boards came from milling this schematic provided to us by our instructors prior to beginning this week’s material. I milled this board by following the instructions outlined in the section above, but did encounter several issues throughout the soldering process that I will outline in the ‘soldering my blinky board’ section below. The process for milling my boards went on without a problem for the two different boards that I ended up soldering, so I did not need to implement any of the emergency or cancellation knowledge that I acquired during my introduction to milling. When milling my board, I used a 1/64th" bit for the traces of my board and a 1/16" bit to cut the outline of the board in order to free it from the excess copper on the remainder of the PCB board. I was also advised to leave the excess copper inside of the milling machine so the adhesion abilities of the Nitto Tape were not compromised due to repeated re-application each time a student wants to mill a board. An alternative to the 1/64" bit would have been a 0.005" or 0.003" engraving bit, the former of which I did end up using later on when milling my programmer boards, which are documented in the section after this one.
Blinky board milling video
Here's a short video of one of our OtherMill Pro CNC machines milling my first blinky board. This board ultimately failed due to a bridge or faulty component but I still got to practice my surface-mount soldering capabilities and received a helpful introduction to the milling machines.
Soldering my blinky board
The process of soldering my blinky board was relatively similar to the various other boards that I have soldered using surface mount techniques thus far in Fab Academy. However, one key difference between the 412 chips that are on the blinky boards is the significantly greater ease of soldering compared to those of the 328p variety that I soldered during the student bootcamp. Nevertheless, my first attempt at soldering a blinky board was a failure. After milling the board with minimal trace clearance to make the process consume minimal time, I needed to ensure that every drop of solder I placed on the board was applied with the utmost precision, which is something that I am certainly not the best at. As a result, I likely created one or more bridges on my board that caused Arduino’s to short out the moment I would plug in both the power and ground pins to an Arduino. Rather than attempting to painstakingly resolve each and every bridge, I decided to mill a fresh board with maximum trace clearance to eliminate the possibility of creating solder bridges on any piece other than the microcontroller. The board with maximum trace clearance also looks a bit cooler in my opinion, which is a definite positive. I was ultimately correct about the adhesion benefits of a board with maximum trace clearance, and due to the ease of performing this process when using multiple different bits, it is entirely feasible to do for each board that I mill in the future. As always, I began soldering my board by starting with the microcontroller, which has consistently proven to be the most difficult part of surface mount soldering for me thus far, though many of the tricks that I gathered from Duaa during the student bootcamp have made this process significantly easier. I began soldering my ATTiny412 Microcontroller by applying flux on each one of the eight pads so the solder would adhere better later on. I then oriented the microcontroller correctly by referring to the schematic and locating the small dot in the left hand corner of the microcontroller. After lining the board up and positioning it correctly on all of the pads, I soldered two opposite corners of the board so it would be difficult for it to pop off when soldering the remaining six pads. I quickly soldered the other six pads and was done soldering my microcontroller. I repeated this same process for each of the two blinky boards that I soldered, though I likely unwittingly bridged several pins on the original board that did not function properly. After soldering the microcontroller, I utilized my method of applying flux to one pad, soldering the same pad, soldering the component to that pad, pushing it down, and soldering the second pad. I quickly finished these steps for all of the remaining components, which included an LED, a 4.9K Ω resistory, a 499 Ω resistor, and a 1 uF capacitor. After soldering all of the components on each of my boards, I tested them by trying to upload the example ‘blink.ino’ sketch to test the included LED in my board to demonstrate my ability to mill and configure a DIY board. The lengthy process and the various tribulations that I encountered during this process are highlighted below.
Programming my board
Once I was certain that I had created a board that would allow uploading through the Arduino IDE, I then needed to upload the example sketch,‘blink.ino,’ to test the LED that I soldered onto my board in order to see if my chip would be able to receive uploads and blink an LED on my board. In order to test my board, all I needed to change on the blink sketch was the LED that would light up. Rather than keeping the value for the LED set to ‘LED_BUILTIN,’ I needed to change it to pin 0, which is the pin on the ATTiny 412 chip that my board was wired to rather than it being connected to the built in LED by default.
The process for uploading the code to the microcontroller was relatively involved as well, as it required the installation of a new library which included the ATTiny412 chips, the uploading of a programmer sketch to an Arduino, as well as the usage of a different programmer within the Arduino IDE. Figuring out how to use all of these features correctly in tandem with each other was the step that consumed the vast majority of my time spent working on my blinky board, as there were many different features that needed to be configured for the code to successfully upload to the blinky board. I've outlined the rough process of uploading the sketch to the blinky board with screenshots of the Arduino IDE and links to the various external features that needed to be downloaded for this to work. Enjoy!
Installing and configuring ATtiny412 boards within the Arduino IDE:
In order to upload the code to my ATTiny412 board, I needed to be able to select the board within the Arduino IDE, but the board does not come included with base install of Arduino, so I needed to install the megaTinyCore library from its GitHub page and configure it within Arduino.
a. The first thing I needed to do was clone the GitHub repo and configure it within Arduino. To do this, I first navigated to the 'additional boards manager URL's' field of the 'preferences' tab of the IDE and copied the 'clone with HTTPS' link from the GitHub repo into this field. b. After installing the boards into the Arduino IDE, I navigated to the 'boards manager' field under the 'tools' menu of the IDE and selected my ATTiny412 chip. After this, I needed to turn my Arduino into a programmer that used the jtag2updi programmer in order to write to my blinky board.
Preparing an Arduino to program my blinky board
As I would need to write to my board using the jtag2updi programmer, I first needed to install the sketches that I could upload to an Arduino so it could serve as the programmer for my blinky board. Obviously, programming a board like this is an abhorrent activity, but I had not yet fabricated my own programmer at the time of originally programming my blinky board. In order to upload the sketches, I first needed to download them. The jtag2updi sketches and files are located on this GitHub page. Rather than cloning the repository via HTTPS, this time I simply downloaded them as a zip and extracted the files into a separate folder. After extracting the files into a folder, I removed the '-master' from the end of the file so that the code would still work when the folder 'jtag2updi' was referenced in the code, as leaving the file named 'jtag2updi-master' would throw various errors upon compilation.
GitHuh repo with jtag2updi files and Arduino sketch Downloading repo as zip file in order to extract and change the name of the file to 'jtag2updi.' c. After extracting the files from the zip, I opened the 'jtag2updi.ino' sketch that was included in the file in the Arduino IDE and uploaded the sketch to my Arduino using the normal Arduino settings.Writing to the ATTiny412 chip on my blinky board
a. The remainder of the process for programming my board was relatively straightforward, as I simply needed to upload the 'blink.ino' sketch that comes pre-installed with Arduino to my 412 chip. In order to do this, I did need to change several settings within the Arduino IDE, including the programmer and board. b. To change my programmer, I simply navigated to the tools -> programmer section of the IDE and changed the programmer to 'jtag2updi,' which was included in the download of the jtag2updi sketches that I documented the installation of in the previous step. I changed my board to the 'ATTiny412' and then selected the correct port per usual. c. After all of my settings were ready, I simply selected 'upload using programmer' in the Arduino IDE and successfully uploaded my blink sketch to the Arduino. I have included a video of the working blink board below.
Here's the code that I uploaded to my Arduino to test the LED. Lighting up the LED is really the only thing that this board can do, but this was a good test of my soldering and milling capabilities that I can implement in more advanced forms later on throughout the program and throughout the remainder of my life when participating in various engineering activities.
Blink Turns an LED on for one second, then off for one second, repeatedly. Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to the correct LED pin independent of which board is used. If you want to know what pin the on-board LED is connected to on your Arduino model, check the Technical Specs of your board at: https://www.arduino.cc/en/Main/Products modified 8 May 2014 by Scott Fitzgerald modified 2 Sep 2016 by Arturo Guadalupi modified 8 Sep 2016 by Colby Newman This example code is in the public domain. http://www.arduino.cc/en/Tutorial/Blink */ // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(0, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(0, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }What I learned from making my blinky board
Throughout the process of milling my two blinky boards, I learned that maximizing trace clearance is ideal for increasing the ease of soldering boards. However, when I was soldering my blinky boards I did not use the most optimal settings within the BanTam software, though I did discover the best settings to use later on when soldering my programmer throughout the latter half of electronics production week. Ultimately, throughout the process of soldering my blinky board I significantly improved my surface-mount soldering capabilities as well as my ability to program custom boards within the Arduino IDE.
Creating a FabUPDI programmer board
As mentioned in my documentation for my blinky board, utilizing an Arduino as a programmer is a terrible thing to do and stands in direct violation of a multitude of Fab maxims. Therefore, I took it upon myself to create a programmer board that would allow me to program my fabricated boards via another fabricated piece of technology, ultimately eliminating the need for external technology in my projects and starving the corporate greed that has plagued the maker community for eternity by eliminating my need for certain products. I failed often throughout this process, primarily on two different portions of the board, these parts being the microcontroller and the row of 2x3 headers that are used to write to the programmer itself. I have extensively documented each and every failure that occurred throughout the process, so this section will be incredibly lengthy. I hope it is informative and useful to anybody who might be planning on creating this same board in the future.
Milling my first programmer
I began the process of fabricating my programmer with high hopes, thinking that I might make a couple of mistakes along the way but would exit the process largely unscathed. I milled my first board with 1.0mm of trace clearance and a trace depth of 0.25mm, which were the most optimal settings that I had discovered that also allowed for a higher allowance of error in creating solder bridges and preventing the ripping of traces throughout the process.
NOTE: To avoid documenting the same milling process repeatedly and preserving my sanity, I have only included documentation for the milling of boards which entailed a paradigm shift in the milling methods employed.
For all of the programmers that I milled and soldered this week, I followed Adam Harris' FabUPDI Programmer schematic which can be downloaded from this GitHub repository.
Soldering my first programmer
I began the process of soldering my first programmer by applying flux to each of the pads on which the microcontroller would be placed. However, as I had not soldered a chip with such close pins in several weeks, I momentarily forgot quite how difficult it is to accurately solder the pins to the board. As a result, I created lots of bridges on this first board and decided that it would be best to simply mill another board and restart altogether. The second board that I soldered is likely where the most disappointing failure of the entire process occurred, which is elucidated in the next section.
Soldering my second programmer
When soldering my second programmer I slightly increased the trace clearance to 0.8mm from 0.5mm to give me a little more room between traces so soldering would be easier. This ultimately proved to be true as I was able to solder my board with greatly increased efficiency and accuracy after fluxing each pad before soldering. While I did almost finish my board, I ultimately failed on this board after I ripped up two pads on the row of 2x3 headers that are used to write to the programmer. After ripping the pads, I could have repaired the traces using jumper wires and simply connected the headers to my Arduino or whatever I was using to program the programmer via another jumper wire, but I wanted to prove that I can actually solder a board without utilizing replacement jumper wires at least once before resorting to restorative means such as jumper wires.
After soldering my second programmer, I learned an important lesson about soldering my headers to the board. This board likely would have functioned properly as I spent lots of time ensuring that each solder joint did not include any bridges; however, I ultimately pulled two pads on my headers when trying to adjust them. After making this mistake, I concluded that in the future I would spend more time ensuring that my headers were properly oriented prior to allowing the solder to dry to the board. This strategy prevented many bridges from occurring throughout my next boards, but various other problems presented themselves throughout the course of soldering my next boards which are described below.
Changing my milling process
Following my first two failures, I began to ponder how I could improve the ease of soldering on my boards, and I figured that maximizing the trace clearance within the Bantam software would allow me to solder the pins and components to my board with significantly greater ease. However, I ultimately discovered that milling boards in this manner significantly increased the likelihood of ripping traces off of my board. When milling the boards with incredibly high trace clearance, I discovered that using two different tools could optimize the process of milling significantly. Ultimately, by using a 1/32" bit for the majority of the traces and for removing the excess copper from the board, and using a 0.005" engraving bit for the smaller traces such as the ones for the microcontroller, I managed to reduce the estimated milling time in the BanTam software from around 1.5 hours to just 10 minutes, obviously not including the several minutes that were consumed by taking the necessary safety precautions for both myself and the bit whilst swapping tools. I did end up using this PCB design for the next three boards that I milled and attempted to solder, but ultimately reverted back to using boards with 1.0mm of trace clearance in order to decrease the likelihood of me continuing to break traces in the manner that you will see throughout the next three boards that I attempted to solder.
Soldering my third programmer
Soldering my third programmer went much like the previous two. I destroyed my third board when I bridged the microcontroller on the board to an extent that I deemed impossible to correct without an unnecessary waste of time spent trying to correct an error that I was unsure of whether or not I could actually resolve. Ultimately I decided to simply mill another board with high trace clearance and restart entirely for the fourth time.
Soldering my fourth programmer
I felt significantly more comfortable when soldering the micrcontroller on my fourth programmer board, but ultimately failed when I ripped a trace on one of the header pins and had to restart my board.
Soldering my fifth programmer
It was not until I soldered my fifth programmer board that I actually successfully completed the soldering of a board. However, upon attempting to upload a blink sketch to my Arduino, I received an error that is indicative of a short somewhere on the board. Still not confident in the possibility of there only being a single short on my board, I decided to mill another board but revert back to using smaller trace clearance on the board to hopefully prevent the further ripping of traces on my board.
Soldering my final programmer
After failing to correctly solder three consecutive boards that I milled with maximum trace clearance, I decided to mill a board with lower trace clearance for several reasons. Firstly, I wanted to make tearing traces off of my board slightly more difficult, as I found that removing the excess copper from the traces significantly increased the likelihood of a soldering iron ripping a trace or a pad off of the board. Second, I found that decreasing the trace clearance on my board would increase the ease of desoldering, as I could simply scrape excess solder onto the outline of the board rather than attempting to remove the solder from the board entirely which was required when I did not have any excess solder on the board when maximizing trace clearance. Soldering this board was relatively similar to all of the other boards that I had soldered up to this point. I fixed several bridges by implementing a variety of methods that I have acquired over my time participating in engineering, including utilizing solder wick and tweezers to remove visible shorts. After I was satisfied with my programmer and was decently convinced that I had eradicated the entirety of the bridges, I was ready to program the board.
Programming my board
The process for programming the board required two other chips, one to program my programmer and the other to be programmed by my programmer, so I could verify that the device worked as intended. I first needed to upload the ‘ArduinoISP’ sketch to a generic Arduino that would serve as the programmer for my board. After uploading this sketch, I then burned a bootloader onto my board so that various settings would be configured, which would allow other sketches to upload successfully later on. After loading the ArduinoISP sketch onto my board, I opened the ‘jtag2updi’ sketches described in the latter portion of this page and uploaded them to my programmer using the ‘jtag2updi’ programmer and selecting ‘Upload Using Programmer’ within the Arduino IDE. Once I uploaded this sketch, I uploaded the blink sketch to my board to test the onboard LED using the same ‘jtag2updi’ programmer as in the previous step. Following the successful blinking of my board, I was ready to program an FTDI board using my programmer. I decided to upload the blink example using the same process as before and connected the FTDI board to the row of six header pins on my programmer. I uploaded the sketch successfully, confirming that I had built a functioning programmer that I can use for all of my future Arduino projects throughout Fab Academy.
Programmer Conclusion
Soldering and programming my FapUPDI programmer board was not a simple task, and the many failures that occurred throughout the process that consumed many hours of my time were incredibly frustrating in the moment, but I do recognize that the many repeated failures and the eventual success improved my surface mount soldering abilities significantly, and these skills will be immensely applicable over the course of the next four months as I begin to solder larger boards with similar microchips, as I am relatively certain that the ATMega328P is the most difficult that SMD soldering will become throughout the program. After six attempts I am incredibly glad to move onto other material, but I also am excited to have surmounted the inconceivably daunting task of milling, soldering, and programming a FabUPDI board.
Week 5 Group Project
For this week’s group project, my peers and I were tasked with characterizing the settings for one of the milling machines in our lab. As this assignment was relatively small in scope, two of my peers, Graham Smith and Teddy Warner, milled a file on one of our OtherMill Pro machines that demonstrated various trace depths and widths so we could determine the most optimal settings for our machines. I contributed to this week’s assignment by writing about the experiment and filming the milling process. Our findings are documented in extensive detail on our group site.