week 4: Electronics Design
4.1 learning electronics
4.2 designing the board
4.3 fabricating the board
4.4 programming
This week is all about circuit design - we're making a rather straight forward board that has an ATTiny45 which can communicate via serial port to your computer to send and receive a "helloworld" message. However, unlike week 2, we will be designing our own schematic and PCB layout.

learning electronics

This week, I decided to get through the project a little bit differently - I'm tired of feeling lost and confused with no context for what each step is actually doing as was the case with week 2. So I followed the rabbitholes and questions that came up until I felt like I understood the electronic components enough to move on. below is a somewhat incoherent list of things that stood out as important basic background info for circuit design this week: For this task, I chose to use Eagle, since it's in the Autodesk family and I've already started on Fusion 360 and there's plenty of documentation and community support. As a starting point, Jake wrote up a general guide for builing circuits in fabclass: CBA Circuit Best Practices. I also found sparkfun tutorials to be super helpful throughout this whole week. They give a details walk through of setting up Eagle here.

designing the board

I found this schematic tutorial to be helpful. I downloaded the fablab eagle library from here and began importing all the parts my board would require. Using Neil's board as a reference guide and the fablab inventory, I found all the parts on digikey and their corresponding name in the fablab library.

Drawing the board schematics was rather straight forward once I had all the parts and could follow Neil's original board layout

schematic

Then I needed to actually design the layout of the board. Sparkfun has another good Eagle tutorial that I relied on.

board layout

fabricating the board

finally, it's time to mill the board. I exported the eagle layout to a png file using the python script with instructions described in the manufacturing section here. Then sent the png to mods and milled it the same as week 2.

too big traces

. . . but this time the traces came out waaay too large - one ATTiny44 nearly fits on a single pad. and the cutout outline didn't match the size of the board so it cut a large line right down the middle.

The problem was the dpi (dots per inch) setting when loading the .png file to mods. mods calculates the real distance to mill based on the number of pixels in the image, so you need to calibrate the dpi. to do so, I measured the ground pad for the button in Eagle to be 2.29mm = 0.09 inches. Then in imageJ, I measured the same pad to be about 273 pixels. Therefore, dpi = 3033.

correct milled

finally milled the right size traces, collected all the relevant components, and ready to solder

board with components

and finished!

finished board

programming

I plugged to programmer and board into my macbook and it doesn't show up at all. But then plugged into the linux machine and it does - even with the usb 3.0 hub so the issue with the macbook must not be the speed.

make -f hello.ftdi.44.echo.c.make ran fine, but then I got a rc=-1 error when trying to run sudo make -f hello.ftdi.44.echo.c.make program-usbtiny-fuses

I went back to the lab and Zach helped me realize that the ATTiny was soldered backwards - thanks zach! came back and then the program-usbtiny-fuses command worked once but then when trying to run program-usbtiny I get the rc=-1 error again. then trying to run fuses again I get rc=-1 error again ...

program debugging

the issue is the crystal. program-usbtiny-fuses sets up the mcu to no longer listen to its internal clock and instead switch to the clock on the crystal. but my cyrstal wasn't soldered correctly - the ground signal was accidentally connected to the mcu as well.

programed

so fixing the soldering worked! plugging in the usbtiny after made the green light turn on on the helloworld board. and the green light turned on on the programmer

finishing the make commands to get the programmer running - the next step is to use the python script to open up a little gui interface to the serial port and see what the helloworld chip has to say.
** note:: python script dependencies: python-tk and pyserial

so I'm sending data to the board, but it doesn't seem to be making it there ... I can press the button and receive a list of what was typed but it never says I typed anything . . .