5. Electronics production

This week’s individual assignment was to mill and stuff an in-circuit programmer with a PCB. The group assignment was to characterize the design rules for this PCB making production process by documenting feeds, speeds, plunge rate, depth of cut (traces and outline) and tooling.

Group assignment: Characterize the PCB Process

We worked with our fablab’s Other mill Pro, a small CNC subtraction type machine made by Bantam Tools. We started our testing by cutting a simple ruler on the fab academy assignment page. Traces Outline We had to do the traces and the outline separately because the mill cuts them separately. We imported them as PNG’s to the fab modules page and made them into g-code files for the mill. Using this ruler we were able to characterize the process and the specifics outlined by the project. The process we followed and all of our issues are outlined on our {Week 4 Group Assignment Page](http://fabacademy.org/2020/labs/charlotte/groupasswk3.html#home).

We all worked collaboratively while trying to make the g-code, it was a relatively new process to us. Most of the troubleshooting and planning out was also done together. I helped set up the machine and fully mill the board with the g-code files we devised.

Individual Assignment

The individual assignment this week was to mill and stuff an in-circuit PCB programmer. Oversimplifying what this all means, PCB simply stands for “Printed Circuit Board,” and an in-circuit just means this board is capable of programming other boards cost effectively.

Our group collectively decided we were going to make the FabTiny ISP. An earlier fab academy student designed this and documented his steps making it here.

We started out by importing the files we needed for the boards as PNG’s.

But before we could actually cut them out we needed to make them into and making them into something the mill could read and execute as cuttable/millable toolpaths (g-code). To make this g-code we used the Fab Modules Page. There is also a Fab Mods Page but we chose to use the former. Once you have navigated to the page, simply select “Input Format,”

“(image) .png,” and select the file you want to upload from your computer when the popup file folder prompts you to. Then navigate to “Output Format” and select “Othermill (.nc)”.

After that, select “Process” and select 1/32 inch bit (for outlines). Later we will select 1/64th for the traces.

Finally, select “Calculate” under “Process,” and this will calculate the toolpaths for you. Hit “Save” and your files will be saved. Repeat the process with the Trace file (note; select 1/64th under “Process”). And you will have both the files you need.

This is what it looked like with mods (not modules) for reference. We didn’t use these files but they are another option we experimented with.

Before we uploaded the files and milled them, we cleaned the mill with a special vacuum to remove any residual dust and grime from prior cuts, as many of our cuts are so small that little particles could make the board not lie flat. We then measured the length and width of the material we were using(then put these values into our g-code files and re-saved/exported them) and put a strong double sided adhesive on the back to ensure it would stay flat on the bed.

After this you change the bit of the machine and adjust the settings so the machine knows what bit you are using. We also had to home the machine in the x y and z axis, so the machine knew where it was, however the g-code incorporated the dimensions of the board and most of the settings so we were able to upload our files and mill the board without doing much else in between.

In the last photo, you can see that some of our traces look different from the others. This is due to our material not being completely flat, so the height of the material (based on thickness of the material) wasn’t uniform throughout. We had to press it down flatter and move the position of the z axis down a few mm to get the bit to cut through all the way.

When we were done milling the traces and the cuts, we removed the copper, sanded stray traces, and began surface mount soldering. However, I almost immediately ripped up a trace so I had to remill my board. Me and a few others who had immediately ruined our boards experimented with using a .003 inch bit for the traces, which had been suggested to us earlier. However, we didn’t change out g-code file settings and later while soldering, we noticed the traces ended up being far too close to each other, which made soldering very hard, I kept accidentally making solder bridges between traces that were not supposed to be connected. Next time we will adhere to the 1/64th inch guideline.

What the PCB should look like:

source

What mine looked like (after round 2):

Soldering:

I started by gathering all the materials outlined by the tutorial referenced above. They are as follows:

  • 1x ATtiny45 or ATtiny85
  • 2x 1kΩ resistors
  • 2x 499Ω resistors
  • 2x 49Ω resistors
  • 2x 3.3v zener diodes
  • 1x red LED
  • 1x green LED
  • 1x 100nF capacitor
  • 1x 2x3 pin header

There were also a number of schematics provided to follow. I found the wire diagram and the actual photo of the board most helpful so I included them here.

source

I took a moment to tape my board with doible sided adhesive, and gather a solder iron and solder. There is also a small part of the end of the board (The end of where the USB would be plugged in) with copper on it that needed to be scraped off, which I did before I started soldering. I tried to follow the instructions as laid out in the FabTiny ISP source by starting on the inside with the smaller parts then working me way outwards. I started with the ATTiny component. My process was to heat up the trace first, then hold a tiny bit of solder on top of the trace until it started to melt and follow the trace. I would do this on the board (without the component) so that I could then reheat the solder and push the component leg into the solder with a pair of tweezers. I found my parts often dired crooked like this, but when I tried to place the parts and then solder, I would end up knocking the part over. The first couple of time I got too much solder on, and I had to press a solder “braid” (a strip of material you can buy online and in various other places). You use the braid by placing it over the excess solder you want to be removed, then by placing your solder iron on top of the braid. The solder will begin to flow through the braid, then you can remove it. Doing this took me a couple of tries. This is how my first component (The ATTiny) turned out:

My first couple of solder joints came out alright, but I immediately noticed I had flipped the orientation of this piece. This doesn’t apply to every piece, but certain pieces have polarity, and the electricity won’t flow in or out unless the energy is meeting the component at the proper leg, where energy is meant to be flowing either in or out. I tried to use the solder braid here, but I couldn’t get it to work the first time. I started trying to heat up the joints and wiggle the part with the tweezers, and ended up ripping a trace (a piece of the copper needed as a “wire” up). As mentioned earlier, I had to go back to the mill. After this, I continued to solder parts on from middle to outside, keeping in mind that I should be doing the smallest parts first.

I soldered the ATTIny again, then did the resistors (they don’t have polarity, and I wanted to practice my soldering without having to worry about flipping another part and not noticing for a while). I then put in the capacitor(has polarity, look for the marks denoting the cathode side), and finally the diodes(also have polarity, and little marks denoting the cathode side). The images on the FabTiny tutorial were very helpful for seeing which direction the parts with polarity needed to be. I finished by putting the 6 pronged pin on (ISP header) and copied all the extra solder bridges on the photo, mainly the ones at the end of the USB (so it can be plugged in) and connected a bridge with little disconnected semi-circles. If you look closely, this leads to the major ISP pin on the 6 pronged ISP, and when you connect it, it allows this path to connect to a programmer. Without this connection, this currently un-programmed piece of PCB will not be able to be programmed. After it is programmed, I will remove the solder so there is no more connection and the board can no longer be programmed, it can only program other boards (which is the end goal).

My biggest problems (as stated above) were getting too much solder on the part and putting parts in slightly crooked. There was also a very long time where my solder all suddenly stopped melting after it had been working fine. I spent a lot of time pressing very hard trying to get the solder to melt, and wasted a lot of time switching out components that I thought I had broken somehow. It turns out a bin of scrap pieces of solder had been commingled with solder that didn’t melt at our standard solder iron temperature, and I had tried using pieces of that. That lead to me pressing a 750* iron on my board very hard, for a very long time and leaving marks on it from that. None of these errors actually inhibited the functionality of my board, it just doesn’t look particularly pretty. I hope that as I solder more I can make it look a bit better.

Final board:

Programming

The final step was to program the board as a programmer. We want to be able to progrma our PCB’s into functional USBTinyISP’s, and then use our USBTInyISP to program something else.

I started by plugging in my PCB’s 6 prongs to another student’s functional programmer, plugging that programer into a random computer(as a power source) and plugging my PCB into my windows computer (which I will be using to program).

I needed to download the proper toolchain for windows. I started by downloading the Atmel AVR toolchain for windows but this link will lead you to a menu that allows you to choose the right downlaod for your computer. You then have to extract the files, when extracting you should navigate to your “C” drive (local disk) and go to program files. All the file folders you need to go to will be described here. You can then double click on the top bar of your computer and it will give you a path “link” that can be copied into anything asking you for a file location.

To get the written path: Double click on the below, then Ctrl + C and Ctrl + V the path)

