Critique my first PCB design - Page 1
Forum section: electronics / beginners

author: 0-8-15 User
author_rank: Regular Contributor
timestamp: July 01, 2020, 03:34:32 pm
content: I recently built a small battery powered prototype that converts the revolutions of the counter of an electromechanical induction meter into RF signals. It works great, but now I want to take the opportunity to create my first circuit board.Closely following the "Intro to KiCad by DigiKey" I came up with the following design (see attachments).Open questions:Can I expect a somewhat reasonable antenna performance if I simply attach a long wire (~ 17 cm) to H1?Is the choice of 15/30 mil inner/outer diameter vias reasonable to interconnect 40 mil traces?Will I run into issues if I have pads so close to the edges of the board?Do I need additional vias to connect the two ground planes?Should I avoid traces on top of each other at all cost?I would love to hear your thoughts on my design.

author: dazz
author_rank: Frequent Contributor
timestamp: July 02, 2020, 06:27:26 am
content: I'm not qualified to answer your questions, but don't you need to make your dimension rectangle larger? The way it is now, your battery holder won't fit in that pcb.Hope some of the local experts will chime in about your questions, it'll be a learning opportunity for a noob like me. I've read somewhere that there's usually no need to have two ground pours. Not sure though.

author: Rerouter
author_rank: Super Contributor
timestamp: July 02, 2020, 06:56:13 am
content: Main things I see would be:- unwrapping some nets, e.g. the ATtiny power trace, if you flipped the D3-pad2 trace to above the attiny, you could directly run the thick power trace to the capacitor,- C4 could be to the left of the attiny, and power should run to that capacitor before the attiny,- Run D4's power directly from the cap to unwrap some more nets,- I would like to see C6 rotated to the same orientation as the rest, I know its not needed, but its not a bad habit to form if you have no other limitations.- Move R3 near the LED, he doesnt need to be all the way over there when he is just to ground, he can be anywhere, at minimum swap his position with R1,- If traces can live on the top layer, with no conflicts, move them there, e.g. pin 3 of U1, when you get into more complex designs, the more freedom you can leave yourself on the bottom layer, the less headaches you will find yourself against.- Like the other poster, the board should support the battery holder, otherwise its size and weight could tear it off the PCB via rotating about the pads,- C5 can now probably take the place C4 was in to tidy up those traces.

author: Rerouter
author_rank: Super Contributor
timestamp: July 02, 2020, 07:03:21 am
content: Quote from: 0-8-15 User on July 01, 2020, 03:34:32 pm1. If that is the wavelength, half or a quater wavelength, it will be reasonable as an omnidirectional antenna. not the best, not the worst.2. Easy way to answer this is to treat it as a trace, work out the hole circumference and take that as a trace that wide and half your copper thickness, if that still meets the calculator for thermal rise your fine (KiCad has built in PCB calculator tools like trace current)3. If traces are so close to the edge the DRC is throwing an error, you have a problem, otherwise no as far as getting it manufacturered, e.g. usb connectors have pins that go through the PCB less than 1mm from the edge, its generally less than 0.3mm they have issue with as the drill bit could break out the edge of the PCB4. Only for high edge rate signals, and high current signals, both need a well defined return path, or there current may interfere with other parts of the circuit, if you have 1A flowing in some trace on the top layer, think like it has 1A flowing through ground beneath it.

author: 0-8-15 User
author_rank: Regular Contributor
timestamp: July 02, 2020, 10:04:20 am
content: @Rerouter, awesome, thanks for all the advice. I will try to put as much of it into practice as I can.Quote from: dazz on July 02, 2020, 06:27:26 amThe dimensions of the printed circuit board are chosen so that it fits exactly into a recess in the electricity meter. The intention behind the free space on the left and right side is to have an area where I can attach adhesive tape.Edit: New try (see attachments).

author: dazz
author_rank: Frequent Contributor
timestamp: July 03, 2020, 12:26:13 pm
content: So, is it really necessary or even a good idea to have two ground pours?

