Controlling the volume of a speaker with a digital potentiometer?

Good afternoon,

I am developing a digital FM radio alarm clock and I want to use it without any button but with a remote IR control.

I was wondering which could be the best way to implement the volume control without having a physical potentiometer to move.

I use the output of a TEA5767 FM radio chip into an LM386 module audio amplifier and the amplified audio signal is connected into a 4 Ohm 3W speaker.

I saw that there are some serial digital potentiometers: can this be a good idea for my puropose? My main concern is about to find a digital potentiometer that can handle the voltage of the signal I need to manage.

What do you think about that? I believe this is just only one option to manage my goal, do you have any better idea?

Many thanks!

Replace the input potentiometer in this circuit by a digital pot. Vin is the output from the radio IC, which will be less than 1V. You’ll need one pot for each channel if you’re using stereo.

EDIT: Here’s a dual 10K digital pot with a log taper - should do nicely.

LM386.JPG

johndg: Replace the input potentiometer in this circuit by a digital pot. Vin is the output from the radio IC, which will be less than 1V. You'll need one pot for each channel if you're using stereo.

|500x327

EDIT: Here's a dual 10K digital pot with a log taper - should do nicely.

Many thanks!

Actually, I forgot to tell that I have this chip in a kind of shield format:

[img width=240 height=240 alt=LM386 SMD Audio Amplifier Module at Rs 75/piece | एम्पलीफायर मॉड्यूल - Ametek Electronics, Mumbai | ID: 20619573891]https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRTAeaW3SPztiYZTxsXV9GXISURe2zkPrGuog&usqp=CAU[/img] Should I still be able to use your solution with this kind of shield?

Many thanks!

muse_force: Many thanks!

Actually, I forgot to tell that I have this chip in a kind of shield format:

Please post a link - I don't know what that is. A link to the other board (if there is one) as well.

johndg: Please post a link - I don't know what that is. A link to the other board (if there is one) as well.

Many thanks!

Here is a link to the board:

https://www.openimpulse.com/blog/products-page/product-category/lm386-audio-amplifier-module-high-gain/

As you can see it is just the amplifier with some resistors, capacitors and a trimmer to adjust the gain.

What do you think about that?

Many thanks again.

Muse - many people that write about digital potentiometers fail (ie. a fail on them and their part) to mention certain limitations associated with them, such as - as far as I know - the voltages at the two end-terminals must be chosen to be within 0V and 5V levels (or something like that).

There are often certain details left out from articles about digital potentiometer - as in they can't be used for every situation in the same way as regular classical/analog potentiometers. In fact, they probably shouldn't even call them digital potentiometers.

No problem. Connect one channel audio out to H0 of the pot IC; L0 of the pot IC, radio board GND and amplifier board GND (pins 1 & 2) to common GND; WA0 of pot IC to amplifier input (pin3). Turn volume control on amplifier board to full volume. Same idea for the other channel. Don’t know whether you can make out the horrible pencil scribble I snapped with the horrible camera on this laptop, but I tried!

LM386_B.JPG

johndg: No problem. Connect one channel audio out to H0 of the pot IC; L0 of the pot IC, radio board GND and amplifier board GND (pins 1 & 2) to common GND; WA0 of pot IC to amplifier input (pin3). Turn volume control on amplifier board to full volume. Same idea for the other channel. Don't know whether you can make out the horrible pencil scribble I snapped with the horrible camera on this laptop, but I tried!

|500x231

Many thanks!!

Do you think I may have issues for the limit of 5V that many digital pots have?

Southpark: Muse - many people that write about digital potentiometers fail (ie. a fail on them and their part) to mention certain limitations associated with them, such as - as far as I know - the voltages at the two end-terminals must be chosen to be within 0V and 5V levels (or something like that).

There are often certain details left out from articles about digital potentiometer - as in they can't be used for every situation in the same way as regular classical/analog potentiometers. In fact, they probably shouldn't even call them digital potentiometers.

Many thanks.

I have read something like you are saying about digital potentiometers. So I was concerned about using one for this application.

But I think that the schematics posted here should work because I don't think that the output voltage of the Radio module exceeds 5V.

What do you think about that?

Many thanks again.

Southpark:
There are often certain details left out from articles about digital potentiometer - as in they can’t be used for every situation in the same way as regular classical/analog potentiometers. In fact, they probably shouldn’t even call them digital potentiometers.

“Digital volume controls” would probably be more appropriate.

muse_force:
But I think that the schematics posted here should work because I don’t think that the output voltage of the Radio module exceeds 5V.

The problem relates to whether the “digital potentiometer” can handle negative voltages where the audio input is centred around ground.

If it cannot, you have to provide a decoupling capacitor on the input and possibly, a high value bias resistor or resistors to centre its input voltage on half its supply voltage. You would generally expect to have a decoupling capacitor on its output anyway, supplied in the following amplifier but the LM386 does not require this and the module has a grounded potentiometer as well so you would have to provide that second decoupling capacitor - and preferably remove the potentiometer on the module.

In the case of the MAX5408 cited, it expects a signal centred on ground, so does not need the decoupling capacitor, but its input is strictly limited to not 5 V, but no more than 300 mV positive or negative.

It is indeed, a digital volume control and by no means a general purpose “digital potentiometer”. :astonished:

muse_force:
Do you think I may have issues for the limit of 5V that many digital pots have?

Just read the datasheets. Radio chip (first pic) has a maximum audio output (AFL, AFR) of 940mV (datasheet p24).
Digital pot chip (second pic) has a maximum input on any analog signal pin of VDD +0.3V (datasheet p2), which in this case is 5.3V.
I checked before suggesting it.

.

Digital pot chip p2.JPG

Most welcome muse_force!

I totally agree with what Paul_B mentioned. I agree that they should have called it digital volume controller or something. This means, you use this device to select a particular volume level that you wish to have, and then the output of this device is then interpreted or processed by some other hardware in order to output audio waveform at the desired level.

Potentiometers (classically) allow the two ends of the potentiometer to have pretty much any voltage (within safety limits and things like that of course, and within power handling capabilities etc). And they can be used as general-purpose voltage divider (as there's a range of potentiometers having different resistances to suit an application) ...... quite versatile.

But those other devices --- what they call 'digital potentiometers' are not like that at all. They're not a one-for-one swap for an actual 'potentiometer'.

johndg:
Just read the datasheets. I checked before suggesting it.

I just read them again myself. The radio chip doesn’t specify a maximum output current on the audio outputs, but it looks as if it could exceed the input current limit for the pot chip. Might need a bit if re-thinking tomorrow. Don’t order any yet.
I’ll continue to call it a “potentiometer”, because that’s what it is, log scale or not.

EDIT: Just spotted that the amplifier chip has a maximum input of +/- 0.4V, so need to pot the radio chip output down (and/or AC couple it). (Think the current will be ok. 0.94 / 5000 (10k || 10k) is only about 200uA).

Right - I’ve had (yet) another read through the datasheets, and I think this does the trick (just showing one channel):

The output of the radio chip (VAF) is in the range 0 to +940mV. This “sees” a minimum resistance to ground of 10K (from the digital pot) in parallel with the divider resistors to the right of the pot (upper: 10K, lower: 18K), which gives
(10K x 28K)/(.10K + 28K) = ~7.4K, so the maximum current through the digital pot will be 0.940/7400 = 127uA.

The 10K…18K divider brings the maximum voltage range down to 0 to +0.940V x 18K/(10K+18K) = 0 to +600mV.

The capacitor, 100nF, blocks the DC and the following 100K resistor shifts the range to +/-300mV. This is assuming we take the trimpot on the radio board out of circuit.

The trimpot is through-hole mounting, so even with plated-through holes, it should come off quite easily. It may be possible to just cut the ground plane around the bottom end of the trimpot, but we can’t see the top side of the board, so no idea where the tracks run. When the pot has been removed, it should be replaced with a link so that pin 3 of the connector goes directly to the input of the IC.

The amplifier chip input resistance is a bit low, at 50K, but I think it should be OK.

Any comment regarding improvements, errors or omissions gratefully received.

johndg:
Right - I’ve had (yet) another read through the datasheets, and I think this does the trick (just showing one channel):

The output of the radio chip (VAF) is in the range 0 to +940mV. This “sees” a minimum resistance to ground of 10K (from the digital pot) in parallel with the divider resistors to the right of the pot (upper: 10K, lower: 18K), which gives
(10K x 28K)/(.10K + 28K) = ~7.4K, so the maximum current through the digital pot will be 0.940/7400 = 127uA.

The 10K…18K divider brings the maximum voltage range down to 0 to +0.940V x 18K/(10K+18K) = 0 to +600mV.

The capacitor, 100nF, blocks the DC and the following 100K resistor shifts the range to +/-300mV. This is assuming we take the trimpot on the radio board out of circuit.

The trimpot is through-hole mounting, so even with plated-through holes, it should come off quite easily. It may be possible to just cut the ground plane around the bottom end of the trimpot, but we can’t see the top side of the board, so no idea where the tracks run. When the pot has been removed, it should be replaced with a link so that pin 3 of the connector goes directly to the input of the IC.

The amplifier chip input resistance is a bit low, at 50K, but I think it should be OK.

Any comment regarding improvements, errors or omissions gratefully received.

Many thanks for your reply!

So I have to remove the trimpot which adjust the gain of the LM386 chip from the amplifier module board, right?

If we set it to its minimum will we be out of the accepted range?

Many thanks again for your precious and useful help!

muse_force: So I have to remove the trimpot which adjust the gain of the LM386 chip from the amplifier module board, right?

Right.

muse_force: If we set it to its minimum will we be out of the accepted range?

If it is turned to minimum there will be no sound at all from the speakers. If it is turned to any other value, it will interfere with the operation of the volume control circuit. At best it will greatly reduce the output volume. Afraid it's got to go!

johndg:
Right.

If it is turned to minimum there will be no sound at all from the speakers. If it is turned to any other value, it will interfere with the operation of the volume control circuit. At best it will greatly reduce the output volume. Afraid it’s got to go!

Good evening,

Just some updates.

I’ve received the 4 Ohm 3 Watt speaker. So, I connected it to the amplifier board and the amplifier board to the radio module.

I’ve tried some trimpot position and it must be close to zero to avoid clipping of the speaker.

The audio quality is very poor and the number of station is very low. There are a lot of click and pops.
I have tried to power the whole circuit with a 9V battery but nothing has changed.

I’m close to order the digital potentiometer.

I’ll try to change the sketch to see if the poor quality is depending from some bugs in the software.

What do you think about that?

Many thanks, I’ll keep you updated!

muse_force: I've tried some trimpot position and it must be close to zero to avoid clipping of the speaker.

The audio quality is very poor ...

The radio output (up to 940mV, all positive) isn't what the amplifier is expecting (+/- 300mV max). Try the circuit I suggested, but without the digital pot. Connect the radio output to the top end of the 2 resistors making the voltage divider, and include the capacitor. I can't comment about the radio reception, except maybe it needs a better antenna?

muse_force: ... I have tried to power the whole circuit with a 9V battery ...

DO NOT DO THIS WITH the digital pot chip. If the supply is more than 6V the magic smoke will come out.

10k digital pot should work to replace the input pot of the LM386 circuit.
Here’s a code example

There is , however , one caveat:
You said :

I use the output of a TEA5767 FM radio chip into an LM386 module audio amplifier and the amplified audio signal is connected into a 4 Ohm 3W speaker.

Yet I don’t see any radio output amplitude information in your post .
We need to know what the ac voltage is on the output of your radio chip and additionally, the LM386 input pot needs a 1uF non polarized cap in series to couple AC and block DC.
That being said, if you post that information it should be possible to ascertain whether the above suggestion is valid
or not.

l

LM386.JPG