4. Electronics production¶
This week I had to make and program a programmer for an individual project, as well as charactere the design rules for the PCB production process as part of a group project.
Individual Project¶
Making the Programmer
I started with getting the trace and outline files of the programmer from Brian’s Tutorial and saved them as PNG files. I then opened Fab Modules and loaded them in, and followed the same steps followed in the group project, except with different files. For the bit details like cut depth and spindle speeds, I used this website. I changed the cut depth to 0.25 mm, since the material thickness was 1.7. I wanted 7 passes to be safe that the bit wouldn’t break, so I did 1.77/7 and approximated it to 0.25. I changed the spindle speed to 12000 RPM.
Then I did the same thing for the outline file, except with a 1/32” bit. I used the settings found on the website linked above, except I changed the cut depth to 0.425 mm, since I wanted to be safe with 4 traces. (1.7/4 = 0.425.)
The paths I ended up using can be found here (I changed the file names to make it more easy to recognize):
I used was the Othermill Pro to mill the programmer. For the software, I used Bantam Tools Desktop Milling Machine Software.
Milling the Board
I took a PCB board and stuck 4 strips of Nitto tape on the back. I aligned the PCB board against the metal in the milling machine and loaded up the design on Bantam Tools.
I first used a 1/64” bit to mill the traces. I went through the instructions to locate the tool, and then I wanted to find out the material depth. I went to the “BitBreaker” dropdown and selected “Probe Material Thickness.” I moved the metal clip onto the PCB and followed the instructions. The thickness ended up being 1.78 mm.
Then I clicked start milling, and let the machine do the rest of the work.
This shows the trace milling after I vacuumed the dust from the board.
Then I repeated the process with a 1/32” drill bit to cut out the outline of the programmer. This time, though, I entered the bit as the 1/32” bit it was. After locating the tool, I clicked start milling.
I used the scraper tool to remove my PCB from the milling bed. I also deburred the board by using the scraper to scrape off the burrs.
Soldering the Board
It was time to solder. I followed the Brian’s tutorial linked above to know which components I needed:
- 1x ATtiny45 chip
- 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
I used a small square of Nitto tape to tape the board down to a small tile so that I could easily move the board around. I started soldering from the center of the board, starting with the ATtiny45 chip. At first, the soldering iron I used was not easily heating the solder, so I switched out the iron. After, I made sure the chip was oriented properly and soldered it down with the new iron– it worked well.
Then I soldered the pins.
Then I soldered the resistors that are closer to the center of the programmer, the two diodes, the capacitor, and then the two LEDs down. I soldered from the center components first, and then moved my way towards the outside of the programmer. I then soldered the USB contacts and the solder bridge so that I could program it. (When the bridge is connected, the programmers can be reprogrammed, when it is not, the programmers cannot.) Then I removed it from the tile and Nitto tape.
So that the programmer can fit tighter into a USB port, I added layers of electrical tape on the bottom. I stuck four layers of the tape and used an X-Acto knife to cut around the programmer.
Programming the Board
Now I had to program the board. I did this part on a Windows computer, and followed this workflow my coursemates and I came up with:
Install all the programs necessary
-
Install AtmelStudio, and put it in the Downloads folder.
-
Install AVR Gnu toolchain to
C:\Program Files
-
Install Gnu Make and unzip the file and copy it to
C:\Program Files\GnuWin32
-
Install avrdude. Unzip the file and copy it to
C:\Program Files
-
Install Firmware source code and extract it to the downloads folder.
-
Install Zadig for the driver. Downloaded it to the downloads folder.
Update the path
Change the environment variables so that it shows up when typing commands into the command line:
-
Hit the Windows key and search “Edit the system environment variables” and hit enter.
-
Under the “User Variables,” click “Path” then “edit,” and a new window should pop up showing file paths. Add the following paths one by one.
C:\Program Files\avr8-gnu-toolchain-win32_x86\bin
C:\Program Files\GnuWin32\bin
C:\Program Files\avrdude
- Then hit OK on all three windows.
Install the drivers
Use Zadig to specify the driver:
-
Launch Zadig, one of the programs downloaded earlier.
-
Plug in your programmer into a USB extension cable, and plug the dongle into the computer. The red LED on the programmer should light up.
-
Click on the Options dropdown and click List All Devices. Then on the main dropdown, select USBtinyISP. On the box to the right of the green arrow, I click the down arrow once. The driver (to the right of the green arrow) should be either libusb-win32 or libusb0.
-
Click Reinstall Driver. A popup showing “The driver was installed successfully” should pop up.
Program the Board
Use Windows PowerShell and another programmer to program the board. Plug in your programmer and its USB extension cord. Use male to male wires to connect the pins. Make sure the each pin is connected to the other corresponding pin on the other programmer. Connect the other programmer into the computer as well using another USB extension cord. This is what the setup looks up:
-
Click on the Windows button and search PowerShell. Hit enter to launch it.
-
Open the firmware folder and copy the path from the address bar.
-
Open the Command Line and type
cd
(include a space after “cd”) & paste the file path for the FabTinyISP folder. -
Type the command
make all
.
-
If there is no error that shows up, continue. Type in
make flash
. According to the tutorial, this downloads the hex file to the chip and erases the previous contents of the target chip. -
Type
make fuses
to burn most of the fuses. -
To check if the board is working, unplug and replug the board back into the computer and it should be seen in the Device Manager as
libusb-win32 devices
. If not, there is some debugging that needs to be done on the board. -
Connect back to the PowerShell and type “make rst disbl”.
-
Disconnect the solder bridge. The board should now be programmed.
Programming an Arduino Uno Using the Programmer¶
To check if my programmer worked, I programmed an Arduino Uno to blink using the programmer. I first plugged the programmer into the USB extension cord, and plugged the extension cord into the computer. Then I used female to female wires (we used two female to male wires to extend it) to connect the pins on the programmer to the pins on the Arduino. I had to make sure that the pins aligned with one another. Then I plugged the Arduino into the computer to give it power. This is what the setup looked like:
Then open Arduino, and open the code you want to program into the Arduino. I chose the example Blink code provided by Arduino.
After I opened the code, I went to the tools dropdown and selected “Select Programmer”. I then selected “USBTinyISP”. Then, I made sure that the selected port for the Arduino was connected to the port that was not called COM1. This time, it was COM24. I went to the Tools dropdown and selected Port, then COM24. Afterwards, I went to the File dropdown and selected Preferences. Next to the “Show verbose output during:” selection, I checked the “upload” box. This would show text upon uploading code similar to what would normally appear in the command center with avrdude.
After, instead of doing what I normally do for the Arduino (clicking compile and upload), I went to the Sketch dropdown and selected “Upload using Programmer”. The code compiled, and the Arduino was coded.
Group Project¶
This week, we also had to characterize the design rules for the PCB production process: document feeds, speeds, plunge rate, depth of cut (traces and outline) and tooling. I helped document the concept definitions, specifically of feed rate. Personally, I helped to create the G-code file using Fab Modules for the traces part of the ruler (I screen recorded the embedded video on the group link page). I also helped set up the PCB and mill for the trace section of the ruler, as well as switch out drill bits. I had to import the trace file and go through the milling process. I also helped document the majority of the process going along as teammates worked on the rest of the project. From this project, I relearned how to make G-code and how to mill smaller traces. I learned that a quick way to often get a mill to work properly, other than re-making the G-code, is to lower the z value of a design onto the PCB board.
The link to our group project can be found here: Group project