Arduino Forum

Using Arduino => General Electronics => Topic started by: xl97 on Mar 27, 2015, 03:45 am

Title: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 27, 2015, 03:45 am
A while back, I had some pcb's fab'd..  (think all SMD Arduino and waveshield merged into one board)

and I assembled a couple by hand using some solder paste and a toaster oven..

I purposely left off a few resistors/caps...  so I could test different values there while the pcb was in a breadboard.

some/most were just wires with female ends on it so I could stick a through hole resistor/cap in and test..

when I found values that worked for me (ie: sound decent to my ear)..   so I keep this one in my breadboard for testing in other projects I plan on using this board as the main board.

I then assembled a few other pcb's taking the values I had/have in the breadboard.. and using SMD versions for the final product.

The version in the breadboard sounds MUCH better than the version that has the matching components on-board.. The later sounds like it has the volume to high in certain parts of the audio and distorts.

I'm curious as to why this is?

I took pics to help visualize things..

The pot I have wired to test tweak values/components R5/R6

(http://dmstudios.net/misc/scab_value_compare/pot_example2.jpg)



Testing values for the R8, C18, C21 components  (although in the final board assembly, I am only messing with R5/R6 and R8..  all other smd components on the final board mirror the smd components on the pcb in the breadboard... ie: C18/C21)

(http://dmstudios.net/misc/scab_value_compare/testing_values.jpg)


took another pcb that had wrong values for R5/R6 and R8.. removed the SMD components there.. and soldered in the same values being used on the breadboard..

R8 = 3.3k
R5 = 7.8k (measured at pot)
R6 = 1.8k (measured at pot)

but the solo board sounds not as good as the board pcb in the breadboard?  I am not clear why though?
(http://dmstudios.net/misc/scab_value_compare/final_board_test.jpg)


Here is a pic of the schematic for that portion as well..

I have also tried a value of 10k at R8 originally..

R5
R6
R8 are the ones of focus..


(http://dmstudios.net/misc/amp_filter_values/amp_values1.jpg)


I have since altered the pcb design and added an SMD pot for components R8 and R5/R6 in hopes of not having to worry about nailing down a specific value for those areas again. :(



Side question:

I got to thinking maybe I fat-fingered a cap somewhere....  how do you check what values the caps are when they are SMD ones?


I'm very non-experienced in the audio department... please keep that in mind. :)

Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Coding Badly on Mar 27, 2015, 04:03 am

One problem / difference is that breadboards have a great deal of capacitance between rows.

Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 27, 2015, 05:23 am
wouldnt the multimeter give the true readings though?  since I'm putting the probes on the components n the breadboard/rows.

oh... 'capacitance'..   (I read resistance previously)

the caps I have though are directly to the board (through female terminated wires)  (you can sorta see it in pic #2 I believe..  R8, C18 and C21 are all connected to female ended/terminated wires so I can switch our values quickly while I test)

only R5/R6 are going through a POT on the breadboard.

would just the wires on those two caps be enough to throw things?  and by how much? how can I check?

thanks! :)

Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Coding Badly on Mar 27, 2015, 06:51 am
Quote
would just the wires on those two caps be enough to throw things?
True.  But there is additional capacitance between every pair of pins you have plugged into the breadboard.  In my experience, there is capacitance between each row and the neighbors up to three rows away.

Quote
and by how much?
Enough to severely interfere with analog input readings.

Quote
how can I check?
I have no idea.  I assume measuring the capacitance would have to be done with nothing connected to the breadboard lest the item plugged into the breadboard would interfere or be damaged.

Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Wawa on Mar 27, 2015, 07:24 am
This IC is an oldie with quite a bit of hiss and distortion.
You did decouple the supply with C17-100n. Is that close to the IC. If not, the IC could oscillate.
C17 probably needs a bit of help from an electrolytic cap (~1000uF/10v) if your supply is not "solid" enough.
C20 value depends on the load impedance. 100uF is a bit low for an 8ohm speaker, but ok for 32ohm headphones. I would use a 470u electrolytic unless you only drive 32ohm headphones. Low value makes the bass sound thin.
R5/6 just sets the volume. With a 5volt supply, you quickly run out of "headroom" (clipping/distortion).
Can you run the IC on 9- or 12volt..
C21, with this value, does not affect the sound.
C18 is part of a lowpass filter with -3db at ~3Khz, and -12db at ~12Khz. Quite a lot of high-cut.
At least that is what an LTSpice simulation told me.
C15/R7 does not influence the sound. It just prevents the IC from oscillating.
Leo..
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: TomGeorge on Mar 27, 2015, 10:22 am
Hi,
Can you attach the image of your circuit please.
Its too small to read on screen in your post.

You real chance of finding the solution is to use an oscilloscope.
A capacitance meter or DMM with capacitance measurement on it will help with the SMD caps.
If you are going to do design work, you need to keep an eye out for bits of test gear, even ebay has some suitable meters.
Any reason for SMD?

Thanks Tom........ :)
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Wawa on Mar 27, 2015, 10:37 am
Schematic image is 2304x501 px. Big enough.
I can only see it enlarged by dragging it onto my desktop, and them opening it.
Leo..
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: TomGeorge on Mar 27, 2015, 12:36 pm
Hi,
Just looking at spec for LM386, they have in some cases a 10uF bypass cap from pin 7 to ground.

Is it possible that in going SMD your track width is causing volt drop to chip supply pins?

Tom...... :)
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 27, 2015, 01:53 pm
Hi,
Just looking at spec for LM386, they have in some cases a 10uF bypass cap from pin 7 to ground.

Is it possible that in going SMD your track width is causing volt drop to chip supply pins?

Tom...... :)
thanks for the replies.. (I'll try to go through them more once I get to work/break)..


As for the SMD track thoughts...


wouldnt that also be a problem with the PCB that is in the breadboard then?

The same exact pcb..  just has some pins soldered to it.. and place in a breadboard.. so I can easily have space to mock-up other components/parts with it for testing.. before using the same board (without header pins).. and solder directly to it.


I doubt my DMM has a capacitance option.. (what does it look like....[the symbol]?)

I'm still not clear about the breadboard capacitance stuff...   I suppose I could just pull the pcb out of the breadboard... leaving just the pot connected to it.. (or heck even just connecting wires straight to the pot, so nothing is in the breadboard anymore).. and see if it still sounds good..


at that point though...  I'm not sure what could be the problem.. if I am in using the exact same SMD values of the through holes I am testing with?

I appreciate all the suggested values to changes other components too, but I'm not grasping why the current values work and sound good on one board, and not the other then?  If these were the issues.
(all valid things to explore no doubt, and see how things improve or change..etc...  but I'd like to not change things until I can get the two current boards aligned using the same/current values., if that makes sense)


Also as WAWA mentions.. the images should be big enough, not sure what the forum software does to the images.. if I click on them, they open up to bigger images

I am powering the board from a +7.4v Li-Ion pack.


I really am ok with how it sounds IN THE BREADBOARD..  (which is mis-leading, because its really an assembled pcb.. and only in the breadboard for easy prototyping with it)


just cant the standalone version to match the quality.



@WAWA what value to do suggest for C18 then?



@TomGeorge-

SMD to make the footprint as small as it could be to be used in the most variety of projects  (which is mostly , small sci-fi props...etc)

I cut some solder masks on my vinyl cutter, smear some solder paste, populate, pop it into my $17 wal-mart toaster oven and the are done.

thanks guys!  hoping to still get this worked out.. and understand more.

Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Wawa on Mar 27, 2015, 09:40 pm
@WAWA what value to do suggest for C18 then?
Up to you and/or your application. With this value it cuts a fair amount of highs.
Make it smaller, like 4n7 or 2n2, if you want a flatter response.
Leo..
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: TomGeorge on Mar 27, 2015, 11:55 pm
Hi,
Check the side rails of the protoboard, they should be continuous from one end of the board to the other, warning warning some are not, they have a break halfway along them.


Quote
I doubt my DMM has a capacitance option.. (what does it look like....[the symbol]?)
C or Cap or uF or mF or nF or the capacitor symbol.

Sorry for asking this (shoot me down in flames if you like)... I see 1,272 posts in your stats.

Hi, what is your electronics, programming, arduino, hardware experience?

Tom........ :)
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 28, 2015, 03:13 am
@TomGeorge-


1.) The breadboard (that the pcb is set in) does have breaks in it. (but I have jumpers connecting the break in the rails)... although I dont understand what this info is leading toward? 

if I take the pcb out of the breadboard.. and just leave the 'wired in' resistors and capacitors..  how much capacitance could those wires give on the C18/C21? the leads are maybe 2in long, if that?

if it still sounds good... (removed from breadboard.. and I am mirroring those same values on aother board.. something else might be wrong then?  (ie: mix up a value on a part somewhere?)


anways.. :)

2.) No harm asking my experience.. its kind of mixed I guess..LOL  I am not a pro or anything close, nor is this my day job.   I guess I get an idea/project in my head and I work towards it, learning what comes with it along the way.

I'm fairly competent when it comes to Arduino's..  general electronics is 'meh' at best.. hardware..probably worse..lol

built several Arduino's and variants to suit my needs (built in micro sd sockets, merged wave shield, run some off internal 8Mhs clock..etc)  some bluetooth enabled stuff.. most of my stuff is for simple fun projects or for props for sci-fi stuff..

random project that led to me learn things like messing with servos, using 7-segment displays (ie: MAX72xx chips), etc..etc..


like these:

*electronics for an iron-man helmet:
https://www.youtube.com/watch?v=cTXt8l2XH-Q


*electronics for some spider-man webshooters (3D printed)
https://www.youtube.com/watch?v=BpxKEWFCCmE

*modified nerf gun for sci-fi/halo junk:
https://www.youtube.com/watch?v=uEFNH2zFVy4

and probably my most elaborate project to date:

e*electronics kit for a StarWars DC-17 gun: (was supposed to mirror the gameplay of StarWars: Republic Commandos....although I have never played it myself)
https://www.youtube.com/watch?v=jj58wl-aT0M

(several pcbs, for RGB led in barrel, 7-segment counter for ammo, MAX72xx for the ammo/bargraph and of course the code)


learned Eagle basics along the way, make my own packages if need be..

make my own solder masks, re-flow..etc   little workshop set-up...

definitely not properly trained or anything!  lol..  (post count is probably all questions!)  haha..

programming is hit or miss...  I am web designer/developer by day.. so the concepts are not new.. but i'm also spoiled in that manner as never have/had to worry about size/space, casting var properly..


hopefully puts things into perspective for you better? this is just a hobby for me.. so wherever the fun takes me! :)

Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 28, 2015, 04:29 am
update:

