Now that we have taken some time to learn about Fusion 360 and Simplify3D, we need to focus on the electrical aspects of this book. First, we will investigate what a PCB is and briefly describe how it is designed. Then I want to go over PCB Design software that will be used to create PCBs in this book. After that, we will have an in-depth discussion on Eagle and how to make your first PCB, as well as how to load libraries into Eagle. Then we will learn how to export the Gerber files for the final board. Finally, we will review how to get this board manufactured using PCBWay. There is a lot to cover just like the previous chapters, so let’s get started.
What Is a PCB
PCB Design Software
There are a lot of PCB Design software on the market, such as Altium, KiCAD, and what this book will utilize: Eagle. PCB Design software allows you to create schematics and board layouts. These can then be converted into Gerber files which will then be sent to the board manufacturer. There is a lot to learn with PCB Design software; this chapter will give you a good glimpse and get you ready for the next chapters that will have several board designs.
Eagle
Eagle has a monthly subscription program, so if you only want to use it for this book, you can purchase a monthly license for 15 USD. Eagle is a professional PCB software that can even link to Fusion 360, so you can make sure a PCB fits in its enclosure. It also allows you to connect to various component libraries, so you do have to create every component your board needs. So, let’s get started with Eagle.
Eagle’s Main Windows
Did I say windows? Yes, Eagle has two main windows that you will be using to create PCBs. The first window we will talk about allows you to create a schematic of the PCB. A schematic is a drawing of all the ICs, resistors, capacitors, headers, and their connections; these connections are called nets. The second window we will discuss focuses on the physical layout of the board; this is important because it will become the Gerber files you send off to the PCB manufacturer.
Schematic Window
- 1.Action bar: This bar has a couple of important buttons on it. They are
- a.
Open/Save/Print: This is where you can save your progress.
- b.
Schematic/Board: This button allows you to toggle between the board window and the schematic window.
- 2.Parameters bar: This bar holds all the functions for: control grid settings and layer control.
- a.
Layer settings: Allows you to show or hide layers (most of the time, this is used in the board window).
- b.
Grid: Allows you to change the resolution of the grid and change the units of measurement.
- c.
Layer selection box: Select which layer to edit. Normally set to “Nets” for the schematic window.
- 3.Command buttons bar: I will not spend too much time here listing all of the commands (there are a ton), but instead will show you these as we create PCBs throughout the book, but here are a few very common commands:
- a.
Info: Allows you to check various properties of a component.
- b.
Add Part: Allows you to select the component you want to add to the schematic window.
- c.
Delete: Deletes a component from the schematic window and the board window.
- d.
Show: Select a net with this option selected, and all nets with that name will be highlighted.
- e.
Group: Use this function to select multiple objects.
- f.
Net: Nets are used to connect your circuit together; we will be using this function a lot in the coming projects.
- 4.
Command texts bar: In this text box, you can type out commands to quickly move through schematic development. These are typically used when you get a bit more experience in Eagle. If you want to see a list of the commands, go here: http://web.mit.edu/xavid/arch/i386_rhel4/help/24.htm.
- 5.
Simulation bar: This bar allows you to evaluate your circuit to make sure it will work as expected.
Board Window
- 1.Actions bar: This bar is just like the one found on the schematics window but has one function I want to mention.
- a.
CAM Processor: This is the function that will be used to create the final Gerber file that will be sent to the board manufacturer.
- 2.
Parameters bar: See the “Schematic Window” section.
- 3.Command buttons: Several of the command buttons are the same, but there are a few that differ.
- a.
Route Airwire: These are used to physically connect the circuit from the schematic view together.
- b.
Ripup: This will not delete nets; that is to say, this will not remove the connection from component to component; it will just delete the routing of the net and leave a yellow line where the two components terminate.
- 4.
Command texts bar: See the “Schematic Window” section.
Alright, now that we know about the layout of the two main windows in Eagle, we can start to discuss how to add libraries that have already been created to Eagle.
Loading a Library
- 1.
Open Eagle. See Figure 5-4.
- 2.
Open a new File Explorer and navigate to “My Documents.”
- 3.
Create a new folder called “Extra Libraries.” See Figure 5-5.
- 4.
Go to this link: https://github.com/sparkfun/SparkFun-Eagle-Libraries. See Figure 5-6.
- 5.
Download the SparkFun Eagle library. See Figure 5-7.
- 6.
Unzip and put the folder “SparkFun-Eagle-Libraries-master” into the “Extra Libraries” folder. See Figure 5-8.
- 7.
Go to Eagle and select Options ➤ Directories, and the Directories window will appear. See Figure 5-9.
- 8.
Copy the link address from your File Explorer to the Libraries text box in the Directories window. Remember to add the “;” after the “$HOMEEAGLElibraries”. See Figure 5-10.
- 9.
Click the “OK” button on the Directories window. See Figure 5-11.
- 10.
On the front screen of Eagle, go to the Libraries drop-down and click the arrow. See Figure 5-12.
- 11.
You should now see the SparkFun library. Right-click it and click “Use all.” One thing to note is that you will need to select “Use all” on each library when you want to use this for each project. See Figure 5-13.
- 12.
The library has now been added and is ready to use.
Alright! Now that we know how to add libraries to Eagle, we can start to create schematics and layouts, but first I would recommend adding the Adafruit library to Eagle. The link for which can be found here: https://github.com/adafruit/Adafruit-Eagle-Library.
Creating a Schematic
- 1.
Open Eagle. See Figure 5-14.
- 2.
Go to the Libraries drop-down and right-click the SparkFun library we added in the previous section and click “Use all.” See Figure 5-15.
- 3.
Select File ➤ New ➤ Schematic; this will open a schematic window. See Figure 5-16.
- 4.
Press Ctrl-S and save this schematic as LED_Board. See Figure 5-17.
- 5.
Click the Add Part button, and the ADD window will appear. See Figure 5-18.
- 6.
Scroll down to the SparkFun-PowerSymbols selection. Then double-click the “5V” text. See Figure 5-19.
- 7.
Add two of the “5V” symbol onto the schematic window by left-clicking the screen. See Figure 5-20.
- 8.
Pressing escape will bring you back to the ADD window where you can double-click GND. See Figure 5-21.
- 9.
Add two “GND” symbols to the schematic window, just as you did with the “5V” symbol. See Figure 5-22.
- 10.
Press escape again, which will open the ADD window again. See Figure 5-23.
- 11.
In the search bar, type in “LED” and press enter. See Figure 5-24.
- 12.
Scroll down to the SparkFun-LED ➤ LED drop-down and double-click the “LED3MM.” See Figure 5-25.
- 13.
Now if you right-click, you will notice that the LED symbol will turn 90 degrees. Do this once. See Figure 5-26.
- 14.
Press escape again (or click the “ADD” button). In the search bar, type in “button” and press enter. See Figure 5-27.
- 15.
Scroll down to SparkFun-Switches and locate MOMENTARY-SWITCH-SPST. Then locate MOMENTARY-SWITCH-SPST-SMD-4.5MM and double-click it. See Figure 5-28.
- 16.
Right-click three times on the schematic window to orient the switch correctly and then place the switch symbol. See Figure 5-29.
- 17.
Click the Info button and then click the switch you just placed. The info dialog window will open. See Figure 5-30.
- 18.
If the Properties window you are seeing is not correct, try right-clicking the switch near the “+” symbol; you should see this menu. Make sure you try and right-click the bottommost “+” symbol. See Figure 5-31.
- 19.
The Properties menu should have the value of “VALUE.” See Figure 5-32.
- 20.
Select the “Display” drop-down menu and select “off.” See Figure 5-33.
- 21.
Click the ADD button again. See Figure 5-34.
- 22.
In the search bar, type in “connector” and press enter. See Figure 5-35.
- 23.
Scroll to the SparkFun-Connectors drop-down; then select the CONN-02 drop-down. See Figure 5-36.
- 24.
Double-click the “CONN_025MM” and add it to the schematic window. See Figure 5-37.
- 25.
Click the ADD button again and type in resistor into the search box and press enter. See Figure 5-38.
- 26.
Go to Resistor ➤ R-US ➤ R-US_R0805 and add it to the schematic window. See Figure 5-39.
- 27.
Press escape and click the cancel button. See Figure 5-40.
- 28.
Click the “Move” button and configure the symbols like Figure 5-41. Rotate any symbols as needed by selecting the symbol and using a right mouse click.
- 29.
Click the “Net” button; we are now in the phase where we will be connecting the various components together. Pay special attention to each of these connections as an incorrect connection here means an incorrect connection on the board layout, which can cause serious problems with your board. See Figure 5-42.
- 30.
Connect 5V to the 5mm terminal block. See Figure 5-43.
- 33.
Connect the right side of the switch symbol to the left side of the resistor. See Figure 5-45.
- 34.
Connect the right side of the resistor symbol to the anode (left side) of the LED symbol. See Figure 5-46.
- 35.
Connect the GND symbol to the 5mm terminal block. See Figure 5-47.
- 36.
Connect the GND symbol to the cathode (right side) of the LED. See Figure 5-48.
- 37.
In order to add a value to the resistor, right-click the “+” on the resistor and select “Value” on the pop-up menu. Then enter “330ohm” and click “OK.” See Figure 5-49.
- 38.
The schematic is now done, but in order to create a board file for the next section, we need to click the “Generate/Switch to Board” button. A dialog will come up asking you if you would like to create a board file; click the “Yes” button. See Figure 5-50.
- 39.
This file will automatically be saved as LED_Board.brd. See Figure 5-51.
Now that the schematic is done and we have a board file, we can focus on the board layout for this project, which is what the next section will cover.
Laying Out a PCB
- 1.
Go to the Board Layout window if you are already not there. See Figure 5-52.
- 2.
Click the Grid button and make sure it looks like Figure 5-53.
- 3.
Once the Board Layout window is open, click the “Info” button. See Figure 5-54.
- 4.
Click the left vertical line, and a menu should appear. See Figure 5-55.
- 5.
In the second text box next to “From,” type in 542 (if this value makes your board huge, please make sure you change your “Grid” to “mil”) and click “OK.” See Figure 5-56.
- 6.
Now click the bottom horizontal line, and the same box should appear. See Figure 5-57.
- 7.
Type 1294 into the box right next to the “to” and click “OK.” See Figure 5-58.
- 8.
Now click the top horizontal line (or what would be horizontal had we not updated the other lines). See Figure 5-59.
- 9.
Type 1294 into the box right next to “From” and click “OK.” See Figure 5-60.
- 10.
Click the right-side vertical line. See Figure 5-61.
- 11.
Type 542 into the second box next to “To,” and you now have the dimensions for the PCB. See Figure 5-62.
- 12.
Click the “Move” button and select the terminal block. See Figure 5-63.
- 13.
Rotate the terminal block and move it onto the PCB. You can use the “Info” button and type in the position “155” and “365,” or you can move it with the mouse and hold the Alt Key to get more precision. See Figure 5-64.
- 14.
Next, move the push button onto the PCB. Pay attention to the yellow lines going from one component to the next. These lines are the nets you created in the schematic. The position for the button should be “540” and “265.” See Figure 5-65.
- 15.
You may notice that the push button’s device name is very long and not necessary to put on the PCB. If you zoom in to the PCB and right-click the “+” right next to the name, you can select “Delete,” and this will remove the name from the PCB. See Figure 5-66.
- 16.
Now add the resistor to the PCB, positioned at “860” and “270.” See Figure 5-67.
- 17.
Now add the LED to the PCB, positioned at “1135” and “280.” You have now finished arranging the parts onto the PCB. See Figure 5-68.
- 18.
Select the “Route Airwire” button. See Figure 5-69.
- 19.
At the top, select 12 from the “Width:” drop-down menu, or you can just enter “12.” See Figure 5-70.
- 20.
Left-click the 5V contact on the terminal block (J1), then move your mouse over to the top-left contact of the push button (S1), and left-click that contact. See Figure 5-71.
- 21.
Left-click from the 5V contact on the push button (S1) and drag your mouse to connect the route to the other 5V contact on the push button (S1). See Figure 5-72.
- 22.
Left-click the top-right contact on the push button and connect it to the left contact of the resistor (R1). See Figure 5-73.
- 23.
Left-click the top-right contact on the push button again and connect it to the right-bottom contact “N$1.” See Figure 5-74.
- 24.
Next, left-click the right contact of the resistor and connect the other end to the top contact of the LED (D1). See Figure 5-75.
- 25.
To select the bottom layer, go to the top and change the “Layer:” drop-down to “16 Bottom.” See Figure 5-76.
- 26.
Select the bottom contact on the terminal block (J1) and connect the other end to the bottom contact of the LED (D1). Because this is on the bottom layer of the board, you can pass right through top layer contacts and routes as long as the contacts are not on the bottom layer as well. A good example of this is that when you pass underneath an SMT (surface mount) part which is only on the top layer, but if there is a through-hole contact, you will have to go around that part. See Figure 5-77.
- 27.
The board is now ready to be made into a Gerber file. See Figure 5-78.
Exporting Gerber Files
- 1.
Go to the Board Layout window for your project. See Figure 5-79.
- 2.
Go to File ➤ CAM Processor. Make sure your current project is saved. See Figure 5-80.
- 3.
At the top, you will see the “Job” file that is currently being utilized, “template_2_layer.cam.” This job will work for the current PCB we have created, but if we say had a four-layer board, this job would need to be modified to include those layers, as well as any other layers, such as soldermask or silkscreens those layers may also employ. See Figure 5-81.
- 4.
If you select the “Top Copper” layer, you will see a preview of that layer. Same thing goes for any of the other selections that the CAM Processor shows. See Figure 5-82.
- 5.
Click the “Process Job” button, and Gerber files will be generated after you select where you want them to be stored and what name you want to give them. See Figure 5-83.
- 6.
When done, just exit out of the CAM Processor window and close out Eagle.
PCB Manufacturers
Summary
Looked at what a PCB is and what kind of software is needed in order to make a PCB
Took a tour of Eagle and some of the most important functions
Learned how to load a third-party library into Eagle
Learned the basics on how to create a schematic
Learned the basics on how to create a board layout
Learned how to export Gerber files
Took a look at PCBWay as a board manufacturing company