Scott Zitek - Fab Academy 2014

Electronics design

Week 6 Assignment

The assignment for this week is to redraw the echo hello-world board, add (at least) a button and LED (with current-limiting resistor), check the design rules, and make it. If possible, we could also simulate its operation.

Circuit design

I decided to use CadSoft EAGLE PCB design software since it has versions available for multiple operating systems and a freeware option.

  1. I downloaded and installed EAGLE 6.5.0 on three computers this week. I installed it on a 64-bit Windows 7 system, a 64-bit Ubuntu 12.04 system, and a 32-bit Ubuntu 12.04 system.

  2. Once the EAGLE PCB software was installed, I "installed" the fab lab specific component library.

  3. I found an excellent tutorial by Anna Kaziunas France at However, instead of editing the example schematic and board provided in the tutorial, I started a new project and created mine completely from "scratch."

  4. Drawing the schematic was the easy part. All I had to do was find the "right" component from the fab.lbr library and then draw wires between the components by using NET from the Draw pull-down menu.

  5. If wires were drawn between every component connection, the drawing would quickly become a scramble of wires. So I used LABEL from the Draw pull-down menu to label connections instead of drawing NETS (wires) between all of them. You need to change the name of the label from its default (e.g. N$4 to something meaningful e.g. BUTTON) and then all labels in the schematic will be connected to all other labels on the schematic with the same name.

  6. Depending upon the type of component, there will be various attributes that can be edited. Select Value from the Edit pull-down menu and then select a component name (e.g. R2) to enter the value for the component (500). This will label device R2 as a 500(Ohm) resistor on the schematic and eventually on the board drawing. Note, for some reason this didn’t work on all devices (e.g. C1 or XTAL1).

  7. I needed to determine the resistors specifications needed so that I could designate them properly on the schematic.
  8. According to, a 10k ohm resistor could be used as the input pull-up resistor or perhaps a resistor built into the ATTiny 44 could be enabled. With a pull-up resistor wired to between VCC and the input, the input pin will read a high state when the button is not pressed. When pressed, the button supplies a path from ground to the input pin. In this way, there are very clearly distinguishable high and low states for the input. The input does not just "float" to no connection when the button is not pressed.

  9. When I thought I was finished, I used ERC (Electrical Rules Check) to error check the schematic.
  10. Results of the first Electrical Rules Check of my schematic

  11. I systematically went through and corrected all the issues identified by Electrical Rules Check until it stopped complaining.
  12. Finished EAGLE schematic with pushbutton and LED added.

  13. Once I corrected the problems detected by the Electrical Rules Check, I then went to the board mode. To my surprise, all of my components were on top of each other in a pile off the board outline.
  14. By default, none of the components were positioned on the board (the white outline in upper right corner).

  15. I manually moved all of my components onto the board and then used the autoroute to find the best path between connections. I think it did a terrible job. Autoroute would need about 8 jumper wires to make this layout work. I used undo and manually routed the wires myself.
  16. Components moved onto the board. Notice all connections are shown as yellow lines that are the shorted path between the two points. These are called air wires.

    After using the autoroute feature. I was surprised it didn't have an option to move the components to make the routes work. Note the blue lines represent jumper wires or connections on the opposite side of the board that would be needed to make this layout work.

  17. I move and rotate components to try to untangle the air wires (yellow wires) and give them a simple direct route between components. At first, I had a hard time selecting components to move them. It seemed no matter what I clicked on the software selected the closest wire. The trick is to click on the crosshairs in the middle of the component to select the component.
  18. It wasn't hard to come up with a layout where most of the connections worked. In this example, I have only a few air wires.

  19. I then spent several hours in a quest to route all the needed connections between components without having to use any jumper wires or zero ohm bridge resistors. I really enjoyed the challenge; it was like a fun puzzle for me. However, this simple circuit took me a few hours of trial and error before finally finding the combination of component layout and routes that worked.
  20. I am getting close. Only one air wire remains, but there are lot of things in between.

  21. Once I had a board that would work, I spent even more time moving all the components and redoing the traces to compact the placement of components so I could use a smaller circuit board. I found that if I used the ALT button when moving components and wires, I could jump to intermediary positions on the grid. This allowed me to fine tune the wires to make sure I would have adequate clearance between traces for the endmill to cut and to try to reduce the chances of solder bridges.
  22. My board layout with no jumpers and the components moved closer together to better utilize board space.

  23. When I thought my board was finished, I used DRC (Design Rules Check) to error check my circuit board layout. My board did not have any significant problems.

  24. I added an outline with chamfered corners to layer 20 to represent how I wanted the board cut out.
  25. Board layout with outline.

  26. I exported the circuit traces as a png.
  27. I then exported the circuit traces using monochrome, 500 dpi, window --- note the pixel size (e.g. 824x740)
  28. This is what the exported file looked like that I used Fab Modules to cut the circuit traces.

  29. I then worked on exporting the outline of the circuit board.

  30. I exported the board outline using the exact same settings as before – monochrome, 500 dpi, window. Make sure the window size is exactly the same (e.g. 824x740). If you resize the window between the circuit export and the outline export, the exported pngs will be different size files (pixels wide by pixels tall) and not lined up together (different origins).
  31. This is what the exported file looked like for the outline.

  32. I imported board png file into GIMP or other paint program and use the bucket tool to white fill everything outside the outline. Otherwise, Fab Modules will cut on both the inside and the outside of the line. I noticed that the example Hello.echo board had a white board with a black outline. I believe the cutter diameter compensation would cause the resulting physical board sizes to differ slightly depending upon which approach is used. Note: I was not able to use Corel Photo-paint with the png file. I’ve read that Corel Photo-Paint assumes a transparent image with a black background, so the png is shown as a solid black rectangle.
  33. This is what the exported file looked like that I used Fab Modules to cut the circuit board outline.

  34. Using the Modela MDX-15 with Fab Modules, I first cut the traces with a 1/64" endmill and the cut out the board outline using a 1/32" endmill.
  35. Circuit board cut and ready to remove from the Modela mill.

  36. I soldered the board using a stereo microscope and a new Metcal MX-5211 soldering station.
  37. Metcal MX-5211 microprocessor controlled advanced soldering system.

  38. After soldering several resistors and capacitors, I had a problem soldering the ATTiny IC chip legs. The solder seemed repelled by the IC legs. We dont have a hot air gun so I tried to remove the IC with desolder braid and ended up ripping off an important circuit trace. Since I had already cut a test circuit board without the fancy chamfered corners, I just used it.
  39. Completed circuit board.

  40. When soldering, make sure to install the LED and IC chip in the correct orientation. Pin 1 on the IC indicates pin 1. There was a green line on the LED. I don't think the "polarity" of the resonator matters.

    I interpreted the data sheet for the LED as indicating that the green line represents the cathode (negative side)

    Programming my echo board.

    1. I download the hello.ftdi.44.echo files and put them in a directory on my desktop.. I opened a terminal window in Ubuntu and made that my active directory.

    2. Since my Fab ISP is not working I used our avrisp2. I connect my board to a USB port using the FTDI cable. I connected the avrisp2 to a USB port, and then I connected them together using the ribbon cable.
    3. Programming my hello.echo board.

    4. Once everything was connected, I typed in the following commands, each time verifying success before continuing.
    5. 	make -f hello.ftdi.44.echo.c.make     				(make the hex file)
      	sudo make -f hello.ftdi.44.echo.c.make program-avrisp2-fuses 	(set fuses for 20MHz)
      	sudo make -f hello.ftdi.44.echo.c.make program-avrisp2 		(write program to ATtiny)
      	lsusb								(list usb port usage)

      The lsusb command shows that Future Technology Devices International, LTD FT232 USB-Serial (UART) IC is detected.

    6. I download and put it in the current directory. requires python-tk, so I installed it using the following command.
    7. 	sudo apt-get install python-tk
    8. I then run by entering sudo python /dev/tty and then pressing the tab key a few times INSTEAD of the enter key. A list of ports should appear. I ended up guessing it was port ttyUSB0. We want a buad rate of 115200. So I typed the following command and pressed enter:
    9. 	sudo python /dev/ttyUSB0 115200
    10. I noticed a few errors in the terminal window but the program appeared. Each time I pressed a key on the keyboard, responded.
    11. Success, my circuit board echoes back what I type.

    Circuit simulation

    For extra credit, we were asked to simulate the circuit that we built. I installed and tested LTSpice via EAGLE, 123D Circuit, and AVR Studio.

    1. I watched some EAGLE tutorials on how to use it. It appears that you need to use special component libraries made for LTSpice. These components contain additional information on how to simulate the components operation. I looked for the LTSpice ATTiny 44 component and could only find a user created one.

    2. I downloaded LTSpice directly from the Linear Technologies website but received a warning when I tried to install it. I have been installing a lot of software for Fab Academy and this is the first time I have seen this particular warning. So I decided not to take my chances and continued looking for a better option.
    3. I received this warning when I attempted to install LTSpice.

    4. 123D Circuit is an online application. It is designed to work best with Google Chrome browser. After going through the built in tutorial I learned enough to create a simple circuit. You basically use 123D circuit to virtually breadboard circuits and then simulate them. From there can work on a schematic, board layout, and generate a bill of materials. With a free account you have options to share finished design and have circuit boards produced. Besides being able to simulate a Arduino starter kit board with programming, the software seems fairly limited. For example, I could not find an ATTINY 44 in the main component library.
    5. Simple simulation using the 123D Circuit virtual breadboard. In this example I am using a potentiometer to adjust the output intensity of an LED. When the simulation is running, I can rotate the pot and see the LED get brighter and dimmer accordingly. If a circuit puts too much current to the LED the simulation will show the LED break.

      123D Circuit then can generate a schematic for what is on the virtual breadboard.

      123D Circuit can also generate a circuit board, but I had to manually re-arrange the layout of the components on the board.

      123D Circuit can also generate a Bill of Materials (BOM) for your circuit.

    6. With 123D Circuit I could easily simulate a simple circuit like an LED controlled by a pushbutton. I am really looking for something to simulate the entire hello.echo circuit including the ATtiny 44 program. I installed Atmel Studio (previously known as AVR Studio) which also required the installation of Microsoft Visual Studio 2010. From what I read online, it sounded like this Windows only software could simulate an ATtiny 44. However, with great power often comes great complexity. I could load some examples of circuits using newer Atmel processors but I was unable to find any examples using the ATtiny 44. I also could not figure out how to create a project from scratch that would simulate the ATtiny 44.
    7. I could not find a board wizard in Atmel Studio for the ATTiny 44.

      I did find the ATtiny 44 listed in Atmel Studio. Note that a Simulator is listed under supported tools.

      I tried to create a new Atmel Studio project using the ATtiny 44 but got stuck when it asked to define a stimuli file.


    Back to index