Bandpass audio filter problem

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
Hi guys

Am hoping someone with more experience than me might be able to help point out where I might be going wrong with the little project I'm currently trying to do. I've attached an image showing the filter circuit design that I got from an online calculator, based on the bandwidth I want this to allow through (approx 900-2000hz), and have made up the circuit, and coupled it to a KY-037 microphone module, with the analogue output from that being the input to the filter circuit, the gnd joining the filter gnd, with 5v supplied to it from an arduino's 5v output.

The filter circuit is powered by a 9v battery direct to the LM348 op-amp, and the output from the circuit goes directly to a small speaker.
I hope that makes sense when you see the filter diagram! One important thing to note with the filter diagram is the figures all have been changed after that screenshot - I changed the influencing factor of the capacitor value from 0,01uf to 1uf (as I have loads of those), which caused the resistors to be 100th of the value shown on the image, so the 17k resistor is now 170ohms etc (sorry for confusing things!):

Screen Shot 2017-03-27 at 22.27.36.png

Basically apart from a slight crackle from the speaker when I power up the circuit I get no output from the speaker. When I test with a meter the output from the mic module (while in situ) it gives me just 12mv and does not vary when subjected to noise.
However! When I detach the mic module's analogue output from the filter circuit, and then test the output of the mic module I can see that it is now around 122mv baseline, but increasing according to noises, as I would expect.

I'm fairly new to building circuits like this from scratch, although when I was a youth about 25 years ago I used to etch a few basic circuits that I tried to make with components harvested from broken electronics at least!

This is the mic module I'm using:
Screen Shot 2017-04-01 at 10.59.21.png

If anyone has suggestions on what I might be doing wrong here I'd be really grateful, thankyou.

Cheers! :)
 

crutschow

Joined Mar 14, 2008
28,542
First, with a single supply, you need a virtual ground at about 1/2 the supply voltage so it can amplify the plus and minus swings of the AC signal.
This is discussed in the article about using a single supply voltage starting with the second sentence.
Did you do that?

Also your resistor values are way too low for the microphone or the op amp output drive capability.
You can't arbitrarily change resistor values (by two orders of magnitude yet) and still expect everything to work. :rolleyes:
It's not surprising that the mic output is significantly attenuated by the low filter input resistance.
(The picture of the mic module doesn't tell may anything about its electrical characteristics or the load it can drive.)

Stick with the capacitor and resistor values shown in designs until you understand enough about electronics to make changes.
 

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
Thanks very much for the reply and the explanations - they've very helpful but I don't know if a couple of points have been overlooked possibly (probably my ignorance)!

First point is that the article above the diagram explains that if I use a single supply op-amp like a 324 then it needs to have the virtual ground that you (and the text) both describe, but that the diagram is intended for a dual supply op-amp such as the LM348, which is exactly what I am using, thus I have not added the virtual ground, but have followed the diagram exactly since the diagram is based on an LM348 and that's what I've used. Apologies if I've misunderstood something here, but could you explain why it is that I need the virtual ground adding when I'm using the chip that shouldn't need one?

Second bit is that re' the resistor values I haven't just come up with the figures for them - apologies if I wasn't clear when describing it, it could have been better described.
The webpage for this circuit calculates the resistor values by itself, based on 2 factors really, the desired capacitors that you want to use, and the frequency band required. Once those are input then it works out the necessary resistor values.
When I took the screenshot showing the values based on 0.01uf capacitor, I then realised I had loads of 1uf electrolytic ones, and only ceramic ones at 0.01uf so I changed the baseline capacitor value, and the resulting resistor values that it calculated are what I've used.

It sounds from your explanation that maybe these aren't suitable necessarily but they're certainly not just numbers I've guessed at - I'm stupid sometimes but hopefully not that.....well, actually lets just move on from that one! :D

So I'm a little confused about being wrong with these bits re' both the resistor values and the requirement for the virtual ground, as I was fairly sure from diagram calculating those values, and the fact it only describes the virtual ground for a different type of chip that I had it set up right.

Sorry if I'm sounding ignorant and the help is very much appreciated but if you wouldn't mind pointing out why I've got that wrong it'll help me understand a bit better.

Much obliged indeed!

*edit* I'll try to find the link for that calculator page that I used so you can see that I'm not just making up the resistor values and perhaps get a better idea about where I got those etc.
 

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
Right, here's the calculator page I used for this:
http://www.wa4dsy.net/robot/bandpass-filter-calc

Here's the actual figures for the components I've used:

Screen Shot 2017-04-02 at 16.15.27.png

Again, apologies if I'm really missing about about these issues that you described, I really appreciate the knowledgable input, but just want to ensure I correctly understand what's wrong.

One point I should also make about my ignorance with this is that one of the input values required is the voltage gain. I've input this as 1, purely because I have no idea what sort of figure would be appropriate for that. So maybe this is related to why the resistor values are way wrong from what you've said??
 

crutschow

Joined Mar 14, 2008
28,542
thus I have not added the virtual ground, but have followed the diagram exactly since the diagram is based on an LM348 and that's what I've used.
But it plainly states that you need a dual supply and you said you had a single 9V supply.
A dual supply would have two 9V supplies in series with the junction being tied to ground so you have a plus and minus voltage to ground.

If you have a single supply voltage, then you need a virtual ground.
Otherwise the circuit can't amplify the negative half of the sinewave signal.
It's not whether the op amp is a single supply type or not, it's whether you have a single or dual supply.
I then realised I had loads of 1uf electrolytic ones, and only ceramic ones at 0.01uf so I changed the baseline capacitor value,
Electrolytic capacitors are inappropriate for filters.
They have a wide tolerance (typically ±20%) and are polarized so cannot carry an AC signal unless they have a DC bias (which they don't in that circuit).

The ceramic .01μF caps are the ones you should use.
Why did you think they were not appropriate?

Resistor values for an op amp circuit should be typically no lower than about 2kΩ.
What's the minimum output load the mic circuit can tolerate?

The desired voltage gain is whatever you need in the circuit.
Do you need to amplify the mic signal?
 
Last edited:

LesJones

Joined Jan 8, 2017
3,655
Also I think the value od R1 will have been calculated based on the input signal being from a zero source impedance source.

Les.
 

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
Thanks folks

It's not whether the op amp is a single supply type or not, it's whether you have a single or dual supply.
Thanks - I realise now you've said this why I've misunderstood what's required. I can address this now by either making it dual supply as you described or by adding the virtual ground.

Electrolytic capacitors are inappropriate for filters.
They have a wide tolerance (typically ±20%) and are polarized so cannot carry an AC signal unless they have a DC bias (which they don't in that circuit).

The ceramic .01μF caps are the ones you should use.
Why did you think they were not appropriate?
When I googled the capacitor symbols in that diagram I found results showing (contrary to a normal capacitor symbol with two parallel lines) this type as both polarised and as electrolytic, so I thought since i only had one or two ceramic ones at 0.01uf but lots of electrolytic ones of 1uf, and as the latter appeared to be what those symbols suggested when I looked on google on a few sites, that they would be more appropriate. That obviously seems to be incorrect from what you're saying so I'll see if I have any 0.01uf ones in old projects that I can take.
If normal, non polarised ceramic type caps are fine for this though, why is it that the diagram does not use the normal symbol with two straight lines?
Again this is just my ignorance I presume, and that maybe this is just different people following slightly different standards for the symbols they use?

Resistor values for an op amp circuit should be typically no lower than about 2kΩ.
What's the minimum output load the mic circuit can tolerate?
I will have to check to see if I can find data about the mic module in this respect. Very useful to know about the min resistance etc though thankyou!

The desired voltage gain is whatever you need in the circuit.
Do you need to amplify the mic signal?
I'm unfamiliar unfortunately with what sort of voltage corresponds with what sort of output properties as such. I do need some degree of amplification in the overall circuit but it'll be a bit of trial and error, so that 1 volt gain figure was admittedly totally arbitrary I'm afraid.

The project is basically to attempt to make a fairly basic 'voice changer' that restricts the vocals to a band of 900-2000hz and provides amplified output that would approximate to a normal talking level or thereabouts. I do have separate amp modules, but hadn't tried any yet since it was clear that something (many things it now seems!) wasn't right with my first attempt.

This is very useful feedback though thankyou. I shall hang my head in shame slightly, and go away and correct these issues then try it again.

Thanks for the the assistance!
 

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
Hi again

Ok at the risk of making myself look more ignorant, here's what I've now done.
The circuit has been rebuilt using 0.01uf ceramic caps, and with the correct resistor values to correspond with these.

I have set up what I "think" will be a virtual ground based on an example I saw but I'm uncertain about whether I have done it correctly or not.
There is still no output activity as such from the circuit, but on the plus side the mic module does now at least have a measurable and varied output around say 120-160mv when subjected to sound and while connected to the rest of the circuit. Previously this only worked while detached from the main circuit. I've powered this by an Arduino as it required 5v.

Sorry this diagram isn't brilliant but hopefully it conveys what I've done. Sorry the virtual ground I've drawn on is tiny, but it's two 1k resistors in series between 9v+ and the main GND of the circuit. There is a 10uf cap parallel with the ground side resistor, and the negative feed from this to the LM 348 is from the junction between these two 1k resistors.

The circuit shows 2 separate internal parts of the op-amp and I've drawn on 2 sets of power feeds accordingly, but the chip itself only has one v+ and one v-.

So at this stage I'm assuming one or more of the following is likely true:

1) I maybe damaged the op-amp earlier
2) my virtual ground setup is incorrectly configured
3) a voltage gain of 2 (that I based the components on) is insufficient
4) it needs additional external amplification

