dB meter

craig87

New Member
Hi im new to this forum and am after some help and information.

Im looking at making an in car dB meter that reads bass notes up to 145dB (hopefully), i want the results to show on a LCD screen or 7 segment display.

Basically......... WHER DO I START!!!???

Thanks
 

Coyoteboy

Senior Member
I cant really help you but I will request that you stop encouraging pointlessly noisy car stereos that drive round my neighbourhood in the summer making what was a peaceful area just a constant thumping because even if we like the tune being played, you can only hear the bass line. ooooooohh how annoying! :)

Welcome to the forum.
 

craig87

New Member
Haha im not one of them cars its a competition car i travel to places with the music down and then when all our cars are in an environment where no one will be annoyed with the music i turn it up for competitions.

I also play my music with all my windows up unlike the mcdonalds car park boys!!

Thank you for making me feel welcome!!!!!!!!!
 

Coyoteboy

Senior Member
:) I'll let you off in that case! Still not sure I see the point (Surely clarity of stereo or performance of car are the two defining features, not just volume?) but I digress anyway...Thinking about your original request - you're going to be needing something to sample your sound - so a mic obviously. That mic will have to be sensitive to ~20-100Hz to really test bass notes, otherwise its just testing noise from many frequencies. So you need some sort of low-pass filter to take out the higher frequencies and then pass that into the picaxe ADC. Problem with that is that I'm fairly sure you'd have to be bloody lucky to get the picaxe to sample at exactly the right time, so you would need an external, very high speed, ADC sample and hold system to pass that info to the picaxe.
 

craig87

New Member
right i understand everything you said up until the last three lines, explain the problem again??

Oh and btw we dont test the speaker until it blows or distorts it is all about clarity as well.
 

Tom2000

Senior Member
First off, decide how much dynamic range you need. Then do some voltage calculations to see what voltages you'll be handling for your minimum and maximum sound levels. You'll have to design your front end accordingly, per your system specifications.

You might need to include some sort of log amp in the signal processing chain.

Design your signal processing chain to present adequate voltage levels to your ADC input, then set up your output according to your preferences.

One idea... you'll need a sound pressure level meter in order to calibrate your system. SPL meters are cheap and plentiful today. Perhaps a store-bought (or eBay-bought) SPL meter might fulfill your requirements and take that prickly calibration step out of the equation?

Tom
 

Coyoteboy

Senior Member
:D Theres more than bass to music :) I can't really talk, i had 2 10" subs in a tube in my car, could be heard from a few blocks away, but only because the door speakers provided less bass than a passing fly. I tend to prefer "sleeper" performance now.

Last 3 lines re-phrased...

You need an electronic or physical means to remove other frequencies from what the system "hears". If you're only testing/playing with bass notes then this is not necessary, if you are actually testing with music this would be more complex. The best way I can explain what I mean is that f you have a single thump of bass (1 wave), you want to sample that note at the time when the amplitude is max. In order to do this you need fairly fast electronics sampling rapidly and determining the highest amplitude point of the wave. If you have continuous tones you could take an average over a large number of samples, but this is likely to give you low readings (if you think about taking an average of a sine wave, it is 0). IMO the picaxe probably isnt fast enough to sample the sound and determine the max amplitude without supporting circuitry - i could be wrong but the time for the readadc commands to sample input voltage are likely to be about as long as the wavelength you are testing, meaning you could end up sampling the volume at times that are always low etc leading to unpredictable/varying results - not what you want.
 

Tom2000

Senior Member
It's late and I'm very tired.

The signal processing chain would have to, among other things, rectify and filter the audio so the ADC would receive only the envelope representing the audio levels, not the instantaneous level of the sound wave. The ADC wouldn't have to sample very quickly at all - maybe 10 times per second might be enough, or maybe just a bit more. Well within the capability of a Picaxe.

I should have made that clear in my previous post.

Tom
 

andrewpro

New Member
measuring DB's can be pretty tough. It's possible to do it all inside a micro, but I'm doubting the ability to a picaxe to pull it off.

