~ Electronics design.
~ post date: 2017.3.6, recent update: 2017.3.8

Background

Designing, fabricating and coding an echo hello-world board with a button and LED. An echo board will receive keystrokes and return the same. For instance, type "hello world" and the board will reply "hello world". This would be a basic program to test the functionality of a fabbed board. My primary mission is to learn PCB design software, the interrelationships of electronic components, and draw, cut and stuff a board. As a secondary objective is to flash the MCU with a program and test it.

Contents
  • Designing a PCB with Eagle.
  • Cutting and stuffing the PCB.
  • Echo : Programming.c
  • Jump : Index
  • Project files
  • Download Hello World PCB Schematic (Eagle)
  • Download Hello World PCB Board (Eagle)
  • EAGLE : Drawing a PCB

    EAGLE is a scriptable printed circuit board (PCB) computer aided design (CAD) program for 1. creating relationships between electronic components, for which you may download and curate libraries, then 2. positioning the components on a PCB and drawing traces. EAGLE stands for Easily Applicable Graphical Layout Editor. As of 2016, EAGLE was acquired by Autodesk Inc.

    The EAGLE is split into two primary GUIs: Schematic and Board graphs. You will use the schematic graph to select and interrelate the electronic components to be soldered on the PCB. The board graph is used to arrange the components and draw traces, pads, holes, etc. Both interfaces present a working area flanked by buttons along the left and top. The mouse pans and zooms. Most of the buttons are self-explanatory making this a fairly easy application to initially grasp.

    Start by importing electronic components from the libraries into the schematic graph. Click on the white plus sign just under the wrench button on the middle left. EAGLE comes preloaded with several libraries and users can make custom libraries. The FAB Academy has a custom library with all the electronic components commonly found within Fab labs. Very helpful. This board requires the following components:

    1. IC1 : 1x ATtiny44
    2. RES1, RES3 : 2x 10kΩ resistor
    3. RES3 : 1x 500Ω resistors
    4. LED : 1x red LED (directional)
    5. XTAL : 1x Panasonic ceramic resonator
    6. S1 : 1x OMRON switch
    7. CAP1 : 1x 1UF capacitor
    8. PIN : 1x 1x1 pin header (hole)
    9. ISP : 1x 2x3 pin header
    10. FTDI : 1x FTDI SMD header

    Source the components in the library and press OK. Then, mouse click somewhere in the schematic graph to add one component. If multiple of the same, you can click twice or more. Or, you can copy later. Also, components can be moved around the schematic window any time throughout the design process.

    One ATtiny44 placed in the schematic graph. All the connection points are numbered and labeled. Perhaps the functionality of some are more obvious than others. VCC is voltage in. GND is ground.

    What about the others? Datasheets are your number one ally. Good news, the ATtiny44 datasheet has 286 pages of useful information, including pin descriptions!

    After placing electronic components in the schematic window, connections need to be labeled. This can be done in two ways. One, using the pencil tool next to the "T", draw a line directly from one pin to another. Two, use labels, four buttons below the "T". Any labels with precisely the same name will be connected (although it is otherwise invisible).

    As connections are made, it is helpful to move the components around to double check that the connections were made. Sometimes things that appear connected are not and that could cause trouble later if not caught. For instance, you may cut a board with missing traces.

    The schematic graph can be organized in any way, as long as the proper connections are drawn and/or labeled. I tried to present the arrangement with some clarity. Now that all components are connected, it is time to move into the board graph interface. Click the Generate/Switch board button on the top just to the left of the 1/1 pulldown.

    Now all the components will be displayed to scale with their connections to one another drawn with yellow lines. At first the components are piled up to the side. The basic interface is the same as the schematic window. Move the components into the general arrangement planned. Keep an eye on the yellow lines with an idea of how the traces may be aranged. Because this is a one sided board, traces cannot overlap. It is like drawing a maze, and it is challenging. I will return to this later in this section.

    Setup design rules in accordance to the tolerances of your CNC mill or Vinyl cutter.

    After the components are organized, EAGLE has an Autorouter feature. The application will try to draw the traces and pads to your design rules within your organization of electronic components. This PCB will be a single sided/layer design. Top: Auto. Bottom: n/a. Effort and threads are related to the amount of computing power you want to give EAGLE to solve this puzzle. Press continue and on the next dialogue, Start.

    Autorouter will draw several variants to varying degrees of success. In this first test, the best result was missing connetions. Either accept this result and try to solve the problem yourself, or rearrange the electronic components and try the autorouter again. Opting for the latter, I did this process several times and by doing that, I learned about organizing the components.

    Fast forward a couple hours and I have a few 100% variants. Using this, I started adjusting the traces manually. There are two main tools for this process: Route and Ripup. The buttons are side by side in the row just above the "T". I was challenging myself to find a very compact arrangement. Unfortunately, the traces do not update as components are moved, so this process can become tedious in EAGLE.

    After the traces are settled, return to the design rule check (DRC) dialogue and run a check. This will show you conflicts with your rules. Make the necessary adjustments to resolve the errors.

    With that, my first PCB drawn from scratch. Here are the final schematic and board layouts.

    Download project files

    I will post links to resources I have found helpful here.

  • Autodesk Eagle : Main site, free trial, free for students for two years.
  • Cutting and stuffing the PCB.

    This section is largely covered in a previous post and may contain some redundancy. I need to export the board design from EAGLE, generate the mill paths and solder the electronic components.

    The board is ready to be cut; EAGLE's job is complete. Time to export. From the View> Layer settings... menu, set all the layers to invisible except Top, Pads and Dimension.

    Export the file as a monochrome PNG at 1500 dpi.

    The PNG may not be exported in perfect condition but can quickly be edited in a PNG suitable editor, i.e. Photoshop, Inkscape. I did not find a good way to export a PNG for the outline cuts. EAGLE has a thin line it considers the outer border of the board and will export that line. The line, however, is too thin for Fab Modules. I deleted the line from the trace PNG and deleted the traces from a duplicate of the file to be used for the outline. I also slightly rounded the corners of the outline and added the eye graphic to the traces. Now the outline and trace files can be converted to tool paths in the Fab Modules.

    On final inspections prior to milling, thankfully, I discovered some mistakes. Double check the dimensions in the input information on the upper-right hand corner of the Fab Modules page. Above, you will see inconsistencies. For instance, my PNGs were nearly double the size drawn in EAGLE! I found Adobe Photoshop doubles the dimensions of the exported PNG upon opening. In pixels, the EAGLE output is: 1696x2084 and upon opening in Photoshop: 3398x4174.

    To solve the error, I scaled the PNGs in photoshop by 0.49928126. Fortunately, the image fidelity sustained. Next, I realized the outer dimensions of the trace and outline PNG files were dissimilar. This was my fault and would have resulted in an outline cut offset from the traces. I fixed the issue in Photoshop and took the exported PNGs back through Fab Modules.

    Now the input information is correct and the tool paths aligned. Check that the x0, y0, and z0 coordinates are correct. For me the coordinates were automatically changed to 10,10,10. After milling a bit, I noticed the paths around the traces were not cutting through the copper. We resolved either the bit is dulling or the substrate was not evenly adhered to the foam block.

    I paused the mill and added 0.05mm of depth to the trace cuts in Fab Modules. Without changing the XYZ origins, I loaded the modified tool paths into the CNC mill and recut on top of this flawed version.

    Problem solved. The mill has cut my PCB. The template I chose for the 1x1 pin header was for a size not stocked in the lab so the pad and hole were too small. I opened the hole with a drill press and resolved to solder along the trace.

    Out lab only had through-hole buttons in stock so I bent and trimmed the pins. Further we did not have any 1x6 surface mount pin headers so I made a custom by pulling pins from a 2x and putting them into a 1x through-hole header. After soldering:

    Download project files

    Jump : Index

    J.travis Russett © 2017
    Creative Commons License All the work contained within is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License
    You may remix, tweak, and build upon my work non-commercially, as long as you credit me and license your new creations under the identical terms.