well I did the reverse..  I actually soldered  some headers onto the 'external board'  (not sure how else to reference it.. the one in the 3rd pic, that I was trying to get it to mirror the audio of the pcb on the breadboard)

sounded terrible still.. (very muffled)...


I took the original pcb that was in the breadboard..  left the pot wired to the breadboard (which shouldnt matter as that is only for R5/R6 (volume)...C18 & C21 are still connected via wires.. -the pcb is NOT in the breadboard, and it sounded great!, loud, crisp...etc..   what the heck?)

The only thing I can think of is, that I messed up and put a wrong value component on the 'bad board' somewhere?  I checked the resistors...and those all match, but no telling what the SMD cap values are, and it they match.  :(


I believe in one of my first schematics I had a value of 100nF for C18...

but in the most current one I have it at 10nF/0.01uF..



What about R8?  I have used 10k down to 2.2k..

If C18 is really the one that has the most effect on the sound quality.. I believe I have been consistent with the 10nF/0.01uF value.. (I have a 103 (10nF) for C18..and a 105 (1.0uF) for C21.. thats what been 'wired' in for the longest time.. and it sounds good...so my other board that sounds crappy must not have a 103 there?


Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Wawa on Mar 28, 2015, 04:39 am
Install LTSpice IV (free).
Unzip the attached file, and load that into the program.
Run simulation (running man)
Use the probe on different points in the schematic (single- or doubleclick).
Change values.
Run again.
Leo..

P.S. R4 is the ICs input impedance (datasheet).
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 28, 2015, 05:23 am
Hi Leo-

thanks.

I have done as requested. (I have wanted to have a reason to learn LTSpice)..

I have it installed, open file, ran simulation, put probe in several places... or even in one spot..change a value ran it.. change a value ran it

I saw the top portion change, to be honest I have no clue what it means, and what I should be adjusting the values to make the above....like?..  (all lines together?)
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Wawa on Mar 28, 2015, 06:23 am
With the probe on R4, you get the frequency response at the end of your filter.
The final result that goes into the power IC.
On the graph, you can see the attenuation on the left, plotted against the frequencies at the bottom.
You can fullscreen the black window to see it better.
You see that your filter attenuates everything ~20db. That's ok, because the LM386 amplifies it again (+26db).
100hz area is bass, 1khz area is midrange, 10khz area is highs.
You can see that the response, with 10n, sags above 3khz.
A 6db drop is clearly audible.
Leo.. 
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 28, 2015, 05:20 pm
some things are still confusing..

1.) I see the 'probe' icon when I hover certain places (kind of hard to get it.. usually its an 'x'..)..

sometimes is some other type of image..  some kind of 'tooth' or 'monkey' looking things with a circle under it with red arrow through it?

2.) when I use/click the probe on R4  (it this supposed to be above it? or on the actual resistor symbol?)
I sometimes get several lines.. other times I get a single (red) line displayed?  Am I supposed to be lookig for/seeing all lines? (ie: the C1 line should be there as well?)


3.) What are all the V(n00X stuff?)  as in V(n002)  V(n004)...etc?


4.) I am trying to post a screenshot.. but when I paste it into photoshop not all the lines displayed are showing up..  only the V(n002) shows up on any screencap?


5.) When I click on the C1 (my C18 equivalent)..  I see MANY lines above..  shows my I(C1) in pink..  but then has 2 pink lines?  one solid..one dotted/dashed?  which do I look at?  and does it matter if my probe is NOT on R4?

If on R4.. the I(C1) doesnt display?

I right clicked on C1, and changed it to 100n.. then re-ran simulator.. the pink lines didnt 'dip' as much? at the 3khz mark...  seems to be 'flat' (straight) to the rest of the right...

if I use one of the suggested values of 2.2n or 4.7n.. .. the lines are like so:


Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 28, 2015, 07:12 pm
I swapped out C18 cap for a 102 (1.0nF) value cap.. and I can definitely hear the difference.  (going to a 101, I couldnt really tell much/any difference)..

I have also tried a 2.2n, 4.7n, 6.8n.. all of which sound 'about' the same to my ear...  but much better compared to the original 103 cap used.. (so thanks for that!)

So I have now tweaked my current pcb in breadboard to be a bit better sounding.. but still and not clear as to why the other board wont give same results.. (when using the same values)..