author: Christe4nM
author_rank: Unknown
timestamp: July 03, 2020, 01:09:16 pm
content: That’s a great little circuit you have there. You’re off to a good start, but there are some things that I’d suggest you have a look at. Allow me to give you a few pointers starting with the schematics.Schematics* It is helpful for anyone reading your schematic to follow a few common conventions. It will help you too when you look at it a year from now. Put (positive) power at the top, GND at the bottom, inputs left, outputs right. Make sure ICs and such are the ‘right way up’ too. The idea is that it will be easier to identify common building blocks in your schematic that way.I suggest starting with putting all GND terminals pointing downward. I’ve attached a picture below of what that could look like. The circuit around U1 now has a clear input and output side, and is easily identified as a DC/DC converter. In addition, by moving and rotating U3 a bit it clear up the nets around it.* U1 has 3 unconnected pins. In theMAX756 datasheetis a table (page 4) listing all the pins and required connections. Pin 4 can be left unconnected, but pins 1 and 2 need to be tied to either the output or ground (datasheet page 5 top-right). I did this wrong in the attached picture by tying them to the input.Edit: I am not too sure whether it's better to tie !SHDN to the battery voltage or the output. Try both on your breadboard and see what happens?* Before doing layout it’s a good idea to putnet nameson important nets. That way they are easily identified when doing layout.For example: make sure each power net has a name that easily identifies it as a power net (e.g. P3V3, +3V3, 5V0, N5V0, VCC_3V3… something along those lines.)Among other important nets are:- communication lines: e.g. TX- high (peak/ripple) current nets: e.g. switching nodes in DC/DC converters. In your circuit that is LX. Reason being that you need to keep those traces as short as possible on your layout.- RF and other high frequency signals. They need to be routed without interruptions over a solid ground plane.LayoutYou haven’t got much space, but you’ve done a good job trying to fit the circuit. I’m afraid that a little rearranging will be required though.* U1 is a DC/DC converter and needs a little extra attention during layout. The datasheet (page 8 ) has a section on layout that tells you that you need to keep C2 and C3 (in your circuit) very close to U1’s ground pin. In addition you’ll need to keep the loops where (high) ripple current flows very short. (Identified in red in the picture below). You’ll want to avoid other traces crossing those as well.* Make sure you take the +3V3 from the positive terminal of C3. Not from the diode or the trace between diode and C3.See the pictures attached for an example of what it could look like. (One was quickly done with MS paint, so bear with me on the visuals.)* While a full ground plane on one side of your PCB with minimal cuts is a very good idea, a full power plane isn’t. If you need it you could do it locally (e.g. under an IC and it's decoupling caps), but in your case I’d recommend just routing a wide trace to where you need the +3V3.Ground on 2 layer PCB* it is recommended that on a 2-layer board you try and keep one side a solid ground plane with minimal cuts. Of course you will not be able to avoid routing on the bottom every now and then. It's a good idea to keep those traces short.* If your bottom ground plane is almost a full plane, technically you could leave the top side without any pour/plane. Leaving the top side of a PCB without a pour however, is bad practice when it comes to manufacturing. The reason being that all that copper needs to be etched away. So do pour a ground plane on the top layer too and stitch it with a few vias to the bottom plane.* If there are lots of traces on the bottom because you couldn't avoid it, it's also a reason to pour ground on the top too and stitch them together to form one plane covering the whole PCB. Stitching is recommended especially near the places where the traces cut the bottom plane.

author: 0-8-15 User
author_rank: Regular Contributor
timestamp: July 03, 2020, 03:54:56 pm
content: Why should I avoid having a full power plane on the top layer (like shown in the attachements)?

