Review a newbie's PCB design layout? (LED driver board) - Page 1
Forum section: electronics / projects

author: kissel
author_rank: Newbie
timestamp: July 12, 2022, 12:26:28 am
content: If you want to skip the backstory, I'm looking for critiques on the PCB layout shown in the last two images ("Front"/"Rear") in the post.As the title states, I'm a newbie. I got some circuit basics in my mechanical engineering classes, but other than that I'm self-taught. I've been messing around with electronics for years, but recently I unwittingly tossed myself in the deep end with a project to make some LED light fixtures for my aquarium. One thing led to another, and I thought: "All these wires and this breadboard sure suck. How hard could it be to design a PCB?" and "Ahh, the drivers I was using were obsoleted - how hard could it be to make my own driver circuit?"Well, it turns out it was pretty hard. Good ol' Dunning-Kruger got me. The drivers instantly blew up when I plugged in the power supply. After some discussion on StackExchange and some reading on SMPS circuit design, I realized a few issues, like:While the traces were fat enough from a thermal perspective, their inductance could be a problem. I shortened and fattened the power-carrying traces.Having the capacitors on the opposite side of the board from the drivers could cause noise from the inductance of the vias. I flipped the caps to the same side.Having a single large capacitor per driver may be insufficient for high-frequency noise. I added a second smaller capacitor to each.Inductance of the long wires between the PS and the board could be causing voltage spikes. I added a large electrolytic cap between VIN and GND on the board.Having the ground plane directly beneath the inductors reduces their inductance from eddy currents. I removed the ground plane from that area.I won't know for sure what the issue was until my new oscilloscope gets here, but I thought in the meantime I'd pick your brains for any other obvious problems my design might have.Any thoughts?Edit: More recent images are inpost 4.

author: ataradov
author_rank: Super Contributor
timestamp: July 12, 2022, 12:57:13 am
content: The first version looks like a typical novice layout.The second one is way better. Common issues (not really critical) I see:1. Traces go too close to vias and other plated holes. There is plenty of space, no need to cramp things together. Look ar R+ and VIN and the via, for example. They look like power traces, but then they are way too close to each other.2. I'm not sure why the traces from U1 need to jump two times? Why not start them in red? And again, vias are too close to the pads and other tracks.3. It appears that you use entire plane for VIN. There is really no need for that. It is far better to have ground planes on both sides.It is hard to meaningfully review the PCB without looking at the schematic.

author: kissel
author_rank: Newbie
timestamp: July 12, 2022, 01:15:54 am
content: Alex,Thanks so much! I'll edit the first post to add the schematic.To some extent, it feels like there's a balance between spacing things out and keeping traces as short as possible. Is there a concrete way to determine how far apart to keep stuff, or is it just intuition?Yeah, I really didn't like that. If I keep them on the bottom (blue), I cut off the drivers from GND. If I go to the top and leave them there, I cut off R8-R11 from VIN (aside fromsome tiny gaps between pins on J1).What is the benefit of having two ground planes? Reduced EMI? I figured it would be beneficial to have minimal losses on VIN, and it made it easy to not have to deal with routing another set of traces (probably a silly reason).

author: ataradov
author_rank: Super Contributor
timestamp: July 12, 2022, 01:41:15 am
content: Quote from: kissel on July 12, 2022, 01:15:54 amA few mm of length increase would not make a difference. It is mostly an intuition, but a good rule of thumb is to check whether you can clearly see what is connected where on a full board view. In this case I has to look at individual pixels to figure out what is going on. This is not good. It must be obvious what is connected and what not on a quick glance. Visibility would be even worse when the trace is under the solder mask.And for high voltage (mains) tracks you need to follow clearance rules, but this is not the case here.Quote from: kissel on July 12, 2022, 01:15:54 amThat's why you need to have two ground planes stitched with vias and VIN as a single trace. Having the whole plane as VIN does absolutely nothing here, but prevent optimal routing.Quote from: kissel on July 12, 2022, 01:15:54 amYou can actually route stuff. In absolute majority of 2 layer designs you want to have two GND planes. Things change what you go to 4 layer boards.Quote from: kissel on July 12, 2022, 01:15:54 amYou need to consider loses everywhere, not just one net. Again, it is hard to tell without a schematic, but the trace that goes from the IC to the VIA on "R+" net is the thinnest place in what looks like high current link. Strong VIN does not matter, even much weaker would not be the point of failure. It is important to balance things.I see you attached a schematic. This is also unreadable mess, so start with sorting that out. Start with the placement of J1. You would have a way less mess if you just place it on the right and vertically.AL8862Q can switch up to 1 A. This is not a lot in a grand scheme of things, so I would also review the rest of the setup and firmware (switching frequency and all that stuff.)