But I'd be really grateful for input on this to help point out my blunders with how it is now if possible.

Thanks!
IMG_0069.PNG
 

crutschow

Joined Mar 14, 2008
28,542
A good try but not quite there. :)

The virtual ground point between the two resistors goes to the ground (∇) symbol, not to the minus terminal of the op amp.

Instead connect the minus op amp terminal to the minus terminal of the battery.

The resistors are connected to the plus and minus terminals of the battery.

The purpose of this is to place the ground point halfway between the plus and minus voltage.
 

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
Thanks very much for the input again, I rally appreciate the help.

Is this a correct change to the circuit then now?

Only question I have about this is whether it affects the shared ground to the mic module? If so I can isolate that without an issue I'm sure. IMG_0070.PNG
 

crutschow

Joined Mar 14, 2008
28,542
Is this a correct change to the circuit then now?

Only question I have about this is whether it affects the shared ground to the mic module?
It's correct if you connect all ground points together.
You cannot have separate grounds for the mic circuit and the filter circuit.
A primary rule of electricity is that all signals need a return path.
So the mic output signal current into the filter must have a return path back to the mic ground. That can only occur if the mic and the filter share the same ground.
 

jjw

Joined Dec 24, 2013
726
What is the impedance of the speaker?
LM348 can't drive a speaker with low impedance and anyway a capasitor ( around 47uF ) is needed from output to the speaker.
 

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
It's correct if you connect all ground points together.
You cannot have separate grounds for the mic circuit and the filter circuit.
A primary rule of electricity is that all signals need a return path.
So the mic output signal current into the filter must have a return path back to the mic ground. That can only occur if the mic and the filter share the same ground.
Thanks for confirming. I did think that was the case hence already having the combined ground like it was, but just wasn't sure if the change I was going to make was going to affect this somehow.

What is the impedance of the speaker?
LM348 can't drive a speaker with low impedance and anyway a capasitor ( around 47uF ) is needed from output to the speaker.
Thanks for the tip about the capacitor.
I couldn't find any details for the speaker I was trying, which was a small 1" tweeter from a set of component car audio speakers. I removed the rear cover and it has no markings so I found a small 8ohm speaker instead and have added a 47uf capacitor. I've put this inline on the + ouput, with the output going to + side of the capacitor and the - side of the cap connecting to the + terminal on the speaker. I think that's the right way to do it, unless for some reason it actually needs to go across the speaker terminals. I doubt that's the case from your description though.

Well, I've amended the connections of the virtual ground (moved it to the system ground), and have put the 9v- feed direct to the op-amp.

Unfortunately I still have no functionality/output going on with the circuit, so I'm a little puzzled now as to what fundamentally is wrong.
I've tried swapping out the chip for another in case I've damaged it, but it made no difference.

I'm not overly sure what to try now as such.

One area I'm still blank on is the voltage gain figure that might be appropriate for this sort of circuit and the arrangement I have.
As per the diagram above, the component values are based on a value of 2 that I have entered for the gain, but this is basically a completely arbitrary figure on my part so perhaps I need it to be a multiple of this, or smaller etc - I have no idea (you're all well aware of that by now, I realise).
I suspect even if the value of 2 I'm using is not optimal, that it's not the main/only reason that this little project basically isn't working, but not sure what else to try meddling with....

Thanks folks. :)
 

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
Sorry for the delay!

Right these are the voltages I get with the circuit powered.

There are 2 things to note with this:
1) The measurement of voltage at the chip v+ is with the + probe on the + chip pin and the - probe on the circuit ground, not on the chip's -v pin, since that's a direct 9v of course.
2) the 2 circuits of the LM348 that are in use (1 & 2) are reversed from the way they are shown in the previous schematics. This is done completely on the assumption (hopefully not a foolish one!) that each of the 4 circuits with the 348 behave in the same manner....
This means that 5, 6, 7 in the schematics above are 3, 2, 1 respectively, and 1,2,3 in the schematic are 7, 6, 5 respectively.

I hope this makes sense, I just set it up like this because of the physical arrangement of the circuit and the chip pins in relation to the other components, ie it was just easier to do it that way and if each of the 4 circuits within the chip are identical then I figured it doesn't matter.

This is where someone points out I'm an idiot most likely.....:eek:

Voltages.jpg
 

crutschow

Joined Mar 14, 2008
28,542
Pin 4 should be +4.5V.
(How do you think the circuit can operate with only 62mV of power?)
Similarly pin 11 should be -4.5V (which you didn't measure).
 

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
As I mentioned, pins 4 & 11 get direct 9v across them from the battery, but I get the 62mv when measuring between pin 4 and ground (since gnd does not directly get the negative from the battery).

It would seem from this that there's a fault somewhere relating to the functioning of the virtual earth for it to be giving 62mv instead of the intended -4.5v. I don't assume it can run on 62mv but am just reporting what it is doing.

I was using ground as the -side for all the measurements using the multimeter, so there didn't seem a great deal of point to measure between the chip -ve input and the GND, but I just have and it's -9.33v (negative probe on gnd and positive one on the chip -v input (pin 11).
 

Thread Starter

MrJoshua

Joined Mar 31, 2017
11
Uurgh! I must apologise as I've spotted that for some reason I had the wrong op-amp in it currently and had a 324 in there instead of a 348. Not sure how that was mixed up but I've re-measured and if we use the same image I just posted but with the correct 348 op-amp the figures I get from left to right on the bottom row of pins are (all measured against GND):

1= -2.3mv,
2= -3mv,
3= 0v,
4= 1.2v,
5= -0.4v (and a slight buzz in the speaker while testing),
6= -6.45v,
7= -6.45v

and topside:
11= -8.85v

Apologies for the confusion over that. Not that I think these numbers are any better as it were.
At the speaker I get -6.8v (before the 47uf capacitor), and direct on the speaker terminals a solid -3.8mv

So a lot of rubbish figures I guess.

I can't help but think from this that something on the circuit layout is wrong, it is on veroboard after all so I may have made an error potentially.
I think it would be best if I retraced back over everything relative to the schematic and checked everything is correct relatively to all the other components.

Potentially I might make a primitive circuit based on printing the schematic out, and then sticking down the components directly in place with where they are on the diagram to ensure it is all definitely correct. Either that or taking the effort to knock up a proper etched circuit board. It'll take me some time to do that though but it might be for the best.

Unfortunately after having a fairly serious illness not so long ago it has had a lasting impact on my mental focus unfortunately, so while I try to ensure things are accurate it is possible I've made a connectivity blunder.
I'm not sure what else would account for these figures really.
 
Top