Author Topic: Driving a small speaker with an H-bridge?  (Read 1658 times)

0 Members and 1 Guest are viewing this topic.

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Driving a small speaker with an H-bridge?
« on: February 01, 2024, 02:31:18 pm »
I want to drive a small speaker (4 Ohm, 1..3 W) from an FPGA, in a battery-powered gadget. The supply voltage is 3.7V from a LiPo. Small integrated class D amplifiers like the PAM8302A are an obvious choice to do this.

But my audio already comes out of the FPGA as a PWM signal, so it seems a bit silly to low-pass filter it, only to chop it up into PWM again in the amplifier. And, more importantly, I am concerned about beat frequencies between the amp's PWM frequency and any residual PWM carrier from the FPGA output. Hence would prefer to drive the speaker directly with the amplified PWM signal from the FPGA.

Is there a small-and-simple integrated H-bridge which you would recommend for this, or a dedicated "digital speaker driver" IC? Or can you think of reasons why this is a bad idea? Thanks!
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Driving a small speaker with an H-bridge?
« Reply #1 on: February 01, 2024, 03:09:10 pm »
Maybe a CMOS gate driver? Or two, or a dual.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Driving a small speaker with an H-bridge?
« Reply #2 on: February 01, 2024, 04:00:33 pm »
Maybe a CMOS gate driver? Or two, or a dual.


should work, problem is finding one that works at such low voltage
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Driving a small speaker with an H-bridge?
« Reply #3 on: February 01, 2024, 04:43:14 pm »
Valid point, they may have UVLO.
Maybe look for low voltage motor drivers, then.
 

Offline JustMeHere

  • Frequent Contributor
  • **
  • Posts: 744
  • Country: us
Re: Driving a small speaker with an H-bridge?
« Reply #4 on: February 01, 2024, 05:32:48 pm »
 

Offline MarkT

  • Frequent Contributor
  • **
  • Posts: 367
  • Country: gb
Re: Driving a small speaker with an H-bridge?
« Reply #5 on: February 01, 2024, 07:29:40 pm »
Maybe a CMOS gate driver? Or two, or a dual.

Dual low-side MOSFET driver would be ideal, but watch out for dissipation issues - MOSFETs are capacitive loads, not 8 ohms.  Speakers don't have a lot of inductance so the PWM frequency could be an issue if too low.
 

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Driving a small speaker with an H-bridge?
« Reply #6 on: February 01, 2024, 08:03:03 pm »
Thanks for all the replies so far! A dual low-side MOSFET driver sounds like a plausible choice, and I can use a second FPGA output to provide an inverted drive signal for one of them.

But thanks for the caveats too. I admit that I was thinking "speaker = inductance, no problem", but my gut feeling was based mostly on experience with stepper motors which have much more inductance. I'll do the math...

Just to to TI and get one of their ICs
https://www.ti.com/audio-ic/amplifiers/speaker-amplifiers/overview.html

As stated in the initial post, a small class D amplifier was my first thought. But the post also states why I am reluctant to use one on a signal that is already PWM-based at the source.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21688
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Driving a small speaker with an H-bridge?
« Reply #7 on: February 01, 2024, 08:21:10 pm »
Motor driver.  Speakers are just short-angle motors after all. ;)

Just a real basic one, like TB6612 (emphasis on "like": you need a lower voltage limit than it), would do.  A dual-output gate driver might even work, though they tend to have quite high bias current considering what they do, so maybe this would be the better route.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Driving a small speaker with an H-bridge?
« Reply #8 on: February 01, 2024, 09:37:12 pm »
I duckduckwent "low voltage motor driver", the first result was DRV8832.
Specs look about right, and if you strap Vset to VCC it should behave like an ordinary dumb H bridge.

There is more similar chips if you don't like this one, so it looks like a promising direction.
« Last Edit: February 01, 2024, 09:40:28 pm by magic »
 

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Driving a small speaker with an H-bridge?
« Reply #9 on: February 01, 2024, 09:54:18 pm »
Thanks, I'll look further in that direction. I did check a few data sheets over the past half-hour and found that most of those drivers seem "too smart" already -- bringing their own PWM modulation and/or hall sensing to regulate motor speed.

A straightforward H bridge would probably be easiest to use and have the least risk of unwanted side effects, but I have not found one in a small package and for the right voltages and currents yet. But I'm sure they exist!

EDIT: Something like the MP6513 maybe?
https://www.mouser.de/datasheet/2/277/MP6513GJ_Z-2946051.pdf
Any obvious reason why that shouldn't work to drive a little speaker?
« Last Edit: February 01, 2024, 10:07:15 pm by ebastler »
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Driving a small speaker with an H-bridge?
« Reply #10 on: February 01, 2024, 10:10:08 pm »
Pleasantly dumb, but has 1Ω resistance (20% efficiency) and SOT23-6 is not the best package for getting heat out.
So dunno, I imagine thermal shutdown might occur if you try to run it at high power for long.

