Close

Talking about circuits

A project log for Powerful Portable Speaker

with bluetooth

moritz-walterMoritz Walter 03/19/2016 at 13:1413 Comments

Now that the paint has dried, it's time to talk about circuitry.

Class AB vs Class D

No doubt, a class D amp would surely be more efficient and provide some additional hours of fine music plus would save some space in the housing for other cool things. But well, I still got several TDA2030A, throwing them away would also not be very efficient. Also, they offer superior THD, and the circuit is so simple I can just solder it to a perfboard.

Schematic source: ST datasheet for the TDA2030A from July 2011, page 4

Charging

Some of you may doubt that you can/should charge four LiPo cells with four cheapo TP4056 modules in a single application. I also had doubts, but my tinkerplementation works well so far. It's based on the tiny but powerful Axicom FP2 relays.

During charging, this simple circuit isolates each battery and connects it to its own TP4056 module using the two changeover switches of one Axicom FP2. All TP4056 modules share a common ground and charging power input, but of course only charge one cell each. The charging power input also magnetizes the coils of the relays, so when no charging voltage is applied, the relays fall back to their idle state, connecting all cells in series to power the amp with +/- 7.4 V or 14.8 V respectively.

I als made sure within the expected failure modes, there's nothing bad that can happen:

The circuit is damn simple, very cheap and can be assembled on a breadboard with ease. It charges four cells simultaneously with a total current of 4A max. Unfortunately, that's also the end of the benefits, downsides are that you have to charge in silence and the cells are unbalanced. So not very sophisticated.

LED charging indicator

The TP4056 has two open collector status indicator outputs for i.e. attaching LEDs. I figured I could use four RGB LEDs with common anode to indicate the charging status of each cell. While charging, a LED would light up red, once finished it would light up blue. The green remains unused for now.

Possible improvements

Have I mentioned the cells are unbalanced? That could be easily fixed by adding an Arduino to the project and configuring it to use some MOS-FETs and dummy load resistors to balance the cells while in use. The Arduino could also read the charging status from the TP4056 modules and display them in a bargraph or on a display, or instead of an Arduino something more powerful could be used, too.

Also, of course, there is still the option of adding a class D amplifier, as suggested in the comments. A class D amplifier would save a lot of space in the housing. That space could be filled with boost converters for higher sine power, or with a Raspberry Pi to do cool streaming stuff, and maybe a touch display, or just more batteries. Maybe I'll add all of those improvements in the future, we'll see.

Discussions

HP (@banjohat) wrote 03/21/2016 at 18:57 point

It's a nice idea circumventing all the 'tedious' work with multicell problematics. however, from an optimizing perspective.. weight?
I agree on the THD thing. the amp circuit looks really simple! those AB amplifiers should also be good in parallel providing even lower THD numbers..

  Are you sure? yes | no

Moritz Walter wrote 03/21/2016 at 19:16 point

Thanks! The circuit is not overweight, it's just undertall. Will post photos, soon! Threw in the THD thing because it was all I had :)

  Are you sure? yes | no

Jan wrote 03/22/2016 at 17:02 point

But let's be realistic here: THD numbers don't mean much here. We're talking about two broadband speakers in a (I guess) not throughly calculated plastics case. I assume you can't differentiate between 0,1% or higher (to a degree) THD values here :)

  Are you sure? yes | no

Moritz Walter wrote 03/22/2016 at 17:17 point

@Jan, you are right, it's not an audiophile design. But the bread loaf I used as a reference was very fresh, so I would not expect the housing to introduce any harmonic distortions.

  Are you sure? yes | no

K.C. Lee wrote 03/22/2016 at 17:55 point

Speakers (depending on design and how hard you drive them) are quite a bit higher than 0.1% THD nor do they have a flat response.  So in the end, they are the dominant factor on sound quality.

  Are you sure? yes | no

Eric Hertz wrote 03/22/2016 at 10:59 point

Wait, you can do AB-amps in parallel? Do I understand correctly? Thanks for that addition to the ol' experimentation-plans! (https://hackaday.io/project/8348-random-ridiculosities-and-experiments/log/34326-audio-amp-motor-driver-motor-polarity-oddities-parallelling-experiments-todo if you're interested). 

Mortiz: "THD...was all I had"... surely there's more... Think of all the switching noise, e-m and otherwise, you're not going to emit (nor draw)! The money saved, and I think you already mentioned the environmental impact of using that which already exists and needn't be transported via fossil fuels; transportation to both replace *and* dispose-of... Nevermind reducing the world-effects of semiconductor-manufacture... You're a friggin' humanitarian! ;)

  Are you sure? yes | no

HP (@banjohat) wrote 03/22/2016 at 12:30 point

have a look at this nice amp project: http://www.shine7.com/audio/pa100.htm

and this one: http://www.shine7.com/audio/jeff.htm

I was meaning to comment with these LM3886 chips anyway but I couldn't find them yesterday.. Beautiful circuits!

  Are you sure? yes | no

Moritz Walter wrote 03/22/2016 at 13:08 point

@esot.eric I've never seen someone using integrated AB amps in parallel until @HP posted this. I'm not sure it's a good idea. On the one hand you can of course have several "B" amps in parallel, which is what you'll find in most AB amps, on the other hand, since the IC also contains the "A" amp, the two "A" parts would work against each other, potentially resulting in HF output at best and magic smoke at worst. If the two A stages are perfectly matched  however... it *could* work in practice without *noticeable* trouble. Hum..

Ah, and I've never seen it like that. Thanks @esot.eric I feel much better now :)))

  Are you sure? yes | no

HP (@banjohat) wrote 03/22/2016 at 14:11 point

I can't comment on Moritz comment so I'll do it here.

I found this wikipediea (i know it's not the best of sources but hey)

https://en.wikipedia.org/wiki/Bridged_and_paralleled_amplifiers

and especially these lines:

"Each amplifier must have as little output DC offset as possible (ideally zero offset) at no signal, otherwise the amplifier with the higher offset will try to drive current into the one with lesser offset thereby increasing dissipation. Equal offsets are also not acceptable since this will cause unwanted current (and dissipation) in the load. These are taken care of by adding an offset nulling circuit to each amplifier."

and 
"The gains of the amplifiers must be as closely matched as possible so that the outputs don't try to drive each other when signal is present."

Which shouldn't be THAT hard to do using for example those 0.1% resistors mentioned below.. it would be interesting to measure the current vs mismatching parallel amps... oh well, that is an entirely different project ;)

  Are you sure? yes | no

Eric Hertz wrote 03/22/2016 at 13:50 point

Great info, thanks HP!

(BTW, HP... your name is REALLY HARD to '@', actually impossible... you might be missing messages left-n-right.)

Also found this link: http://www.ti.com/lit/an/snaa021b/snaa021b.pdf

They're suggesting 0.1% resistors ;)

Hrm, but no mention of the amplifier-class... and, in fact, now I'm realizing I need to refresh myself on their differences, thanks Moritz.

  Are you sure? yes | no

HP (@banjohat) wrote 03/22/2016 at 14:12 point

oh! I found that @banjohat will work ;) but I guess I'm about the only one that knows that...

  Are you sure? yes | no

Eric Hertz wrote 03/20/2016 at 12:06 point

Cool switching system for charging... maybe multi-cell Li-Ion charging isn't so scary after-all.

  Are you sure? yes | no

Moritz Walter wrote 03/20/2016 at 12:54 point

Thanks! Don't worry, *real* multi cell charging is still scary :)

  Are you sure? yes | no