Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Round off waveform edges from mosfet simulation

Status
Not open for further replies.
You are simulating with Mosfets that need a 10V gate-to-source voltage but your supply is only 5V. Then many Mosfets you use with those part numbers will not work. You should use Logic-level Mosfets since you use a logic level supply voltage.
 
I'm probably better just to ditch the whole idea and go for the LM386 amp since my speaker is 0.5W 8-ohm and with class D, the output (without 22 ohm resistor) is about 3W at 5V but intermittent? plus I read LM386 is doable when circuit is powered with batteries. Digikey made a write-up about it. As for mosfets, I should probably save them for large-speaker applications in which the power is delivered from a wall wart.

I already own alot of LM386's.
 
How did you calculate 3W? Power is the RMS voltage swing squared, divided by the speaker impedance of 8 ohms. 4.9V RMS squared= 24 and produces 3W in 8 ohms. But 4.9V RMS has a peak of 4.9v x 1.414= 6.93V and the peak-to-peak total swing is 6.93V x 2= 13.9V. The power supply must be a little more than 13.9V.

If the Mosfets are perfect and have no on-resistance then the output swing is 5V peak-to-peak but they are 10V Mosfets driven from only 5V so their output swing might be 4.5V but probably less. 4.5V p-p is divided by (1.414 x 2)= 1.59V RMS. Then the power in 8 ohms is 1.59V squared, divided by 8= 0.32W. This is less than 0.5W. If the volume is turned up way too high producing extremely distorted clipped squarewaves then the output power is doubled to 0.64W.

With a 5V supply, an LM386 produces 3V p-p when it begins clipping into 8 ohms which is 1.06V RMS. Then the power is 1.06V squared, divided by 8= 0.14W which is almost nothing.

People are buying an American class-D bridged amplifier IC on a pcb that produces 1.3W into 8 ohms with fairly low distortion when powered from 5V (2.5W with high distortion into 4 ohms). Look at the datasheet for the PAM8302A. The assembled amplifier is available cheaply from Adafruit, Aliexpress, ebay and Amazon and is here:
 

Attachments

  • PAM8302.png
    PAM8302.png
    480.8 KB · Views: 79
Well for analog the output always changes, and since one mosfet is only conducting at one time for a short period of time, that one time means power goes from +ve into one pin of the mosfet and out the other (I get my source and drain pins messed up unless I stare at datasheets for 24/7) but the point is while the top mosfet is on, power flows from +ve to ground through an inductor, capacitor, and speaker and to ground. If there was no inductor, then at hoigh frequencies we can assume capacitor is almost short circuit. So let's say 1 ohm. Then speaker is 8 ohms for resistance (assuming it functions like a resistor which it probably doesn't when running). Then 1 + 8 = 9. Now current = 5 / 9 =a bit over 1/2 amp. times 5 = 2.7W

Earlier on when I was playing with mosfets and it was overheating with 7.2 volts, It turned out I was drawing 7.2 / 9 = 800mA then multiply by 7.2 = 5.76W

Still 1/2 an amp is alot of power consumption but because I'm using batteries and off a 9V battery I'm already appreciating the results from the LM386, I'm gonna give that a shot.
 
Experimentation wise, I tested the audio on LM386 using laptop earphone as input at various different volume levels and yes I had to adjust gain levels to compensate and yes the volume on the amp is about 20%-50% louder compared to that of the laptop, plus the output was relatively clean.

On the other hand, I tried mosfets and the sound is more distorted on average but the volume didn't improve (probably because I used the wrong mosfets and possibly IC?)

But given the parts I already have on hand and quality of sound as well as being able to hear it from an acceptable 60cm distance for my application, I'll use LM386's for now and when I need more amplified sound, I'll use wall wart to deliver a higher voltage then I can make loud sound.
 
An amplifier output is AC, not DC. The output capacitor blocks the DC by charging to half the supply voltage. Then if the Mosfets and capacitor are perfect, the peak voltage across the speaker is 2.5V that produces a peak current of 2.5V/8= 313mA.
The RMS average current when the amplifier is at max undistorted power is 313mA x o.707= 221mA. The output power into 8 ohms is 221mA squared x 8= 0.39W, not 2.7W. A linear amplifier will heat with about 177mA more and a class-D amplifier designed properly will heat with only 11mA more.

By the way, an output capacitor resistance should be almost zero ohms except its reactance increases at very low frequencies, then your wrong calculation will be 5V/8 ohms= 625mA producing 3.13W.

The PAM8302A class-D amplifier IC datasheet shows a supply current of only slightly more than 100mA when its output is 0.5W into 8 ohms with a 5V supply. 5V x 100mA= 0.5W so there is very little heating.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top