I'm guessing you're going to use a microphone for the input? This actually makes it a bit easier. But, you could go straight from the amp input (again making the assumption you're using an external amp...which I think is a fair assumption), but there are a lot of compensations that need to be made that way.


Look into the Analog Devices line of log amps. They're about the best on the market right now that can be obtained by mere mortals like us. I've used the AD8307 in many projects and have very good success with everything from the bare minimum circuit to stuff so complex that I could fill a shoebox with auxiliary components. It's a fantastic little chip, AND it comes in an 8 pin dip, AND you can usually get samples for free from AD.

Check the datasheet to get an idea how it works. On the back end of the AD8307, you can hang the picaxe on the output with a lowpass filter or integrator (or probably best a combination of sorts) and run this into the ADC of the picaxe. You can then do any offsetting or amplifying you need to the digital numbers inside the picaxe, and output that to a screen or display or whatever you so choose.

This would be the easy way. If you're going to use anything but a mic, you'll need a lot of signal conditioning in front of the AD8307 but it's still entirely possible.

--Andy P
 

craig87

New Member
right let me explain for you guys my knowedge on electronics!!

I understand lpf, hpf etc for sound but talking about ICs and different switches on them etc i dont have a clue.

I am wanting to use a microphone to read the bass tone yes. What would i start to buy other than the mic??
 

BeanieBots

Moderator
right let me explain for you guys my knowedge on electronics!!

I understand lpf, hpf etc for sound but talking about ICs and different switches on them etc i dont have a clue.

I am wanting to use a microphone to read the bass tone yes. What would i start to buy other than the mic??
Oh dear! You are going to find this tricky then.
Try google on "filter chebychev" or "filter butterworth".
In addition to that, you will need to understand logs and how to convert the output of your "filter" into a logrithmic scale to be read by the PICAXE.
The device suggested by andypro can do that bit for you.
You are going to need to do a lot of datasheet reading and understanding if you want to pull this off.
Either that, or some kind sole might spend a few hours and design it for you.
 

hippy

Senior Member
The best place to start is Google or your favourite search engine. You'll need to understand at least what dB is and what you're measuring and how to ( even if you don't understand the maths to start with ).

You can then compare any solutions you find or are given against that; what one person calls a decibel may not be what someone else does. Just because something is labelled VU, db, dBm or SPL it doesn't mean it's any particular one of those.

The hard part is going to be in filtering ( low / band-pass whatever you're looking for ) correcting microphone non-linear frequency responses, converting the electrical signal into something asccording to what dB is defined as and presenting that as a voltage for the PICAXE to read, convert and display. The PICAXE does very little, and you can use an aalogue or digital meter to start with.

One interesting challenge is going to be in calibration; how do you know your meter is correct and tracks what a professional calibrated device would ?

If you're just after some relative comparative measure of how loud each others' systems are then you can probably get away without calibration and use any volume detection method you choose. If you want accurate dB your measurements are not going to be worth the paper they are written on if it is not calibrated and provably so.

As it's a competition car it's going to be quite embarassing if someone does pull a calibrated meter out and claims you're cheating. If it's not important, you could probably use a simple low-pass filter, a peak detector and choose to display whatever value you feel like proportional to that. 0-10 is a good start, 0-11 if you have a loud amp :)

So perhaps the first thing you really need to do is think about exactly what it is you actually need or want. There's usually a reason that professional equipment has professional prices.
 

andrew_qld

Senior Member
OK here is another thought.

For starters, if you already have a BIG bass amplifier, then the audio being fed into it (or coming out of it) has probably already been put through an audio filter to filter out the high notes.

You are still going to need to read up on the theory, and I think you may still need an Op Amp to do it properly, but you COULD put a very large value voltage divider accross the speakers and measure the voltage drop accross them and calculate the power going into into the speakers. You could work out the power from V2/R. Then you would have do the maths inside the picaxe to convert this into a logarithmic value to get dB.

Of course a speaker isn't a pure resistive load, so the maths could get a little complex, and I'm not sure how accurate it would be.

Another idea would be something like an AD8307 which is a logarithmic amplifier designed for RF work. You feed RF into it and it gives you an output in dBm. It MAY work at low AF frequencies.

I'd feed a steady tone into the speaker and muck around with a voltmeter and resisitive divider to see what you can come up with.

Certainly not an easy project but that might be somewhere to start.

Good luck!
 

BeanieBots

Moderator
@ andrew qld.
I'd guess that the objective is to measure the efficiency of the speakers so you would be eliminating the very thing that is being tested.
Otherwise it would be even simpler, you know the power amp rating!
 

andrew_qld

Senior Member
@ andrew qld.
I'd guess that the objective is to measure the efficiency of the speakers so you would be eliminating the very thing that is being tested.
Otherwise it would be even simpler, you know the power amp rating!
Very true BB. I was also going to suggest using the power amp readings too- measure the SPL power at certain power output levels with a tone then calibrate a picaxe to read the power going into the amp. That might be defeating the purpose I guess.

Andrew's brain in't working too well. I am on holidays, garage door repair man woke me up at 6am and I haven't had coffee yet. It's just after 7am here.
 

BeanieBots

Moderator
Know the feeling. It's 22:30 here and I've been up since 05:00.
By the way, it's way more complex than V^2/R.
That would be the equivalent of replacing a car speedo with an engine torque meter. Sort of works in theory but too many other unknowns to be worth considering.
 

craig87

New Member
i was looking at the LM3915 chip to drive a diplay. However, i think you can all agree im doomed and need someone to design me a circuit lol!!

Anyone??

I just dont understand how youd go from a signal in to a mic, into a filter, then into a display driver and then a display for your dB level!!!!
 

Tom2000

Senior Member
i was looking at the LM3915 chip to drive a diplay. However, i think you can all agree im doomed and need someone to design me a circuit lol!!

Anyone??

I just dont understand how youd go from a signal in to a mic, into a filter, then into a display driver and then a display for your dB level!!!!
Designing an accurate SPL meter isn't a simple exercise. And considering all the fooling around you'll have to do to select the proper components, design, test, redesign, tweak, test, and calibrate, probably not cheap, either. It's unlikely that you'll find anyone to design this for you as a freebie project, since it would entail a significant out-of-pocket outlay on the designer's part.

I'd recommend that you purchase an inexpensive commercial sound pressure level meter. There are many available these days at attractive prices. It will work out of the box, saving you lots of headaches.

Or, if you're determined to do it yourself, Google for keywords sound pressure level meter circuit and see what turns up.

Tom
 
Last edited:

craig87

New Member
well its actually a college project for my last year at college. Im doing engineering and will never use it again as it has nothing to do with what i work with!!

My company have given me an initial funding of £100 so i should be alright cash wise, i didnt think it would be a 'freebie' hence why i am prepared for someone to design me a working circuit and me to make it. I can solder and put together circuits and i am confident i could probably program it, its the design i am unsure off!!

OH and by the way it doesnt have to be dead accurate say + or - 3-5 dB.
 
Last edited:

hippy

Senior Member
As it's a college project part of that will be a specification of what you are creating, what it does and why; is it a dB meter, VU meter or something else. Once you know exactly what it is, you can then set about getting what you need. If you don't have those specifications then you won't really have a project.

You will be wasting your own and everyone else's time if you design a dB meter when all you want is some (any) indication of loudness. If it's a dB meter but you don't care about accuracy, then what's the point of a dB meter ( especially given what an error of 3-5dB means ) ? Also, are the people sponsoring you expecting to see any particular functionality or outcome ?

It also has to be asked; how is this project meant to test your abilities upon which you will be academically judged; the ability to project manager, your skill at spending the cash to create the device, or to demonstrate you are capable of designing electronic circuits and/or programming ?

I don't think anyone here would criticise someone for taking every opportunity to shift a workload to someone else, but if you end up avoiding doing what it is you are meant to be doing you miss out on learning the things doing it would teach ( both successes and failures ), and you really only end up cheating yourself.

All of us here who are willing to help have to answer difficult moral questions, not just are we helping you unfairly get better grades than others who may be more deserving by setting our skills above theirs, but whether we are actually helping you or not. You will almost certainly always get help here, and hopefully that will be help which sets you up for life not just for short-term gain.
 

craig87

New Member
right......

It is a college project, they expect me to design and build a project (however i can get as much help as needed and the design can be passed to someone else as long as i understand the design fully i.e. how the circuit works.)

I want to be able to play a bass tone through my subwoofer and measure the volume it is hitting in the drivers seat via a microphone. I said it doesnt have to be dead accurate as i wont be using it for competitions, as long as my college can see that it is working and does measure correctly i can just say that more expensive components would be required to get a dead accurate measure.

It is not going towards a degree as i am an apprentice who works for an AV company (nothing to do with electronics) but i have to take this course and i am interested in electronics and do want to learn more.

However, i know i will not be able to design this circuit single handedly, therefore i am trying to find someone who will help me.
 

Tom2000

Senior Member
Another idea would be something like an AD8307 which is a logarithmic amplifier designed for RF work. You feed RF into it and it gives you an output in dBm. It MAY work at low AF frequencies.
I just peeked at the data sheet. Yes, it's spec'd down to 20 Hz.

That's a real honey of a part, Andrew. 90 dB of dynamic range from audio to 500 MHz is nothing to sneeze at. $10.18 (in PDIP) or $7.42 (in SOIC) from DigiKey, qty 1, in stock.

Many thanks for the tip!

Tom
 

andrewpro

New Member
I just peeked at the data sheet. Yes, it's spec'd down to 20 Hz.

That's a real honey of a part, Andrew. 90 dB of dynamic range from audio to 500 MHz is nothing to sneeze at. $10.18 (in PDIP) or $7.42 (in SOIC) from DigiKey, qty 1, in stock.

Many thanks for the tip!

Tom
It depends how it's coupled. You can actually use it at DC, but you have to be VERY careful about your input matching and filtering, otherwise it gets wonky (experience here). Also, I've used it even past the 900mhz "top end" so to speak with careful matching. The response drops off like a rock off a blimp above, say, 6 or 7 hundred mhz, but if you're not looking for anyhitng super accurate, and just want to see some relativity, it'll work. The whole lineup is fantastic.


Go the OP (craig your name is I think?)- Instead of saying to yourself "I'm going to build a DB meter"...say to yourself soemthing like "I'm going ot build a relative SPL meter to see if the driver is in danger" sort of thing. That right there cuts your workload in half (if you can do this, of course). 3-5 DB is quite a large difference, and if that's your accuracy, I say scrap the DB idea.

Second: Dont think of this entire project as a single entity. A professional designer wouldn't sit down and design an spl. They would design a microphone pre-amp, a level detection circuit, and a display driver. oh..and a display. You could evenn break that down further...

1) mic. power supply (if it's an electret mic)
2) filter (couple resistors and caps)
3) amp (op amp to bring mic level up)
4) filter (output filter for preamp..again, couple resistors and caps)


5) amplifier (for filtering, level setting, detector impedance matching, etc)
6) detector (a full wave rectifier if you've brought the level up high enough)
7) post detection filter (again, res and caps)

8) display driver (something like the above mentioned bargraph chip)
9) extra circuits needed to make blinkies blink and lighties light
10) the blinkies and lighties.


Every single one of these steps really shouldn't take more than 5 or 6 parts a piece for the most complex, and being in very small stages, you wont get overwhelmed with "oh my god I have to build an entire meter", but instead "oh this will be easy, I jut have to make a filter, or an amp" and just string them all together.

Then, down the line, when you need a particular section for a different project, you dont have to say "how did it work in the sound meter" you can say "oh..I can just use this amplifier, or this filter". It will expand your repetoire of basic circuits, and be a smaller headache int he long run as well.

--Andy P
 

Tom2000

Senior Member
Wow! Thanks for the additional info, Andy. I was wondering about DC coupling. What a chip!

And that's excellent advice for Craig.

Tom
 

craig87

New Member
Andy that was brilliant advice, so if i look at making each of these individual circuits you have listed and string them together then this will complete my meter.

It is actually starting to make sense now!!!
 
Top