First ever PCB design - Looking for design advice  - Page 1
Forum section: electronics / projects

author: AshW
author_rank: Contributor
timestamp: June 06, 2020, 08:55:00 am
content: Hi all,Attached are some images and files of a usb "breakout board" (4 port switch) and a speaker driver with a switching pj-307 3.5mm jack. This is my first ever pcb and is designed to add two physical usb ports and two internal ports as well as a stereo speaker driver with a headphone jack that switches outputs when plugged in. This isn't a finished version so nothing is organised and I'm expecting it to have some basic and pretty rookie mistakes but I'm really just looking for advice on any improvements or fixes I could make.https://drive.google.com/drive/folders/1HX_nFH2X1OD_XKLhu9dXKvbH8ryPEA-M?usp=sharing- Google drive folder of all files (Includes Gerbers)

author: homebrew
author_rank: Frequent Contributor
timestamp: June 06, 2020, 03:45:39 pm
content: Here are some initial thoughts, that came to my mind after looking over your design briefly:Overall PCB-Artwork1) You seem to have a solid 5V plane on the bottom and a solid ground plane on top. That makes it hard to get a good (good = solid, uncut) ground plane at all. Better have ground on both sides and use vias to "stitch" the planes together. Having different potentials on outer planes might also be dangerous if brought close to the mounting holes, as a screw could easily short the rails.2) I would add more bypass capacitors to the digital ICs. 100n is normally a good starting point.USB1) USB tracks seem not to be layed out as differential pairs and there seems no impedance controlling. However, controlling impedance on a two layer board is difficult, why I would recommend four layers for any USB design. You should also have some distance between USB DM/DP pairs to adjacent tracks and adjacent ground planes.2) I would strongly suggest adding a fuse at least at the USB input side.3) Think about adding some ESD-Protection on the USB-lines and on the 5V power rails at the connectors.4) The crystal oscillator seems to lack the typical load capacitors (depending on the crystal, typical values range somewhere from 12p-33p). I've not come across such a capacitor-less design before so check with the datasheet if that is really supposed to be like this!Audio1) I would suggest to have a separate ground plane for the audio amp - but the experts here will certainly comment on this in more detail. The chip has different ground pins for reasons.2) You might add some EMI filters on the output according to the datasheet's suggestion (https://www.diodes.com/assets/Datasheets/PAM8403.pdfPage 9)3) Also, you might add a 1000uF cap on the supply is suggested on the same page in the datasheet. However, be careful with the inrush-current - that 1000uF will act like a dead short at first, before it is charged. I'm not sure if your upstream USB-Port likes this. Again, wait for the experts here to clarify.4) Be careful to decouple the amplifier supply from the USB 5V lines. As your chip is a class D amp, it might create considerable noise on the supply lines if not filtered sufficiently.Schematic:Quite hard to read, when signals are drawn straight through components. Also the schematics in the picture is clearly not corresponding to the board as all connectors seem missing.So yeah - even if that seems like a simple project, a lot of details might have to be considered ...

author: phil from seattle
author_rank: Super Contributor
timestamp: June 06, 2020, 04:10:11 pm
content: On the USB signals, I have read that for short runs, impedance and length matching isn't that important. I see no attempt at it in numerous products - though that doesn't make it right. In this case the longest run is about 20 mm.

author: AshW
author_rank: Contributor
timestamp: June 07, 2020, 05:59:05 am
content: Thanks,I will definitely fix the 5V situation as well as splitting the ground planes and cleaning up some of inputs and outputs. I'm getting the power from a usb out connection on a raspberry pi so I assume that the power would be nice and clean but I really should separate the internals of the circuit.Also note that I've seen the same configuration for the usb switch in a few "micro switches" so I assume it works correctly.Other than that I'll get to implementing your advice.Thanks!

author: homebrew
author_rank: Frequent Contributor
timestamp: June 07, 2020, 08:08:01 am
content: Quote from: AshW on June 07, 2020, 05:59:05 amDo you mean the crystal oscillator? Then that might really be ok for some reason. I would nonetheless add the SMD-pads to install load capacitors if it wouldn't oscillate. Doesn't cost you a anything ... saves you a ton of headache in case.Regarding the trace impedances, yeah true! As phil noted, there is quite some margin of error on USB so you might get away with it and get your design to work in the majority of cases. However, the design is still out of spec and under certain conditions (e.g. more out of spec hubs attached, long and low quality cables ...) the deviations from the spec might add up to the point your device behaves unreliably.EMI/EMC/ESD is another topic. If not considered, your device will likely still function but will be more likely damaged in the long run or interfere with other equipment. Likely you might accidentally also bast out tons of RF (conducted or radiated) into your environment, which is never good ...Having said the, I just spotted that your USB connector shields are not connected to anything. You might consider changing that. There are a lot of options to do that - you can look that up in other designs.In any case: Make it at least safe enough so that it doesn't burn down the house ...