A Class D Operational Amplifier takes in some analog signal, converts it into a pulse width modulated (PWM) signal, amplifies that PWM signal through a MOSFET driver and switching MOSFETs, then outputs an amplified analog signal after a low pass filter. This class of amplifiers is far more efficient than a linear amplifier, and dispenses way less heat, but sacrifices some audio quality in the analog to digital and digital to analog conversions.
Generating a high frequency triangle signal using a 555 timer. Build the circuit as shown to the right, which will output a triangle signal with a frequency of about 270 kHz. The control voltage is set by the 10 nF capacitor attached to pin 5, which caps the frequency from exceeding 300 kHz. Both the 2.2k resistor and the 1 nF capacitor make for pretty fast rise and fall times, thus giving us a signal that is as triangular as possible. Make sure not to exceed 300 kHz if you choose to modify resistor/capacitor values. Use a larger capacitance at pin 5 if you seek to cap the frequency, or use larger resistances/capacitances for the elements attached to pins 2 and 6. Observe the specific pinout of your 555 timer online to ensure that everything is going in the right place.
Comparing your generated triangle signal with some input signal. Using an LM393 comparator chip, build the circuit portion shown to the right. One op-amp input must be the triangle signal, and the other the input signal. Ensure that both comparators have their inputs switched; that is, one should output a signal that is inverse to the other. Once again, use the LM393 pinout diagram available online to ensure you’re doing this properly. It is essential that you generate two signals that are inversions of each other, one high and one low. The high input should be that which the triangle signal goes to the positive input of the op-amp, but check each output to verify. I suggest checking using an oscilloscope on AC mode so that any DC offset is removed, so you can accurately assess which is the high input and which is the low input. Attach a 1k resistor across each output and the power supply, which will return a saturated output without dispensing too much current. The outputs of both op-amps at this stage should be a pulse width modulated signal.
This step is pretty straightforward, just build the circuit block seen to your right, ensuring that the high output of the op-amp goes to the high input of the chip, and vice versa for the low. I highly, highly, highly suggest using 12 volts as your maximum V_cc input, and having your lowest voltage be ground. Going below 0 volts or above 12 volts might lead to burnout, or worse, fire. These chips have a switch within them that will short and burn if too much current is driven through them. Your capacitors must not be below 0.1 uF. Ceramic or electrolytic work fine. Check your pin 5 voltage using a digital multimeter to ensure that it doesn’t differ greatly from 12 V – it should be around 11.4 V due to the diode before it. Both the high and low outputs will be around 12 V, so it is critical that the difference between pin 5 and the outputs isn’t too large or too small. We want to operate the forthcoming MOSFETs as switching transistors, which means they must be in their saturation regime. You can look up what those saturation values are for this specific transistor to make sure that you are within bounds.
Build the circuit block shown to your right, paying great attention to the pin scheme of the MOSFETs and the direction of the diodes. We want to prevent current flowing into the gates of the MOSFETs, and we want the source of the high MOSFET connected to pin 5’s output, which is then connected to the low MOSFET’s drain. It is imperative that you add 10k resistors before the drain of the high MOSFET and after the source of the low MOSFET to limit the current flowing through them. Do not, and I repeat do not, turn on these MOSFETs with the 12 V supply until you have added the resistors. Too much current flowing through the MOSFETs could damage them before you finish the circuit. At this point, check to see at the pin 5 connection junction what your output is. You should be getting a 12 V peak-to-peak, pulse width modulated signal.
We want to filter out frequencies higher than 20 kHz, which is the upper threshold for frequencies humans can hear. We will be doing this by building a low pass filter out of an inductor and a capacitor, taking the output at the capacitor. You can do this with an RC low pass filter as well, but I’ve chosen an inductor so as to limit the resistance load I’m attaching to the circuit. For an LC filter, the specific relationship between L and C to get the frequency above is (L)(C) = 6.33e-11 . If you don’t happen to have a 20 mH inductor and a 3 nF capacitor (which satisfies the relationship above) you can use the relation above to figure out what you need based on what you have. The more general form of this equation is (L)(C) = 1/[(2 pi f)^2], where f is your cutoff frequency. If you want to vary this frequency, use this general expression to determine the LC constant necessary. Build the circuit shown to the right if you want to take my method.
You’ll find that any input signals above 20 kHz are severely attenuated by the amplifier, which is fine, given that it is a human audio amplifier. Using a function generator, or a real audio signal, send in an analog sinusoidal curve that is at 20 kHz and 5 volts peak to peak. You’ll notice a signal like that to the right, which is amplified to 44 volts, and has a trace to it that emulates the input signal. What we’ve essentially done is generated an amplitude modulated output signal that carries the information of the input audio signal, but greatly amplified, and at much less frequency (only 2 kHz). You’ll notice that for smaller input frequencies the frequency of the output signal is pretty much preserved. Play around with input signals to see the traces of the AM outputs.