PCB Design questions - Deciding about layers, wiring, and decoupling - Page 1
Forum section: electronics / beginners

author: CookieEater
author_rank: Contributor
timestamp: October 30, 2022, 05:54:45 pm
content: PCB Design questions - Deciding about layers, wiring, and decouplingGreetings everyone,My name is Matthias, I am 30, and from Germany. I started this new hobby around last Christmas and "my experiences" with designing, ordering, assembling and programming circuit boards so far are:-~10 designs-2 layer pcbs (bottom ground plane, signals and vcc on top)-Around 50x50mm in size-<25 components-Mostly based around a central µC and I/O, sometimes another IC along the way (display driver or a sensor)My current project is going to be a circuit board around 100x100mm in size. The design involves a µC, three I/O expanders and 4 motor driver ICs. Along with that comes a relay for 230VAC, multiple connectors for external I/O and motors, an rf receiver, a piezo, and a sensor that is being connected externally as well. Logic is supposed to run off of either 3.3V or 5V, motor drivers and relay are driven by 12VDC.The component count on the board is going to be around 80.I have been using and am quite happy so far with KiCad (I'm running on Linux).Right away due to the many same components I wanted to start off with a modular design, using hierarchical sheets and prewiring of component groups, ending up replicating them using the Replicate Layout plugin KiCad offers, in the hopes of having to do less work overall but also to have everything aligned properly.Especially the use of the Replicate Layout plugin was somewhat tedious and I ended up having to redo this a couple of times, mostly because I noticed later on that I actually should have aligned some components within the respective groups differently.Until now I have always had good results with my circuit board designs, obviously during the end of the routing I would have one or two nets that involved a bit of fidgeting, but everything came out well so far.Honestly with this current design I'm feeling a little overwhelmed and I ended up procrastinating quite a lot. Choice of components and the schematics are completely done, "only" the pcb layout is left to be done. The modular design principle which I tried to follow doesn't feel like it has paid off for me emotionally so far and actually has been a source of some frustration for me. With this project in particular I have been having issues separating the different design steps from each other (schematic, wiring of the individual component groups, things in general, but most of all the final arranging/logistics of everything) which so far has led to multiple reiterations and therefore to a lot of having to do things over again (maybe different software would handle components groups better).I feel like I'm doing something wrong here.Moreover I'm always trying to follow up, or rather teach myself, what is at least to what I have read so far considered to be "best practices". Obviously I neither have the knowledge, nor equipment to verify the individual claims made and their effectiveness, especially in my designs, but the general idea I am trying to follow here is that I won't end up into problems along the way and I won't teach myself any bad habits.Unfortunately so far I haven't been able to find the right forum for electronics.I have tried stackexchange which is very dry, impersonal (I had formal pleasantries in my post edited out by other users), and it is difficult to ask follow up questions.The arduino forum has a very mixed user base with very few but very skilled users, but it is mostly targeted towards a different kind of problem set.I don't like the structuring behind reddit threads which makes it difficult to engage with individual replies on a global scale.And there is a German forum specialized for electronics and engineering, which allows people to reply without accounts and is full of trolls and people that will literally just bluntly insult you (For the non-German folks, imagine the cliche dry humor with the hard sounding language that German is to non-native speakers).I am sort of hoping to find my happy place here with you guys and found about about this forum mostly from Dave's videos which is probably why I am reading this post in my head with a very strong Aussie accent, forgive me...Anyways, after some introduction of myself, I have some broader design questions I would like to have some opinions on.1) Decoupling capacitorsI read a couple of German blog articles about this, one I really liked but can't find anymore, but basically it centered around this graph:https://electronics.stackexchange.com/q/173362f) is what I have been following to the letter in my designs so far. Unfortunately to my surprise I noticed that some ICs seem to have VCC and GND on opposing sides, and the datasheets have exemplary circuit board designs where solution d) is clearly shown. Supposedly according to that graph solution d) will end up having no decoupling effect at all. How do I evaluate such contradicting information? I mean clearly the IC manufacturer isn't the dumb person here, but I am. Which purposes can a decoupling capacitor have and and when should I account for which?2) How many layers does my pcb need?How do I know how many layers my circuit board needs, and how do I know I'm not just too dumb enough to route it?Especially with my current design and the prewiring of the component groups, I am getting the idea that this is going to be a cluster**** with only two layers. However I sometimes still get the impression that by doing another rewiring of the groups within themselves that I might be able to make it work for me. I have given that another try yesterday and after around 20 minutes I was frustrated and gave up.I feel like this is going to be my first 4 layer circuit board.Are there distinctive criteria I can orient myself towards, or specific design examples (ideally ones I can load up in KiCad and have a look at myself) to sort of get a better judgement in that area?What about power planes? Can I have a logic power plane and a 12V plane internally, the bottom as the GND plane and the top layer for signals only?From reading so far I have only gotten the impression that there is only one single layer designated to be the power plane, and that different voltages are arranged on it instead of them having individual layers.If I were to have power planes, especially two, are there any (parasitic) effects I should look out for since I have a huge area of overlap? Isn't it worse than with simple one-layered designs? What do I have to look out for there specifically?Are 4 layer boards less forgiving during rework? So far I have been using a ZD937 and a 858D for the hot air rework. I have been mounting small-pitched QFN packages and tiny Bosch Sensortec ICs successfully right from the start, without even having to think much about preheating the board. Are 4 layer boards more delicate when it comes to that since they have more layers and have higher thermal mass?Thank you everyone for your time and efforts!Matthias

