Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

If you want TPA3250 amps without having to build your own, they're widely available from the usual cheap vendors for less than $100.

The victory of class D is now total; extremely low distortion numbers can be achieved without heroic board layout or expensive passives made of unobtanium. All available in the tiny packages of AirPods, smartphones etc. And power levels in the tens of watts can be done with a single chip.



I built this project myself last spring. That 3e-Audio TPA3250 board isn't sold anymore, so I built my own custom variant amplifier using similar parts with a TP3251:

https://photos.app.goo.gl/gPH8VZiaGRiNYWfL6

It sounds MUCH better than my existing cheap vendor Fosi TPA3116 did -- the cheap vendor ones don't use quality components, especially for the power supply, so you're not going to see the expected performance.

That power supply board (diode bridge + filtering caps) was designed with a friend in KiCAD and fabricated by JLCPCB (I have a few boards leftover). The speakers are also DIY -- Hivi 3.1 with cherry wood veneer!

I showed article author Zorpette my work, and he gave it his blessing =)

EDIT: If you do try to build this, be VERY careful around the high-voltage power supply electronics.


There is no way DIY diode bridge and filtering caps on a separate board could make a slightest difference here, in fact high frequency noise from the power supply could only be filtered right near the chip. But leveling up an amplifier, to a 4 times more powerful as you did, would make a significant difference in sound.


In fact there is a way or two.

The extra resistance (2 to 10 milliohms probably) of the wire between the two boards, together with the smoothing capacitors on the downstream board, acts as a low pass RC filter.

Also the capacitors on the PS board may be low-inductance types, and filter HF noise more effectively than the caps on the amplifier module.

Having the diode bridge further away from the amp module's inputs means the antenna action of the rectifier's leads is less effective: the RF power of over-the-air rectification transients at the inputs is reduced by the square of the distance.

The layout of the amp as shown is good, except that I'd shorten and cable-tie wires to help prevent hum loops.


I would suspect imagine that putting a power supply like this in the same enclosure could introduce unpleasant noise. There will be a big current spike every half cycle when the rectifier starts conducting. The power factor will be awful, and I can easily imagine 120 Hz and its harmonics coupling somewhere you don’t want them. Not to mention that you might be able to hear the power supply buzzing.

Get a nice AC-DC converter brick and call it a day. If you want to be fancy, stick a linear regulator on the output.


If Apple or Dell sold 36V 10A power bricks, then maybe.

The ones that I've seen don't put out their claimed current, lose regulation badly at high load, and put a lot of hash on the DC rails. Seriously ugly. Opening them up, the circuit design often looks like it comes from the 1980s. Physical design usually doesn't meet standards for HV separation and creepage.

Rather than a linear regulator, lots of filtering (a few 100nF ceramics and a few millifarads of smoothing) would help. And a high-powered TVS or two for when the power brick dies, as it will.


Apple or Dell? I would start with Meanwell if I were trying this.


TPA3251 is the best on all performance


Very pretty! Thanks for showing it. What I'm going to say I hope will be taken as constructive, for those who are a bit more OCD about their electronics.

Safety: -

The mains safety earth (chassis bolt) should only ever have one lug: the mains input earth. Put a separate bolt an inch or so away from the mains safety earth bolt for the chassis connection of the bridge centre ground. (People have killed themselves doing repairs by ignoring this, and having faulty mains wiring.)

Fuses on the transformer secondaries are recommended if the transformer is expensive. If the bridge rectifier or an amp output stage fails, it'll almost certainly fail short, and the transfomer will heat up until its internal thermal fuse melts -- or if there isn't one, until it catches fire.

Likewise fuses on the DC rails will help protect the expensive smoothing capacitors from amp failure. (Yes, the TPA3251 has built-in protection - but that might also be damaged by the surge that caused the output stage to fail.)

I hope the polyester cap across the transformer secondary is X2 class.

Other points:-

A snubber across the mains switch will reduce arcing on switch-off and prolong the life of the switch. 10R-50R 3W in series with 100nF, X2 class, will do it. (The wattage rating is a proxy for both voltage rating and surge current rating.)

From the scale it looks like the transformer is a 120 or 160VA model. That's seriously undersized for an amp module rated at 350W (circa 550 VA with a traditional mains-frequency transformer). Transformer secondary fuses are strongly indicated.

OTOH, going up to a 500VA toroidal transformer means you'd need a soft-start circuit to prevent your house circuit breakers popping on start-up, from the initial transformer saturation inrush current.

I'm amazed you don't get RF interference with all that length of unshielded wire on the input side. I just have to leave one inch unshielded to be plagued with EMI - unless I use filters on the input terminals (100R / 220pF RC filter).

You don't have DC blocking on your volume control. I guess none of your sources have any DC offset. If not, changing the volume will be scratchy.

References: -

1. Bob Cordell, Designing Audio Power Amplifiers.

2. Doug Self, Audio Power Amplifier Design 6e.

3. Rod Elliott, sound-au.com. "Designing Linear Power Suppplies part 2" https://sound-au.com/power-supplies.htm

4. Idem, "Transformers - The Basics, part 2". https://sound-au.com/xfmr2.htm


This level of free electronics review is awesome, thanks from a software guy with more solder than sense.

Glad I'm not into power or audio electronics. :)


I hope I haven't put you off for life! :)

It can be fun and rewarding to buid your own.

Your amp will be fine as long as you use it for lounge-room listening. Just don't use it in pro situations, e.g. a wedding reception or large party (50+ people). Please!

(But if that cap across the transformer secondary is only DC rated, not AC, you can expect it to explode. Might take a couple of years, if you're lucky. I had one last five years before I learned about "X-class" mains rated capacitors.)


- There is only one lug, see photos.

- Polyester caps are AC rated

- Transformer is 300VA


I disagree that the "victory is total". First of all, distortion in the upper part of the audio range is not that stellar. Secondly - I personally can tell apart Class-D, Class-AB and Class-A. Class-D has grainy sound, even the best ones, $3000+ I tried; I get fatigued pretty quickly from them.


Interesting - I didn't realize that AirPods have class-D amps.


I'm pretty sure everything small and portable uses switching amplifiers, in fact pretty much all modern consumer electronics use class-D from your phone to your TV unless you specifically seek out separates from an audio shop. This is because class-D amps are extremely convenient, they are small, cheap, power efficient and they require little consideration for cooling - audio quality is an area of debate, there are certainly lots of very poor quality class-D amps our there with absurdly high THDs, but there are probably lots of good ones too.

AB would be more likely than A, but I can't imagine finding them even in a large flat screen TV since they are inherently less efficient and require larger power transformers which make them fairly heavy and bulky. You only really find non switching amps these days when people want to sacrifice some of that convenience for some nicer sound.


The trifecta of outstanding power efficiency, low cost, and nowadays very good performance of a class D amp virtually guaranties that any amplified sound you've head from a mobile device, or any consumer device really, was amplified by a class D.

There's not really a good reason to use non-class D in any mobile application today. As few as 10 years ago I thought Class D = garbage you settle for if you must, I've heard some incredibly good Ds that have made me completely change my mind


Just to throw an extra confounding factor in, I can guarantee that your hearing now isn't as good as when you first heard them. But that's fine, it's the subjective experience that counts.


Sound is weird and I agree it is a subjective experience.

I’ve done some unscientific blind tests with nice modern class Ds on people who avowedly think all digital amplification is trash. 9 times out of 10 the reaction has been something like “hmm, how lovely, now when are you going to show me the digital amp?” After I tell them what it is, it becomes “oh yeah, I can hear it now. It’s fine I guess for casual listeners but clearly lacks X.”

People consistently report higher levels of satisfaction with more expensive wine versus cheaper one, even if it’s just the same wine rebottled. They’re not lying, our perceptions and preconceived notions genuinely affect the we experience reality.


I tried many Class-Ds - and all of them caused fatigue. The initially sound even better than AB, but in 15 minutes I get tired.


Fatigue is an interesting factor as there is no physiological bias involved AFAICT - when you can't listen any more you just know, it's almost physical.

I have noticed different headphones and using a class AB headphone amp vs builtin switching amps can significantly impact how long I can listen for... But that anecdotal correlation is not enough for me to assign blame to switching amps, it might just be crap switching amps... or switching amps with not enough headroom. The problem is class D is always used for cheap low power devices, so most bad experiences are inevitably going to strongly correlate with class-D - whether or not it's attributed to the fundamental property of switching vs just being a bit ... shit.


Blinded or unblinded?


Both. I do not believe that non-blind tests are worthless. When you are dealing with subtle effects, knowing what to listen for actually helps in detecting the difference. However, I tried both blind and non-blind. Did not like both times. I really wanted to like Class-D though, it is not like I was prejudiced.


When my amp/receiver bought the farm a decade ago, I decided to try a 50-watt/channel 12-volt class-D amp after seeing the specs. It cost under $50, and I powered it with a hefty wall-wart (120v-1.5amp to 12v) left over from the 90s. It's been on 24/7 since, never used for over 10 watts/ch. The savings went into a decent pair of near-field speakers ... the most important part of great sound.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: