# Have I placed too much on this PCB layout?

I am doing my first PCB layout (using Altium) and have finally gotten past the auto-router stage. The result is a mess and there are some missing nets and design rule violations. Have I packed too much on this board or do I just need to re-think my component placement?

The board is two layers.

I am stuck with a very specific enclosure and won't be able to make the board bigger in the x-y axis.

This is a hobby board, but I have a full SMD soldering setup at home (nice scope and all). The connector placement is part of the enclosure (otherwise those would be the first things to move). It's a drop-in replacement for an older engine monitoring system. It takes measurements mostly from thermocouples and thermistors. The large chip in the center is an ATmega2560 running at 16 MHz.

UPDATE:

Thanks for all of the input. I rearranged the board and moved to 4-layers. Then I routed it all by hand. It looks much better now!

• Small comment: those vias seem huge. Most fab houses will do 0.3mm drills (with >0.6mm annular diam) at their "normal" processes. That might help open up some space. And I would definetively rethink the component placement, everything seems too close to the main IC, and there are lots of blank spaces on the board. – Wesley Lee Mar 19 '18 at 6:43
• Usually the connectors are put on the edge of the board. Are you sure you want to have them in the middle? I think that you are going to solder vertical connectors, but... Maybe it can be better to move them further out – frarugi87 Mar 19 '18 at 13:55
• Short answer would be yes for a 2 layer board. I'd recommend you read over any layout and Application Notes available for your main components. Replace them and lay the important tracks by hand. Get those sorted by hand and then review where you are then try another autoroute. It looks like a 2 layer board could be done. Another option would be to try the next size down of caps and resistors if they will allow. You already have some fine pins on the chips to deal with. – TafT Mar 19 '18 at 16:04
• Is that a set of holes for a DB25? – htmlcoderexe Mar 22 '18 at 7:39
• @htmlcoderexe Yes – user8908459 Mar 22 '18 at 8:54

I assume that you are using the autorouter because you think it will save your time. But I have some bad news: it is said that PCB layout is 80% component placement, 20% routing. You can't just slap down components, you need to think about how the signals connect and if you place the components right, the layout will "flow" from this placement. So if you have a good placement, you have your routing straight away and might as well do it yourself (or at least large parts of it) while doing this layout.

Autorouters are a pain. I've never seen people use them very successfully - especially the built-in ones like what you find in Altium (though they were showing a new tool recently, so that might help?). In addition, the placement of components is vital.

One problem with any automatic layout or circuit synthesis is that the program will only do what you tell it - and if you don't tell it everything, it will do stupid things. Your rules need to be perfect. Your constraints need to be complete. Every requirement you have needs to be put down in the form of rules and directives. Often you might not realize how much you implicitly know/require - Don't route the power signals all the way around the board - The connection between the decoupling capacitor and the supply pin of the chip has to be as short as possible and not go snaking around a bunch of analog circuit - the list goes on.

Your placement seems sloppy - take this example:

If you were to flip R17 the trace that goes from R17 to R18 would not need to cross the trace going from R17 to D1. R19 seems to be in parallel with C12 - perhaps this is something you can use to simplify the layout, by physically putting them parallel to each other. Moving R19 above or under C12 would also make it easier to route C18 nicely. C17 also seems like it could be flipped 180 degrees such that it doesn't require crossing traces. Turning D1 90 degrees clockwise might make it easier to route that trace from the "center" pin to R17. And you have a bunch of unused space under these components, why not use it and move the entire assembly down a bit? Remember that thing I said about 80% placement, 20% actual routing?

In addition, it seems like your autorouter just gave up. Take for example:

There is a lot of space to move these traces apart. This shouldn't be a problem, and anyone can see that you just have to move the left trace a fraction to the left, and the error would be fixed.

• There are people that use autorouters successfully, but they have tons of experience, changed all settings and know exactly when they can use them. – PlasmaHH Mar 19 '18 at 8:20
• @PlasmaHH yes, perhaps I should edit my answer to be less "autorouters are always bad". However, unless my points about placement are not adressed, no matter how good you set the settings, they won't be able to do very well. – Joren Vaes Mar 19 '18 at 8:53
• @OlinLathrop, please do tell me where I said that you shouldn't use auto-routers. I said they are a pain, because as you said they are very complex tools that take a lot of time to set up, and given the context provided here by the OP outside of the capabilities of said OP. Perhaps I am negative towards them, but accusing my of "religious nonsense" seems a bit excessive. – Joren Vaes Mar 19 '18 at 11:58
• "I've never seen people use them very successfully" strongly implies that they can't be used successfully, and therefore by extension, that they shouldn't be used. – Olin Lathrop Mar 19 '18 at 12:45
• @OlinLathrop that is because I have never seen them used successfully for PCB design. I don't doubt that they can be useful in the right hands - after all, automatic place and route is used in digital IC design all the time. But whenever I have seen someone try them for PCBs, it turned out to be more work than it would have been to just do it by hand from the get-go (of course, I work almost purely with analog and RF, not digital). Perhaps it is because English is not my mother tongue, but to me that doesn't imply they cannot be used - just that it might not be as easy as it seems. – Joren Vaes Mar 19 '18 at 12:55

