Driving a small speaker with an H-bridge?  - Page 1
Forum section: electronics / beginners

author: ebastler
author_rank: Super Contributor
timestamp: February 01, 2024, 02:31:18 pm
content: 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!

author: magic
author_rank: Super Contributor
timestamp: February 01, 2024, 03:09:10 pm
content: Maybe a CMOS gate driver? Or two, or a dual.

author: langwadt
author_rank: Super Contributor
timestamp: February 01, 2024, 04:00:33 pm
content: Quote from: magic on February 01, 2024, 03:09:10 pmshould work, problem is finding one that works at such low voltage

author: magic
author_rank: Super Contributor
timestamp: February 01, 2024, 04:43:14 pm
content: Valid point, they may have UVLO.Maybe look for low voltage motor drivers, then.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: February 01, 2024, 05:32:48 pm
content: Just to to TI and get one of their ICshttps://www.ti.com/audio-ic/amplifiers/speaker-amplifiers/overview.html

author: MarkT
author_rank: Frequent Contributor
timestamp: February 01, 2024, 07:29:40 pm
content: Quote from: magic on February 01, 2024, 03:09:10 pmDual 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.

author: ebastler
author_rank: Super Contributor
timestamp: February 01, 2024, 08:03:03 pm
content: 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...Quote from: JustMeHere on February 01, 2024, 05:32:48 pmAs 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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 01, 2024, 08:21:10 pm
content: 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

author: magic
author_rank: Super Contributor
timestamp: February 01, 2024, 09:37:12 pm
content: 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.

author: ebastler
author_rank: Super Contributor
timestamp: February 01, 2024, 09:54:18 pm
content: 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.pdfAny obvious reason why that shouldn't work to drive a little speaker?

author: magic
author_rank: Super Contributor
timestamp: February 01, 2024, 10:10:08 pm
content: 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.editLook at RDS(on) vs VCCActually, 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...

author: ebastler
author_rank: Super Contributor
timestamp: February 01, 2024, 10:20:48 pm
content: Quote from: magic on February 01, 2024, 10:10:08 pmOuch! 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...

author: langwadt
author_rank: Super Contributor
timestamp: February 01, 2024, 10:36:23 pm
content: maybe two N+P logic level mosfet pairsif you can spare 4 pins, you could drive them separately to avoid potential issues with shoot through

author: ebastler
author_rank: Super Contributor
timestamp: February 02, 2024, 07:32:37 am
content: 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.)

author: magic
author_rank: Super Contributor
timestamp: February 02, 2024, 08:25:18 am
content: 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.

author: ebastler
author_rank: Super Contributor
timestamp: February 02, 2024, 12:53:43 pm
content: 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...

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 02, 2024, 01:03:28 pm
content: 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?

author: ebastler
author_rank: Super Contributor
timestamp: February 02, 2024, 01:31:22 pm
content: 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.

author: magic
author_rank: Super Contributor
timestamp: February 02, 2024, 01:34:32 pm
content: Quote from: ebastler on February 02, 2024, 12:53:43 pmClass 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.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 02, 2024, 01:48:25 pm
content: Quote from: ebastler on February 02, 2024, 01:31:22 pmBut 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?

author: ebastler
author_rank: Super Contributor
timestamp: February 02, 2024, 01:59:03 pm
content: Quote from: S. Petrukhin on February 02, 2024, 01:48:25 pmYes, that's the plan, as mentioned in my second post or so.QuoteYes 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.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 02, 2024, 02:37:29 pm
content: Quote from: ebastler on February 02, 2024, 01:59:03 pmI would suggest a fun option to use powerful MOSFET optocouplers instead of bridge transistors, such as KAQY212Ahttps://www.lcsc.com/product-detail/Solid-State-Relays-MOS-Output-PhotoMOS_Cosmo-Electronics-KAQY212A_C194713.html

author: ebastler
author_rank: Super Contributor
timestamp: February 02, 2024, 02:52:24 pm
content: Quote from: S. Petrukhin on February 02, 2024, 02:37:29 pmFour 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 theandicons 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.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 03, 2024, 03:45:12 pm
content: Quote from: ebastler on February 02, 2024, 02:52:24 pmI 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.

author: langwadt
author_rank: Super Contributor
timestamp: February 03, 2024, 03:58:05 pm
content: Quote from: S. Petrukhin on February 03, 2024, 03:45:12 pma step-up will only increase the problem of high resistance switchesand those optos are not only high resistance, they are also slow as molasses

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 03, 2024, 04:00:52 pm
content: Quote from: langwadt on February 03, 2024, 03:58:05 pmOptos are not required, it is not related.

author: langwadt
author_rank: Super Contributor
timestamp: February 03, 2024, 04:07:44 pm
content: Quote from: S. Petrukhin on February 03, 2024, 04:00:52 pmthen why did you suggest it?https://www.eevblog.com/forum/beginners/driving-a-small-speaker-with-an-h-bridge/msg5312593/#msg5312593

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 03, 2024, 04:20:02 pm
content: Quote from: langwadt on February 03, 2024, 04:07:44 pmOne of the options... Opto is easier to control in the upper arm.

author: ebastler
author_rank: Super Contributor
timestamp: February 03, 2024, 04:43:19 pm
content: Quote from: langwadt on February 03, 2024, 03:58:05 pmThanks 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!

author: LinuxHata
author_rank: Frequent Contributor
timestamp: February 04, 2024, 04:37:43 pm
content: I guess, something like LTC1157 can be used for that task, but price....

author: JustMeHere
author_rank: Frequent Contributor
timestamp: February 06, 2024, 12:22:49 am
content: 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