Skip to content

7. Electronics design

Foreword

For future Fab Academy students, particularly those at CLS whom I know will experience difficulty finding the fab_new.lbr library upon the beginning of your electronics design week, I’ve included a download link to the fab new EAGLE library fab academy EAGLE library fab_new fab.new fab eagle fab eagle library fab academy library fab lab library fab academy eagle library charlotte latin fab library cls eagle library fab_new.lbr fab.lbr below. Enjoy!

Download the fab_new.lbr library here! (49 kB Zip/410 kB Uncompressed)

Introduction

Prior to the seventh week of Fab Academy, I had not spent much time delving into the world of electronics design in any CAD environment. As such, my time this week was rife with experimentation in the lab and countless hours spent scrutinizing every minute detail of my schematics on EAGLE. Ultimately, I acquired a plethora of useful knowledge throughout the course of this week which will prove to be invaluable throughout the remainder of the program as well as throughout my future endeavors in the vast world of engineering.

Assignment

  • Group project: Use the test equipment in your lab to observe the operation of a microcontroller circuit board.
  • Individual project: redraw an echo hello-world board, add (at least) a button and LED (with current-limiting resistor) check the design rules, make it, and test it. extra credit: simulate its operation

Redrawing and modifying ‘blinky’ board to include a button

During the fifth week of Fab Academy we focused on electronics production by using our lab’s milling machines with schematics provided to us by Adam Harris, one of which was a simple board that used an ATTiny412 microcontroller and the other which was a jtag2UPDI programmer board. As we were provided the schematics for each of the boards, using EAGLE or another circuit designing software was not necessary. However, as this week’s assignment was to redraw the blinky board, learning how to use EAGLE would be necessary. While there are other circuitry design CAD softwares available such as Altium or Proteus, using EAGLE makes the most sense for students at CLS because we already have Autodesk education licenses, meaning we can use almost every paid software that is offered by Autodesk free of charge. As I was already familiar with basic circuitry design prior to using EAGLE, I decided to immediately open the software and display an image of the .brd file which I would use as a reference whilst designing my schematic. Dr. Harris’ original design can be downloaded here, and an image of the design is included below.

pg1

Installing component libraries

As the surface mount components that we have in our Fab Lab are not included in the base installation of EAGLE, I first needed to find the fab.lbr and fab_new.lbr EAGLE libraries and install them in order to access the various components of the blinky board. This process was relatively time consuming as there was not a known place to install the files from when my peers and I began our exploration of electronics design at the beginning of week 7. The file was eventually found, and can now be downloaded from the link at the top of this page. The process of installing EAGLE libraries is relatively simple, and entails navigating to the ‘libraries manager’ section of EAGLE and searching for local libraries on a machine. After I completed the installation process for each of the libraries that would be necessary to design this board, I began placing the components of my first board.

Designing my first board schematic

pg1

I began my design by placing the ATTiny412 microchip, which I found by navigating to the chip within the fab_new.lbr EAGLE library.

pg1 pg1

Next, I placed the button and FTDI headers on my board and made a connection from the ground pin of the button to the ground FTDI header which I planned on routing to the ground pin on the microcontroller. I would later realize that placing all of the components and then routing connections would make the process significantly more efficient, but I began my first designs by connecting each component using the ‘net’ feature immediately after situating it.

pg1

After placing the FTDI headers on my board, I decided to place a resistor and capacitor in the same region of the board as the button and complete the connections to the button. My schematic became incredibly messy after doing this, which is why I eventually began placing all of my components prior to beginning to route net connections within the schematic. I also made my first mistake here, which I would not discover until much later in the design process. As there are two connections within the button, it is important to double-check that the ground pin is connected by itself, but on this schematic I connected the ground pin of the button to data as well, which would ultimately cause the button to fail if I did not make any other mistakes on the board, which ultimately was not the case, so this error really did not affect me as more egregious errors superseded it in terms of their actual damage.

pg1

Next, I placed my LED and connected a resistor to the LED which would expand its lifetime at the expense of making it slightly dimmer. While I did not specify any values for the components on this board, each component would have the same value as the components on Dr. Harris’ board, as these values had proven to work and the 4.9K resistor connected to the UPDI(R) pin is required for successful uploads. After routing the final connections to my board, I foolishly thought that it was complete. As such, I generated a .brd file from the schematic in EAGLE and began preparing my board for milling.

Designing my first .brd file in EAGLE

pg1

After transferring my schematic file into a .brd file, EAGLE generated traces from the net connections that I created between each component during the first phase of the design, though these connections were thin and incredibly messy, as EAGLE’s algorithm for trace generation is still unable to appreciate the underlying beauty of 90 degree angles and sensible locations of components.

pg1

As I am not an emotionless machine that is chiefly and absolutely absorbed by an obsession with efficiency, I decided to manually route my traces so they would make more sense and have more space in between them, allowing for easier soldering after milling as bridges between traces would become significantly more difficult to form. I moved my microcontroller to a more central location on the board so the traces for each component could go different directions away from the central microcontroller, almost as though the microcontroller is Rome and the many traces leading away from it represent Rome’s expansive transit network. This was my final design, and it included several errors which ultimately prevented my board from working. First and perhaps most embarrassing, my button was not connected to ground. By following the various traces, it is observed that the only thing on my board that actually is grounded is the ground pin. Next, my capacitor did not actually connect the VCC and ground portions of the board, so none of the components on my board actually would have received proper and continuous power even if I had not made any other mistakes on the board. However, I did not realize the multitude of mistakes that I made when designing the board, so I continued the process of preparing the board for milling.

pg1

In order for our milling machines to successfully and consistently mill traces, the trace clearance needs to be increased to at least 12 on EAGLE. As I wanted my traces to be slightly larger on this board, I increased the width of each trace to 16 units.

