Author Topic: Playing loud sound bytes from microcontroller  (Read 2072 times)

0 Members and 1 Guest are viewing this topic.

Offline bentomoTopic starter

  • Contributor
  • Posts: 37
Playing loud sound bytes from microcontroller
« on: June 24, 2017, 02:06:05 pm »
So I'm looking for the cheapest way to play some loud sound bytes from a micro controller.

I've got a PIC selected and an EEPROM to store a couple hundred KB of pcm audio. But I'm having trouble finding the right amplifier. By loud I mean 90-95dB acoustic.

My design is pretty early in the development cycle so I'm free to change most things around.
 

Offline DaJMasta

  • Super Contributor
  • ***
  • Posts: 2296
  • Country: us
    • medpants.com
Re: Playing loud sound bytes from microcontroller
« Reply #1 on: June 24, 2017, 03:54:21 pm »
Unless you need a feedback loop for the micro to know how loud it is, or change it with a very wide dynamic range or something, once you can generate the sound at any level, the loudness has nothing to do with the micro.

You just need more in the amplification stage and a suitable speaker.  I assume this is for a device with a built in speaker and not connecting to an external system?  Do you need the micro to be able to control gain?  Do you have much of a physical space requirement?  Power requirements?  Sound quality requirements (also what kind of sound is it)?


You can get 90dB up close with a small, cheap 8 ohm speaker and a single power transistor, though you'd probably need a second as a preamp stage and it's not going to sound great.  If you want 90dB several meters away, then you're going to need a lot more driving power.  There are a number of single chip amps that make it fairly easy (just follow the app note, for example), but without knowing the physical constraints of the device and the area that it needs to be heard... it's really tough to try and recommend specifics.
 

Offline bentomoTopic starter

  • Contributor
  • Posts: 37
Re: Playing loud sound bytes from microcontroller
« Reply #2 on: June 25, 2017, 03:16:44 am »
It's going to emulate a dog bark. Which is generally 90-100db. The sound bytes are about 8khz so pretty low quality. The pic probably isn't going to control the gain, the final version might but only 2 or 3 levels. Size and power I'm not too worried about. I've got a 4" x 4" 8 ohm speaker picked out. I've got plenty of room and it's powered off of a decent size lipo.

Cost is the primary concern so I'm just looking for the professional way to do it. It doesn't necessarily have to be pcm either. I can also do spin, i2c, or something similar.

I'm fine with following app notes too, I just need to find the right one to forgot out how much power I need in the amp. The speaker can handle 6 watts continuous so I believe that should be sufficient.
« Last Edit: June 25, 2017, 03:21:02 am by bentomo »
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Playing loud sound bytes from microcontroller
« Reply #3 on: June 25, 2017, 03:31:33 am »
If you analyze the sample, you may find that there are few (if any?) low frequencies, and high-frequency overtones (harmonics) may also be absent (or unimportant to your undisclosed experiment).  So you might try a horn speaker.  They are loud and efficient (so you don't need a huge amplifier for high SPL.)

https://www.parts-express.com/cat/pa-horn-speakers-for-music-paging/240

Here in 2017, digital techniques are used to create relatively high-efficiency audio power amplifiers at remarkably low prices.  Look for "Class-D" and "Class-T" amplifiers.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9008
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Playing loud sound bytes from microcontroller
« Reply #4 on: June 25, 2017, 03:55:29 am »
Use a PWM output to drive a discrete H bridge. A super cheap way to make a very simple digital amplifier.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf