EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: MustSeeMelons on June 13, 2024, 08:45:50 am
-
Hi!
I'm building an internet radio box that consists of a Pi Zero, a PCM5102A I2S to analog, and a TPA3111D1PWPR (10W) amplifier. I've attached the schematic as well as the PCB layout of a 2-layer 1.6mm board. Basically following the datasheets to put it all together.
For volume control, I placed a pot after the I2S chip. Power-wise I'm using a 12V barrel plug, 3.3V LDO for the I2S chip, and 5V buck for the Pi itself. The amp is running from the 12V supply.
It works! But once I turn the volume up a bit it sounds like trash. Distorted, fart-sounding is the best I can describe it.
I'm using a generic 4 Ohm speaker without any known characteristics.
I tried another generic 4 Ohm, but 15W rated speaker - sounds the same, perhaps gets a bit louder.
I've used this speaker before with a MAX98357 (3W) and it worked great. Though now before it starts to sound bad the sound seems fuller? If that makes sense.
Next, I tried out a brand name 30W speaker. With a proper datasheet. After some googling it seemed I was experiencing clipping, so my hopes were low that this would change anything - but it did! It sounds awesome!
Can someone please shed some light on the subject? Are two of my three speakers just under spec? Or am I doing something terribly wrong? I added a low pass filter, maybe I need a high pass as well?
Any help would be appreciated, thanks :)
-
Wrong connection of R11 - should be connected to pin 7, instead it conected to pin 14 (and vice versa - just swap pins 7 and 14).
R15 is short circuited.
-
Adding high-pass filters can help improve sound quality by removing unwanted low frequency noises.
-
See if the power supply can give enough current for the peaks. If not, the voltage drops and creates feedbacks and strange effects.
-
If you have an oscillocope, you can check if there is ripple in the power supply whe you rise the volume. If not, you can try with a more powerful PS, as a PC power supply to discard this posibility.
-
@xvr How can you tell that the pins are swapped? R15 is a bit weird - but I'm just following the application schematic. Attached it.
@jzx I'm testing from a bench power supply that can supply 5A. If it were a power supply issue wouldn't the issue be present on all speakers?
-
@xvr How can you tell that the pins are swapped? R15 is a bit weird - but I'm just following the application schematic. Attached it.
See 'Pin function' table on page 3. It says
- AVCC 7 P Analog supply. A 100-kΩ resistor in series with AVCC is needed if the PVCC slew rate is greater than 10 V/ms.
- AVCC 14 P Connect AVCC supply to this pin
And any case - connect power suply through 100K resistor is a nonsense. I think that DS has an error here. May be it should be 100R?
-
You don't say what's the maximum output power of your 12v adapter. At 10w output on a 4 ohm speaker, the amplifier chip alone would consume 1A of current.
The layout is pretty bad, with what looks to be pretty thin traces where there's no reason to. I would more or less have a copper pour/fill from the barrel jack all the way down to the left of the audio amp chip and the components near it. Not that trace that splits into multiple diagonal traces.
Also the layout of the switching regulator and the linear regulator is kinda bad.
The inductor is too far from the chip and uses too thin traces. I would actually put the BST capacitor C6 right where the text for R3 is, and have the inductor right below the capacitor. This way you can have a trace come out the SW pin and connect to a rectangular copper area that connects to both the inductor pad AND the C6 capacitor.
Keep the feedback resistors away from the inductor, and connect the output capacitors directly to the other pad of the inductor. Pay attention to the advice on page 14 in the datasheet: https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP1660GTF/ (https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP1660GTF/)
It may be a good idea to add a solid (polymer) capacitor in parallel with those two ceramics, something in the 47-100uF 10-16v range.
For the 3.3v regulator, because it's so close to the 2 22uF ceramics on the output of the 5v switching regulator, you could leave out that 1.5uF ceramic capacitor on input.... maybe change it to a 100nF for decoupling purposes even though even that wouldn't be needed since it's so close to the 5v switching regulator.
But the biggest issue is that 1117 regulators can be unstable with ceramic capacitors on output, depending on who makes them. For your TLV1117, it's not designed to be stable with ceramic capacitors, you can see the recommendations on page 11 : https://www.ti.com/lit/ds/symlink/tlv1117.pdf (https://www.ti.com/lit/ds/symlink/tlv1117.pdf)
8.2.1 Design Requirements
• (A) Output capacitor selection is critical for regulator stability. Larger COUT values benefit the regulator by improving transient response and loop stability. This device is designed to be stable with tantalum and aluminum electrolytic output capacitors having an ESR between 0.2 Ω and 10 Ω
This part really needs ESR above 0.2 ohm, other models from TI recommend as much as 0.4 ohm minimum, and most 1117 regulators not "tweaked" for stability with ceramic capacitors require at least 0.1 ohm ESR.
The easiest way would be to use a low capacitance value electrolytic capacitor, anything in the 22uF to 100uF 10-35v rated should have an ESR above 0.1 ohm
Or you can use a regulator that advertises being stable with ceramic capacitors like AZ1117I for example : https://www.digikey.in/en/products/detail/diodes-incorporated/AZ1117IH-3-3TRG1/5699672 (https://www.digikey.in/en/products/detail/diodes-incorporated/AZ1117IH-3-3TRG1/5699672) (note that while it's stable with ceramic capacitors this model also has specific requirements, like at least 22uF capacitance, others are fine with as little as 10uF)
I'm not saying these are the reasons it would sound bad, but they could be. For example the PCM5102A is powered from 3.3v and if the output oscillates...
Also... decoupling capacitors (0.1uF / 100nF) should be as close as possible to voltage pins, I see in the schematic that your 10uF are positioned closer. It probably makes very little difference, but just saying for future designs.
For the amplifier chip, I don't think you need 220uF .... even the datasheet shows 100uF, I'd use two 100uF solid (polymer) capacitors and I'd probably use 270-470uF solid (polymer) on the input by the barrel jack.
-
@jzx I'm testing from a bench power supply that can supply 5A. If it were a power supply issue wouldn't the issue be present on all speakers?
I have forget your third speaker. If the amplifier works with one speaker, must be correct, but decoupling capacitors are important.
In your first post you have not said the power of the power supply, and a weak power supply is a common cause of distortion at "high" power. (10W is not very high, but for a small power suply it is).
Can someone please shed some light on the subject? Are two of my three speakers just under spec?
It is posible. You dont know the characteristics of the 1st speaker, and the characteristics of the 2nd can be fake (chinese watts) o it can be damaged. If the coil is not well centered in the magnet or if it is distorted, it can brush against the core, perhaps only at high volume, when the coil goes further. Have you tested your 2nd speaker with another amplifier?
-
@mariush Thank you so much! Lots of useful info for a newbie :) Have to spend more time with datasheets and not ignore recommended layouts :palm: Sorry regarding the 12V adapter, it is rated at 3A. I mainly use the bench supply to avoid wasting parts on prototypes.
@jzx On the 3W amp all speakers sound good.
@xvr Huh, the table contradicts the recommended layout :( I guess time to go to TI's forums to figure this out? :D
-
The datasheet seems misleading, as that 100k resistor on pin 14 shows the other end connecting to AVCC...but pin 14 is AVCC, so that 100k resistor appears to just short itself out :-// If pin 7 & pin 14 are actually connected internally (as they are labelled the same) then connecting a resistor between pin 7 & 14 ahieves nothing.
Looking at the way others have interpreted AVCC, pin 7 has been connected to supply through a 10R resistor, then the 100k connectes from pin 7 to pin 14. In your circuit you have done this, but you have also connected the supply straight to pin 7 as well. This isn't required.
-
@jzx On the 3W amp all speakers sound good.
You said that at low levels it sounded well, but bad if you raised volume. A damaged speaker can sound well at low level and bad at high level.
If the speaker sound well with the 3W amplifier at higher level than with the 10W amplifier, it is not the trouble, but the 10W amplifier can send more power to the speaker.
Have you an oscilloscope?
-
Looking at the answers on the Texas Instruments forum about pin 14, it is not internally connected to pin 7, despite both pins having the designation AVCC :palm:
Pin 7 is a power connection while pin 14 is an I/O connection. Why on earth did they call both pins AVCC? No wonder there is so much confusion :-//
Some have even connected pins 7 & 14 externally on the PCB, thinking they were the same internally, which caused problems.
-
@jzx I don't have a proper oscilloscope, yet. I want to buy one but keep putting it off. I am quite space-constrained. I have this thing: https://www.aliexpress.com/item/1005003318080178.html?spm=a2g0o.productlist.main.3.49d64060ttDhA9&algo_pvid=2fd06943-cca0-4f20-9592-35fe18a19622&algo_exp_id=2fd06943-cca0-4f20-9592-35fe18a19622-1&pdp_npi=4%40dis%21EUR%2126.00%2115.07%21%21%2127.25%2115.80%21%402103080e17187320854378211ef0d1%2112000035132000036%21sea%21LV%212194027302%21&curPageLogUid=LBGlyaxXtW61&utparam-url=scene%3Asearch%7Cquery_from%3A (https://www.aliexpress.com/item/1005003318080178.html?spm=a2g0o.productlist.main.3.49d64060ttDhA9&algo_pvid=2fd06943-cca0-4f20-9592-35fe18a19622&algo_exp_id=2fd06943-cca0-4f20-9592-35fe18a19622-1&pdp_npi=4%40dis%21EUR%2126.00%2115.07%21%21%2127.25%2115.80%21%402103080e17187320854378211ef0d1%2112000035132000036%21sea%21LV%212194027302%21&curPageLogUid=LBGlyaxXtW61&utparam-url=scene%3Asearch%7Cquery_from%3A).
In fear of miscommunication, I shall clarify:
Speaker I: Chinese, no data on it - works well on the 3W at all levels. Distorted at higher levels on the 10W. (It might be a 3W speaker, dunno)
Speaker II: Chinese, but rated at 15W! No more data. Works well on the 3W at all levels. Distorted at higher levels on the 10W.
Speaker III: Branded, 30W, has a proper datasheet. Works well on both amps with no distortion. Actually sounds pretty great just sitting on a table above some one layer TP :D
@807 Thanks! The reference schematic caused a headache. So technically I can remove the direct connection for pin 7 to 12V and keep it all through the 10R resistor?
-
This scope probably is slow, because if the output is not very well filtered, you will have rests of the high frequency modulation.
What are L2 and L3? In the datasheet are specified as ferrite beads, lousy, and in your board they seem standard coils. If they are not lousy you can have resonances.
-
...@807 Thanks! The reference schematic caused a headache. So technically I can remove the direct connection for pin 7 to 12V and keep it all through the 10R resistor?
Yep. That's what most others have done. Otherwise the 10R resistor is doing nothing by being shorted out.
-
@jzx L2 and L3 come from 8.2.2.3 from the datasheet. My reasoning was "it shouldn't hurt"
Update regarding the TLV1117 - I'm using a variant that is stable with ceramic caps: https://www.ti.com/lit/ds/symlink/tlv1117lv.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1719656731397&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Ftlv1117lv (https://www.ti.com/lit/ds/symlink/tlv1117lv.pdf?HQS=dis-dk-null-digikeymode-dsf-pf-null-wwe&ts=1719656731397&ref_url=https%253A%252F%252Fwww.ti.com%252Fgeneral%252Fdocs%252Fsuppproductinfo.tsp%253FdistId%253D10%2526gotoUrl%253Dhttps%253A%252F%252Fwww.ti.com%252Flit%252Fgpn%252Ftlv1117lv)