author: Christe4nM
author_rank: Unknown
timestamp: July 03, 2020, 08:13:46 pm
content: Quote from: 0-8-15 User on July 03, 2020, 03:54:56 pmThat’s a great question. There are multiple reasons actually.If you ever happen to create a 4-layer PCB there are reasons to do with signal integrity and EMC, but they don’t apply in the same way to a 2-layer board. So, let’s look at your circuit:In your case you’ll run into an issue around U1 if you simply pour the power rail. The positive terminal of C3 (the output capacitor) is the quietest point of that supply section. That is where you’ll want to reference the rest of your circuit’s power supply to.Take for example the OUT pin on U1. That senses the output voltage, so U1 is able to regulate it to 3.3V (or 5V if you selected that). If you take it from anywhere else but C3, it’s sensing from a (more) noisy place and it can’t do the best job it can.The circuitsinput → L1 → LX → GNDandinput → L1 → D1 → C3 → GNDhave switching currents running through them. That means there is significant noise there. It’s the output filter’s job (C3 in this case) to filter that noise so your supply to the rest of the board is somewhat clean.This also means that even though D1, and U1(pin6) are connected to the same voltage, you cannot just put a pour there to connect them. They really do need to be connected directly to C3. With C3 being as close to U1 as possible. If not, you’ll end up with noise all over your power rail and board, as it couples into other areas of your circuit too. Potentially it could interfere with your RF signal and antenna.Youcoulddo a power pour for the circuit that comes after C3, as long as it’s only connected to C3, and not underneath any of the rest of the circuit around U1. But then why would you? There’s not much that does connect to 3V3 anyway. A wide trace to connect it directly will do what you desire. And with all that a ground pour is already easier: no need to exclude the zone around U1.If it’s vias you wish to avoid; in your case you may not even need them. You are using THT parts, and every GND connection functions as a via to connect the top and bottom pours. Avoid unconnected copper areas though (remove them or put a small via in there to connect them to GND).

author: 0-8-15 User
author_rank: Regular Contributor
timestamp: July 04, 2020, 04:48:46 pm
content: I tried my best to put everything into practice (see attachments). However, I am still not sure whether I should place some vias or not and whether I should give the output of the Dickson charge pump as a power network its own network name (e.g. 5V3).I am still overwhelmed by the multitude of tips I have received so far. Thanks a lot!

author: Christe4nM
author_rank: Unknown
timestamp: July 06, 2020, 09:59:46 pm
content: That looks good. Quite nice to put the antenna connector right next to the U3 RF pin. I am impressed to be honest. Not only have you managed to put it all in that small space, but I even see you have some symmetry in the placement here and there which will make it stand out as looking nice too. (It’s never a must, as the circuit itself is the most important. Yet if it so happens it does look nice)Do please have a look at the connection of U1 pins 1 and 2, just in case. It may be that one or both actually need to be connected to the output. As I understand it from the datasheet so far: !SHDN goes to the input. And 3/!5 goes to the output.Quote from: 0-8-15 User on July 04, 2020, 04:48:46 pmI can only speak for myself here: my pleasure. And overwhelmed: yeah I bet. I find that every time I start with a new topic in electronics at first there is a lot of information to sift through. Sometimes it’s a challenge to know which things you need to apply in your own circuit and which things would be overkill. That understanding comes with time and just doing it more often.Quote from: 0-8-15 User on July 04, 2020, 04:48:46 pmI can only speak for myself, but the tips I gave are meant to help you not just with this circuit, but for when you start making larger circuits too. In your case your circuit is quite small. So, don’t worry about naming the 5V3 net. Those tips I gave are recommendations, not rules. You’ll find that if you have a much larger circuit with many nets it’s suddenly quite useful to know which ones are power.As for vias; the large area underneath the battery holder will not carry much current, so it’s fine to leave as is. For good measure you could put one in the lower-right corner (e.g. near BT2’s positive terminal.) In that case the ground planes are connected in each corner of the PCB. Where the rest of the circuit is there are enough GND pins near to each other. In other words: no need for additional vias.I'd be curious to see the end result of you project. Good luck!

author: JustMeHere
author_rank: Frequent Contributor
timestamp: July 07, 2020, 02:51:58 am
content: It might not matter for this board, but watch for slots in your ground plane. These are caused by traces and the holes in your design. Try to get come copper between the holes. Notice how your copper relief is slightly too much so no copper goes between the holes. If you have a SMPS then you can get some real nasty noise caused by slots.Really consider going surface mount. It's not nearly as hard is it seems. Once you've learned, you won't want to go back. It makes routing much easier.

author: 0-8-15 User
author_rank: Regular Contributor
timestamp: July 08, 2020, 12:20:55 pm
content: Quote from: Christe4nM on July 06, 2020, 09:59:46 pmIn my prototype, which uses two rechargeable AA batteries connected in parallel, both pins are connected to the input. The threshold level of the logic input is about 1V according to the datasheet. So if I don't connect the 3/!5 pin to OUT, in the worst case the output voltage would rise to a maximum of 5V for a fraction of a second before the DC-DC converter finally switches off.It was hard for me to decide whether to connect the batteries in parallel or in series, but I think I will get a slightly longer runtime out of a serial configuration. However, I will no longer benefit from automatic shutdown once the individual battery voltages drop below 1V. The peak input current at 1.25 V is around 100 mA.Quote from: Christe4nM on July 06, 2020, 09:59:46 pmI'll post a picture once its done, but that might take a while.Quote from: JustMeHere on July 07, 2020, 02:51:58 amAll I have to do in order to fix this is to lower the ground plane clearance setting? The default setting is 20 mils. How low could I go? Down to the minimum allowed trace spacing of the manufacturer?

author: JustMeHere
author_rank: Frequent Contributor
timestamp: July 09, 2020, 06:34:26 am
content: QuoteYep

author: dazz
author_rank: Frequent Contributor
timestamp: July 09, 2020, 06:40:11 am
content: Is it just me or the attachments are broken in this thread? When I maximize them they don't correspond to the thumbnail

author: 0-8-15 User
author_rank: Regular Contributor
timestamp: July 09, 2020, 10:07:33 am
content: @dazz, I re-uploaded them, does it work now?

author: EEVblog
author_rank: Unknown
timestamp: July 09, 2020, 10:25:40 am
content: I suspect that layout could have been done on a single sided board. Not that it technically matters as you'll order a DS PTH proto anyway. But it's a good habit to get into when thinking about PCB layout, like "how can I route this on the one layer?". That can leave the other layer for ground and/or power. Comes in especially for SMD layout.

author: 0-8-15 User
author_rank: Regular Contributor
timestamp: August 01, 2020, 10:06:04 am
content: The boards have arrived, but I probably made one of the most stupid mistakes you can make. I ordered them from OSH Park and choose their "After Dark" service thinking that everything but the traces would end up being black. Stupid me!I think I will order them once again in purple and use these "failed" ones to improve my soldering skills. This also gives me the opportunity to make some small changes to the design. Namely to further reduce the distance between the battery holders and to reduce the distance and minimum width settings of the copper zones to 6 mils.

author: soFPG
author_rank: Frequent Contributor
timestamp: August 01, 2020, 10:19:35 am
content: May I ask where do you get your PCBs manufactured?Edit: Should've read the textNice looking PCBs

author: 0-8-15 User
author_rank: Regular Contributor
timestamp: August 23, 2020, 02:54:27 pm
content: The new boards have arrived (this time from JLCPCB). I chose the cheapest shipping option and the delivery time was exactly 14 days (Monday to Monday). The assembly is almost complete, but I still have to decide what type of antenna to use.I have also updated the schematic drawing, taking into account the advice I received from @Christe4nM and determined the efficiency of the DC-DC switching regulator.

author: electrolust
author_rank: Unknown
timestamp: August 26, 2020, 11:25:52 pm
content: Quote from: dazz on July 09, 2020, 06:40:11 amthere's a longstanding image bug in the forum that does that. apparently doesn't affect all users.

author: Christe4nM
author_rank: Unknown
timestamp: October 24, 2020, 04:55:16 pm
content: Thanks for showing us the result; it's looking good! (Somehow I missed the updates to this topic back in August.)