7. Electronics Design¶
Learning outcomes
- ~~Select and use software for circuit board design~~
- ~~Demonstrate workflows used in circuit board design~~
Have you? 1. ~~Shown your process using words/images/screenshot~~s 2. ~~Explained problems and how you fixed them, including how you worked with design rules for milling (DRC in EagleCad and KiCad)~~ 3. ~~Included original design files (Eagle, KiCad, Inkscape, .cad - whatever)~~
Eagle¶
Eagle is free software for education. There are several good tutorials on line. I started with this guy: Jeremy Blum He has tutorials that helped me understand the software.
I uploaded Neil’s hello.world board to start with and made just a few changes to add a button and LED to turn on and off. The first board I made didn’t work because I failed to route all of the traces and connect all of the connections. I’ve made this board several times now and have learned alot. In fact, I’ve made all of the boards several times.
Now that I know what I’m doing a bit more, I made this tutorial on Eagle for my students for next Fall.
Using Eagle¶
To use Eagle, first get it set up with the parts libraries that you will need.
I downloaded SparkFun, Adafruit, pinhead_v2 (for the 2x5 pin) and, of course, the fab.lbr.
Second: Pay attention to the file folder structure with Eagle. It’s putting both your design files and items like library files in your Documents folder.
To begin drawing in Eagle, start a New Project. Name it according to the project. Then select “New” again and open a new schematic.
In your schematic window, add parts by clicking on the add parts icon on the left. I’m going to make the board with a button and an LED for this week. The components I need are in the fab parts library.
Drop the part on your schematic window by clicking. Then hit ESC or you will keep putting down more of the same part. When you are finished adding parts to your schematic, hit ESC twice. Don’t forget to get a VCC and a GND part even though they aren’t on your list.
To move parts, delete them, rotate or mirror them, you need these tools also located in the left side of the window.
Move your parts around in the window. I like to spread them out.
I am going to name the connections rather than draw them. All of those lines intersecting confuses me. To name them, I draw a short line using the Net tool. Then I right click on it and give it a Name.
In this picture, you can see that I have named nearly everything. I drew just a few connections for the button, resistor and LED.
I’m going to connect the LED to PB2. I reviewed the ATTiny44’s pins and I know that PB2 can be used for output. The button is at PA7 which can be used for input.
Once I believe all my connections have been made, I change to the board view. It always looks like this mess.
I move the parts apart first so I can see what I have.
Then I move them around and rotate them to straighten the traces as much as possible. I know approximately where I want things to go. I start with the microcontroller in the middle, the resonator on the left and the FTDI on the right. I put the 2x3 pin at the bottom and go from there.
I typically let AutoRouter do his thing just to see what he comes up with. Here you can see that he did his best but had two vias. This happens because of all of the things that are connected to GND and VCC. Auto routes them all separately.
I solve that problem in a more global way on this board by drawing a master GND trace around the left side of the board and a master VCC on the right. I methodically click on all of the pads to be sure everything is connected where it is supposed to be.
Design Rules¶
I have some cleanup to do on these traces. I have set my Design rules defaults:
minimum clearance at 16mil. I don’t want my traces to squish together but it’s a pretty small board and I have to route some traces through the 6pin pads.
Minimum width at 12mil. I don’t want tiny traces that easily break.
I make my grid super small (change it from 50 to 2) so that I can move components and traces around with precision. I want to line up as many components as possible to draw straight, uncomplicated trace lines.
I ask ERC to tell me if I’ve messed anything up. The report is pretty clear.
I am ready to export it to png for millings.
Export the file for milling¶
I turn off all of the layers except the Top and File –> Export –> Image.
On that screen I check Monochrome and set the resolution to 500. I give it a name and version number and save it.
My next step is Inkscape to clean up anything that is wrong with the board and maybe add a graphic. On this board, I just added a “B” for button.
In Inkscape, I have to resize the board to 52%. I check the size of the graphic against one of the parts. In this case I used the FTDI pads. The pads are 15.2mm from end to end.
When I’m finished, I export at 1000 dpi and take it to the Roland for modding.
Electronic Components for boards¶
Over the last several weeks, I’ve been reading, watching videos, and talking with a friend who is an engineer to learn about electronic components and what they do.
PCB components can be categorized as “active” and “passive”.
Active Components
Diode: Allows current to flow in one direction.
Transistor: Has two jobs. It can amplify an electric current or it can be a switch and make the small current turn on a larger current.
Integrated circuits: This is the microchip.
Passive Components
Capacitor – Stores and discharges electricity.
Resistor – Limits the power of the electrical current.
Inductor – Creates a magnetic field.
We have not used an inductor but I am familiar with the remainder of the parts.
Using the Multimeter While Building the Board¶
We have several Fluke multimeters in the Lab. As I am soldering, I check the connections on the “diode” setting. This is especially true with components like the 2x3 pins because often traces are lost underneath them. If I check them along the way, then I can unsolder/resolder before the whole board is stuffed. I learned the hard way that I need to check the connections at the pin part of the pins, not at the solder point. The solder may be there, but the foot of the 6 pin may not be stuck down into the solder. I need to touch the tip of the black multimeter probe to the pin while touching the red probe to where the pin should be connected.
Thoughts about Eagle¶
Eagle had a steep learning curve for me but now that I understand it, I can’t imagine using anything else.
Downsides:¶
- It was not intuitive even for basic things like opening the program and getting to the schematic window. (Unlike other programs that open to the primary screen that you need to get to work.)
- It took several for me to get all of the libraries that I have needed for the different projects (in addition to the fab library, I needed pinhead to get more surface mount pins, and Sparkfun and Adafruit for other basic parts). This student has a good tutorial for adding libraries and a link to the fab library.
- AutoRouter sounded good when I first heard about it and I typically use it for the basic connections and then I draw the global VCC and GND and reroute accordingly.
Upsides:¶
- Now that everything in my Eagle software is set up, it will be easy for me to just give those libraries to my students rather than make them look around and download them from the internet.
- Eagle satisfies my requirement of being free for students, as well.
- Now that I have used Eagle, I can explain it well to my students so they won’t experience the frustration I did due to Eagle not being intuitive as most software is these days
- It seems very powerful. I like the forward and backward corrections it lets me make as I need to make changes on the BRD side. As I become more experienced with it, I will surely find more useful tools.
“Stuffing” the board¶
Soldering does not come easily to me. I have to use a magnifying glass and more light (an Ott light). My hands shake so I often drop the components or move them around on the board unintentionally. Some of these problems will get better with practice. Here is a gif of my progress soldering the components.
LED problems¶
I had a lot of trouble with the LED on this board.
It works fine when it is not on the board. Using the multimeter on diode setting (red probe to anode and black to cathode) the light turns on (although not very bright.) But after it is soldered on, it would not light with the multimeter.I put it on and took it off several times before it worked. I read about the surface mount LEDs on their data sheets and I watched a video about them here (It must have been pretty old because he talks about getting pcb boards at Radio Shack – hahahaha) Primarily what I learned is that I must be getting them too hot. It is recommended to use flow soldering (using a solder paste to stick the component on and then heating the whole board in a toaster oven). So, using the soldering iron, I just have to be very careful not to burn the LED.
When I finally got it stuck on and working properly, I plugged in the AtmelICE and the ftdi cable and pushed a little code into it to light up the LED.
Programming the board¶
I am using Brackets on my MacBook Pro for code. I took Neil’s make file and took out parts I don’t need and change the “PROJECT” name to hello.world.ftdi. I change the name of the makefile to hello.world.ftdi.
I put just this little bit of c code in another file. It tells the board to look to pin PB2 for my LED and turn it on.
Then I take my two little files into Ubuntu in Parallels on my MacBook Pro. (Parallels is a program that allows me to run both Windows and Ubuntu on my Macbook.) I plug in a hub for my ftdi cable and my Atmel ICE cable and make sure that Ubuntu sees the hub and both cables on the dashboard.
In Ubuntu, I create a new folder on my desktop and call it hello.world.ftdi. Then I put my make file and c file inside of it. I open that folder in Terminal and type sudo make -f hello.world.ftdi.make Pursuant to that command, Terminal makes a .hex and a .out file.
Then I type sudo make -f hello.world.ftdi.make program-ice. At first, Terminal told me that it could not see my board. I’ve seen that message before and know that it typically means some connection isn’t being made. After checking all of my cables, I press down on the LED and run the command again. That’s what it wanted! It went through the programming correctly and the light turned on! (But now I know there really is a problem with my soldering the LED to the board.)
Thoughts About This Week’s Project¶
I think that Eagle’s learning curve was not as steep as I originally thought. If I had had a person showing me where to click for certain things, I would have learned it much faster. There is no good documentation that I have found (so I made a tutorial for my students), and the videos assume you already know how to use a different program to accomplish the same task.
I learned quite a bit about soldering and especially about the LED that I had so much trouble with.
Neil’s code is intimidating. There is so much there that I don’t understand. Breaking it down into smaller parts (one step at a time) is the way for me to go forward.
Files¶
sch, brd, c, make, traces, interior files zipped