author: kissel
author_rank: Newbie
timestamp: July 12, 2022, 03:32:18 am
content: Thanks for the suggestions and advice. I've reworked the schematic (sorry about that) and redone the PCB with both sides as GND planes and with more breathing room between vias and traces. Here are the images; this time I've included images with the silkscreen layers focused so you can see the reference designators for comparison to the schematic.Quote from: ataradov on July 12, 2022, 01:41:15 amThis trace is super low current; it just measures the voltage across the current sense resistor. Anything with remotely high current is 1mm+, and the LED power traces are all 2mm.Quote from: ataradov on July 12, 2022, 01:41:15 amThe drivers blew without the MCU even soldered onto the board, so they should have just been 100% duty cycle. Working theory is that high inrush current combined with inductance of 1m wires carrying power to the board caused voltages to initially spike. I've only got 17v headroom on the drivers so it wouldn't take much.

author: ataradov
author_rank: Super Contributor
timestamp: July 12, 2022, 04:10:52 am
content: The schematic looks way better. You still need to separate all the grounds and use local symbol where needed. I'd do the same for VIN and other commonly used signals, but that's a matter of taste. Grounds just look wrong. And clean up the pull-down resistors and control signals.Would not they be disabled without the MCU? I think you may have other issues. I'd definitely use the old board for debugging with smaller loads.See annotations on the picture. You still have places where traces are too close to other stuff. There is no need for that.You need to add a lot of vias stitching the ground planes. Rotate the capacitors. There is no need to cram everything together, remember, you will have to solder that, and in your case access to that small capacitor between the IC and the big capacitor would be very hard.Keep traces on the same layer if possible. The board is very low density, no need to jump the layers.I'm also not sure if removing the ground from under the inductors does anything useful. I personally would keep it.Also, your C1 intersects with L1.

author: kissel
author_rank: Newbie
timestamp: July 12, 2022, 04:29:40 pm
content: Thanks!Quote from: ataradov on July 12, 2022, 04:10:52 amSorry, not familiar with that terminology. What do you mean by "separate the grounds and use local symbol"?Quote from: ataradov on July 12, 2022, 04:10:52 amI've really tried with them, but it seems impossible to get them any better since the order of the MCU pins is different from the order of the drivers; signals are going to all be crossing over each other no matter what. Is it possible to describe how they could be cleaned up?Quote from: ataradov on July 12, 2022, 04:10:52 amThe datasheet says "Leave  floating for normal operation". I definitely will be debugging the old board once my oscilloscope arrives tomorrow, though.Quote from: ataradov on July 12, 2022, 04:10:52 amCorrected! I always like to know the "why" - what's the danger in having traces close to pads/vias/other traces? Cross-talk?Quote from: ataradov on July 12, 2022, 04:10:52 amAhh, thank you! I'll do that. I see you showed thermal vias under the IC exposed pads. I was thinking about doing that but thought I read that could cause problems for the board house. Is that wrong?Also, is there a typical via size you would use to tie the planes together?Quote from: ataradov on July 12, 2022, 04:10:52 amEverything I've been reading has been really emphasizing getting the caps as close as possible to the ICs. Is that incorrect guidance?Hmm, I wasn't thinking about manufacturability. With reflow soldering, what's the difficulty with components that are close together? Just the fact that you'll need to place them both without knocking the other out of place?Quote from: ataradov on July 12, 2022, 04:10:52 amLet me walk through my reasoning for each one and you can tell me if I'm wrong.The trace between the ICs and the current sense resistor (top row of vias): The current sense has to be on the top, whereas the IC is on bottom, so a via is necessary here.VIN (middle row of vias): Again, current sense is on top, so VIN should be on top.CTRL (bottom row of vias): These were necessary to keep the ground plane connected to all of the ICs, but adding all the vias like you suggest will fix that. These traces can now stay on the bottom.The root of the problem is that the LED power traces need to be really fat, and there's no way of fitting them all on one side of the board. Consequently, the inductors and the current sense resistors need to be on opposite sides. I chose to put the ICs and everything else on the same side of the inductors, as I'd rather have a via on the trace measuring current sense voltage instead of having a via between the driver and inductor.Quote from: ataradov on July 12, 2022, 04:10:52 amI've read from a number of sources that ground plane under an unshielded inductor (which mine are) will reduce inductance due to eddy currents in the plane, and it will also induce voltage fluctuations in the ground plane. I'm also reading, however, that it's not a good idea to run traces across an unshielded inductor, which I'm doing with the + LED power traces. Maybe I just need to switch to shielded inductors.Quote from: ataradov on July 12, 2022, 04:10:52 amL1 is on the bottom, and C1 is on top.

