Advice Needed on Component Selection for a Small, Battery-Powered Sound Project

Hello everyone,

I'm working on a small electronics project and could use some advice on selecting the right components. The project involves a microcontroller, a speaker, and a battery, all housed in a thumb-sized enclosure.

Project Requirements:

  1. Microcontroller: I'm considering using the ATtiny85 for its small size and low power consumption.
  2. Sound: The project needs to play a high-quality "gong" sound at specific intervals.
  3. Power: It will be powered by a small battery (e.g., CR2032), and I'm aiming for a decent battery life.
  4. Size: The entire assembly, including the enclosure, should be roughly the size of a thumb.
  5. Switch: There will be a switch to select different modes (e.g., different time intervals).

Specific Questions:

  1. Microcontroller Suitability: Is the ATtiny85 a good choice for this type of project, or should I consider another microcontroller?
  2. Speaker: What type of micro speaker would provide good sound quality while fitting within a thumb-sized enclosure? Any specific recommendations?
  3. Power Management: How can I maximize battery life, and are there any specific components or techniques I should use to minimize power consumption?
  4. Sound Quality: What is the best approach to ensure the gong sound is clear and loud enough in such a small form factor? Are there any specific libraries or techniques for sound playback on the ATtiny85?
  5. General Tips: Any general tips or advice for working on compact, battery-powered sound projects, especially regarding component layout and minimizing space?

I appreciate any insights or recommendations you can provide. Thank you!

I'm not familiar enough with the Tiny85 to have an opinion if it has enough Flash for that kind of sound, but I know that an ESP32 does, and it will play very high quality audio. Even has an onboard dual 8-bit DAC. Actually most modern 32-bit MCUs will have enough flash and speed to play sounds well and have low power modes.

Adafruit's Bluefruit Circuit Playground uses an nRF52840 and has decent audio quality (probably much better than the onboard speaker provides). I've used the nRF52 series in wearable devices and they have very good low power behavior. However, it's quite a bit more complex than a Tiny85 if you're starting from scratch.

You could also take a look at the DfRobot PlayerPro. It's small, if not quite thumb-sized. I don't recall what audio device it uses, but you may be able to put one on a smaller PCB than they use. Also produces high quality audio.

Not trying to shift you away from the Tiny85, but the problem is that a lot of these AVR chips are really old and technology has moved on far from when they were designed.

1 Like

Well, I would be. I think it's an unnecessary complication in a project that's already somewhat demanding due to its small intended physical size.

Frankly, no. I'd go for one of the many QFN-packaged, more modern 32bit controllers. There are STM32 types that have Arduino support for easy programming and pack far more punch than the t85.
I'd consider using a controller that has an integrated DAC. They're quite common on higher end STM32's for instance. You can output audio data using e.g. DMA to the DAC.

These requirements are mutually exclusive.

Sleep the system as much as possible. Use an efficient speaker and a class D amplifier.

Those are very subjective terms. In-ear headphones are clear and loud if you put them in your ear, but if you hold them in your hand, they're barely audible.
The housing of the speaker will do a LOT with how it sounds and how efficient it is. You'll probably end up with a tiny little variant to an infinite baffle or a bass reflex design. The former is the simplest. Evidently, low frequency response will be lacking anyway.

Yup. Work on getting the requirements straight. Then buy a bunch of tiny little speakers and test them out; don't worry about the rest of the system in doing so. Evaluate speaker performance and experiment with housing designs to make the most of the sound. Once you've determined the optimal compromise in speaker choice and housing for your needs, work out how much space you have left in your space budget.

Then figure out a suitable means towards amplification; you may or may not get away with directly driving (through a coupling capacitor) the speaker from a microcontroller GPIO (assuming onboard DAC; you'll need to include an R/C filter otherwise). You could go for a very simple, single transistor design, running in class A, that you only turn on whenever the sound needs to play. Or, more efficiently, a small class D amp. I've not specifically looked for them, but I assume there are QFN package amps available that will get the job done with a handful of external components and will output up to a couple hundred mW's, which should be more than enough.

An overall much simpler approach would be to revise the requirement of having the entire thing fit inside a 'humb-sized enclosure' and look for degrees of freedom elsewhere. Maybe it's acceptable to have only the speaker in a small enclosure and have a pair of wires run to a larger case nearby that houses the battery, controller etc. This would simplify matters dramatically. If all this does need to fit in the thumb-size space, take some time to learn the basics of PCB layout since you'll have to DIY pretty much everything from the ground up.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.