I can only attribute this to me having fat fingered a cap somewhere?  mixing up a value?


I think I'll try to make/bake another board and see if I have better luck on being the same as the pcb in breadboard' sound..

Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Wawa on Mar 28, 2015, 09:09 pm
Haha, the "monkey" is a current clamp.
You can see the current THROUGH that part.
Not usefull for this schematic.
You should only measure/click the wire/top of R3/R4.
Doubleclick, and it removes previous test lines and only shows the last one.
V(n004) etc. Clicking on it selects the measurement you did on a node.
You can enlarge, cut, zoom, etc. to see fine details, like spikes.
Not usefull in your simple schematic.
Leo..
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: dshay on Mar 29, 2015, 12:30 am
This has already been explained to you, but I will repeat for emphasis.

If you insist on prototyping by ear with an analog circuit, cease and desist with the solderless breadboard, especially if you do not have a decent fluke meter ($200) with accurate capacitance readings.

In a solderless breadboard every common bus are plates in parallel, especially the ground/power busses which are long plates in parallel.

See below:

(https://dlnmh9ip6v2uc.cloudfront.net/assets/f/8/7/0/f/513a1dfbce395fe624000001.JPG)

Plates in parallel is the definition of a capacitor.

Design a prototyping board with socket terminals (see harwin/mill max) Swap to your hearts content.

See here for Socket Terminals (http://www.digikey.com/product-search/en/connectors-interconnects/terminals-pc-pin-receptacles-socket-connectors/1442577)

Analog circuits is an art form and right now you're being a masochist, your circuits will never be repeatable.
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 29, 2015, 03:07 am
hmm...  nice opening statement.  (nobody makes you post by the way)  8)   (nothing to be angry over)



anyways..

1.) I asked what I am trying to 'get to' (achieve) in the LTSpice simulator (having never used it before.. and explaining I am new/not very experienced in audio stuff!?)...  I changed the values.. and see 'some' line changes as well..  I also explained the results I got, with what values..etc.. but if I am not clear on what RESULTS I am trying to achieve in the top portion, I am just changing values for fun.. hence the change in the values on the board to 'hear' the changes in real life as well.


now, either you didnt read fully,..or you dont understand? ....  "but I will repeat for emphasis."   ;)

