Why is my SMT PCB so much worse than my breadboard layout? - Page 1
Forum section: electronics / projects

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 28, 2016, 04:27:38 am
content: I am working on a circuit that is supposed to be a multiple feedback band pass filter at 16900Hz. On my breadboard I get areasonableapproximation to what the math/theory expects, but when I moved my circuit to 0603 parts on a two layer board it gets much worse - especially at the low end. I would expect it to getbetteron a PCB, not worse! (Tighter loops etc).Attached is an image with the expected response (blue), PCB response (green) and breadboard response (orange). Also attached is a of the layout, the real life pcb and the breadboard and schematic. (Ignore extra components on the breadboard, they're not connected).Is there coupling going on in the board? I can't think of anything that would cause such a worsening in frequency response, especially at the low end.How can I modify my design to get closer to the ideal frequency response?All resistors are 1%, caps are 10% or 20% X7R.Thank you.

author: singapol
author_rank: Frequent Contributor
timestamp: August 28, 2016, 04:58:07 am
content: I suspect the quality of the caps, for ceramics X7R is the cheapest and worst in terms of leakage you should use COG types but since this is not RF territory only about 16K hz. film caps such as polyester (mylar/MKT), polypropylene/MKP can do. For really accurate specs. perhaps polystyrene or silver mica ( through large size)..same with polystyrene but also subject to temperature/temp.co.

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 28, 2016, 06:20:20 am
content: Thanks for the responses!But the caps in the breadboard are also X7R? Why does the transfer function look more like expected in this case?Do you have any suggested information about where each type of cap belongs? e.g. any good application notes.

author: Mechatrommer
author_rank: Super Contributor
timestamp: August 28, 2016, 06:36:17 am
content: Quote from: MattHollands on August 28, 2016, 04:27:38 amremodel you simulation to take into account capacitive coupling between each component's pad to ground plane, and readjust component values to get back what you want. looking at your schematic, i will start remodeling at node near label C25 and node near label AGND because that where higher impedance input is, capacitive coupling around 1-2pF each. my 2cnts ymmv.

author: Tim F
author_rank: Regular Contributor
timestamp: August 28, 2016, 07:18:28 am
content: I don't suspect the Q of the X7R of the caps to be a major issue for frequency response. The tolerance of the caps (and resistors to a lesser degree) will lower the Q and move the center frequency of your filter, as will parasitic capacitance of the board/layout and opamp inputs. One of the caps is probably 10-20% off nominal on the PCB build.You shouldn't have a 10dB attenuation across all frequencies on the breadboard though. I would suspect the 6K2 being out of spec, the output impedance of the source to be high or another problem in the measurement setup.

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 28, 2016, 07:57:24 am
content: Quote from: Tim F on August 28, 2016, 07:18:28 amDo you see anything that could explain the terrible low end filtering?Quote from: Tim F on August 28, 2016, 07:18:28 amI just built another filter (same circuit etc), and I'm getting my peak at 40.5kHz! This is ridiculous I don't understand what is up with my filters.My measurement process is: Power up board, connect sig-gen to input, connect channel one across input, connect channel 2 across output. Set frequency, measure input peak-to-peak, measure output peak-to-peak, change frequency etc.

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 28, 2016, 07:59:15 am
content: Also, if it helps, I built a 60Hz filter on the breadboard and it was pretty bang on the mark. Haven't built it on the pcb yet though.

author: Niklas
author_rank: Frequent Contributor
timestamp: August 28, 2016, 08:09:20 am
content: Shouldn't R27 be connected to analog GND, same potential as the opamp's +input, instead of GND?

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 28, 2016, 08:40:47 am
content: Quote from: Niklas on August 28, 2016, 08:09:20 amI don't think it should matter - DC is blocked by the caps. However maybe it will put greater DC bias on the caps leading to greater variation in capacitance. The original thinking behind this is that AGND is generated by an Opamp at Vcc/2 and so I wanted it to be sinking as little current as possible.

author: chuckb
author_rank: Frequent Contributor
timestamp: August 28, 2016, 03:55:31 pm
content: A few things to check1. The Op Amp bypass capacitor is missing from the SMD pcb picture. That is critical for a high frequency opamp connected with test leads.2. In a prototype application the hookup of signal generator, power supply, output monitor are all critical. Because of R27 grounding to the power ground (good catch Niklas!), the audio signals are traveling through the power supply lines. I would recommend having a single point on the pcb where all the power supply, signal generator and output monitor ground connections come together in one spot. And of course all that test equipment, except one, needs to be floating from power ground.Good luck!

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 28, 2016, 08:57:33 pm
content: Just to be clear, here are a couple more schematic details. Attached is an image showing how I generate AGND which is Vcc/2. The ground connection for all of my test equipment is the black circle on the output of the opamp (the board is floating). The sig-gen, input monitor and output monitor are marked with red circles.If I understand what you're saying, the problem could be that the signal from the sig-gen is travelling through R24 and R27 and into ground, and then has to find a return path to AGND which is causing the problem? I see how this could be the case, but want to check I understand.Also, to clarify - VAA is the same as VCC.

author: rstofer
author_rank: Super Contributor
timestamp: August 28, 2016, 10:19:54 pm
content: Totally off topic: I would use solder paste and a cheap hotplate to solder these components. Something like the unit I bought from Target:http://www.target.com/p/elite-cuisine-single-cast-electric-burner-hot-plate-in-black/-/A-49124276Put the board on the hotplate, set the dial to HIGH and watch until the solder flows. When done, gently remove the PCB with a pair of tweezers and set it aside to cool. Then worry about turning off the hot plate.Why not take the radial lead capacitors from the breadboard and stick them down to the PCB? Just to see...Maybe try the resistors too.

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 28, 2016, 11:48:31 pm
content: Quote from: rstofer on August 28, 2016, 10:19:54 pmYep my soldering is horrible! I probably will reflow solder for the final build but atm I want to build it slowly and debug my issues.I have replaced the 1k3 resistor from GND to a through hole resistor to AGND to see the difference. Frankly, there's not much difference.First image is the original response and second image is with the 1k3 to AGND.

author: Andy Watson
author_rank: Super Contributor
timestamp: August 29, 2016, 12:12:35 am
content: Quote from: MattHollands on August 28, 2016, 08:40:47 amIt wouldn't matter if AGND was generated by perfect components, but I wouldn't be happy adding the response of U1A into the signal path.What vaue is Vcc (or Vaa) relative to GND ?

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 29, 2016, 12:34:03 am
content: Quote from: Andy Watson on August 29, 2016, 12:12:35 amYou're right, that is totally a reason to use AGND instead. VCC=VAA=12V. I have since replaced the 1k3 resistor to GND with a 1k3 (TH) resistor ro AGND and not experienced too much difference (look at my previous post).

author: hendorog
author_rank: Super Contributor
timestamp: August 29, 2016, 01:24:41 am
content: The pad numbering of the NE5532 on the PCB looks backwards compared to the datasheet.

author: StillTrying
author_rank: Super Contributor
timestamp: August 29, 2016, 01:45:06 am
content: The input resistances of these NE553X are quite low, and vary between manufacturers, - which might have a damping effect on the filter.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: August 29, 2016, 02:02:28 am
content: Say, is that flux residue?

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 29, 2016, 03:45:01 am
content: Quote from: hendorog on August 29, 2016, 01:24:41 amThe IC is on the back side of the board. We are viewing it as if we are looking at the front side of the board and looking through the board to the back side - so everything is mirrored.Quote from: StillTrying on August 29, 2016, 01:45:06 amYou're right - all of my simulations so far had assumed infinite input impedance and infinite input resistance. I have done some more maths and simulation. Attached is an image showing the frequency response for input impedances of infinite, 300k (typical) and 30k (minimum). As you can see the 30k and 300k are practically on top of each other but have a good 5dB drop at the peak from the perfect case. This explains some of the missing gain! I would still like to see if I can improve it further. Do you have any recommendations for opamps with higher input impedance? Preferably low noise and pin compatible (although I'm respinning the board anyway so it doesn't matter too much).Quote from: Alex Eisenhut on August 29, 2016, 02:02:28 amSay, yes. I guess you're hinting to me that that could be causing a problem... Extra stray capacitance?

author: chuckb
author_rank: Frequent Contributor
timestamp: August 29, 2016, 03:49:46 am
content: I have replaced the 1k3 resistor from GND to a through hole resistor to AGND to see the difference. Frankly, there's not much difference.First image is the original response and second image is with the 1k3 to AGND.I agree, it looks like the original connection with the 1k3 resistor GND works better. From your results it seems like the 1 kHz (-24dB) and 100 kHz (-16 dB) attenuation values are now inline with your expected results. The peak response is still 10dB low. Could this be capacitor matching issue?Is there a 0.1ufd power supply bypass capacitor on the pcb? You may need a 10ufd cap also for this low frequency operation. This may help affect your peak gain.

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 29, 2016, 06:10:27 am
content: Quote from: chuckb on August 29, 2016, 03:49:46 amI have a 10uF on the board near the power supply, I don't have a 0.1uF near the amp. I don't have any 0.1uFs, but I'll try a 1uF instead.So one thing I have noticed is that my input signal is about -3dBu, which basically means that all of my readings are actually 3db too low, so that accounts for some missing gain. Plus, I am thinking of changing to the TL082 which has an input impedance of 1GOhm, this should give a few more dBu too.

author: Siwastaja
author_rank: Super Contributor
timestamp: August 29, 2016, 08:03:28 am
content: I vote for the X7R issue. Just fix it first (even soldering in the though-hole caps, it's well possible, just looks nasty), it's the most probable culprit. The fact that you are using X7R on the bread board doesn't matter - not all X7R are identical. Some are much worse than others (mostly depending on the physical size).

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 29, 2016, 08:23:21 am
content: Quote from: Siwastaja on August 29, 2016, 08:03:28 amI''ll hopefully get some time to try that tomorrow!In the meantime, does anyone see anything wrong with my layout that could be causing issues? I'm running to a (personal) deadline (ie I'm leaving the country) and will need to order my second round of boards by September 1st in order to hit the deadline. Of course I will have more time to decide on components as digikey takes far less time to delivery than it takes to get boards in from China.

author: StillTrying
author_rank: Super Contributor
timestamp: August 29, 2016, 09:56:40 pm
content: Well all I can do is simulate it.After making very large changes (X10+) to the filtering and other parasitic components, I've also come to the conclusion that the input impedances of the op amps aren't the problem, they cause offsets but not the flattening.Possibly it's something to do with the output impedance, - which probably also means the impedance of the v/2 virtual ground. If you were using a proper + GND - supply on the breadboard, and then swapping to the op amp virtual GND version on the PCB - that would be a suspicion.Of course, other theories are available on request.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: August 29, 2016, 11:11:39 pm
content: Quote from: MattHollands on August 29, 2016, 03:45:01 amNo. What kind of flux? I can't tell from the picture. But if that's water soluble flux, it's conductive, and needs to be cleaned off immediately.

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 30, 2016, 06:22:47 am
content: Quote from: Alex Eisenhut on August 29, 2016, 11:11:39 pmErrr yeah, water solubleSo, I cleaned up the flux with a damp cotton bud and then reflowed all the components to evaporate the remaining water after leaving it to dry for a bit. And here is the frequency response. Blue is input, Red is output. as you can see it's MUCH better. If you add the extra 5dB onto the peak to take into account the terrible input impedance, I think it's looking pretty good. I'm guessing that the flux was the biggest issue.Quote from: StillTrying on August 29, 2016, 09:56:40 pmDefinitely not - the breadboard is exactly the same!

author: MattHollands
author_rank: Frequent Contributor
timestamp: August 30, 2016, 07:33:24 am
content: The image above makes the low frequency response still look bad... But I think that's to do with my crappy USB scope (all I have with me) trying to out do itself... I did a rough capture of the low frequency response and it still looks pretty good.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: August 30, 2016, 10:04:22 am
content: Quote from: MattHollands on August 30, 2016, 06:22:47 amThe flux residue looked awfully clear on the pictures, I hoped it wasn't water soluble but there you have it...Throw it in the bin and stick to RMA, it might look messy, but in fact RMA residue is wonderfully inert. Unless your next project is a super-high impedance amplifier, you can leave RMA residue on your board if you want.Or if you must keep the WS, clean the residue off immediately. The stuff's much more active than rosin.

author: bson
author_rank: Unknown
timestamp: September 01, 2016, 09:30:02 am
content: Just be aware that multiple-feedback filtersaresensitive to actual component values... this is their big weakness!

author: MattHollands
author_rank: Frequent Contributor
timestamp: September 13, 2016, 07:55:08 am
content: Ok, new board with the same layout but using TL082s and NP0/C0G caps where possible and using RMA flux instead of water based. Frequency response looks pretty good. Taking into account that the input signal is -2dBu at the peak, then the peak gain is about 15dB.Slightly disappointed that I'm not reaching nearer to the theoretical 20dB, but overall will do for my purpose.

author: rbm
author_rank: Regular Contributor
timestamp: September 16, 2016, 11:22:45 am
content: Thanks for this excellent discussion. I am in the early stages of building a multi-stage filter as well and read this thread with interest, as I am an opamp noob. I will take all the good advice present in this thread. Love EEVblog forums!

author: krivx
author_rank: Frequent Contributor
timestamp: September 16, 2016, 11:41:25 am
content: How are you generating these Bode plots?

author: MattHollands
author_rank: Frequent Contributor
timestamp: October 13, 2016, 11:56:29 pm
content: Hey guys! Sorry to be so late to respond to your posts - have barely had time for the forum with moving back to the UK and going back to school etc!Quote from: krivx on September 16, 2016, 11:41:25 amBasically I am plugging my signal generator into the input and using my 2-channel oscilloscope to capture the input and output of the circuit simultaneously. Then, I set my scope to spectrum analyser mode and set it to "peak hold mode" where it captures the strongest value for each frequency. Then I am performing a frequency sweep on my signal generator from 10Hz to 97kHz.

author: MattHollands
author_rank: Frequent Contributor
timestamp: October 13, 2016, 11:58:15 pm
content: Also, if people are interested I have now completed the project! I'm very happy with the result.Watch a video here:and read about it here:projects.matthollands.com/category/spectrum