Introduction: Better Projects Using PCB's
If you've spent time working with electronics projects then you know how fun and exciting it can be. Nothing is more exhilarating than seeing your circuit come to life right before your eyes. It gets even more exciting when your project turns into a useful gadget that you want to make a permanent fixture around your home or office. But whats the best way to accomplish this? Breadboard is certainly not the answer, and building a complicated circuit on proto-board can become quite tedious. Both of these tools have their place, but they are not ideal for realistic production.
The solution? Make your project using a PCB (Printed circuit board). With the number of makers and hobbyists growing on a daily basis, manufacturers are making professional level services available (and affordable) for everyone. At one time it was incredibly expensive to design and fabricate PCBs. With high quality CAD software readily available for free in some cases, and factories making small prototype boards for as little as $5 plus shipping. There are very few reasons not to take advantage of these services.
My goal is to take you through this project at a high level. Because every CAD software is slightly different you will need to collect some knowledge from other sources to make this happen. I will post links to a few resources that I found helpful. Before you get worried about the time it takes to learn these skills let me say that I got my start with absolutely zero knowledge and experience, and I was making successful designs after spending less than 8 hours learning from online resources.
I have personally used all three of these CAD software pakages, but I recommend that you look at these introduction videos to get an idea of how each of them is set-up.
Doctor Peter Dalmaris has an excellent course based on KICAD that I have completed and highly recommend if that is the software you choose. His explanations of how all of the features work are easy to follow and very complete. Here is a link to his class at Tech Explorations.
Another option to consider (although this is not one I have used myself) Is EasyEDA. I have seen other makers use this online software to make some very solid designs.
Lets get designing!
Supplies
- PC with CAD software
- Soldering iron
- Flux
- 1 ESP-32 module (WROOM-32D)
- 2 MCP 23017's (SOIC package)
- 5 volt regulator (L7805)
- 3.3 volt regulator (AP2114H)
- generic DC barrel jack for a 2.1mm plug
- Male or Female pin-headers (optional)
- Toaster oven and solder paste (optional)
- Drill (Optional)
Step 1: Planning and Design
It's very important to have a solid foundation to any project. A little time spent planning can save hours of frustration down the road.
A good place to start is creating a list of functions and features you want your design to have. The following is the list I used when I created this example project.
- An ESP-32 based board compatible with existing ESP-32 designs
- More digital pins than the standard ESP-32 Dev kit
- Available 5v and 3v3 for powering accessories attached to the PCB
- A programming port so I can update the unit in the future
- The ability to run on a 6 to 12 volt input
Second is collecting a list of parts you wish to use, and find a readily available source. The last thing you want to do is make a PCB that you can't buy the parts for. You should also collect the manufacturers data sheets for every part you plan to use (trust me this is VERY important and I will explain why later).
Finally collecting any notes and drawings you may have already created for this design. This would include any physical constraints you may have. Such as you would like your board to be compatible with an Arduino shield or fit inside a specific enclosure. All of this information will be needed at various steps in the process.
Step 2: PCB Schematic Using CAD
Lets start making our schematic!
In general I like to add all of my parts to the schematic and lay them out in a way that makes sense to me. At this point where you place them has no impact on the physical location on the PCB, so you can use that flexibility to your advantage. If you do not have footprints for all of your components I highly recommend SnapEDA and Ultralibrarian. These resources have an amazing selection of available parts for just about every CAD software you might be using. Just look up the part number of the component, and download the appropriate files. They having tutorials teaching you how to import these files if you don't already know how to do that.
Before wiring your parts together it is best to check the pin-outs of each component for accuracy. This is why having the part data sheets is important, I've had entire batches of PCBs ruined (remember those hours of frustration?) because I skipped this step. If you didn't make the part yourself (and sometimes even if you did) ALWAYS double check.
When you go to wire your schematic I've found its beneficial to use net labels to make the connections. If you have a large quantity of wires running every which way then it becomes difficult to follow, and also increases the chances of making a connection someplace you shouldn't (more hours of frustration). A balance of wires and net labels is usually the best, just be certain to use a list of net labels that will make sense to anyone else looking at the design. This will make life easy if you come back to this design in the future wanting to make changes, or troubleshoot the original design.
The schematic is also a good place to leave notes about how various parts of the circuit are supposed to work. This is a good way to keep track of all the details required to make the thing work as it should. An example on this project is that a jumper is required between the enable pin of the ESP module and the 3.3v supply for programming. While this probably isn't the only place you should document that kind of information, its definitely good to get in the habit of writing EVERYTHING down.
Give your schematic a good inspection before moving on to the next step. This needs to be right for the PCB layout process to go smoothly. A slow and methodical approach will always give you the best final result. Go over any notes you may have and verify each of them against the schematic.
Attachments
Step 3: PCB Layout
- Before we start arranging our components its best to look at the footprints and make sure they are correct for the parts you intend to use. For instance some parts will have though hole and SMD variants available, make sure you only use parts you will be able to install. The EPS-32 module has a pad underneath the will require some special handling (more on this later) Just make sure you have a plan for these situations. After selecting the proper packages for our components you should again check the pin-outs of each part against the data sheet (have you noticed a trend here?) Believe me when I say that these can be wrong and it will make for a long day if you have to trace down these issues later.
When arranging your components make sure you account for any of those physical constraints I mentioned earlier. In some cases it may be necessary for you to place certain parts first because their location is critical, and fit everything else around them. Remember to place parts that are connected close together, but also allow enough room for you to work with during assembly. If you have a specific enclosure you plan on using it might make sense to create the board profile and any drill holes first.
After all of your components are located where you want them its time to start routing your tracks. There are a few key points to remember while doing this.
- The shortest trace possible is generally best
- Bigger is typically better (especially for power supply lines)
- You need to know how much current a given track should be handling and make sure the size you have selected can safely handle that amount (This is a very important safety issue, over current can cause heating and potentially be a fire hazard)
- Know what tolerances your manufacturer is able to maintain and follow those guidelines. Here is a link to the capabilities page for one manufacturer (your CAD software may have a design rules checker that will alert you to any places that do not meet a standard the factory can follow)
While routing tracks can be a fun puzzle, sometimes our designs can get complicated making this an extreme challenge. In those cases using an auto-routing software can save you substantial time. Here is a link to an Auto-router I have used on several projects. The Auto-router imports your project and uses your design rules to making appropriate traces for all of your nets. Typically I will let the Auto-router do its work, then manually change a few things that I may want to be different. You can also route the traces you want to be in specific locations, and the auto-router will work around those existing tracks as it works on the remaining nets.
Step 4: Final Touchs and Preparing for Manufacture
With parts placed and tracks run your PCB is just about ready to go. Now is a good time to give the entire layout a good once over. Follow traces using the schematic as a guide and make certain all the connections you need have been made.
You should also consider adding graphics to your board in the silkscreen layer. Your name or some other makers mark is a good way to let others know you take pride in your work. I also believe in marking most if not all of my connection points with what they are for. This helps when you go to hook the thing up after assembly, and makes it easier for others to understand the functions of these connection points.
Another thing to consider is marking a revision identifier, especially if this is a board you intend to make more than once. This way you can make changes to the circuit in the future, and tell at a glance which version of the board you are working with.
With all of that done its time to plot/export your design, and send it to the manufacturer. In general these will be Gerber files, and typically they should all be stored in a single .zip folder. This is what you will upload when you place your PCB order.
Here is a link to the Gerber files for my example project on GitHub
Step 5: Ordering Your PCB's
More and more options are available for this than in the past. Its become so easy that anyone can have their designs professionally made by large factories and an incredibly reasonable price.
I have designed over 35+ PCB's and all of them have been produced by JLCpcb (https://jlcpcb.com)
A very good company that I have never had any quality problems with. Here is a link to a video that gives a tour of their facility and explains the PCB fabrication process in detail. Factory Tour
Go to their website and start a quote. Next upload the .zip of your Gerber files. You should see a rendering of your design after the upload completes. Pick your quantity, color, and any other criteria you would like to specify at this time. Then its a simple matter of proceeding to checkout. You can easily upload your own Gerber files to a free online Gerber viewer and see what these files look like when they are rendered.
Typically I try to send in several designs at one time to combine on the shipping. Normally I would expect to receive these in 1-2 weeks after the order is placed. This of course can vary depending on a variety of factors, but they will give you updates on your orders progress via their website and a tracking number after your order ships.
Step 6: Lets Build It!
Its time to assemble!
Remember earlier I mentioned that there is a trick to soldering the ESP-32 module? If you look at the footprint on the PCB you will notice a large pad underneath the component. Well that could be a bit of a challenge, but I have to ways that you can get the job done.
Option 1: Use solder paste and a small toaster oven.
This is really straight forward, and it is definitely going to give you the best results overall. This video explains the process. Make sure you understand the temperature requirements of the solder paste you are using, and you will have some pretty incredible results without much effort. This will take care of soldering most if not all of the SMD components. Bonus points if your toaster oven came from a junk pile and needed to be repaired before using.
Option 2: Get out the drill!
This option will definitely work but it is not the most ideal. Carefully drilling a small hole through the PCB in the center of this pad will allow you to solder it from the back side of the board like a through hole component. Things can go wrong quite easily with this approach so take your time and use a high quality drill bit. If you do not intend to use a reflow oven process you could handle issues like this in your design by adding a plated through hole in the center of this pad. This will allow you to solder with an iron without the risk of damaging your board.
Solder any remaining through hole parts (and SMD if you didn't use the reflow method). For the pin headers I will solder a single pin to hold it in place while I turn the board over to make sure its straight. Its also good to check the soldering very carefully on all SMD parts using a magnifier of some sort. If you find anything that needs touched up use some flux (trust me this makes a big difference) and reheat the solder joint. I found on my example design that the ESP-32 module had several places that needed to be re-worked. Also note that I intentionally did not add any pin-headers to this board, that is because I intend to directly solder the wires from my peripheral devices. This is not always the best approach, but for my application its not a problem.
That's it! from start to finish we took a circuit concept and made our own custom PCB for this project. Once you get the hang of it the possibilities are almost endless. I hope this Instructable has given you some good ideas, and pointed you to some useful resources to help you on your PCB making journey. Thanks for reading!
Happy making, and don't let the smoke out! (Seriously it needs the magic smoke)