The installation GNU.make. There are “make” files, they will allow us to “make” the code we input as a programming language into hexadecimal form on our PCB, because hexadecimal is what a PCB will understand. Repeat the same steps as above, but put it in “Program Files (x86” instead of just “Program Files”. Run the file so it opens. Make sure it finishes installing before you move on to the steps with the command line.

Then install AVRdude. Repeat the above, place it in “Program Files”. These are all tools we will need to access through the command line, but before we get to that our computers need to know how to get to these tools, so you need to add them to your path variable. To do this: Search “environment” in your search bar or navigate there from the control panel. It should bring the next image up.

Click on “Environment Variables…” and double click on “Path”

Add the three last paths:

  • C:\Program Files (x86)\GnuWin32\bin
  • C:\Program Files\avrdude
  • C:\Program Files\avr8-toolchain-win32_x86\bin

There are a few more downloads you need: The installer for the “driver” (the program that will control the PCB) is called Zadig.

With your PCB plugged in, and select the following settings:

This screencap was actually taken after the drivers were installed. The bottom left corner tells you that drivers were “installed successfully,” I assume it will alert you if something is wrong. Where it says “Reinstall Drivers” Will say “Install Drivers”, click that to install. Finally, we have all the necessary paths.

Programming

We are about to use a programmer to make my PCB into a programmer. I plugged my PCB’s 6 pins into female to female plugs, and put the other end in the already finished programmer. (Make sure the ISP pins line up!) Once this is done,I will also have a functional board programmer (for now I will call it a PCB to avoid confusion, but eventually they will both in fact be programmers).

The I plugged the programmer into the USB port of my computer, and plugged the PCB into another random USB port connected to a computer so it would have power (the power doesn’t flow through from my computer to the PCB.” The red light will light up if this is working. I opened powershell, and did “cd” (changed directory) into the C drive and downloads file containing the GNU from earlier (also called fts_firmware…)

While in that directory, I ran the following commands. 1. make all 2. make flash 3. make fuses 4. make rstdisbl

That’s it! I plugged the USB into my computer and navigated into devices on the control panel so I could see if my computer recognized the board as a USBTIny, and it did.

I then removed the solder closing the ISP bridge. To make sure my programmer could program other things, I uploaded a basic blink code from arduino onto it. After you open the app, under “Files,” “Examples,” “Example 1” I chose “Blink.” This loaded a code that will make the LED on the Arduino turn on and off.

Click “Tools”, set the “Board” to Arduino Uno Click “Port”, set COM to any serial port (except COM1). Click “Programmer”, set to USBtinyISP Click “Sketch”, “Upload Using Programmer”.

I then went to “File” and “Preferences”, then found the “Show verbose output during” setting, then checked the “Upload” box. This will just allow us to see the output in a language for humans, not computers. After plugging the arduino and the USBtinyISP into USB ports as we did earlier, select “Sketch”, and select “Upload Using Programmer”.

If the LED blinks, it’s working!