Close
0%
0%

Portable TPA3116 100w*2 amplifier

Modifying and building out a low cost TPA3116 class-D amplifier board with bluetooth

Similar projects worth following
I had need for a 4 speaker sound system with decent volume, but was small and lightweight enough to travel with. The amplifier is based around a TPA3116 amplifier board with a BTM835 bluetooth module. This has substantial power, is low cost and is available by a number of manufacturers as cheap imports from China. Combined with some small surround speakers and an old router to use for a case, the whole thing packs away nicely.

The amplifier board needs a case, and some modifications to make it work better for the application which required some reverse engineering.

This project is documented in the project logs.  A handy index with links:

  1. Initial Testing
    1. Amplifier section
    2. Bluetooth section
    3. Noise
  2. Reverse engineering/Adding a hard volume knob
  3. Schematics
    1. Audio Path
    2. Power
    3. Input Power
    4. Volume control
  4. Case
    1. Outputs
    2. Volume
    3. Board mounting
    4. LEDs
    5. Finished
  5. Final
    1. Future changes
    2. Portable speaker

  • 1 × TPA3116 amplifier board I used this one, but it is available in a bunch of places. $20 https://www.amazon.com/gp/product/B01MZ0IZMW/
  • 1 × Power supply The board calls out 24VDC, though in later testing I found that 12V worked. The lower voltage may not put out the same power, especially with an 8ohm load. I used this one which was plenty. Note that if this really was putting out 100w*2, a 5A24V supply wouldn't be sufficient. In testing with two 4ohm loads, current was peaking around 4A, so it may not be possible to practially get ths 100w*2 output. $20 https://www.amazon.com/gp/product/B01GC6VS8I/ I intentionally used an external brick power supply instead of building it into the case with the amplifer to separate switching noise.
  • 1 × Case I used the case from a Linksys wifi router I thrifted for $2
  • 1 × Volume potentiometer and knob I pulled a stereo, audio-taper potentiometer and knob from my stock.
  • 4 × Speaker wire terminals I used some simple banana jack sockets I had in stock. I decided to use these instead of full binding posts to keep the size down, and I knew I would want my speaker wires to already be terminated for easy setup on site.

