First time using a Voltage Regulator sanity check, plus decoupling capacitors questions

Thread Starter

bignobody

Joined Jan 21, 2020
97
Hi! I've only soldered a few circuits before. Tomorrow I am planning on building a mono audio amplifier with a LM386 IC. I've a thread about it here (including a link to the schematic I am working from) https://forum.allaboutcircuits.com/threads/166673

The schematic uses a 9V battery, but I'd rather use a "wallwart" power adapter instead. This is fairly new territory for me - I've mostly just been using 9V batteries so far.

Based on the research I've done, my plan is to connect a 12V AC to DC power adapter to my circuit with a 2.1mm DC barrel jack and then to a L7809 Voltage Regulator.

My understanding is that you need to use a higher value adapter than regulator, because the regulator needs a couple of volts to turn on (read: a 9V regulator won't work with a 9V adapter).

Positive connection from the barrel jack goes to the Input pin of my L7809 Voltage Regulator.

Ground pin of the L7809 to ground connection of the barrel jack (I'll probably go through an on/off switch first).

L7809 Output pin should then have a nice regulated 9 Volts to supply the LM386 and other components of my circuit.


Most sources I studied recommend a 0.33uf capacitor between the L7809 Input and Ground pins and a 0.1uf capacitor between the Output and Ground pins to "smooth out ripples". That seems straight forward enough.

Now, the Amplifier schematic also calls for some decoupling capacitors near the power source, specifically a 100uf and a 0.1uf to filter out low and high frequency noise from the power supply.

Should I put the noise filtering capacitors before or after the voltage regulator?

My intuition tells me it probably won't matter much, except it might give the capacitors a bit longer life if I put them after the voltage regulator since they'll only be getting hit with 9V instead of unregulated 12V. But perhaps there are other considerations I'm not aware of...

Also, if I already have a 0.1uf capacitor between the Ground and Output pins of the L7809 to filter out the ripple, does that make the 0.1uf capacitor of the high frequency noise filter redundant?

Finally, a more general L7809 question - these legs are very long. Is it safe to clip off the excess after it's been soldered in place?

Thanks for reading! Any answers or relevant feedback/tips are most welcome.



Edit: corrected capacitor value from 0.033uf to 0.33uf
 
Last edited:

SamR

Joined Mar 19, 2019
5,031
The regulator does some smoothing as part of its regulation but putting caps in front doesn't hurt and any after depends on if the circuit is generating any unwanted ripple. Switching and such.
 

Wolframore

Joined Jan 21, 2019
2,609
Decoupling caps before and after is recommended but it depends on your application. I’ve seen them oscillate and refuse to work without them and other times they’re fine with minimums... the 1.5-2v drop is due to the pass transistor in the circuitry. There are other designs out there that minimize this using FET and PNP... excess Leads should always be clipped.

the node between output and ground pin is the same as after the regulator so without seeing your schematic yes it would be duplicating.

the input cap is used to provide extra current when there are immediate load demands to smooth out the supply... again depends on your circuit.

when in doubt add all the recommended caps... you may find it’s enough or not enough depending on your situation
 

BobTPH

Joined Jun 5, 2013
8,813
The capacitors shown in the amplifier circuit are there to counter the voltage drop caused by inductance of the wiring between the power supply and the amplifier. They are only effective if the are placed where the power wires come into the amplifier board.

And yes, you can and should clip the leads after soldering.

Bob
 

Thread Starter

bignobody

Joined Jan 21, 2020
97
Thank you, SamR, Wolframore and BobTPH for your responses. I look forward to building this with a little more confidence :)

The capacitors shown in the amplifier circuit are there to counter the voltage drop caused by inductance of the wiring between the power supply and the amplifier. They are only effective if the are placed where the power wires come into the amplifier board.
Sorry if this seems like splitting hairs here, but I interpret this to mean "place them after the voltage regulator", because that's effectively where the power wires come in to the amplifier circuit. Is this correct?
 

dl324

Joined Mar 30, 2015
16,846
The schematic uses a 9V battery, but I'd rather use a "wallwart" power adapter instead. This is fairly new territory for me - I've mostly just been using 9V batteries so far.

Based on the research I've done, my plan is to connect a 12V AC to DC power adapter to my circuit with a 2.1mm DC barrel jack and then to a L7809 Voltage Regulator.
You can do that, but you'll waste power in the voltage regulator. I'd just modify the LM386 circuit to operate from 12V.

Some wall warts don't have good regulation. In that case, you might need a voltage regulator and/or a capacitor.
 

Thread Starter

bignobody

Joined Jan 21, 2020
97
You can do that, but you'll waste power in the voltage regulator. I'd just modify the LM386 circuit to operate from 12V.

Some wall warts don't have good regulation. In that case, you might need a voltage regulator and/or a capacitor.

This threw me for a bit of a loop. The LM386 I am using has a max Supply Voltage of 15V, so I could operate it at 12V. But chances are the adapter won't have good regulation, so I'll need that voltage regulator anyhow. So then I'd be using a L7812 instead of L7809 with a... 14-16V adapter (if such a thing exists) instead of 12V to overcome the voltage drop on the Voltage Regulator and I'm right back to wasting power... Am I missing something?
 

dl324

Joined Mar 30, 2015
16,846
But chances are the adapter won't have good regulation, so I'll need that voltage regulator anyhow. So then I'd be using a L7812 instead of L7809 with a... 14-16V adapter (if such a thing exists) instead of 12V to overcome the voltage drop on the Voltage Regulator and I'm right back to wasting power... Am I missing something?
What you're missing is that if you buy a good 12V adapter, you don't need to regulate or filter.

LM317 voltage regulators are adjustable (using 2 resistors) from about 1.25V to a few volts below the input voltage.
 

Thread Starter

bignobody

Joined Jan 21, 2020
97
What you're missing is that if you buy a good 12V adapter, you don't need to regulate or filter.
LM317 voltage regulators are adjustable (using 2 resistors) from about 1.25V to a few volts below the input voltage.
This is clear. Thank you!
 

Thread Starter

bignobody

Joined Jan 21, 2020
97
You don't need regulation for the LM386. You do need filtering. Put the 100μF capacitor at the LM386 power rail.
Haha, well. This simplifies things a lot. Thank you.

12 V adapter to DC Barrel plug.
DC Barrel plug positive to decoupling capacitors.
Decoupling capacitors to L386, etc.
 

dl324

Joined Mar 30, 2015
16,846
12 V adapter to DC Barrel plug.
Just note the polarity of the adapter. Center positive is more common, but some can be center negative.

Second hand stores are often a source for inexpensive adapters. The ones in my area sell them for $2-4. Laptop supplies that will give you around 18V at 6 amps sell for $7-8.

Also note that the female connectors could also be 2.5mm ID.
 

Audioguru again

Joined Oct 21, 2019
6,674
Most sources I studied recommend a 0.033uf capacitor between the L7809 Input and Ground pins
No. "Most sources" did not read the datasheet! See my attachment from the datasheet.

Now, the Amplifier schematic also calls for some decoupling capacitors near the power source, specifically a 100uf and a 0.1uf to filter out low and high frequency noise from the power supply.
Should I put the noise filtering capacitors before or after the voltage regulator?
Also, if I already have a 0.1uf capacitor between the Ground and Output pins of the L7809 to filter out the ripple, does that make the 0.1uf capacitor of the high frequency noise filter redundant?
Yes. Obviously the voltage regulator replaces the 100uF capacitor at the input of the amplifier and the 0.1uF capacitor is already duplicated at the output of the voltage regulator.

Finally, a more general L7809 question - these legs are very long. Is it safe to clip off the excess after it's been soldered in place?
Most "legs" are supposed to be short. clip off the excess.

Sorry if this seems like splitting hairs here, but I interpret this to mean "place them after the voltage regulator", because that's effectively where the power wires come in to the amplifier circuit. Is this correct?
The voltage regulator should be very close to the amplifier, then only one 0.1uF capacitor is needed and works for both.

The LM386 I am using has a max Supply Voltage of 15V, so I could operate it at 12V.
Do not use a 4 ohm speaker, the LM386 will overheat and produce less output power than an 8 ohm speaker. Use an 8 ohm speaker. The datasheet shows that with a power supply voltage more than 9V then the LM386 output power does not increase much but the instead heating increases a lot.
9V supply, max output is 0.56W and heating is also 0.56W.
12V supply, max output is 0.66W but heating is 0.8W. You will not hear the small difference between 0.56W and 0.66W.

Use the 9V regulator. Some of my 9V AC-DC adapters produce 18V with no load which will blow up the LM386 when you turn down the volume.
 

Attachments

Thread Starter

bignobody

Joined Jan 21, 2020
97
Thank you, Audioguru, very thorough!

No. "Most sources" did not read the datasheet! See my attachment from the datasheet.
Yes, my mistake. 0.33uf, not 0.033uf. Thank you for this correction and for all the other corrections you made to the schematic.

Yes. Obviously the voltage regulator replaces the 100uF capacitor at the input of the amplifier and the 0.1uF capacitor is already duplicated at the output of the voltage regulator.
This was not obvious to a beginner like myself. Thanks!



Do not use a 4 ohm speaker, the LM386 will overheat and produce less output power than an 8 ohm speaker. Use an 8 ohm speaker. The datasheet shows that with a power supply voltage more than 9V then the LM386 output power does not increase much but the instead heating increases a lot.
9V supply, max output is 0.56W and heating is also 0.56W.
12V supply, max output is 0.66W but heating is 0.8W. You will not hear the small difference between 0.56W and 0.66W.

Use the 9V regulator. Some of my 9V AC-DC adapters produce 18V with no load which will blow up the LM386 when you turn down the volume.
Thank you. I intend to use an 8 ohm speaker and will go back to my original plan of using the L7809. Even if the LM386 doesn't strictly require it, you make a good case for it being the safer option.
 

dendad

Joined Feb 20, 2016
4,452
Generally, I just uses a couple of 10uF Tantalum caps on the regulator pins, and have made that my standard for years.
On your 12V supply, if it is an unregulated "analog" one, that is, a transformer, rectifier and capacitor, the unloaded voltage may be quite a bit higher than 12V.
If it is a switch mode version, it will be ok to use it as the regulation is good.
But, add power bypass caps at the amplifier in any case. I've found is a good practice to have a 100nF cap close as you can across the power pins of each IC, and a number of 10uF Tants around the circuit. A larger electro as well will not go amiss. Generally, the boards that I design for industrial control are over bypassed, but that has stood us in good stead and some of our boards are still in use over 30 years later.
 

Tonyr1084

Joined Sep 24, 2015
7,853
Have said this half a dozen times before - you can get 12 VDC power bricks from places like Xfinity. I sometimes stop in and ask for one of their power supplies that are used on routers. They're often 12VDC, 3A. Sometimes you can find one rated at 5A. And since they're used and they get them back all the time - they just toss them. So they usually have no qualms about giving me one or two at a time. But don't do it too often, they'll get the idea that they are worth something and start charging for them.
 

Audioguru again

Joined Oct 21, 2019
6,674
I forgot to ask why you need bass boost:
1) Is it because the speaker is cheap and/or is too small?
2) Is it because the speaker does not have an enclosure so the sound from its rear comes around and cancels bass from its front?
3) Is it because the enclosure is too small?
4) Is it because your signal source reduces its bass?

The bass boost is created by reducing higher frequencies. So the sounds of mid and high frequencies are 1/4 of the original 0.56W which is only 0.14W.
Actually, The LM386 with a 9V supply and an 8 ohm speaker has low distortion at half the power I am talking about.

Don't power an LM386 from 12V. It simply heats more without increasing its max output power much.
 

Thread Starter

bignobody

Joined Jan 21, 2020
97
Generally, I just uses a couple of 10uF Tantalum caps on the regulator pins, and have made that my standard for years.
On your 12V supply, if it is an unregulated "analog" one, that is, a transformer, rectifier and capacitor, the unloaded voltage may be quite a bit higher than 12V.
If it is a switch mode version, it will be ok to use it as the regulation is good.
But, add power bypass caps at the amplifier in any case. I've found is a good practice to have a 100nF cap close as you can across the power pins of each IC, and a number of 10uF Tants around the circuit. A larger electro as well will not go amiss. Generally, the boards that I design for industrial control are over bypassed, but that has stood us in good stead and some of our boards are still in use over 30 years later.
Thanks for the perspective and the suggestions, dendad! I will err on the side of more capacitors rather than less. I'm pretty sure the power supply is switching (because it's small).
 
Top