author: JustMeHere
author_rank: Frequent Contributor
timestamp: October 30, 2022, 06:10:59 pm
content: 4 layer stack up issignalgndvccother signalThis provides your uC very short paths to VCC and GND. Be very careful with SIP and DIP through hole packages. The copper must go between the pins. This is because any slots in your planes create noise.4 layer boards are actually much easier than two layer boards. GND and PWR are already routed for you and they are available everywhere.

author: CookieEater
author_rank: Contributor
timestamp: October 30, 2022, 06:14:38 pm
content: Hello,So you're saying that I should not have a dedicated power plane for logic and the drivers and relay each (one 5V plane, one 12V plane), but instead divide the power plane into sections?Thank youMatthias

author: blazy
author_rank: Newbie
timestamp: November 05, 2022, 11:00:36 am
content: fyi robert has lots and lots of videos about pcb stackup, crosstalk, planes and lots of other things including this layer video with rick hartley (a real OG)about the decoupling: f) seems to be the way i mostly did it too, although i think that this question is more than just black or white and as the comments under the picture tell too, you should take it with a grain of salt.Obviously d and e seem counter-intuitive since your purposefully not taking the shortest path and therefore risk running into ground loop issues but as the top answer telly, there might be situations when its not doable any other way.Ideally you would have 0.1u, 1u and 10u on every device/pin for the best combination of fast response and big buffer, but mostly the datasheet will tell you which ones you really needed.For more about that, i can (again) suggest roberts vids:about the 4 layers: i think theres probably always a mathematical odd to make it into a 2 layer (as your autorouter will happily show you) if its a somewhat reasonable part count. But you shouldnt be **** your head just for the sake of saving on one more via. Buy your pcbs from jlcpcb where you'll get a couple 4 layer pcbs for the price of one 2 layer from eurocircuits or betalayout. For soldering pins to a big copper plane you can generally use thermal relief pads, except for components which have high heat dissipation where it might be favorable to use the plane as a heat sink.PS: I think i know about which german forum you are talking and, indeed, their users can sometimes be really salty and stubborn, but these are mostly (almost) retired EE that dont want to see the world evolve and change to new standards and methods, nothing to take personally

author: redkitedesign
author_rank: Regular Contributor
timestamp: November 05, 2022, 11:23:14 am
content: Your logic isn't using 12V, and your motor drivers don't use 5V. So both power planes use different parts of the board, and can be routed next to eachother on the same PCB layer.All signals between them reference the same ground plane, which should be continues over the entire board (there are situations where a split ground plane is useful. Those are rare, and require specialist knowledge for the actual design too. You can safely assume you will not benefit from a split ground plane unless you can explain quantitatively why you need it).Decoupling is an issue that can draw debates like Linux vs. Windows. I've never seen a design where the logic could not be properly decoupled with a single 100nF 0603 SMD capacitor on each power pin. Connect the ground pins of the logic and caps directly to your groundplane and you are done.Relays and motors might need more decoupling capacitance.4-layer boards from China are almost as cheap as 2 layers, and they are a lot easier to route. Unless you like routing, or make more than 10000 pieces. you're almost certainly better of with a 4-layer.I've never bothered with replicating layouts. For me, most of the work isn't in actually placing components and traces, most of the work goes in thinking about how to place the components and how to wire them. Once I've figured that out I find it easy to just draw it twice (or three times) and take advantage of slightly adapting each replication to the actual board placement, because I often try to cram 100 components on a 50x50mm board.In general, time spend on figuring out an effective placement is never wasted, good placement makes the wiring an easy, natural consequence.