edit
Look at RDS(on) vs VCC :scared:
Actually, it's a good idea to look at this spec for every candidate chip because the relation between RDS(on) and Vgs is well known...
« Last Edit: February 01, 2024, 10:15:45 pm by magic »
 
The following users thanked this post: ebastler

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Driving a small speaker with an H-bridge?
« Reply #11 on: February 01, 2024, 10:20:48 pm »
Look at RDS(on) vs VCC :scared:
Actually, it's a good idea to look at this spec for every candidate chip because the relation between RDS(on) and Vgs is well known...

Ouch! I had indeed not seen that, thanks. Brave of them to specify the Vcc range as starting from 2.5V.  :-\

I should probably get some sleep and look further with open eyes tomorrow...
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Driving a small speaker with an H-bridge?
« Reply #12 on: February 01, 2024, 10:36:23 pm »
maybe two N+P logic level mosfet pairs

if you can spare 4 pins, you could drive them separately to avoid potential issues with shoot through
 

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Driving a small speaker with an H-bridge?
« Reply #13 on: February 02, 2024, 07:32:37 am »
Hmm... I can't seem to find H-bridge drivers with an ON resistance that is negligible vs. the 4 Ohm speaker resistance, whether I look at motor drivers or MOSFET gate drivers.

Maybe I should just forget about the class D approach and use a small class AB audio amplifier like the LM4871? That would avoid the risk of PWM beat frequencies, and losses should not be terrible at these low audio power levels. (The ~1.5W peak output power will only be used in short bursts in my application, and quiescent current is manageable at a few mA.)
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Driving a small speaker with an H-bridge?
« Reply #14 on: February 02, 2024, 08:25:18 am »
DRV8212?
Completely dumb, uses charge pumps to work down to 1.65V, RDS(on) typically less than 0.4Ω at maximum Tj and 3V or even 2.5V supply.
This should be good enough given that 1A DC is the absolute worst case that can happen here. 0.4W has a chance to work even in SOT23.

TI has whole series of those DRV chips, go through all of them and you may find something.
« Last Edit: February 02, 2024, 08:35:22 am by magic »
 
The following users thanked this post: ebastler

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Driving a small speaker with an H-bridge?
« Reply #15 on: February 02, 2024, 12:53:43 pm »
Nice find, thank you! The DRV8212 looks like the best choice from TI's DRV family. The other members have higher "on" resistance, support higher current and/or higher voltage, have a bigger package with more functionality. The DRV8212 interface is as simple as it gets, nice small package, and not too expensive either at less than a USD (in single quantities from Mouser).

I want to give this a try. A plain old class AB amplifier would probably do the job nicely -- but given that I have a PWM signal from the FPGA to start with, the direct digital drive approach just seems "right". Let's see whether the little speaker (or audio transducer) agrees...  :)
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: Driving a small speaker with an H-bridge?
« Reply #16 on: February 02, 2024, 01:03:28 pm »
What is a conventional bipolar transistor or MOSFET not able to satisfy?
The speaker is an excellent integrator...  :-//
Is it a high-quality audio signal?
And sorry for my English.
 

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Driving a small speaker with an H-bridge?
« Reply #17 on: February 02, 2024, 01:31:22 pm »
No, it's not a high-quality signal -- just game sounds in a small handheld game. But with the low 3.7 V supply voltage, I want the anti-symmetrical drive on both sides of the speaker to get decent volume. Hence the need for an H bridge, or a small integrated audio amp which provides the same.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Driving a small speaker with an H-bridge?
« Reply #18 on: February 02, 2024, 01:34:32 pm »
A plain old class AB amplifier would probably do the job nicely -- but given that I have a PWM signal from the FPGA to start with, the direct digital drive approach just seems "right".
Class D, yes.
Class AB, there are actually not too many solutions for high current rail to rail output. And if you lose 1V at each rail for emitter followers, that's 10dB down the drain.
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: Driving a small speaker with an H-bridge?
« Reply #19 on: February 02, 2024, 01:48:25 pm »
No, it's not a high-quality signal -- just game sounds in a small handheld game. But with the low 3.7 V supply voltage, I want the anti-symmetrical drive on both sides of the speaker to get decent volume. Hence the need for an H bridge, or a small integrated audio amp which provides the same.

But then your FPGA should output 2 PWM signals - for positive and negative half-waves to the upper and lower arms of the bridge.
How else are you going to get the middle point?

FPGA in a small handheld game?  |O
And sorry for my English.
 

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Driving a small speaker with an H-bridge?
« Reply #20 on: February 02, 2024, 01:59:03 pm »
But then your FPGA should output 2 PWM signals - for positive and negative half-waves to the upper and lower arms of the bridge.

Yes, that's the plan, as mentioned in my second post or so.

Quote
FPGA in a small handheld game? |O

Yes indeed. It's a pocket version of "Computer Space", the first arcade video game. No CPU yet, since that was way over budget in 1971, but game logic and video signal generation were hard-wired in TTL chips. There's a VHDL version of the schematics which I want to run true-to-form. A low-power iCE40 FPGA does the job nicely.

Don't hurt your head.
« Last Edit: February 02, 2024, 02:20:07 pm by ebastler »
 