pg1

The last thing I needed to do in EAGLE before exporting the .brd file to our milling machines was changing the dimensions of the outline of the board. To do this, I moved the traces of the board into the bottom left corner of the millable portion of the schematic and used the ‘move’ tool to manipulate the edges of the box as close to the traces of my board as possible, which would maximize efficiency and minimize the waste generated by my board.

vagane
densepoint1

After soldering my board I attempted to test it and it surprisingly did not work. After realizing the preponderance of errors that I had made during the design period of my board, I postulated that attempting to rectify these errors would likely prove more time-consuming than simply restarting my board entirely. Therefore, I opened a new schematic file in EAGLE and began anew.

Designing my second blinky board

pg1

I began by placing all of the components on my board in the rough positions of where I expected them to be located on the final board. This image is slightly inaccurate, as I ultimately decided to remove the 2x1 UPDI headers and simply use the FTDI headers for programming as it would allow me to simply attach an FTDI board to the headers and program the board entirely through the 6x1 headers.

pg1

Next, I made the proper connection using the ‘net’ feature within EAGLE and converted the schematic into a .brd file so I could begin editing the traces and size of the final board before exporting the board file to one of our milling machines.

vagane
largeschlong

After realizing that I did not need the 2x1 UPDI and ground headers on my board, I returned to the schematic file and removed them and all of the traces that were connected to them. As the ground for my button was connected to the microcontroller via the 2x1 headers, I also needed to reroute this connection, but this was incredibly simple. The ease of deleting this component and immediately being able to return to a .brd file that was updated in real-time in parallel with my schematic demonstrated the usefulness of EAGLE compared to its competitors, as most other comparable softwares do not offer this real-time editing capability that EAGLE does.

pg1

After returning to the .brd editor within EAGLE, I used the ‘auto-route traces’ option and generated some very tight and ugly traces that would be difficult to solder and generally did not make sense. I ultimately took it upon myself to manually route each individual trace to make the board larger, easier to solder, and more aesthetically pleasing.

pg1

After manually routing each trace of my board and locating each of the components in a position that made sense given the locations of the other components on the board, I needed to make several final preparations to the board before it would be ready for exportation to the Bantam software.

pg1

I changed the width of each individual trace and made the ground trace that each component would connect to very large, primarily because I thought it would look cool but I also did not want such an important trace to rip, which would effectively render my board useless as so many ground connections would be almost impossible to repair. After changing the width of each trace, I exported the .brd file to the Bantam Tools software to complete several final preparations to my board prior to milling and soldering the board.

vagane
largeschlong

After ensuring that all of the settings within the Bantam software were correct, I milled the board using a 0.005” engraving bit for all of the smaller traces and a 1/32” bit for the wider traces, outline, and for clearing away all of the excess copper from the traces. While the software predicted that the milling process would last for around 9 minutes, it only ended up taking about 4 minutes of actual tool time, not including the minute or so that it took to swap the tool from the 0.005” bit to the 1/32” bit after all of the smaller traces had been milled.

pg1

After finishing milling my board I was ready to begin soldering. Soldering this board was a relatively simple process, as I had used all of the components on my board other than the button at least once during Fab Academy or prior endeavors before this week's assignment. To solder all of the components, I simply referenced my schematic, which is pictured above and can be downloaded in zip format through the link at the bottom of this page, and placed the situated the components as they are displayed on the .brd file on the physical board before soldering.

pg1

After soldering my board, I was ready to begin programming it

Programming my board

I began the programming process by connecting my blinky button board to an Arduino through three jumper cables. I connected VCC to 5V, GND to GND, and UPDI to pin 6 on the Arduino. Next, I uploaded the ‘jtag2updi’ programmer sketches to my Arduino. I then switched the ‘board’ and ‘programmers’ in the Arduino IDE to ‘ATTiny412’ and ‘jtag2updi’ respectively. I then loaded my button sketch, which is included in the zip file below, onto my ATTiny412 by selecting the ‘upload using programmer’ option within the Arduino IDE. My code uploaded successfully and the board began working! I've included a copy-pastable version of the code below as well. Fortunately, I did not encounter any errors with writing or uploading my code. The code that I used for this week is simply a modified version of the Arduino 'button.ino' example sketch with the output and input pin numbers modified to work with my respective board. This week I became far more proficient with the process of programming boards via UPDI, and established a very clear workflow for how to upload efficiently while marginalizing the likelihood of any errors that can possibly occur when uploading such as ensuring all of the necessary connections exist between the board and my programmer.

const int buttonPin = 3;
const int ledPin =  2;

// variables will change:
int buttonState = 0;

void setup() {
  pinMode(2, OUTPUT);
  pinMode(3, INPUT);
}

void loop() {
  digitalWrite(2, HIGH);
}

Individual Assignment Conclusion

This week's individual assignment greatly imrpoved my confidence in using EAGLE to design my own board schematics. Throughout the remainder of Fab Academy, I am certain that I will frequently implement the various skills that I acquired this week in vastly more-complicated forms, and I am very excited to test the bounds of the incredibly useful proficiency that I acquired in EAGLE throughout the course of this week.

Group Assignment - Learning to Use An Oscilloscope

Prior to this week's group assignment, I had never used an oscilloscope. As the group assignment for this week was to monitor the operation of a microcontroller using an oscilloscope, several of my peers and I learned how to use the oscilloscopes that we have in our lab by changing various settings on the device until it was properly calibrated. After calibrating the device, we used an Arduino connected to a breadboard featuring a potentiometer to monitor the operation of the circuit. The documentation for this week's group work can be found on our group site.

Important Links

Download this week's files! (17 kB)

Last update: May 17, 2021