# PCB design review: Decoupling, bypassing and grounding

I'm trying to make my own wireless sensor using ATmega microcontroller. I've some basic understanding of electronics but I'm a total amateur when it comes to designing circuits and PCBs.

This is just a hobby project so it's not expected to be of a production quality or anything like that. But still I would like to make it as good as possible just for a good feeling of doing things right.

I've read something about decoupling, bypassing and grounding but not sure if I understand it correctly. So if someone could look at the board and point out things which should be done differently I would be really thankful.

Edit: added schematic of the circuit

• Your tracks going between header pins look a bit fat for the space. Is there enough clearance there? Do you really need them so fat? – Majenko Oct 12 '14 at 23:40
• The status LED is just a regular 5mm LED or there's more connected to the STATUS_LED connector? If it's just the LED, 10K looks a bit too much for it. Maybe 470R to 1K would be better. – Ricardo Oct 12 '14 at 23:45
• If you plan on etching the PCB yourself, do you intend to do through-hole plating? If not, you may have trouble soldering the component terminals on the top side of your board. – Ricardo Oct 12 '14 at 23:48
• In general, dual-layer home-etched boards can be quite challenging, particularly for a first project. Maybe do a single-layer board first to get comfortable with the process? – Connor Wolf Oct 13 '14 at 0:10
• It's usually a good idea to make power traces thicker. – miceuz Oct 13 '14 at 12:27

Etching PCBs at home is fun, but the process makes PCB design a bit tricky for hobbyists like us. The most important constraint is that it's difficult to make plated through-holes. And those are essential for soldering components to double-sided boards like yours.

If you have your board made at a fab house, you'll get all of your PCB vias and holes plated like in the picture below. That's nice because you can then solder all components on the bottom of your board and be done with it. That's possible because all tracks on top will be linked to the bottom layer at the plated holes, thus ensuring continuity.

(Picture from RobotRoom.com)

If you don't master some kind of through-hole electroplating at home (a process that involves nasty chemicals), you won't get those holes plated. The end result is that you'll have to solder the component pads on the top of your board whenever there's a track reaching them.

Soldering on the top layer can be inconvenient at best, or just impossible, depending on the component and the PCB design. For example, headers are easy to access from the bottom, but they usually have a plastic support that gives them mechanical strength and that sits flush on top of the board. DIP sockets also brings problems as they sit flush on top as well.

Solder components on the top layer is usually a bad idea also because it hinders maintenance. You may assemble your board in an order that lets you access hard to reach pads, but when all the components are placed, you may be left without access to those pads. In my experience, because these pads are harder to reach, the soldering quality suffers and these pads end up being the first to fail.

To work around those problems, I suggest you do the following:

1. Design single-sided boards whenever you can. Use your schematic as an exercise, for example. Try to place its components carefully so that they make single-sided routing easier and try and route all tracks that you can on the bottom layer. I usually change pin assignments if it makes routing easier. If you need to cross tracks, use plain jumpers (I usually use remains of through-hole components for that). I use the top layer to represent the jumpers. Also, plan to use resistors and capacitors as jumpers. I've done just that in the picture below, on ATmega328P pins 2 and 3 - serial TX & RX.

2. If you can't make a single-sided board for some reason, make sure your tracks only change sides at vias, like in the places marked in orange in the picture below, and not at the component pads. You can then solder a piece of wire on both sides of your board on those vias. This will make for a much more robust solution than soldering at the components pads.

3. Make the vias really large (I use 0.07 inch or ~1.8mm). If you follow rule #2 above and only make tracks change sides at vias, those large vias are the only features you'll have to match between both sides of your board. Large vias make the registration process of double-sided boards easier.

4. I also try to stick to the 0.05 inch grid on Eagle, make only 45° turns and leave as much space as you can from tracks and pads of different signals.

Considering your design and the fact that you will etch it at home, and assuming that you can't make plated trough-holes, you'll have trouble with your oscillator crystal and all of your connectors. I would suggest you use the trick of bringing the track away from the pads into a via and then cross it over to the other side for those components.

You may get away with soldering the ceramic capacitors and resistors on the top layer, but I don't recommend that. I'd just re-route your board to try and bring most, if not all tracks to the bottom layer.

I don't know whether there are issues with the external components you plan to use (the NRF905 for example), but I would watch it if they use high-frequency signals for driving them (anything above 500kHz).

Below is my (quick and dirty) attempt at a single-sided version of your board. Pardon me if I made any mistakes, but it should give you an idea of how to try and route most of the tracks on the bottom layer. I had to use 5 jumpers, but you may be able to do better.

I now realize that my version of the 14-pin connector is mirrored in relation to yours, which made my version easier to route. But, if you don't have any software or hardware restriction, you may reassign the MCU pins to the connector so that it is easier to route your version as well.

I hope this helps.

• Thanks a lot for taking the time to explain the issue very clearly. I was somewhat aware of the problem with the crystal and the headers. But obviously I wasn't paying enough attention to this. I was also interested in electrical aspect of the design. In case I would use some cheap chinese manufacturer to make the PCB for me are there some things I should really reconsider in my design? Since I don't have any tools and chemicals for PCB etching yet it could be just easier and cheaper to let them make it. – loblik Oct 13 '14 at 6:02
• That can be done on one layer if you have enough clearance to send a trace between two pads. Looks like all of your layer changes can be removed with some needle-threading. – alex.forencich Oct 13 '14 at 6:03
• I haven't yet sent a PCB to a fab house, so I could comment on that. It's on my list of things to do before I die :D So I cannot comment on that. But others may chime in and address these complementary aspects of your question. Just don't accept any answers for a few days so that people see that you're still looking for answers. If that doesn't work, post another related question. Just be aware that folks here don't usually welcome broad questions, so make sure you focus your next question on the specific aspects you want addressed. – Ricardo Oct 13 '14 at 12:10
• It may be worth noting that a jumper which is soldered at two places may be nicer than a trace which connects two vias, each of which requires a piece of wire and two solder connections. On the other hand, using a ground plane for the top side (along with vias) might be good even if one uses discrete wires for all other top-side connections. – supercat Oct 28 '14 at 21:38

How did no one mention this yet?