The following users thanked this post: S. Petrukhin

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: Driving a small speaker with an H-bridge?
« Reply #21 on: February 02, 2024, 02:37:29 pm »
But then your FPGA should output 2 PWM signals - for positive and negative half-waves to the upper and lower arms of the bridge.
Yes, that's the plan, as mentioned in my second post or so.

I would suggest a fun option to use powerful MOSFET optocouplers instead of bridge transistors, such as KAQY212A   :palm:
https://www.lcsc.com/product-detail/Solid-State-Relays-MOS-Output-PhotoMOS_Cosmo-Electronics-KAQY212A_C194713.html
And sorry for my English.
 

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Driving a small speaker with an H-bridge?
« Reply #22 on: February 02, 2024, 02:52:24 pm »
I would suggest a fun option to use powerful MOSFET optocouplers instead of bridge transistors, such as KAQY212A   :palm:

Four of those would be needed, and with ~ 2*1 Ohm of "on" resistance in series with the speaker they would eat up a significant share of the available drive voltage, right?

I can't tell whether you are being sarcastic and trying to tell me that the H-bridge approach is an unreasonable complication. If that should be the case, I would appreciate some real advice. In view of the advantages I hope to get (best use of available power, direct use of PWM signal available from FPGA, avoid beat frequencies from two chained PWM schemes) -- why do you think this is a bad idea?

By the way -- I do find the use of the  |O and  :palm: icons offensive when used in response to someone else's posts or proposals. In my view they should only be used to comment on one's own blunders.
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: Driving a small speaker with an H-bridge?
« Reply #23 on: February 03, 2024, 03:45:12 pm »
I would suggest a fun option to use powerful MOSFET optocouplers instead of bridge transistors, such as KAQY212A   :palm:

Four of those would be needed, and with ~ 2*1 Ohm of "on" resistance in series with the speaker they would eat up a significant share of the available drive voltage, right?


I will leave your understanding of emoticons unanswered.

Obviously, a universal means can be a step-up output transformer - any desired power regardless of the voltage that the power supply can provide.
And sorry for my English.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Driving a small speaker with an H-bridge?
« Reply #24 on: February 03, 2024, 03:58:05 pm »
I would suggest a fun option to use powerful MOSFET optocouplers instead of bridge transistors, such as KAQY212A   :palm:

Four of those would be needed, and with ~ 2*1 Ohm of "on" resistance in series with the speaker they would eat up a significant share of the available drive voltage, right?


I will leave your understanding of emoticons unanswered.

Obviously, a universal means can be a step-up output transformer - any desired power regardless of the voltage that the power supply can provide.

a step-up will only increase the problem of high resistance switches

and those optos are not only high resistance, they are also slow as molasses
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: Driving a small speaker with an H-bridge?
« Reply #25 on: February 03, 2024, 04:00:52 pm »
and those optos are not only high resistance, they are also slow as molasses

Optos are not required, it is not related.
And sorry for my English.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Driving a small speaker with an H-bridge?
« Reply #26 on: February 03, 2024, 04:07:44 pm »
and those optos are not only high resistance, they are also slow as molasses

Optos are not required, it is not related.

then why did you suggest it? https://www.eevblog.com/forum/beginners/driving-a-small-speaker-with-an-h-bridge/msg5312593/#msg5312593
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1146
  • Country: ru
Re: Driving a small speaker with an H-bridge?
« Reply #27 on: February 03, 2024, 04:20:02 pm »
And sorry for my English.
 

Online ebastlerTopic starter

  • Super Contributor
  • ***
  • Posts: 6510
  • Country: de
Re: Driving a small speaker with an H-bridge?
« Reply #28 on: February 03, 2024, 04:43:19 pm »
a step-up will only increase the problem of high resistance switches

and those optos are not only high resistance, they are also slow as molasses

Thanks for pointing out the speed issue; that's another reason to avoid optocouplers. I don't see why one would use them in a 3.7 V system. And I don't see the point in transformers either for driving a small low-impedance speaker.

I will try the small H bridge (DRV8212), which I would consider the most elegant solution. But will also order a small integrated class D amp with internal PWM generation (PAM8302) as a fallback; maybe the dual-PWM beat frequency I am concerned about is not an issue in practice. And I do have a few small class AB amplifier ICs around -- they definitely work, but get less power to the speaker than I would like.

Thanks again to all who have provided advice!
 

Offline LinuxHata

  • Frequent Contributor
  • **
  • Posts: 355
  • Country: us
Re: Driving a small speaker with an H-bridge?
« Reply #29 on: February 04, 2024, 04:37:43 pm »
I guess, something like LTC1157 can be used for that task, but price....
 

Offline JustMeHere

  • Frequent Contributor
  • **
  • Posts: 744
  • Country: us
Re: Driving a small speaker with an H-bridge?
« Reply #30 on: February 06, 2024, 12:22:49 am »
This amp is probably overkill for your application, (and you will need a boost converter somewhere) but maybe you can find one out there that fits our needs.  Takes PWM directly.

https://www.ti.com/product/TAS5103
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf