4

I want to use a 5 V square wave generated by an ATTINY85 to drive a 1 W, 8 ohm speaker at 1 W. The project has to be battery powered.

I would like to use a 18650 rechargeable 3.7 V Li-ion battery and a 5 V 600 mA boost converter:

18650 3.7V Li-ion battery and 5V boost converter

With a simple emitter-follower circuit, it doesn't seem possible to me to achieve the required 2.82 V (RMS) swing.

I considered using an LM386N amplifier, but from the datasheet it seems that the output voltage would not be enough to achieve the required 1 W maximum power.

I am wondering if I have to use more capable boost converter, making the project more complex having other stuff which need to work at 5 V, or if it is possible to do something else.

JRE
  • 71,321
  • 10
  • 107
  • 188
stenio
  • 319
  • 1
  • 9

3 Answers3

9

If you need to drive a square wave the usual trick (from the piezo days) is to use an H-bridge do double the applied voltage:

  • On 'forward' you have 5V applied
  • On 'reverse' you have -5V applied

… driving thus the speaker with a 10Vpp signal You could use a bridge intended for small DC motors, the load is in fact similar.

Just remember to switch off the bridge when you are done otherwise you'll burn the speaker with a DC signal.

TonyM
  • 22,898
  • 4
  • 39
  • 64
Lorenzo Marcantonio
  • 8,431
  • 8
  • 30
  • "from the piezo days" this means that something else is being used these days... can you please tell me about what is being used in these days? – Sanmveg saini Mar 22 '21 at 10:38
  • 1
    @Sanmvegsaini Speakers, I guess – user253751 Mar 22 '21 at 11:23
  • I meant that's a trick often found for piezo in battery powered equipment. Some japanese MCU (Epson I'm talking to you) had a mask option to pull out the inverted phase to drive a piezo beeper; the piezo have usually no issues with DC biasing. Now piezo are often self oscillating so it's a while I don't see this done – Lorenzo Marcantonio Mar 23 '21 at 08:51
3

Overkill for a square wave, but you can use a class-D amplfier-on-a-chip such as the PAM8403. It will give you typically 900mW (or is it 1.8W?) at 10% distortion (meaningless with a square wave) with an 8 ohm load, using just one half. Not sure if the specs are per channel or total.

enter image description here

The chips are available through distribution or you can buy an inexpensive module from China for a dollar or two.

More conventional mono bridged amplifiers such as the LM4871 are also available. They have been cloned and very inexpensive modules are available. The cloned chips (eg. LTKCHIP Shenzhen) are only a few cents each in one reel quantity.

enter image description here

Spehro Pefhany
  • 397,265
  • 22
  • 337
  • 893
0

A simple way is to add a push-pull stage to the output of an op amp. See: https://en.m.wikipedia.org/wiki/Push%E2%80%93pull_output.

That just adds two transistors, and pretty much any transistor will work.

For more info, see also: https://www.analog.com/en/technical-articles/increase-amplifier-output-drive-using-a-push-pull-amplifier-stage.html this app note uses a dual supply, it would also work with a single supply. Whatever your + and - supply to the amp is would work as the + and minus of the push pull.

EDIT: I originally wrote that you could add a push pull after the LM386. However, the LM386 has an internal feedback resistor that will take away the benefit. I edited the answer to say to use it with an op amp instead of a LM386. (See discussion below)

Also, I made it clear that the app note can use a a single ended supply.

KD9PDP
  • 2,096
  • 8
  • 17
  • 3
    Doesn't address the actual question asked so downvoting, I'm afraid. (a) The LM386N already has a push-pull output, so adding another does nothing but spend money. (b) The Analog Devices link shows a circuit that uses positive and negative supplies to gets its power increase. The OP hasn't got a negative supply. – TonyM Mar 22 '21 at 09:33
  • I also realized that the lm386 also had an internal feedback resistor, so you can't easily use the push pull in a negative feedback.I think you can use a second push pull even if the output is push pull, you are kind of making a darlington pair in that case, but you still need the feedback after. I'm changing my answer to say that it won't work as well work a LM386, but it would with a regular op amp. – KD9PDP Mar 22 '21 at 10:08
  • @tonyM I made the edit I mentioned in the previous comment, but wanted to point out you can still add a push pull after an op amp that has a push pull output. The ap note I linked was for adding a push pull to an op amp that already has a push pull output https://www.analog.com/media/en/technical-documentation/data-sheets/60201fa.pdf the fact that the op amp is single or dual supply doesn't really matter, the push pull still works if it's to ground and single supply op amp. Whatever your op amp supplies are, push pull will take the same supply and work. – KD9PDP Mar 22 '21 at 10:20
  • But my comment "(a) The LM386N already has a push-pull output, so adding another does nothing but spend money" is true and nothing to do the general topic of additional push-pulls. I'm writing specifically about the OP's question so the edits still leave the answer wrong. And you've ignored "(b)...The OP hasn't got a negative supply" and left the AD link in - how come? – TonyM Mar 22 '21 at 10:43
  • @tonym If you are current limited after a push pull, you can add another push pull and still get more current and therefore more power. The LT6020 also has a push pull output just like the LM386 and you can increase power putting another push pull after it. It isn't true that adding a push pull is a waste just because the LM386 already has a push pull. Also, it doesn't matter that the OP doesn't have a negative supply. Whatever your negative supply to the amp is (even if it is ground) will still work. It's still a good example of what the circuit looks like. – KD9PDP Mar 22 '21 at 11:05
  • None of this addresses my original points, which still stand along with the downvote. – TonyM Mar 22 '21 at 11:13
  • @tonym Can you please explain? I gave evidence supporting my statements, but still don't understand what you are objecting to. I must be missing something. Are you saying it's not current limited, so no current gain will matter (at 8 ohms, you might be right, but at 4 ohms, the push pull will help). And is your objection to the ap note don't because it says -Vee? If I redrew the exact circuit and replaced all -Vee with gnd, would that help? It's the same thing and works the same way, that's why I left it. I'll edit my answer to say "this also works with single sided supplies." – KD9PDP Mar 22 '21 at 11:24