-
A deeper dive into the amplifier design
3 days ago • 0 comments
It has occurred to me that, in the Design Walkthrough, I never really explained how the amplifier itself works from an overall design perspective. I thought it would be useful to do that, so here we are.To understand why Amply is designed the way it is, we need to start with our desired result. At the output of the amplifier, we ultimately want to drive a certain amount of power into the speakers. Assuming that our desired power is 10W, and that the speakers have an impedance of 8Ω, we can calculate the required voltage and current using the following formulas:
This means that our amplifier has two distinct requirements: It needs to take our input signal (which, at full volume, is around 1Vrms) and amplify it to around 9Vrms, and it needs to be able to provide around 1.12A of current to the speakers.
In addition, we also want to:
- Present a high impedance at the input, so that we don't load down the Bluetooth receiver.
- Manage the amplification loop so that we can control its gain, and prevent it from distorting the signal or going into uncontrolled oscillation.
There is no single device that can do all these things at once, so we need to break down the problem into smaller pieces. Hence the use of an op amp, which provides the voltage gain, and a power stage, which provides the current gain. The op amp also has a very high input impedance, and can use negative feedback to control the gain and stability of the amplifier.
Voltage gain
As mentioned in the design walkthrough, the op amp is configured as an inverting amplifier. This is needed because, while the input signal includes both a positive and negative component, our amplifier is powered by a single supply, which means that the output can only swing in one direction relative to ground.
We solve this problem by creating a “virtual ground” at the mid-point of the supply voltage, and then allowing the output to swing around that point. The inverting configuration has the distinct advantage of allowing us to inject the virtual ground directly into the non-inverting input of the op amp, which means that we don't need to use a separate buffer stage to create this signal.
The gain of the inverting amplifier is determined by the ratio of the feedback resistor (RV1) to the input resistor (R1):
The negative sign indicates that the output is inverted relative to the input—for all practical purposes, we can ignore the sign in our application, so long as both the left and right channels are inverted in the same way.
In our case, the maximum possible gain with a 50kΩ feedback resistor and a 1kΩ input resistor is:
Current gain
While the op amp has no trouble providing the voltage gain we need, it really cannot provide more than a few tens of milliamps of current, which is nowhere near the 1.12A we need to drive the speakers. If we plugged its output directly into the speakers, the only sound we would hear is probably that of the op amp going up in smoke.
The power stage of the amplifier is responsible for providing the necessary current to drive the speakers. In our design, we use a Class AB push-pull configuration, which consists of two complementary transistor pairs (one NPN-based and one PNP-based) that work together to amplify the current. I have already mentioned how this works, so I don't want to spend too much time on it here.
The key point, however, is that the power stage primarily amplifies current, not voltage. As you can see here, we need to use two transistors for each leg of the push-pull stage because power transistors typically have a much lower gain than small-signal transistors like the 2N3904 and 2N3906. By using a compound pair, we effectively multiply the gain of the two transistors, which allows us to achieve the necessary current gain to drive the speakers. The Sziklai configuration is particularly advantageous in our case because it requires less base current than a Darlington pair, which means loading the op amp less and allowing it to operate more efficiently.
Stability
As the old saying goes, an amplifier is just an oscillator that hasn't started oscillating yet. In other words, if we don't manage the feedback and stability of our amplifier properly, it can easily go into uncontrolled oscillation.
In order to work as an oscillator, an amplifier needs to exhibit both a loop gain equal to 1 and a total phase shift of 360º around the feedback loop (called the Barkhausen criterion).
Our amplifier is unlikely to oscillate at audio frequencies, and probably not until well into the MHz range, but we still add a small capacitor in the feedback loop (C7) to ensure that the gain rolls off at high frequencies (around 80kHz in our case), which helps prevent potential oscillation issues and also prevents ultrasonic noise from being amplified and introducing unwanted artifacts into the audio signal.
We also add C9, which is a small capacitor connected between the output of the op amp and ground, to shunt high-frequency noise and reduce the amplifier's gain at very high frequencies. This helps tame parasitic oscillations and reduce RF interference, particularly from the Bluetooth receiver.
Moah powah!
Although Amply's 10W output is more than enough to annoy an entire house full of people, I imagine that at least some folks might look through the design and wonder if it's possible to achieve even more power.
By this point, I have hopefully made it clear that the output power is really just a function of the voltage and current that we can provide to the speakers. Therefore, if we want more power, we need to find a way to increase either the voltage or the current (or both).
It's interesting to note that, in our design, the op amp's output voltage is effectively the limiting factor of the maximum effective gain that our amplifier can achieve. The NE5532 can swing to within about 1.5V to 2V of the supply rails under light load, which means that with, say, a 12V supply, the maximum output voltage is only somewhere between 1.5V and 10.5V. Thus, there is always a non-negligible amount of headroom that we cannot use to drive the speakers.
A possible solution to this problem would be to explore the possibility of using a rail-to-rail op amp, which can swing much closer to the supply rails, and see if that allows us to achieve a higher effective gain. That's in the works, so stay tuned for updates on that front.
Even with a better op amp, however, we would still be limited by the maximum operating voltage. I don't think I know of any audio-class op amps that can operate at more than 40V, giving us a theoretical maximum output power of roughly 25W into 8Ω from a single-ended Class AB output stage, which is still a far cry from the hundreds of watts that commercial amplifier manufacturers love to advertise.
-
Drawing first smoke
6 days ago • 0 commentsIn the Design Walkthrough, I mentioned that the
R15resistor on the output stage of the amplifier was a compromise between the needs of the circuit and the available board space. Good design practice would have been to use two separate resistors, one for each branch of the push-pull output stage, but I wanted to fit everything on a 100×100 mm PCB to stay within the size for which most PCB manufacturers charge a flat promotional rate.In this update, I wanted to dig a bit more into this particular part of the circuit and show you that, even though a 0.33 Ω resistor may seem like an insignificant component, it is actually a critical part of the design.
Transistors are weird, man
Transistors are inherently “unique” devices: even if you pick two transistors of the same type, and even if they come from the same batch, they will have different characteristics—sometimes wildly so. This is because of the way they are manufactured: they are made by doping silicon with impurities, and the exact amount and distribution of these impurities can vary from one transistor to another.
To add to the problem, the characteristics of a specific transistor also change based on the operating conditions. For example, the gain of a transistor (the ratio of the output current to the input current) can vary with temperature, and it can also vary with the amount of current flowing through the transistor. Left unchecked, this not only makes it difficult to design a circuit that works reliably, but it can also lead to a phenomenon called “thermal runaway,” where the transistor gets hotter, thus increasing its gain, which in turn causes it to draw more current, which makes it even hotter, and so on until the transistor is destroyed.
Thus, the golden rule of transistor circuit design is that the reliability of the circuit does not depend on the characteristics of the transistors; instead, the passive components around them are designed to ensure that the circuit operates within a specific envelope, is stable, and so forth.
Degenerates live in your circuit!
One of the most common ways to ensure that a transistor operates within a specific envelope is to use a technique called “degeneration.” This involves adding a resistor in series with the emitter (for a BJT transistor) or the source (for a MOSFET) of the transistor. (The term “degeneration” comes from early vacuum tube and transistor amplifier theory, where it referred to a mechanism that degrades or reduces the gain of an amplifying device through feedback.)
The resistor creates a voltage drop that is proportional to the current flowing through the transistor. This means that if the current increases, the voltage drop across the resistor also increases, which in turn reduces the voltage across the transistor and thus reduces its effective gain. This negative feedback mechanism helps to stabilize the operating point of the transistor and makes it less sensitive to variations in its characteristics. Obviously, the resistor also limits the maximum current that can flow through the output stage and dissipates power of its own, so you typically choose a small value: large enough to prevent thermal runaway, but small enough not to waste too much power or reduce the efficiency of your circuit.
(Note that this is not the same kind of “negative feedback” that is commonly used in amplifier design, where a portion of the output signal is fed back to the input to reduce distortion and improve linearity. Degeneration is a form of local negative feedback that is applied directly to the transistor itself, rather than to the overall amplifier circuit.)
In general, you want each branch of the push-pull stage to have its own degeneration resistor so that each output transistor can be stabilized independently. In our case,
R15is therefore not a true degeneration resistor; instead, its role is primarily to provide a small amount of current limitation to the output stage, preventing thermal runaway through the simple mechanism of limiting the maximum current that can flow through the output transistors. This is not ideal, but it still works.How bad of a compromise is it?
The next obvious question is: how bad of a compromise is it to use a single resistor for both branches of the push-pull stage? Can we just do away with
R15altogether and save even more board space?This is not the kind of question that can be answered with a simulation, because there really is no practical way to simulate the thermal behavior of the circuit accurately without expensive tooling. Thus, the only way to put this to the test is to build the amplifier and see how it performs in the real world.
…which is exactly what I did! I built a version of the amplifier without
R15, and the results were thoroughly underwhelming: the amplifier worked perfectly fine, without any distortion that I was able to detect and with no explosions or fire (always a good thing).However, the nature of this problem is that it is not deterministic: one amplifier may work perfectly fine if the transistors happen to have characteristics that are well matched, while another amplifier may fail spectacularly if the transistors happen to have characteristics that are not well matched. In other words, the fact that one amplifier works without
R15does not mean that all amplifiers will work withoutR15.…and so, of course, I decided to build another prototype to see if I could get a different result. This time, the amplifier did not work at all: the output was very distorted even at low volumes, and the transistors got very hot very quickly. I was not quick enough to turn off the power, and the entire output stage was destroyed in a literal puff of smoke, taking the USB-C power supply with it.
Therefore,
R15is here to stay; in fact, I suspect that I will bring back the second degeneration resistor in the next revision of the board. I will have to find a way to fit it in, but I think it is worth the effort to ensure that the amplifier is reliable and can be built with a wide range of transistors without any issues.Despite the awful smell of magic smoke, I am actually glad that this happened, because it is a great example of why it is important to follow good design practices and not take shortcuts, even if they seem like they will work in theory. It also shows that sometimes, the only way to really understand how a circuit works is to build it and see what happens in practice.
-
Design walkthrough
05/06/2026 at 04:41 • 0 commentsAmply uses a very common design—in fact, the project constraints more or less require the use of a fairly old-fashioned amplifier topology that is far less common in modern designs.
Basic design philosophy
Despite its low price tag, Amply was not designed primarily to minimize cost. In several places, the design is intentionally conservative in order to maximize performance and reliability. The idea is that you should be able to assemble the amplifier with minimal technical knowledge and still end up with something that sounds great and is built to last.
In practice, a fair number of components can be omitted while still producing a perfectly good-sounding amplifier, if at the cost of reducing the design's safety margins and potentially resulting in an amplifier that is less robust or more prone to instability or failure.
For those feeling particularly adventurous, I will point out which components are required for basic operation and which ones can probably be omitted without too much risk.
Power
Amply can be powered either from a DC supply between 9 V and 30 V or from a USB-C power supply. In the latter case, any USB Power Delivery (USB-PD) profile of 9 V or higher will work.
Using USB-C power requires a small USB-PD trigger module that negotiates the appropriate voltage from the power supply. I use a generic module purchased from AliExpress, which cost about $1.30 at the time of writing.
A pair of Schottky diodes (D1 and D2) prevent backfeeding between the two power sources and provide reverse voltage protection. They also introduce a small voltage drop—typically around 0.3 V—but ensure that the amplifier is protected if both power sources are connected simultaneously or if the user commits a wiring “oopsie.”
If you intend to power Amply from only a single source, the diodes are unnecessary and can be replaced with wire bridges to eliminate the voltage drop and slightly improve efficiency and available supply headroom. Likewise, if you do not plan to use USB-C power, the USB-PD trigger module can simply be omitted and the DC supply connected directly to the circuit.
Single-rail woes
Audio signals are AC, which means the amplifier must be able to process signals that swing both positive and negative. One of Amply's design constraints, however, is that it operates from a single positive supply rail for the sake of simplicity.
To work around this limitation, the amplifier creates a virtual ground at half the supply voltage and references the audio path to that midpoint. With a 12 V supply, for example, the signal reference point sits at 6 V above the negative rail. This allows the amplifier to process signals that swing both above and below the midpoint, effectively providing up to roughly ±6 V of signal swing in theory.
The upside of this approach is a much simpler power supply design. The downside is that the available output voltage swing is reduced compared to a true split-rail supply, which in turn limits the maximum output power. For Amply's intended use case, this is a perfectly acceptable tradeoff.
The virtual ground is generated using a simple voltage divider (R3 and R4). In this amplifier topology, the midpoint reference only supplies very small signal-level currents associated with the op amp input and feedback network, so there is no real need to buffer it with an active circuit despite its relatively high impedance.
I also added a 10 µF capacitor (C17) to reduce noise and lower the AC impedance of the reference node. Realistically, the amplifier would probably still function perfectly well without it.
5 V regulator
U2 is a bog-standard 5 V linear regulator that provides power for the Bluetooth module. Since the Bluetooth circuitry only draws a modest amount of current, a simple linear regulator is perfectly adequate here, provided the input voltage is not excessively high.
The LM7805 can technically tolerate fairly high input voltages, but power dissipation quickly becomes a concern as the supply voltage increases. For example, with a 30 V input, even a relatively small load current can cause the regulator to dissipate well over a watt of heat.
For supply voltages above roughly 15 V, I would recommend using a drop-in switching-regulator replacement instead of a conventional LM7805 in order to reduce heat dissipation and improve efficiency.
Bluetooth module
The Bluetooth module used in Amply is an MH-M18, a common and inexpensive Bluetooth audio receiver that I found on AliExpress for around $1.
If you do not want Bluetooth support, you can omit the module and all of its associated circuitry entirely—including the 5 V regulator—and connect your audio source directly to the amplifier input instead.
If you do decide to use Bluetooth, the module also supports several control buttons for functions such as play/pause, next/previous track, power, and volume adjustment. These buttons all connect to a single input pin on the module, which uses a simple resistive ladder to determine which button is being pressed based on the measured voltage level.
Personally, I find these controls unnecessary—I already have a computer nearby—so I usually do not bother connecting them. If you want to use them, however, the board provides headers at J6, J7, J8, and J9 for that purpose.
If, like me, you do not care about the external controls, you can simply leave those headers unconnected and omit resistors R9, R10, and R11 entirely, since they serve no purpose otherwise. In that configuration, the module powers up automatically and is immediately ready for pairing.
The MH-M18 works well and, importantly, does not include the obnoxious “announcer” voice prompts found on some cheap Bluetooth modules. If you have trouble finding this exact module, nearly any Bluetooth audio receiver with a similar pinout and feature set should work. Just make sure to verify compatibility before wiring it into the rest of the circuit.
Amplifier
The two amplifier channels are identical, so I will only discuss one of them here.
The input signal (
R_IN) is AC-coupled through C3/C4 into R2. These capacitors block any DC offset present at the input, while R2 works together with RV2 to determine the gain of the op amp stage, which can be set anywhere between 1 and 50. In practice, a gain of around 20 is usually sufficient for most applications, but you can adjust it to your liking.U1B is configured as an inverting amplifier, which works particularly well in this design because it allows the virtual ground reference (
VREF) to be connected directly to the non-inverting input. This avoids the need for an additional active buffer stage to generate a low-impedance midpoint reference.You will also notice the presence of C8 in parallel with RV2. This is a compensation capacitor that reduces the amplifier's high-frequency gain. At low frequencies it behaves essentially as an open circuit, and, therefore has little effect on the audio-band gain; at higher frequencies, however, it provides a lower-impedance feedback path that helps suppress oscillations and improve stability. The exact cutoff frequency depends on the gain setting, but is generally well above the audio range.
Similarly, C10 shunts very high-frequency signals at the output to ground, helping reduce RF noise and improve amplifier stability. Both capacitors are somewhat conservative additions, and the amplifier might still function without them depending on layout and component tolerances.
The output of the op amp then drives the heart of the amplifier: the class-AB output stage. The output transistors are biased so that one side primarily handles positive output swings while the other handles negative swings.
Speaking of biasing, this function is handled by RV4, R8, C12, D5, and D6. The purpose of the bias network is to maintain a small voltage difference between the bases of the output transistors so that both sides remain slightly conductive even when no signal is present.
Without this small idle bias current, the transistors would both turn fully off near the zero-crossing point of the waveform. Since each transistor requires roughly 0.6 V before it begins conducting, this would create a small dead zone around the midpoint of the signal and produce what is known as crossover distortion.
RV4 and R8 establish a small current through D5 and D6, creating a voltage drop of roughly 1.2 V across the diode pair. This voltage approximately matches the combined base-emitter voltage required by the output stage and keeps the transistors just at the edge of conduction.
C12 provides a reservoir of charge that helps the amplifier maintain sufficient drive during positive voltage swings. Without it, the high impedance of the bias network would limit the amplifier's ability to swing cleanly toward the positive rail, resulting in increased distortion during large signals. The exact value is not especially critical; I chose 100 µF somewhat arbitrarily, and a much smaller value would probably work perfectly well.
Q3/Q7 and Q4/Q8 are the output transistors that actually drive the speaker. They are arranged in a push-pull configuration, with one pair primarily sourcing current during positive output swings and the other sinking current during negative swings.
Each side uses a pair of transistors because a single transistor would struggle to provide enough current gain to drive the speaker efficiently. By cascading two transistors together, the effective current gain increases substantially because the gain of each transistor multiplies with the other.
This configuration is known as a Sziklai pair, and it offers somewhat better linearity and lower voltage drop than the more common Darlington pair.
Without these capacitors, the speaker would be subjected to several volts of DC continuously, which would force the cone away from its resting position and rapidly heat the voice coil. The speaker would probably work for a little while—right up until it cooked itself to death.
The output capacitors are intentionally oversized in order to minimize their effect on low-frequency response. This seemed particularly worthwhile given that small desktop speakers already tend to struggle with bass reproduction. In practice, the capacitance could probably be reduced to around 2,200 µF without a dramatic impact on sound quality.
R15 provides a small amount of output isolation and current limiting, which helps improve stability and slightly reduces stress on the output stage under difficult loads. Ideally, a more sophisticated design would use separate low-value emitter resistors for each output transistor pair, but I ran into PCB space limitations and decided that this compromise is “good enough” for the intended application.
The speaker output is connected at J11. 8 Ω speakers are the ideal choice and will generally allow the amplifier to operate without heatsinking, provided RV4 is adjusted correctly to the highest value that minimizes crossover distortion. 4 Ω speakers will also work, but they require significantly more output current, increasing power dissipation in the output stage and making heatsinking more or less a requirement.
Higher-impedance speakers are perfectly safe to use as well, but the amplifier will produce less maximum output power into them, resulting in lower achievable volume.
Amplifier
The two amplifier channels are identical, so here I will only discuss one of them.
The input signal
R_INis fed through C3/C4 and R2. The capacitors block any DC offset from the input signal, while R2 works with RV2 to determine the gain of the amplifier, which is between 1 and 50 (in practice, a gain of around 20 is plenty, but your mileage may vary).U1B is configured as an inverting amplifier; this is a good choice for our use case, because it allows us to feed
VREFdirectly into the non-inverting input, which avoids the need for an additional buffer stage to create a low-impedance reference voltage. The output of U1B is then fed through R5 and C6, which form a low-pass filter to help reduce high-frequency noise and improve stability.You will notice the presence of C8 in parallel with RV2. This small compensation capacitor acts as an open circuit at low frequencies, so it doesn't affect the gain of the amplifier in the audio range, but it provides a low-impedance path for high-frequency signals well above the audio range (~64kHz), which helps to prevent oscillations and improve stability. Once again, you may be able to do without it, but I included it as insurance against potential stability issues. Similarly, C10 shunts high-frequency signals to ground at the output of the amplifier, and could probably be omitted as well.
The output of the op amp feeds into the heart of the amplifier: the Class AB output stage. Here, we want to drive each set of transistors Q3/Q7 and Q4/Q8 only when the signal moves away from the virtual ground; thus, a transistor is conducting only when the signal is “moving,” and when we are at rest, both transistors are off, drastically reducing the quiescent current required by the amplifier. This, in turn, reduces power dissipation and heat generation; if the transistors are biased correctly, Amply doesn't even require a heatsink under normal operating conditions.
Speaking of biasing, this function is performed by RV4, R8, C12, D5, and D6. The goal of the biasing circuit is to provide a small amount of current to the bases of the output transistors to ensure that they turn on quickly when the signal moves away from the virtual ground, but without providing so much current that they are conducting significantly at rest.
The basic idea behind this biasing circuit is that we want to keep the transistors just on the edge of conduction when there is no input signal, so that any swing in the appropriate direction will cause them to turn on and amplify the signal. If we didn't do this, there would be a noticeable delay between the input signal and the output, which would result in what is called “crossover distortion,” where the output signal is distorted around the zero-crossing point due to the transistors not turning on quickly enough.
To accomplish this goal, we use RV4 and R8 to create a small current—just enough to turn on Q3. This will also forward-bias D5 and D6, creating a ~1.2V drop across them, which in turn provides the necessary base-emitter voltage to keep Q4 just on the edge of conduction as well.
This leaves us with C12, which acts as a reservoir that helps the biasing circuit swing quickly during the positive peaks of the audio signal; without it, the biasing circuit would be too slow to respond due to the high impedance of RV4 and R8, resulting in distortion. The value of C12 is not critical; I chose 100µF somewhat arbitrarily, and you could probably get away with something much smaller.
Q3/Q7 and Q4/Q8 are the output transistors that actually drive the speakers. As you can see, they are arranged in a push-pull configuration, with Q3/Q7 handling the positive half of the signal and Q4/Q8 handling the negative half to minimize power dissipation.
We need pairs of transistors here because a single one would struggle to provide the necessary current to drive the speakers. By using two transistors, we achieve higher amplification because their current gain (hFE) multiplies together, allowing us to drive more current into the speakers with less input current from the op amp. This particular configuration is called a Sziklai pair, and it has the advantage of providing better linearity compared to the more common Darlington pair.
Finally, the output of the transistors is fed through R15 into C15 and C16, which block any DC offset from reaching the speaker. The two output capacitors are intentionally oversized to minimize their impact on the low-frequency response of the amplifier; this seemed particularly important given that desktop speakers tend to be small and therefore struggle to produce bass frequencies. You can probably reduce this value all the way down to ~2,200µF without too much impact on sound quality.
R15 serves as an emitter degeneration resistor to help stabilize the transistors. As the output current increases, the voltage drop across R15 increases, which in turn reduces the base-emitter voltage of the transistors, providing negative feedback that helps to prevent thermal runaway and improve linearity.
Normally, you would have two resistors here—one for each transistor pair—to maximize the benefits of emitter degeneration, but I ran out of room on the PCB, and so I decided to settle for a single resistor that serves both pairs. This isn't ideal, but it still provides some level of stabilization without adding too much complexity to the circuit.
This leaves with the speaker output, which is connected to J11. 8Ω speakers will work best, and with them the amplifier will likely not require any heatsinking, provided that you bias the circuit correctly by adjusting RV4 to the highest possible value that doesn't result in cross-over distortion. 4Ω speakers will work as well, but they will require higher bias current, which will increase power dissipation and will definitely require a heatsink. I don't recommend using speakers with an impedance higher than 8Ω, as they will draw less current and therefore won't be able to reach the same volume levels.
Marco Tabini