Slashdot Mirror


DIY Microprocessor Sound Level Meter Demoed At MIT

An anonymous reader writes "A Piezoelectric Sound Level Meter was demoed at MIT's Battle of the Bands last month, borrowing its display from the do-it-yourself USB LED marquee that was the subject of a previous Slashdot story. This video tutorial describes in detail both the analog electronics plus the C code that runs the system. If this is your first experience at the intersection of digital and analog systems, don't be scared!"

22 of 81 comments (clear)

  1. from MIT? by Anonymous Coward · · Score: 5, Insightful

    ok so pretty cool, but can someone explain how hooking a mic up to an ADC is worthy of a mention for MIT? It sounds more like a high school project at face value, what am I missing?

    1. Re:from MIT? by scoot80 · · Score: 3, Insightful

      Its MIT - even the most mundane things sound exciting to the rest of the world. Just throw in a few more catch phrases - SPI interface, sigma delta ADC, and its already really really exciting!

    2. Re:from MIT? by mustafap · · Score: 2, Funny

      I completely agree. This is a trivial piece of hardware, of which there are millions of examples on the Internet, the majority of which are more interesting than this.

      Is this of interest just because someone at MIT was involved? What's next? MIT engineers demonstrate how to drink beer?

      --
      Open Source Drum Kit, LPLC deve board - mjhdesigns.com
    3. Re:from MIT? by Anonymous Coward · · Score: 2, Funny

      This one measures to 11.

    4. Re:from MIT? by Xeth · · Score: 4, Insightful

      An MIT student is using Slashdot's affinity for the Institute to get free advertising (as he did in the previous story). That's all that's going on here.

      --
      If your theory is different from practice, then your theory is wrong.
  2. Oh wait... Advertisements. by Anonymous Coward · · Score: 5, Insightful

    It IS a high school project at face value. The kit can be yours for only $80!

    Shouldn't ads like this be paid for?

  3. Advertisement? by drolli · · Score: 4, Insightful

    Sound level meter? Did i miss something particularly difficult or innovative about this thing?

    Whats the point? Selling MC Kits?

  4. A CPU for this? by dannycim · · Score: 5, Informative

    Just goes to show ya that MIT guys will crack a nut using a bulldozer. There's plenty of dedicated level-meter chips around which cost next to nothing and provide a better, logarithmic response, which is what you want for sound.

    The LM3915 is an oldie but a goodie, you can even daisy-chain them.

    See http://www.national.com/mpf/LM/LM3915.html

    1. Re:A CPU for this? by hack++slash · · Score: 2, Insightful

      Using off the shelf components that do the job with a setup that's practically plug'n'play doesn't always help you learn how something works.

      "Re-inventing the wheel" can be a good way to learn & understand how something works and why it's built/programmed etc. in a certain way.

      --
      To do something right, you often have to roll up your sleeves and get busy.
    2. Re:A CPU for this? by Alef · · Score: 2, Insightful

      "Re-inventing the wheel" can be a good way to learn & understand how something works and why it's built/programmed etc. in a certain way.

      It certainly can. But it can also be a way of teaching students the wrong way to solve a problem. In the "real world" that involves money, you must never ever re-invent anything until you have made completely sure that there is no better alternative. It is far too common that graduates don't realize this when they enter into professional life.

      Besides, maybe the alternative would be to invent something completely new and more advanced using the "plug'n'play" components. That could teach you equally much, if not even more, about how the technology works. And what's more, it could actually be applicable knowledge that is useful for something.

    3. Re:A CPU for this? by porl · · Score: 4, Interesting

      you may not find the lower level components interesting, but some people do. being interested in vintage amplifiers means that i am somewhat interested in what makes various older components sound the way they do. this led me to learn about the different characteristics of varying types of capacitors, which led me to trying to make my own capacitor out of foil and cling wrap. it certainly wasn't anywhere near the quality of a commercial capacitor, and even fell apart after being moved around too much, but it worked and i really enjoyed it and learnt from it. that doesn't mean i would want to try to rebuild a computer mainboard with diy capacitors (although i would certainly tip my hat to someone who pulls that off) but i don't see it as a waste of time in the slightest.

      to each their own i guess.

    4. Re:A CPU for this? by gstoddart · · Score: 2, Insightful

      Just goes to show ya that MIT guys will crack a nut using a bulldozer. There's plenty of dedicated level-meter chips around which cost next to nothing and provide a better, logarithmic response, which is what you want for sound.

      While there's some truth to what you say, if we all just decided to use off-the-shelf components to do all of this stuff, people would forget how it's done, and then it would be arcanum.

      The MIT approach of using a bulldozer to crack a nut usually demonstrates a pretty fine control over the bulldozer, and a reasonable understanding of how much force to apply to the nut and not end up with powder. It usually somehow comes across with a bit of controlled elegance amid the mayhem. :-P

      Isn't the whole point to be doing the science and technology for the sake of doing the basic science and technology? I applaud anyone who can and does go back to first principles -- because, quite frankly, I can't do it myself. It's just good to know someone is keeping it alive.

      Cheers

      --
      Lost at C:>. Found at C.
  5. Get rid of the micro - LM3914 by marcop · · Score: 4, Interesting

    LM3914 can handle 10 LED's per chip and can be cascaded for more. Add an amp for signal conditioning on the front end, and then hookup lots of LED's per line if you use a transistor to drive a bank of LED's.

    They need a micro because their display is too complex for the job. But, make the display simple and you can make the whole design simple. Yet, since this is MIT's it has to be complex for some reason.

    1. Re:Get rid of the micro - LM3914 by marcop · · Score: 2, Interesting

      You're right, if you want advanced features then you have to include a microcontroller. Although I have used the LM3914 with a CD4538 per line to do peak level indication. If you want to only do peak level indication for the upper few lines then this would be easy enough. However, doing more than a few lines and doing other stuff you mentioned then of course a microcontroller would be easier.

      Point is there are many ways to do this simple project, and it is beyond what should be showcased by MIT and here on slashdot. How about doing something a little more interesting like audio spectrum by having the micro also do FFT? If you cram all these features into the project then perhaps I would make it slashdot worthy. But as is it is far from it.

  6. A little knowledge is a dangerous thing by Ancient_Hacker · · Score: 5, Informative

    This project is an excellent example of how having a little theoretical knowledge is a bad thing.

    They have just enough knowledge to get into complicated and pointless gain calculations, but they miss most of the really important things. Here's a few:

    (1) A piezo buzzer is not designed for any kind of flat frequency response. Which is a basic requirement for a sound-level meter. Major fail from the get-go.

    (2) We're going on 60 years of having a spec for sound meter weighing curves and envelope filtering characteristics. Yet no mention of that in the article. A randomly designed meter is useless.

    (3) They go on and on about calculating the gain of the amplifier stage, and they do it incorrectly. We care not one whit about the DC gain. The AC gain is dependent on the AC impedance of the source and load. Even the DC gain they calculate is useless as those transistors have a huge range of gains. And no analysis of the DC stability, which is harder to get right. Gain just happens, stability has to be designed in.

    (4) Biasing the base from a pot in that fashion is never done in practice. A better design would use two resistors and avoid the cost and impedance variations of the one pot "design".

    (5) A real design would have the +5 volt line decoupled and filtered to keep microprocessor switching noise out.

    ----

    In summary these designers should wait until they get past the first chapter of their transistor class before going out and trying to design anything. Good design requires more than slavish focusing on one small area. An engineer has to have a broad view.

    1. Re:A little knowledge is a dangerous thing by Cassini2 · · Score: 2, Informative

      The criticism may be blunt, but if students do a cookbook project, they should at least be smart enough to know the errors in their ways.

      This project has quite a few major problems in the analog front end. Especially, given the fact that with a micro-controller, you could at least try to fix some of them. The report makes no mention of the fact the students even noticed them. Also, the calculations that they did do, are considerably more complex than necessary. Specifically, the students missed the fact the piezo transducer is a charge coupled device, so they are essentially dropping current straight into the base of the amplifying transistor. No voltage gain calculation required.

  7. Re:Ho-hum by Cassini2 · · Score: 4, Informative

    This one is silly -- why not just read the mic directly and apply the relevant digital filtering/transofrmation? RMS at least.

    Many of the cheap micro-controllers have ADC's that won't do the job well, at least not well enough to get any kind of dynamic range out of the circuit.

    A bigger problem with the MIT design, is that it uses a Piezo-Buzzer for a microphone. This will give a wickedly non-linear frequency response curve. Piezo-Buzzers are designed to have a narrow range of frequencies in which they operate effectively.

    The MIT design also uses a single transistor amplifier circuit. It wouldn't surprise me if the harmonics on the output are poor. Specifically, with this circuit, the average sound level can be determined by simply averaging the output of the transistor amplifier. Essentially, the average voltage on both the collector and emitter of the transistor should change if an AC signal is applied to the base. If this average is read with a DC voltmeter, then it should give an approximation of the sound-level, subject to the microphones frequency response curve.

    I am not clear why anyone would build a sound level meter without using either a proper microphone or an effective amplifier circuit. A quad op-amp IC, and a few circuits from the web, should give you the average sound level over an extended frequency and amplitude range. It is even possible to do RMS to DC, peak-level to DC, and log-linear conversions in analog. For a retro-look, an old-fashioned voltmeter or amp-meter can be used for a display. For a more modern look, it is possible to use a cheap micro-controller with a slow ADC (or an LM3914) for the analog to digital conversion. Historically, this was the way it was done in many stereos, and the same circuit is probably still in use in many professional recording labs.

    The advantage of implementing a proper micro-phone is the much flatter frequency response curve. The advantage of the log-linear conversion, is that most sound meters read in dB, which is a logarithmic scale. It takes a very good linear ADC to implement the same conversion digitally. A 5-bit (32 count) ADC reading a log input has more dynamic range than a 24-bit ADC reading a linear input (2^32 >> 2^24). Although in practice, I wouldn't recommend using less than an 8-bit ADC on an analog circuit.

  8. I expect better from MIT students. by Animats · · Score: 2, Interesting

    Yes. These are MIT students, remember. Now, if they designed something simple that got the same results as a properly calibrated A-law sound level meter, that would be useful. Or, for example, they could use the microprocessor to do an integrating dosimeter calculation, so you know when you've overdosed on live music. That would be useful to do cheaply, because noise dosimeters are still expensive, over $1000.

  9. Is this the level of knowledge at MIT? by Hank+the+Lion · · Score: 2, Informative

    I really like the simplicity of the circuit, and the way they try to explain the basics of transistor design. Nowadays, there is an integrated circuit for about anything, but just using that doesn't make you learn anything, and - in my opinion - takes away the fun of creating something from scratch.

    But am I the only one to see the huge error in the equations they are using?
    They state
    Ic = Ib * beta
    Ib = Is exp(Vbe/Vth)
    where it should be
    Ic = Is exp(Vbe/Vth)
    Ib = Ic / beta
    or, their equations are off by a factor of beta!
    That does not seem too important, it appears you could compensate for this in Is, but in practice, that is not so straightforward.
    The exponential relation between Ic and Vbe holds over many decades, whereas beta is not nearly as constant as we sould like.
    So, if these are really MIT students, I'd like a word with their professors... ;-)

  10. Re:iPhone App by Anne+Thwacks · · Score: 2, Interesting
    response curve of the built-in microphone. Surely that would color the spectrum analyzer?

    That would have to be the easiest thing in the world to compensate for!

    There might be firm limits to the top and bottom of frequency response set intentionally to limit the bandwidth intentionally (wide bandwidth is not good for telephony), but I expect these to be done in software to guarantee sharp cutoff.

    I had in mind a recording RTA application. Sound techician could compare acoustics of different locations/PA rig setups/EQ settings,

    Being able to e-mail a recorded sound spectrum to the lab for interpretation might be useful to all manner of people. (Cant reveal more - they might shoot me!)

    --
    Sent from my ASR33 using ASCII
  11. Re:Ho-hum by hey! · · Score: 2, Interesting

    Well, you should go one step further and ask, why build something like this at all when you can buy a finished product for less, if you count your time worth anything?

    The reason to use the piezo buzzer is simple: you've got one in your parts box and you're curious what you could do with it besides make a buzzing sound. It's like what somebody said about dogs who've been trained to walk: it's not that they do it well, it's that they do it at all.

    With respect to the use of a single transistor, that's educational. Yeah, you can get a better IC amp, but then you can buy a better finished device. You learn something different by using discrete components. Of course, you could do a more elaborate discrete amplifier, but then you put off the satisfaction of seeing the blinken' lights that much longer.

    Years and years ago when I was at MIT, there was a kid who commuted to campus in a homemade electric car. It wasn't a very good car. For the money and effort he put into it, he could have bought a cheap gasoline car and tinkered with that. For that matter, I don't think his car was much better than a bike. The same kind of arguments you are making could apply to that.

    When, other than when you are learning, can you do something differently than by the book, just for the fun of seeing it work?

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  12. Does this thing even work? by Animats · · Score: 2, Informative

    I built up the circuit as a SPICE model, and while it amplifies, it doesn't filter much. That weird filtering circuit in the emitter leg doesn't seem to accomplish anything. Treating the piezo microphone as a voltage source with a 1K resistance, generating a 1KHz input signal at 0.005V (based on a Murata piezo buzzer data sheet), what comes out is a voltage swing of about 0.6V at 1KHz, with a DC offset of 2.8V. The filtering seems to be insensitive to RM; changing RM from 10 ohms to 10 megohms doesn't do much to the output waveform. The 100K pot was adjusted until the voltage across RE was 3.3V, as specified. (This happens with the top end of the pot at 4.4K).

    Why didn't they just put a nice simple low-pass filter on the output, instead of trying to get cute and put it in the emitter lead? And shouldn't there be a diode in there somewhere, to extract the waveform's envelope?

    I actually built something like this in my teenage years, and had it hooked up to a surplus chart recorder (mirror galvanometer, phototube, relays, and motors, a mechanized Wheatstone bridge). (This dates me.) Mine worked.