POSTS
Week 3: Electronics Production
This week, we characterized the design rules for our PCB production process:
Step 0: Test and characterize the Mill
We used the Roland mill to cut this test piece using the 1⁄64 inch mill bit. We were able to get really small traces but we couldn’t go infinitely small- the smallest, accurate trace we could make was around .010 inches. We are also limited by the width of the bit (.016 inches), so a trace of 0.016 or 0.017 is likely going to be accurate.
The next part of this week was to make an in-circuit programmer by milling the PCB, programming it, then potentially trying other PCB processes.
Step 1: Mill the PCB
We took the schematic of the board we wanted to mill and imported it into mod software.
I setup the mill by setting the mill bit to the correct location according to board placement, and by using a 1⁄64 bit mill to do the tracing. I took some double sided tape to secure the board inside the mill- a key thing to remember with double sided tape is peel one side, place it on the board, and then peel the other side- if you try to peel both sides at once, you end up with this, and slightly embarrassed too!
After the mill finished, I changed out the 1⁄64 mill bit for a 1⁄32 mill bit and updated the schematic to be the outline of the PCB so the mill would cut out the actual PCB.
The next step in the PCB process was soldering. We need to solder the following parts onto our board, following the schematic from above:
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, and 1x 2x3 pin header
Soldering with really small parts on a surface was definitely a challenging process. I had to re-do several of my solders because there was either a blob of solder on the board or not quite enough. One of the key strategies to avoid having to hold the solder, the heat gun, and the pliers in two hands, was to place some solder on the board where one side of the component would be placed, and then place the component there and solder the other side. I went back and added some more solder to the first side just in case there wasn’t quite enough, but this allowed me to only need two things in my hands at once.
Here is the finished product with all the components soldered:
Once I soldered the components on, I had to program the microcontroller. I made sure the name of the programmer I was using in the MakeFile was usbtiny, and connected my header pins to its header pins. The LED’s lit up when I did this, it was satisfying!
The firmware was provided so I just had to navigate to the directory with the code and run make flash, in order to program its flash memory with the contents of the .hex file I previously built. I ran into the following bug multiple times. I tried checking all my connections visually, with a multimeter, and by running previous linux commands again, but nothing worked.
“avrdue, initialization failed, rc = 1, Double check connections are try again”
Luckily, someone nearby had seen the error before, and told me that I had to power both boards when programming because the female to female connectors were not sending power through to the other board, which makes very little sense considering that’s the point of the male to male connectors. But I tried it and it totally fixed the error:
After that I successfully ran the make fuses command. This set up all of the fuses except the one that disables the reset pin.
Then, I had to check that my laptop was seeing my USB, which at first it of course was not. I plugged my board in to my laptop and ran lsusb, which didn’t show anything, so to debug I ran dmesg to get more info and saw that my board had been connected at one point and then disconnected…my intuition told me to shift around the board in the port a little bit and it worked. To make the connection more consistent I added some solder to the ends of the board, but the USB still needed some manual adjustment to show up on my laptop.
Once I proved the USB showed on my laptop, it was time to turn my programmee into a programmer! I changed the bit that turns the ATtiny45’s reset pin into a GPIO pin, to disable the ability to program the board. I ran rstdisabl with the ISP header connected to my board, which basically does the same thing as make fuses, but also includes the reset disable pin.
The final step was to split apart the jumper on my board by applying heat to the bridge I previously made. This disconnects power (VCC) from the Vprogram pin on the ISP header.
I then tested using my board to program other boards and it worked well except for the manual adjusting needed for the USB port!