author: ataradov
author_rank: Super Contributor
timestamp: July 12, 2022, 04:52:38 pm
content: Quote from: kissel on July 12, 2022, 04:29:40 pmHave a look at this schematic, for examplehttps://github.com/ataradov/free-dap/blob/master/hardware/d11-nano-dbg/d11-nano-dbg.pdfSee how the ground signal is used where needed instead of using one symbol and running the ground wire everywhere.Quote from: kissel on July 12, 2022, 04:29:40 pmIf the routing ends up being messy, it is much better to use net labels and no run the net. But at the very least you can remove those clumped parallel traces. place everything on an even grid, it is not like you are running out of space.Quote from: kissel on July 12, 2022, 04:29:40 pmBut if you have pull-down resistors, it is not "open".Quote from: kissel on July 12, 2022, 04:29:40 pmIt is just a good habit. Electrically it does not matter in most cases. In this case it is just for ease of reading and understanding.Quote from: kissel on July 12, 2022, 04:29:40 pmWhy would it cause problems?Quote from: kissel on July 12, 2022, 04:29:40 pmIt is generally better to use the same size of the via and place more vias if current capacity is an issue. I generally just go for 0.3 mm diameter, since this is a typical spec for cheap manufacturing.Quote from: kissel on July 12, 2022, 04:29:40 pmThey will still be close. The ground part being rotated is not a huge deal.Quote from: kissel on July 12, 2022, 04:29:40 pmYou may need to rework the board by hand.Quote from: kissel on July 12, 2022, 04:29:40 pmI was mostly talking about control signals, the other stuff is fine.Quote from: kissel on July 12, 2022, 04:29:40 pmWell, you still have a ground plane just 1.6 mm away on the other side of the PCB. Don't overthink it.

author: mariush
author_rank: Super Contributor
timestamp: July 12, 2022, 06:23:24 pm
content: What's the voltage for the leds? How many leds in series? What's the current? What's your power supply?Could you maybe simplify your design by using a single buck regulator to give you ~ 1-2v above the forward voltage of the leds and then use simpler linear drivers with pwm features / analog control ?I would be tempted to use a 2 x 10 or a 2x5 header + 2x2 header for power or some other connector.You could have maybe a barrel jack connector for power and a basic 10 pin ribbon cable for the led power - or use a repurposed a 20 pin USB 3 cable (physically 19 wires in it) - this way you'd also have twisted pairs going to the actual leds, decent gauge, whatever...Depending on input voltage, I'd consider leaving a column of pins empty between the led pins and the power pins (for example could get humidity or something create a short between the input and the leds)Last layout looks OK to me but the inductors seem too big versus everything else, you sure you need such big inductors?In the last layout the traces from the ESP are awfully close to the GBD pads, route them better. I'd also find a way to move the resistors around the ESP to the top side.

author: kissel
author_rank: Newbie
timestamp: July 13, 2022, 03:04:57 pm
content: Quote from: ataradov on July 12, 2022, 04:52:38 pmAhh, that's so much cleaner! I didn't even realize that was a thing, but I've figured out how to make it happen in KiCad. Definitely cleans things up a ton!Quote from: ataradov on July 12, 2022, 04:52:38 pmI think I did what you suggested? Not sure.Quote from: ataradov on July 12, 2022, 04:52:38 pmOh, I guess I forgot to mention - I flubbed the footprint so the pull-downs were not actually soldered in place on the board.Quote from: ataradov on July 12, 2022, 04:52:38 pmI only have a surface-level understanding of the fab process. Don't know what I don't know!Quote from: ataradov on July 12, 2022, 04:52:38 pmNonetheless, I think I'll plan to switch to shielded inductors. They're only like $0.20 more apiece.Quote from: mariush on July 12, 2022, 06:23:24 pmIt's fairly high-power. There are 5 channels, all 1A, and ranging from 18v to 38v. The power supply is 48v.I appreciate the suggestion, but I'd like to stick with the current design unless absolutely necessary. With my limited electronics knowledge, each redesign takes me a huge amount of time.Quote from: mariush on July 12, 2022, 06:23:24 pmWhat's the benefit of doing it that way over my 12-pin header?Quote from: mariush on July 12, 2022, 06:23:24 pmI wanted it to be waterproof, so I'm usingthisConxall connector. And I'm using multi-conductor cables for powerinto the boardandto the LEDs.Quote from: mariush on July 12, 2022, 06:23:24 pmI kinda thought about that, which is why I arranged the connections so that VIN is on the end with GND next to an LED negative pin - a short there wouldn't do anything.Quote from: mariush on July 12, 2022, 06:23:24 pmNo, I don't think they're strictly necessary. Driver datasheet indicated that larger inductors boosted efficiency when V_in was much greater than V_out, so given the significant power draw of the system (~150W) I thought it would be worth a couple bucks to go overkill on the inductors.Quote from: mariush on July 12, 2022, 06:23:24 pmGBD?Quote from: mariush on July 12, 2022, 06:23:24 pmThanks, I'll try. I'm not sure if I'll have too much space with the caps rotated like Alex suggested.

author: ataradov
author_rank: Super Contributor
timestamp: July 13, 2022, 03:39:25 pm
content: Quote from: kissel on July 13, 2022, 03:04:57 pmI'll attach a schematic showing what I mean.See how a connector is routed to both parts of the MCU. If I were to draw that using wires, it would be a mess. But labels make things easier to read ad they also document the purpose of the signals.Quote from: kissel on July 13, 2022, 03:04:57 pmWithout pull-ups it would go into the full current mode, which is 1 A in your case. You may want to limit that too for debugging.