Confused while replacing a potentiometer by a digipot

I have an old radio and I am trying to replace its manual volume control by a digital one. I have desoldered/removed the potentiometer. I would like to use an ESP32 connected to a digipot (MCP4018) instead. (see figure).


The sketch is working fine and the resistance between the digipot's wiper (pin 5 of MCP4018) and the GND can be controlled. However, I am confused on how to connect this setup to the wholes left from the potentiometer (see attached figure). I tried the wiper in OUT whole but it didn't work. Thank you.

Wiper goes to OUT.
Vss goes to GND.
A goes to IN.

Please keep in mind two things:
1: If your original pot was the volume knob, it was/is an audio taper, which means it's not linear, but exponential. Digital pots are as far as I know almost always linear. You will need to 'fake' the exponential part in the microcontroller (not difficult in itself) but you may run out of useful resolution at the top end of the scale. You'll have to experiment/find out for yourself.
2: Usually digital pots can only handle Vdd + 0.6V or so on any of their pins. If you run this one at 3.3V since your ESP32 also runs at 3.3V, you are limited to 3.8V signal on the input but also the wiper output pin. If you exceed that, you destroy the chip. So you need to know exactly and for sure that the circuit you transplant this chip into will meet this requirement.
Edit: the limit according to the MCP4018 is in fact Vdd+0.3V for the A, W and B pins. So you can't exceed 3.6V if you run the chip at 3.3V.

1 Like

Bottom end of the scale!

1 Like

what are the symptoms digipot "not working"

And so with A to 'IN' and B to 'GND'?

You're right, bottom end! My bad.

Thank you very much All for your suggestions. I will try them as soon as I solve a new issue : "Brownout detector was triggered" :slight_smile:

I just solved the new issue by powering the ESP32 from an external power source instead of the serial port. I will continue with your suggestions.

I meant that the sound was not heard.

It is working fine now. Thanks a lot!

so what was the problem

I updated the potentiomer replacement figure to the final working version for reference.

Remark: the digipot's end-to-end resistance is 10K however the replaced potentiometer's resistance was 50K. This limits the amp's max gain. I will open another topic for discussion.

Great!
The solution to your gain problem is simple: use a 50k pot.
Alternatively you could insert an amplification stage (e.g. a simple opamp buffer) in front of the pot.

1 Like

If the original pot was a simple signal divider, i.e the signal was coming in to A and going out from W, then 10k vs 50k should make no obvious difference. If however it was in feedback loop of OP amplifier then it matters. Can you give more details on make and model of the radio?

That's not true. It depends on the output impedance of the preceding stage. It may be a high-impedance stage (which is fairly typical if this is a volume control pot!) that has difficulty driving a 10k load. It's likely that using too low a value here will not only influence gain, but also frequency response.

Please do not.

Someone (such as myself :roll_eyes:) will then have to report the spurious "new" topic to a moderator to have it moved back and attached to this one in order for it to make any sense. :worried:

1 Like