This is only a preview of the August 2020 issue of Practical Electronics. You can view 0 of the 72 pages in the full issue. Articles in this series:
|
Bargain Modules
Class-D Stereo Plus
Subwoofer Amplifier
By
Allan Linton-Smith
PCB size is
100 × 70mm.
T
he Class-D 3 × 50W amplifier
module (stereo plus subwoofer)
shown above can be purchased
(at time of going to press) for about £7.50
from AliExpress (or less – do google it!).
For a bit more money, you can get the
5x50W amplifier module with built-in
Bluetooth support shown opposite.
Both run from 5-27V DC, provide
decent performance and appear to be
very good value for money.
The XD172700 module
The module above uses the latest power
IC from Texas Instruments (TI), the
TPA3116D2 IC (2017 revision G), who
describe it as a ‘15W, 30W, 50W FilterFree Class-D Stereo Amplifier Family
With AM Avoidance’.
The chip measures just 11 × 6.2mm.
Two are used on the first board: one is
used in stereo mode for the left and
right channels, and the other in mono
(bridged) mode for driving a subwoofer.
These amplifier chips are fed audio
by two NE5532 ICs used as preamplifiers and to provide the subwoofer
low-pass filter.
You don’t have to worry about soldering the SMD TPA3116D2 chips because
38
The old saying says that ‘if it sounds
too good to be true, it probably is’.
So if we told you that
you could get an
assembled 3 × 50W
amplifier module for
around £7.50, you would
probably be thinking that
it would be a load of junk.
But in this circuit, that isn’t the
case! This one works almost (!)
as well as advertised – and most
of its shortcomings are easily
be addressed.
this has all been done for you! Our suggested modifications require a little bit
of much simpler soldering.
The board comes with everything,
even the heatsink, which is shared by
both amplifier ICs. It even came with
a set of standoffs, nuts and bolts for
mounting it in a chassis, plus shiny
knobs for the pots! All you need to do is
wire up the power supply, audio input
and speaker output terminals.
The board has two audio input options: you can use either the 3.5mm
stereo jack socket or a three-pin JST
header. And there are two options
for power supply; either a PCB screw
terminal or a 5.5mm DC barrel socket
for a plugpack or inline power supply.
The board requires a simple DC supply, and this simplifies things significantly because you can use just about
any supply that produces 5-24V DC: an
old laptop supply or any other high current source, including a car or electric
drill battery. You could even use a 5V
USB charger. But to get the full output
power, you need around 24V at 6-7A.
Note that to get the full power output
you will also need 4Ω speakers. Higher
impedance speakers cannot be driven
to quite as high power levels. For example, if you use 8Ω speakers, with the
appropriate power supply, you will get
around 30W maximum from the left
and right channels.
The amplifier ICs have a high power
supply rejection ratio (PSRR), so you
don’t need a super-smooth DC supply. It
will reject 70dB of ripple, meaning you
can have up to 200mV peak-to-peak ripple before you’re likely to notice buzz
or hum creeping into the audio outputs.
For testing, we used a 24V 7A DC plugpack which cost £18 including postage.
24V × 7A = 168W, so with a 90% claimed
peak amplifier efficiency, we should get a
total theoretical output of around 150W
RMS – ie, around 2 × 38W into 4Ω for the
left and right channels and about 75W
into a 2Ω subwoofer.
The efficiency of the device varies
significantly with supply voltage and
output power (see Fig.1). It is typically
40-70% at low power levels, ie, below
5W. If you only require power levels up
to 10W into 4Ω speakers you are better
off with a 6-12V DC supply because this
will give you 70-90% efficiency and it
won’t cause any overheating problems
(see Fig.1).
Practical Electronics | August | 2020
Your best approach is to decide
what power output you need and then
choose your power supply to deliver
this with the highest efficiency. Otherwise, the device may overheat and
automatically shut down during use.
Power output figures
The measured power for this module
is good but not quite up to the claim of
2 × 50W + 100W.
During testing, we did manage to
get 2 × 50W into 4Ω and 2 × 30W into
8Ω as expected. But we were not able
to get the full 100W into 2Ω from the
subwoofer output because the device
protection circuit sent the output into
high impedance and it cut out. We were
only able to get about 50W into the sub.
This is no doubt due to poor design
of the subwoofer section; we suspect
that the IC has not been correctly configured for mono operation. It may be
possible to fix this by changing some
of the passive components connected
to the subwoofer amplifier IC, but we
haven’t tried that.
So basically, you can expect to get
about the same amount of power from
the subwoofer channel as you can from
the left and right channels, taking into
account the possibility that your sub
may have a different impedance from
the other speakers.
Frequency response
The quoted frequency response by
the supplier is 20Hz to 20kHz with no
±decibel figure, which is quite common
to see but also a pretty-much useless
statement. So we decided to measure
the frequency response accurately.
First, we did a listening test which
exposed a lack of treble with cymbals,
triangles and slightly muffled brass. The
measured response, as shown in Fig.2,
confirms our subjective impression.
There is a significant drop-off in the
output above 1kHz. We did this test at
1W and 5W output levels, using a 12V
DC supply for convenience.
So the out-of-the-box response is
poor, and you can clearly hear the lack
of treble. It’s down by 8dB by 20kHz.
A glance at the TI data sheet (www.
ti.com/lit/ds/symlink/tpa3116d2.pdf)
indicates that when properly implemented, the IC’s frequency response
should be almost flat to about 40kHz.
The data sheet also recommends that
the LC filter after the output stage, if fitted, should have a 10µH inductor and
680nF capacitor on each output pin. We
measured the supplied LC filter at 55µH
and 1µF, which explained the drastic
reduction in high-frequency response.
We tried reducing the output inductor
values to 10µH, which considerably
flattened the frequency response.
Practical Electronics | August | 2020
As per the data sheet, high-current
ferrite beads can be used in place of
the inductors, if the capacitors are also
changed to 1nF.
This will not be as effective at reducing radiated emissions, however,
and doing this will require quite a bit
of soldering which may damage the
dual-layer PCB.
Changing the inductor values has
another benefit besides flattening the
frequency response; we found that they
got hot during use because the wire
used is too thin.
Audio inductors should be air-core
types to avoid non-linearity in the core
material. We published instructions
for winding a 2.2µF inductor on page
28 of the February issue. To make a
10µH inductor use 30.5 turns of 1mm
diameter enamelled copper wire on
standard bobbins available from Jaycar
and Altronics.
You then just need to remove the
existing inductors and solder the improved ones into place. Keep them as
close to the PCB as possible and mount
them all with the same orientation to
reduce magnetic field interactions.
Ideally, you should replace the 1µF
capacitors with 680nF capacitors, as
per the data sheet; but in practice it
doesn’t make that much difference.
You can see the revised frequency
respone (after changing the inductor
values) as the blue trace in Fig.2
With the 10µH inductors and 1µF capacitors, it shows a slight lift at 20kHz,
continuing to rise to 30kHz, then dropping sharply to –60dB at 1MHz.
Naturally, after doing that, the unit
sounded much better, with an excellent
high-frequency response; very different
from our first listening test!
The subwoofer response is also
shown in Fig.2. It has a peak at 28Hz
and is –20dB at 250Hz,
which is close to ideal.
The subwoofer amplifier can put
out significant power and the IC is
supposed to handle 2Ω speakers, but
we found that 4Ω is the minimum for
this particular module. In fact, you
won’t find many 2Ω drivers (outside
of cars), anyway.
You may notice that after this modification the module has a slight (2dB)
rise at the low-frequency end, close to
20Hz. This is probably due to crosstalk
with the subwoofer section and the
design of the PCB, but it should not be
a problem because most loudspeakers
will not respond to such low frequencies. Either way, a small amount of
low-end boost will generally improve
the response of most loudspeakers.
AM radio frequency avoidance
The TPA3116D2 has advanced oscillator/PLL circuitry which employs
multiple switching frequency options
to avoid AM interference.
These options cover 15 different
frequencies, ranging from 376kHz to
1278kHz, so it can be set to avoid the
AM band in most countries.
Our module was pre-set at 400kHz
(403.5kHz measured) so that only the
first harmonic will fall into our local
AM band.
We also checked the output with
a spectrum analyser and found that
the first harmonic (807kHz) was 57dB
lower than the audio output signal
level, so there should be very little
interference with AM radio receivers
(see Fig.3).
If you are going to use the module in
other places where 400kHz radiation
could be a problem, you could modify
the unit according to the data sheet,
but that would be quite tricky.
PCB size is
167 × 116mm.
The Bluetooth module is
supplied attached to the
main board.
Even if
you don’t
need the two
extra outputs, as
long as you can live
with the extra size (and
cost), this module has two
benefits: no need for mods,
and built-in Bluetooth support. If
you’re clever, and you only need two
or three channels, you’ll take the left
output from one chip and the right output
from the other chip to spread out the heat
load between all the devices.
39
100
90
80
Power Efficiency (%)
70
60
50
40
30
20
0
PVCC = 6V
PVCC = 12V
PVCC = 24V
Gain = 26dB
TA = 25°C
RL = 4Ω
10
0
5
10
15
20
25
30
35
Output Power (W)
40
45
50
Fig.1: sample efficiency curves from the
Power Efficiency (BTL) vs Output Power
Texas
Instruments TPA3116D2 data sheet.
Efficiency is higher with lower supply
voltage, but of course, maximum power
is also lower in those cases. Efficiency
also increases with output power; in
other words, device dissipation does not
increase much as the output power rises.
G018
So we suggest that instead you try
to keep the speaker leads short – less
than 1m if possible – so they make for
poor transmitting aerials. The spectrum
from 500Hz to 40MHz is otherwise
very clean.
Distortion and noise (THD+N)
The unit is quoted as having a THD+N
figure of 0.1% at 1kHz with a 25W
output. We decided to verify this with
some measurements.
The maximum power into an 8Ω
load is 40W RMS and the THD+N
reading was 1% when clipping started
to be noticeable at this level. The high
THD+N at very low power levels is
merely noise. As expected, the module
will deliver 50W into 4Ω loads.
Fig.5 shows a plot of THD+N vs frequency for the module. These figures
+10
Crosstalk
We checked out the crosstalk of the
amplifier module (Fig.5) and the results were as not as good as specified,
probably because of the design of the
PCB and the interaction of the output
inductors, which cause feedback into
the opposite stereo channel.
There is not a lot you can do about
this; it may be possible to re-locate the
inductors or substitute ferrite beads,
but if you want really good crosstalk
performance, given its low cost, you
could simply use a separate module
for the left and right channels.
While we were working on this article, similar modules have appeared
on eBay for around £3. So it’s hardly
worth arguing about!
Amplifier Frequency Response
XD172700 Class-D amplifier
features and specifications
• 3 × 50W RMS into 4Ω (21V DC supply)
• 3 × 30W RMS into 8Ω (24V DC supply)
• Supply voltage: 4.5-27V DC
• THD+N: typically around 0.05% at
1kHz, 1W
• Frequency response: 20Hz-20kHz,
+3,–0dB (after modifications)
• Efficiency: up to 90% (only needs a
small heatsink)
• Switching frequency: 400kHz ±3kHz
• Self-protection circuits: over-voltage,
under-voltage, over-temperature, DC
offset, over-current and short-circuit
protection.
• Input connectors: 3.5mm stereo jack
socket or 3-pin JST header
• Output connectors: 3 × 2-way terminal
blocks
• Power connectors: 2-way terminal
block and DC barrel socket
• Module size: 100 × 70 × 30mm
Protection features
The TPA3116D2 is a well-protected
device and has self-protection for overvoltage and under-voltage conditions,
as well as output DC fault, short-circuit,
overload and over-temperature conditions. When an over-current, shortcircuit, over-temperature or DC offset
fault is detected, the module switches
itself off and you need to cycle power
to restore its function.
No point changing the op amps
As mentioned earlier, the unit we
obtained came with two NE5532 op
amps in sockets. Most dual op amps in
DIP-8 packages have the same pinout,
17/12/18 15:39:09
Subwoofer output
Left/right pre mods
Left/right post mods
+5
Relative Amplitude (dBr)
are the best that we were able to achieve
after changing the output inductors.
The distortion above 10kHz may be
higher than indicated because we used
a 20kHz ‘brick wall’ filter to eliminate
subharmonics from the 400kHz switching frequency, which otherwise would
have affected the measurements.
The 80kHz bandwidth measurements we usually take with linear
amplifiers cannot be made with ClassD amplifiers. Therefore, we took some
intermodulation distortion (IMD)
measurements to clarify the level of
distortion at higher frequencies.
The IMD measurements were taken
by injecting the SMPTE-standard
frequencies of 500Hz and 2kHz (2:1)
and the resultant spectrum shows acceptably low noise up to 24kHz. The
average level is 0.11% which verifies
the THD+N measurements; this is not
bad for a Class-D amplifier.
+0
-5
-10
-15
-20
-25
-30
20
50
100
200
500 1k
2k
Frequency (Hz)
5k
10k 20k
Fig.2: frequency response of the 2+1 channel amplifier module
before and after we modified it. The mauve curve shows the
subwoofer output, which purposefully rolls off at around 100Hz.
The left/right response, as supplied, is in red, and post-mods
is in blue. It’s now much flatter above 1kHz, and it sounds a
lot less muffled.
40
Fig.3: spectrum analysis of the output waveform shows that the
main peak at 403kHz, representing what’s left of the switching
waveform after filtering, is 40dB below the audio signal, while its
first harmonic at 806kHz (in the AM broadcast band) is at –57dB,
so the amplifier should not cause too much AM interference.
Nevertheless, we’d keep the speaker leads as short as possible.
Practical Electronics | August | 2020
Yuanjing Class-D amplifier
features and specifications
• Inputs: 3 separate channels (left, right,
subwoofer)
• Outputs: 5 × 50W RMS into 4Ω (21V
DC supply) or 5 × 30W RMS into 8Ω
(24V DC supply)
• Supply voltage: 4.5-27V DC
• THD+N: typically around 0.05% at
1kHz, 1W
• Frequency response: 20Hz-20kHz, ±1dB
• Efficiency: up to 90% (comes with
small heatsinks fitted)
• Switching frequency: 400kHz ±3kHz
• Self-protection circuits: over-voltage,
under-voltage, over-temperature, DC
offset, over-current and short-circuit
protection.
• Input connectors: 3-way pin header or
Bluetooth wireless
• Output connectors: 5 × 2-way terminal
blocks
• Power connector: solder pads
• Module size: 165 × 115 × 25mm
so it’s easy to swap them – but there
isn’t much point.
First, while the NE5532 is an old
design, it has stood the test of time
and even by today’s standards still has
outstanding performance.
And second, the distortion and noise
in this amplifier is dominated by the
amplifier ICs themselves and not the
op amp-based preamplifiers.
We tried replacing the NE5532 with
newer OPA1642s (soldered to SOICto-DIP adaptors) but the improvement
in performance was so minor as to be
insignificant. If you must change the
op amps, don’t forget to fit them in the
right orientation!
1
Getting one
There are many similar
modules available with
a different size, layout,
components, connectors and so on. You may
want to look for one
that’s visually identical
to ours, since it is at
least a known quantity.
There are many possible sources but here is
one to get you started:
www.aliexpress.com/
item/32810347968.html
As noted in the article, the inductors on the 172700 unit had
much too high a value to give a good frequency response.
Not wanting to spend any money on new inductors (they
would cost more than we paid for the whole module) we
tried partially unwinding some of them. That worked, but
it was a lot of work. So for the remainder, we shorted out
15 turns by soldering thin wires in place (after scraping off
the enamel insulation from the wire), as seen here. This
dropped their inductance down to roughly the right value.
The Yuanjing module
Since we noticed so many other similar
modules were available, we decided to
try a second one; specifically, one with
built-in Bluetooth support.
The one we’ve chosen has no obvious
model number, but since it has ‘Yuanjing’ written in copper tracks in the
corner near the Bluetooth module, and
this is presumably the manufacturer,
that’s how we’re referring to it.
You can find this module for sale at
prices from about £17.50 to £25 on eBay
and AliExpress, although the latter has
a better selection. Search for ‘tpa3116
4.1’ and look for a blue PCB matching
the one shown in this article. This
one appears to be the best deal at the
time of writing: www.aliexpress.com/
item/32799510099.html
This module may be for motor vehicles given that it has two pairs of
essentially identical left/right outputs
– perhaps to drive front/rear car speakers. The four pots along the front control
overall volume, subwoofer volume and
front and rear volume independently.
Amplifier THD vs Frequency, 1kHz, 1W
21/12/18 20:12:07
+60
Amplifier Left/Right Channel Crosstalk
Relative Amplitude (dBr)
Total Harmonic Distortion (%)
+40
0.2
0.1
0.05
21/12/18 18:33:27
Left channel (undriven)
Right channel (driven)
+50
0.5
Even if you don’t need the extra
channels, there are two big advantages
to this module. One, we didn’t need
to make any modifications to get good
performance out of it; it appears to have
the correct output filter components
from the factory. And two, the built-in
Bluetooth audio receiver is very handy
for wirelessly playing audio from a
mobile phone or tablet.
It works seamlessly. When a Bluetooth device is connected, it switches
a relay to divert the Bluetooth audio to
the amplifier chips. With no Bluetooth
connected, audio comes in via a threeway pin header. The subwoofer signal
is generated by mixing the left and
right channel signals and then feeding
it through a low-pass filter.
Like the XD172700, the subwoofer
output on this module does not appear
capable of the claimed 100W. We think
that in both cases, they simply have
not wired up the IC correctly for BTL
operation. It’s merely using one of the
two available channels and so is only
capable of driving 4-8Ω loads to the
+30
+20
+10
+0
-10
-20
-30
-40
0.02
-50
0.01
20
50
100
200
500 1k
2k
Frequency (Hz)
5k
10k 20k
Fig.4: the measured distortion performance of the left/right channels
on our sample module (after output filters mods), into an 8resistive
load. While not quite as good as the amplifier designs we publish, it’s
below 0.1% THD+N up to about 3.5kHz (with a 20kHz bandwidth)
which is not too bad. It certainly sounds acceptable. We use a 20kHz
filter to remove the switching residuals, hence the drop in readings
above 6kHz, above which the main harmonics are filtered out.
Practical Electronics | August | 2020
-60
20
50
100
200
500 1k
2k
Frequency (Hz)
5k
10k 20k
Fig.5: crosstalk figures for this amplifier are not particularly
great, with less than 20dB separation between channels. This
is probably due to the close proximity of the output filter
inductors for each channel. This generally isn’t a problem
when playing regular music recordings, but if it bothers you,
you have the option of using two separate modules, one for
each stereo channel.
41
Fig.6: the self-protection features of the TPA3116D2 IC.
same power levels as the left and right channels. But still,
overall, the performance isn’t bad, especially considering the
price and the convenience of running off a single, relatively
low voltage DC supply rail.
+20
Yuanjing Amplifier Frequency Response
Subwoofer output
Left/right outputs
+10
Relative Amplitude (dBr)
22/12/18 12:27:15
+0
-10
-20
-30
-40
-50
-60
20
50
100
200
500 1k
2k
Frequency (Hz)
5k
10k 20k
Fig.7: the frequency response of the Yuanjing-brand 4.1 channel
amp is fine out-of-the-box, unlike the other one we tried. Note
how its subwoofer low-pass filter is far less aggressive than
the other board’s, with significant amounts of low bass making
it through, up to a few hundred hertz.
1
Yuanjing THD vs Frequency, 1kHz, 1W
Figs.7-9 show how the performance of the Yuanjing module compares. It’s certainly usable as-is and is comparable
to, or better than the XD172700 module in most areas.
Just one point to note: while this module comes with the
appropriate pot nuts and washers (as seen in the photo) it
neither includes the stand-offs nor the cute knobs which the
other one has. Oh well – can’t win ‘em all!
Conclusion
These fully built and ready-to-go modules are very flexible
and would have many useful applications such as in cars,
TV soundbars, computer sound systems and amplifiers for
smartphones. They should be very reliable due to their comprehensive protection against short-circuits and importantly,
against overheating.
The fact that they only require a single DC supply and can
run from 5V to nearly 30V makes them even more flexible.
You can even get a few watts of audio output using a small
USB charger.
The distortion, frequency response and crosstalk could
all be improved, but for the price, we didn’t expect super
Hi-Fi performance.
These modules can easily be mounted inside a cheap Jiffy
box or metal amplifier chassis. It’s so straightforward, we
aren’t even bothering to give any instructions. Just mount
them in the chassis, wire them up and away you go.
Reproduced by arrangement with SILICON CHIP magazine 2020.
www.siliconchip.com.au
22/12/18 13:39:53
+60
Yuanjing Left/Right Channel Crosstalk
Left channel (undriven)
Right channel (driven)
+50
+40
Relative Amplitude (dBr)
Total Harmonic Distortion (%)
0.5
0.2
0.1
0.05
0.02
0.01
20
50
100
Line in
Bluetooth
200
500 1k
2k
Frequency (Hz)
+30
+20
+10
+0
-10
-20
-30
-40
-50
5k
10k 20k
Fig.8: distortion performance is similar to the cheaper one; slightly
worse at lower frequencies (probably due to the use of less-linear
coupling capacitors), and slightly better at higher frequencies.
Its performance is significantly better when using the line input
pin header compared to Bluetooth, likely due to digital artefacts
and noise in the output of the Bluetooth module.
42
22/12/18 13:52:01
-60
20
50
100
200
500 1k
2k
Frequency (Hz)
5k
10k 20k
Fig.9: crosstalk for the Yuanjing amplifier isn’t exactly
great but it’s significantly better than the cheaper one.
You’re not likely to notice this coupling when listening to
ordinary program material with stereo speakers.
Practical Electronics | August | 2020
|