View all 7 components

  • Final

    Quinn12/24/2018 at 21:21 0 comments

    Overall the project was only a days work, low cost mostly using parts I had on hand.  The result works great, with amazing sound and power for such a tiny amplifier.  My intended use is to provide portable well distributed sound in a conference room and it will work perfectly.  The amplifier, power brick, all 4 speakers, 200ft speaker cable and 50ft extension cord all fit within a 16x10x5 box.  The issues with speaker pop and bluetooth sounds can be avoided using the volume knob, turning it down when powering and connecting, turning the source to max, then using the volume knob to adjust.

    Future changes

    There a a number of things I  might do in the future.

    Antenna.  I might look into putting a better antenna on it to increase the range.

    External input.  I'd like to have a line input so that it could be used without bluetooth if possible.  It wouldn't be hard given the volume is inserted at a line level, would just need to switch over it's input and AC couple the line.

    Auto muting/anti-pop.  In thinking through how to deal with some of the issues, I realized I could add an output relay so that the speakers are disconnected before the power goes off, and connected after a delay upon power up.  This circuit wouldn't be difficult and would eliminate the pop and connecting tones(if connecting right away).

    Volume pot.  I think the slight hiss at loud volume would reduce if I changed the pot out for a 1k device.

    Power switch.  In some use cases this might be handy, especially if I make a battery powered version.

    Portable speaker

    In testing, I've found it quite handy to have this little amplifier and have been thinking about building a bracket that would hold the amplifier, 2 of the speakers and a battery pack all together.  The result would smaller than a shoe box, and yet much more powerful than most on the market.  Given that it works fine on 12V, I would probably use a 4S hobby battery pack which could easily have a very long run time given how little power this uses.

  • Case

    Quinn12/24/2018 at 20:34 0 comments

    For a case, I needed something plastic in order to allow the internal bluetooth antenna to work.  I ended up using a small Linksys router I thrifted for $2.

    Outputs

    I selected banana sockets for my output terminals, and mounted them on one edge, 0.75" center between +/-, and 1.0" between the pairs.  This spacing is to allow a dual plug to be used, but also to prevent a dual plug from accidentally bridging between the channels.  These sockets have a double-D shape to prevent rotation and a nut.  I used a rotary tool to cut these slots, and mounted them.  (picture taken at the end)

    Note that the negative output is not ground as the speakers are driven with an H-bridge circuit.

    Volume

    To make it fit in the case, I mounted the volume knob along another side.  I intentionally left space for a switch and line input if I ever wanted to add those in the future. (I wanted to, but don't want to spend the time right now)  There is a small plastic frame on this side which used to frame the ethernet jack.  I cut a rectangular "washer" to fill over this space using galvanized sheet steel.  This was later epoxied onto the plastic to make it easier to get together.  Drilling the hole in a strip of thin metal like this required sandwiching it between two pieces of wood and drilling all the way through so that the bit didn't grab and rip the steel.

    The potentiometer simply went through the hole with a nut holding it in place from the outside.

    Board mounting

    The case didn't have any screw bosses that I could use so I needed to come up with my own way of holding the board in.  On one side, the board could lay on a shelf which was held down by the other case half.  This would allow the DC jack on the amplifier to be at the edge of the case so I wouldn't have to relocate it, simply cut an opening.

    However the other side was still floating.  I cut some hooks out of the plastic from a different router and glued them into the case.  This allowed the board to be slid under those hooks and layed down oh the shelf on the other side.

    LEDs

    The amplifier has two LEDs on it.  The Blue one, D2, flashes 3 times about once per second when a bluetooth connection is made.  The Red one, D3, flashes 2 times about once per second when a bluetooth connection is lost(only after it was initially made).  After power up and before any connection is made, they will rapidly flash alternately.  As they are handy, I wanted to be able to see them on the outside as well.  Instead of desoldering them and moving them, I just left them on the board, and paralleled additional LEDs.  Note that they are not paralleled across the LED itself, but instead, a new LED and new resistor were paralleled across the original LED+resistor.  Looked at another way, I tombstoned a new resistor on the 3.8V rail(where the original LEDs were powered from), then ran a wire from that resistor to the LED, and back to the BTM825 pin.

    I chose to use a dual color red/green led I had from stock, connected to both the board blue and red.  I also added a green led which was simply powered from the 3.8V rail to ground to act as a power indicator.

    The router case already had light pipes to direct the on board LEDs out the front.  They were long and curved, and I had cut them off in order to fit the amplifier board in the case.  I used a small sanding disk to sand the edge flat and then glued the LEDs down to the surface which worked great.

    Finished

    Here is all the modifications done and everything installed

  • Schematics

    Quinn12/24/2018 at 20:10 0 comments

    I drew out the parts of the schematics that I needed.

    Audio Path

    The audio path between the BTM835 and the amplifier:

    This is one of the two channels.  As described before, the circuit takes the differential output of the BTM835, AC couples it to bias to 6V common mode, and converts it to single ended with some gain through a NE5532 opamp.  The output, also biased at 6V feeds into a capacitor before the amplifier.  If it is truly using a TPA3116, AC coupling like that is required as the amplifier provides it's own bias of 3V.

    The output of the opamp I measured up to about +/-0.75V (measured AC mode to remove bias), so is pretty much line level.  This means that non-populated connector could be used as a line out, as long as it is AC coupled first to remove the bias.

    Conveniently this means there is an easy way to insert a volume potentiometer in the path.

    But why is the audio biased at 6V you might ask?  By doing this, the designer could keep the audio directly in the middle of the opamp range, while only using a single polarity power supply.(that is, the opamp is powered by +12V/Gnd and not say +6V/-6V)

    Power

    The power supplies relevant in this circuit:

    A simple 7812 linear regulator is used to provide the 12V rail for the opamp, but also for generating the 6V bias.  The 6V bias is simply created with a voltage divider, so is not suitable for providing significant DC current.  It does have substantial bulk decoupling, 220uF, so can provide plenty of power at audio frequencies.

    There is also a 3.8V linear regulator which powers the BTM835 and the LEDs.  I couldn't identify the SOT23 part, but it should be a linear as there are no coils.

    Input power

    Knowing this circuit, we can understand more about the input voltage.  The module is labeled 12V-24V.  The 24V max is sensible given the TPA3116.  But I would have expected the minimum to be closer to 14V as the rail is used through a (non-LDO) linear to create 12V.  In the end, running it at 12(and lower) will work, it will just change the circuit as the opamp will then run around 10, and the audio bias around 5.

    I did test this with input voltages as low as 11 to work fine as I might want to battery power the module in the future.(4S lithium ion modules are much more common than 5S or 6S)  In testing, current stayed below 100mA until the volume started getting pretty loud.  It wasn't until near maximum(too loud for me in the same small room as the speakers) that the current went about 1A, with the highest peak I saw around 4A.(I did not use a scope so didn't catch quick pulses very well)  Partly because of the low current draw, I decided not to add any additional input capacitance as the amplifier already has 6*330uF caps across the rail.  If running the amplifier near it's max, it might help to add some more, but I would recommend doing some testing first to see what voltage drop you have from your supply and how high the currents peak.

    Volume control

    I initially tested with a regular 1k pot and it worked great.

    I switched to a stereo/dual audio taper potentiometer as a volume control.  I didn't have many audio taper stereo pots in my stock, and initially used a 50k one.  This worked, but increased hiss, and was more subject to 60hz hum.  I switched to a 10k one which improved the situation, removing noticable hum, and reducing hiss down to a low level.  The hiss and hum was mostly when the pot was set away from the ends, so it seems the amplifier doesn't want an input impedance this high.  A 1k would have been much better if I had one or was purchasing one.

    I wired this into the schematic like this:

    This is one of two channels shown.  Notice that the other end of the pot(CCW rotation) is connected to 6V, and not ground.  This is because at this point in the circuit, it has a 6V common mode.  If I were to connect it to ground, excess DC current would flow through the...

    Read more »

  • Reverse engineering / Adding a hard volume knob

    Quinn12/24/2018 at 07:19 0 comments

    The module is intended to have volume adjusted on your playback device, so does not have a volume control directly on it.(the buttons just send a signal back to your phone to adjust it's volume)  The bluetooth module puts out a beep every time you adjust the volume.  I intend to use this a room sound which will be faded in and out, so those beeps are not workable.  Combined with the bluetooth connecting sound and the speaker pops when powered on, I decided that the simplest solution would be to insert a volume control into the audio path.  This would allow me to just turn it all the way down when connecting, and then do my fading with the knob instead of my phone.

    I knew from the product picture and the information I could find about the components, that audio comes from the BTM835 module, through capacitors and into the TPA3116 chips.  I figured I could just insert a stereo potentiometer between those.  One concern I had was that the audio was differential.  To proceed, I needed to trace out a bit of the schematic from the board.

    The output of the BTM835 module is indeed differential, and all 4 of those lines go through capacitors.  However, the other side of those capacitors do not go directly to the TPA3116.  Instead, they are fed into a dual op-amp, which is providing some gain, but also converting the single to single ended.  This circuit is powered from a 12V LDO(which means it'll run lower if the main input is 12V), with the audio biased to 6V so a single ended supply could be used.  I am not sure why they convert the audio to single ended, given that the TPA3116 has a differential input(which can be used single ended.  Perhaps the output of the bluethooth module was not enough, though with a configured op-amp gain of only 1.3x, I'm surprised.

    The output of the op-amps go to the not populated connector marked L - GND - R, and then under the heatsink.  I can see the traces connect to some ceramic capacitors, but I cannot confirm if they connect elsewhere.

    Measuring the output of the op-amps with a scope, I saw that the audio gets to about +/- 750mV, with a 6V common mode.  This 1.5Vp-p is pretty much line level, though the 6V common mode offset means it wouldn't be a good idea to directly use this signal as a line out from the bluetooth receiver.(though could be fed through capacitors to go out)

    The end result of this is that I can easily install a potentiometer as a volume knob, after the op-amp.  I separated the op-amp output from the amplifier input by cutting the bottom side traces.  Given the 6V common mode, I wired one end of the pot to the 6V rail, the other to the op-amp output and the wiper to the amplifier input.

  • Initial testing

    Quinn12/24/2018 at 06:46 0 comments

    I did some initial testing with the amplifier board, wiring in some speakers on the bench to run the amplifier through it's paces.

    The board is a simple 2 layer design with most traces on the top side..  There were some lose solder balls on the board, so the quality is not the best.  The first board I got had the ferrite broken on one of the inductors, but the replacement was fine.

    Speaker outputs have screw terminals and are labeled.

    DC power input is labeled 12-24V with a barrel jack.  While not labeled, it is center positive.

    There are 3 tact switches for bluetooth control.

    Amplifier section

    In theory the board is based on a pair of TI TPA3116 class-D amplifier chips, each doubled up to provide a 100w channel.  I did not pull off the glued on heat sink to look, so I can't guarantee they are genuine parts, but it seems to work pretty good.  The output is very powerful given how little power this module takes, barely getting warm.  There is some hiss when there is no signal source, pretty typical for low cost consumer audio.

    Bluetooth section

    The Bluetooth interface is handled through a BTM835 bluetooth module which is soldered on the board.  I couldn't find much information about the module, except for this document which I think was part of a legal filing.  It at least includes a pinout, and seems accurate.

    The range is not the best, as indicated in some of the product reviews.  I could always maintain a solid connection with my phone within about 16 feet.  Past this, connection depended on who or what was in between, and other factors I couldn't be sure of.  Sometimes I could maintain a connection through walls and people about 30ft, other times it broke up around 16.  I may try to connect in the wifi antenna in place of the PCB trace antenna on the module, but that may be more than I want to put in the project.

    The play pause button worked as expected.  The skip back/volume down button and skip forward/volume up button were different.  pressing and releasing causes a track to be skipped.  Holding the button for a second changes the volume. 

    Noise

    When powered on or off, there can be notable speaker pops, which is not good.  I will need to see what can be done about this.

    With the bluetooth interface, it will play a connection tone when it is initially made.  This is fairly loud, much more than one would want.  This complaint can also be see in product comments.  When adjusting the volume from my phone, there were also beeps each step.  While I can see the desire here, to offer feedback, they can be annoying, and won't work for my application of setting up audio for a room.  These will also have to be worked around.

View all 5 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates