Xin Wen

How to Make (almost) Anything

Week 5: Electronics Design

avrdude done. Thank you.

1. Designing in Eagle
2. Fabricating the Board
3. Programming Echo Hello World
4. Second Attempt

It's electronics week again! This week we are remaking the echo hello world board and adding more components to it. I learned how to draw schematics and design PCB layout in Eagle.

Tools used: avrdude, eagle

Useful links: eagle tutorials - schematics, board layout, programming with makefile and c.

1. Designing in Eagle

Eagle takes a bit of time to get used to, but once you get the hang of it, it's pretty straightforward and the command lines are very nice to use. I found the tutorial from fab academy a good place to start. To make the echo hello world, I downloaded fab.lbr which had all the parts we needed.

Figure 1. Adding components from library.
Figure 2. Components from the original board.

We need to add at least a button and a LED (with current limiting resistor; I used 499 ohm). Here's the modified schematic.

Figure 3. Added a button and a LED (with current limiting resistor).

After finishing the schematic, it's time to route the board. Click "Switch to board" under "File" in schematic view. You will be directed to the board design, which has all the components clustered in the bottom left corner. Everything that is electronically connected are connected with a yellow line. Once you route the connection, the yellow line will disappear. To make sure traces can be properly milled, turn on the grid (under "View") and set the size to 16 mil (which is about the finest distance-1/64''-the mill can handle) or specify in design rule (the little icon that says DRS) that the minimal distance need to be 16 mil.

Figure 4. Routed board design.

Once the board is all routed, I exported the trace as a png with 500 DPI (matching the DPI on the millling machine) by turning on only the top layer. To do so, go to "View" -- "Layer settings".

Figure 5. Traces to be uploaded to mod.

You can also export the outline in Eagle but Allan showed me a neat trick by using Photoshop to uncrop the traces image to create the outline (and erase all the white traces). This trick is useful especially when your outline is some irregular shape.

Figure 6. Creating outline in Photoshop.
2. Fabricating the Board

I then milled the board like how we did in week 3. Although I exported the image as 500 DPI, which is the same on the mill, my board size was off by a factor of 2. I was told that's just something that happens at times. So I changed DPI on the machine to 1000 and it gave me the correct dimension.

Figure 7. Fresh out of the mill.

After taking the board out, I realized my outline was off so the leftmost part was cut off. I decided to connect the three pieces with wires instead of remaking the whole board.

Figure 8. I was half way done with soldering before I had to run off to catch a train. To be continued soon...

Soldering went a lot faster this time! I tried to make the board as compact as possible but it was a bit difficult to solder at times.

Figure 9. All soldered!
3. Programming Echo Hello World

The next step is to program the board with the programmer we made in week 3 to test echo hello world's functionality. I followed the programming tutorial from the class page.

The first problem I ran into was my computer does not recognize USBtiny from the programmer, even though it worked two weeks ago... I knew the USB connection was not well soldered and the four lines did not have even thickness (every shortcut you take will come back to haunt you), so I went back to fix the connection. And it worked!

Figure 11. The amazing feeling when you solved a problem!

However, that's just the first step. I then had an intialization error when I tried to configure ATting to run at 20 MHz. I haven't figured it out yet. I will update this page soon once I make progress...

4. Second attempt

Couple weeks after the electronics design week, I came back to the assignment and remade my board. By then, I was much better at soldering and the board actually programmed on the first try! I used Neil's code to test it and it echoes!.

Figure 12. A new board.
Figure 13. It echoes!