Unlike what others have said, using the auto-router isn't the problem. They are right in that you can't just throw a whole design at the auto-router and expect it to solve everything for you. But, when used properly, auto-routers are legitimate and time-saving tools. Don't listen to the knee-jerkers that say not to use the auto-router.

Your problem is that you tried to cram way too much stuff onto a 2 layer board. Expecting to route that many pins that closely spaced in 2 layers is wildly unrealistic.

The other issue is that you didn't consider layout carefully enough. This is harder to evaluate by looking at your images, but it seems quite likely.

For one thing, there is very little room around the dense chip. Even with multi-layers, there will be congestion around that chip. Sometime I even hand-route traces away from a dense chip to expand them out a bit, then see how the auto-router can handle it.

However, the first rule of good routing is good layout. You can't just plunk down parts somewhere, then connect them up somehow in routing later. Good layout is something you'll learn and get some intuition for as you do more designs. For the first few designs, it helps to give yourself lots of room. You haven't.

Large parts are often flexible in their pin assignments. This usually true of microcontrollers and FPGAs. In some cases I've actually printed out a pinout picture of a large part. I then made notes around it corresponding to the rough placement of things it had to connect to on the board. I crossed off all the fixed pins, like power, ground, MCLR, etc. Then I carefully assigned the soft pins based on proximity to the thing they had to connect to.

This can be a iterative process. You may get partway around the part and realize you are one pin short in one direction. That may require re-assigning pins on the other side of the part to shift things around.

For large parts like microncontrollers, I place it in a large empty area, then place only its immediately connected parts around it. This includes the bypass caps, and the crystal with its caps, if any. You then orient and move that whole group of parts together as a unit from then on.

It's perfectly normal to place some parts in only rough positions, then come back and pack them more efficiently as more parts are placed. Again, the whole process is iterative. After you've gotten some experience and intuition, these steps will go quicker. Expect the first few designs, especially dense ones, to take a while.

Once you have a reasonable layout with air wires that don't cross all over the place, do a little manual routing of important signals. I usually do all the bypass caps first, which of course should already be close to the power and ground pins they are bypassing. If you have a ground plane, then the next step is to connect most of the ground points to the ground plane with vias. This leaves only the air wires that will be actual routable traces.

At this point, depending on your experience, you route a few things you can see will be issues, or just let the auto-router fly.

However, you are not using the auto-router yet to create the final route, just to show you the problem spots. Good auto-routing is also a iterative process. You run the auto-router, see where it gets into trouble, do some manual routing and maybe placement changes as a result, run the auto-router again, etc. Eventually you converge on a completed route. The auto-router has still saved you significant time by doing much of the grunt work for you.

After you have a solution you are reasonably comfortable with, you look at everything carefully and manually clean up obvious things. For example, if you have a ground plane, you want to not have vias clumped. Lots of small islands are better than a few larger islands in the ground plane.

Again though, don't listen to all the religious knee-jerkers. Go ahead and use the auto-router, but do it carefully and responsibly. I do electrical engineering professionally, and have used the auto-router in some way on probably over 95% of all boards I've designed. The more complicated the board, the more the auto-router is a valuable tool in doing the grunt work for you. Just don't expect it to ever do all the work. And, you have to start with good placement.

• One more thing - if this is your first board layout, you are likely either a hobbyist or a student. Chances are you do not have a hard specification that dictates that the board must be a certain physical size. If not, why give yourself more pain by making it as small as you think it can possibly be? Maybe you can double the size of the board or more, especially if this is a first spin and you are essentially proving concepts. Later, when you have made the inevitable changes, is soon enough to worry about optimizing physical size. – mickeyf_supports_Monica Mar 19 '18 at 13:11
• "Don't listen to the knee-jerkers that say not to use the auto-router." I only say this when the writer clearly doesn't have the skills necessary to set it up correctly yet. As I said in my answer, autorouters are for experienced designers, not hobbyists or beginners. – DerStrom8 Mar 19 '18 at 15:56
• Olin, thank you for the suggest about pin reassignment. That solved about 50% of the problem. – user8908459 Mar 21 '18 at 7:24

The auto-router isn't magic. And shouldn't be used to do full boards. You first need to route the important bits yourself. Like power, high speed and bypass caps. Then you can let the auto-route do the tedious stuff.
Design rules must be setup flawless for the auto-router to work correctly.

Now it looks like you've randomly placed the components. You get much better results if you group up the components, or at least put them on a grid. For example,

• U3, which is most likely a voltage regulator, will have some C's near. These don't look very near.
• U7 and U8 most likely have a bypass cap. Where are those?
• There is a collection of R's on the right hand side. If these are for a resistor network, why not put them in a square grid? If you keep some space in between you can often route them by hand fine.
Example:

I'd recommend viewing some professional boards (teardown some test gear), or quality open hardware and maybe some pcb layout video's. From the EEVblog for example.

At least you're working with a defined board size with mounts, good! It's a classic beginners mistake routing a board without size constraints and thinking of the enclosure when the board is already made.

You have made one of the biggest mistakes a newbie can make, and that is trust the autorouter to do your work for you. This is a huge misunderstanding among hobbyists, and that is that the autorouter is for beginners. In reality it is the exact opposite. Only expert Altium (and other package) users can properly use it, and by the time they become experts it is often easier for them to route by hand anyway. Beginners should ALWAYS start by hand. DO NOT USE THE AUTOROUTER.

To help you route your board, I suggest starting by placing the critically-positioned parts (connectors, mainly). Anything you KNOW you need positioned in an exact place and cannot be moved even a few millimeters. Then begin grouping the remaining components up into small sections. For example, group all of the components directly connected to or related to the U1 IC together (off the board), arrange it so that the airwires are short and straight (don't cross), and then route them together (off the board). Do this for all of the different modules (or at least a few at a time), and then move the modules onto the board as groups of components to a place that makes sense. As you move the already-routed modules onto the board, you'll be able to reposition the groups so that the airwires between them are short and straight, and you repeat the process to route the "modules" together just like you did the components within each module. Keep this up and eventually you'll have a well-thought-out, clean design with minimal vias and logical signal flow.

And to answer your actual question, no - there is not too much on that board. In fact, that's quite sparse compared to some of the ones I've worked on. You just need to be smart about your component placement to minimize the number of vias you need and the number of tracks looping around. As others have mentioned, shrink your vias. 0.2mm drill is plenty for most vias.

• 0.2 mm drill can be expensive. For instance OSHpark (most popular for hobbyist and prototypes) and FirstPCB (and other similar Chinese) have a minimum of 0.25mm. I would not suggest anything smaller than 0.3 for non-bga boards. – GAttuso Mar 19 '18 at 12:24
• 0.2mm ~ 8 mil which is pretty standard for most (reliable) manufacturers. But even so, 0.3mm is MUCH smaller than the OP is using in his layout – DerStrom8 Mar 19 '18 at 15:37

An economic perspective:

So, this is a hobby project.

In this case, consider the number of hours you will spend doing your layout versus the cost of a slightly larger board. Some manufacturers (like pcbway) will even charge you the same for a 80x100mm or a 100x100mm board, so the increase in size can be free.

If you spend one day of effort trying to fit it on a smaller board in order to save $2 on PCB costs, just relax! Make your board larger. It doesn't matter if there is some unused space. It doesn't have to look all tidy and cramped... ...the above is now obsolete since you said your enclosure and connector placement were fixed, therefore: If this was my hobby project I'd go 4 layer ($50, worth it, time vs money) to keep a healthy ground plane and not have to spend too much time thinking about EMI. I know it sounds a bit absurd, but 4 layer is so cheap these days that it really makes sense in a hobby context when you want it to work the first time without headaches, EMI issues, and without spending too much time. It also helps in subtle ways: the chances you make a big mistake in noise/EMI will be much lower.

If it is in an automotive environment expect lots of noise (like spark plugs...) so you really want a full ground plane. Especially if you want to get low noise on ADC readings. Remember GND ie 0V is your reference, so skinny ground traces pretty much guarantee high impedance in GND, thus GND being at different voltages everywhere depending on current flowing in it, thus very noisy ADC readings (if it even works).

• I am stuck with a very specific enclosure, and won't be able to make the board bigger in the x-y axis. However, I am considering stacking two boards, but this doubles the cost. – user8908459 Mar 19 '18 at 10:53
• Are you going to hand-solder or get it assembled? Hobby or pro? Is connector placement fixed as part of the enclosure? – peufeu Mar 19 '18 at 11:27
• @OlinLathrop I beg to differ. There is easily enough unused room on that PCB to redo the layout with a bit more consideration in order to make routing easier. – MCG Mar 19 '18 at 12:04
• If this was my hobby project I'd go 4 layer (\$50, worth it, time vs money) to keep a healthy ground plane and not have to spend too much time thinking about EMI. I know it sounds a bit absurd, but 4 layer is so cheap these days that it really makes sense in a hobby context when you want it to work the first time without headaches, EMI issues, and without spending too much time. – peufeu Mar 19 '18 at 12:18
• If it is in an automotive environment expect lots of noise (like spark plugs...) so you really want a full ground plane. Especially if you want to get low noise on ADC readings. Remember GND ie 0V is your reference, so skinny ground traces pretty much guarantee high impedance in GND, thus GND being at different voltages everywhere depending on current flowing in it, thus very noisy ADC readings (if it even works). – peufeu Mar 19 '18 at 13:35

In terms of your question of component placement. Component placement (as others have said too) is 80% of the routing. Pre-thought-out proper part placement and everything else falls into place.

Once the components are placed in a strategic manner you will find two things result here. 1) Educating the Altium auto-router will take far more time than just hand-routing. 2) Routing just falls into place w/a reduce via count and no scenic trips (X, Y & Z) with the Cu. traces/conductors.

Not to mention the clean-up after the auto-router had it's way; I have seen many strange things the auto-router does and it really scares me. Yes, I have used the AR (in a time-pinch) but only on single-ended misc stuff and the like.

IMHO, take the Altium auto-router up to the North Pole, chop a hole in the ice and throw it in.