2.) If the cap I am changing out is NOT IN THE BREADBOARD, I am failing to make the connection about your 'plate' comments and pics of the internals of a breadboard?.. or how extra capacitance is being added???

instead of soldering the cap (C18) to the board, I have female terminated leads going to the cap instead.  (I guess a flexible 'socket' if you wanna go that route.)

at this point...the only part in the breadboard.. (which I guess could also just be connected to wire/leads directly, although they dont fit very tight, so I used a breadboard to secure my connections.) is the POT for R5/R6  (nothing to do with capacitance)..  so why the condescending tone?  (I'm just looking for guidance from those more experienced then myself)..  so back to what are you talking about for the breadboard/plate point?  You are now talking about the POT? (which is resistance?)

Using a lower value cap for C18 as Wawa suggested/explained to me, did in fact, increase the quality of the audio..(from what I already considered pretty decent for a little hobby board)

the other board (which did not have a switchable/variable cap for C18) was not sounding the same as the original board.. it only had swappable parts for R5/R6 and R8..  which as explained (doesnt have anything to do with audio quality or capacitance, but mostly the volume)..  hence my comments that that board must have a different value cap for C18 that I 'fat fingered'. the SMD value or something..







Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: dshay on Mar 29, 2015, 06:27 am
To be honest I read the first couple posts in horror and rushed to post, I was on a phone and didn't see your circuit.

The plates you have your potentiometer plugged into would appear in a parallel circuit to your potentiometer making the circuit not just resistant and would react differently at different frequencies.

But the main point of my post was that analog is tricky and it's best to prototype as closely to your finished circuit as possible and you're injecting unknown variables into your circuit.

The size of your board I'd recommend investing in wire wrap or just using two soldering irons to remove components directly from your board.
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: xl97 on Mar 29, 2015, 04:33 pm
I have done 'exactly' that..... used soldering irons to removed the components directly form the board..
and instead of soldering directly back in.  I used female terminated wires to re-connect them. (no breadboard in the mix -at all-)

as for the POT.. if its only used for the volume.. and the volume seems to be correct..... whats the issue?

The cap(s) seemed to be the focus that Wawa was relaying to me (correctly) as part of the sound quality issue/correction.. (and hence the capacitance tip, if things were also in the breadboard)  (they were not, never were)

I think part of the confusion came from that one board had replaceable caps and the other not, only swappable resistors (thinking that my caps were correct on both boards, and why the sound quality wasnt the same)..

Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: pito on Mar 29, 2015, 08:11 pm
The capacitance between the rows of that breadboard is 3.2pF.
So not a big deal when talking audio stuff.
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Wawa on Mar 29, 2015, 09:49 pm
Exactly what I think.
The only thing I can think of is audio ICs oscillating.
The only time I had trouble with breadboard capacitance was a few weeks ago when I tried to make an 8-button touch sensor with the 74HC273.
Leo..
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: pito on Mar 30, 2015, 12:31 am
Mind the ceramic capacitors are not recommended to have in the audio path.
Especially cheap smd ceramics one and ceramics multilayers one (larger capacities). They may create distortion as they are highly nonlinear.
Also the capacity of ceramics caps heavily depends on the DC bias, ie. 1uF rated for 6V may have 0.2uF at 5V.
So for hifi and precise filters always use quality film polymer capacitors.
If you had used film caps on the breadboard and the cheap smdies on the production board, you may hear a difference, of course.
Good reading:
http://www.murata.com/en-us/support/faqs/products/capacitor/mlcc/char/0005
http://www.murata.com/en-global/products/emiconfun/capacitor/2012/11/28/en-20121128-p1
http://www.eevblog.com/forum/blog/eevblog-626-ceramic-capacitor-voltage-dependency-download/15/
http://www.ee-training.dk/tip/why-you-should-specify-mfg-and-pn-of-bypass-caps.htm
http://www.maximintegrated.com/en/app-notes/index.mvp/id/5527
(http://forum.arduino.cc/index.php?action=dlattach;topic=311473.0;attach=120570)
Title: Re: Confused by different results on breadboard vs pcb testing (audio/filter values)
Post by: Wawa on Mar 30, 2015, 03:43 am
Yes, I knew about the voltage dependency of certain ceramic caps.
But in this application, there is no DC on the caps. And t/t AC is very low.
Leo..