PWM output to a Digital Potentiometer

Thread Starter

Robert Gaskins

Joined Mar 9, 2017
5
I am working on this project that I need to replace the 4.7K Potentiometer Pot with a Digital Potentiometer that can be controlled with a PWM out put signal. I know how to run the Digital Potentiometer in a circuit that you hit a button to get it to go up/down in resistance. Were I am lost is how to get the PWM signal to act like a button going up or down in resistance on the Digital Potentiometer.

If needed... I can run the PWM to 0-10v analog and then run the Digital Potentiometer from the 0-10v?? Any help would be great..
 

OBW0549

Joined Mar 2, 2015
3,566
I'm not aware of any digital potentiometers that operate from a PWM control input; all the ones I've ever used have either a simple up/down interface or are set via SPI or I2C. Could you post a link to the particular digital pot you're referring to? That way people might be able to better help you.
 

Thread Starter

Robert Gaskins

Joined Mar 9, 2017
5
Ok I might be on the wrong track than.. What I know is:

I have a PWM or 0-10v output and I would like it to replace the 4.7K pot with. I tried to replace the pot with voltage from the 0-10v circuit that is being driven by the PWM. But it looks like the circuit that the pot is controlling needs to see the resistance from the pot not just the voltage. So I know that with a Digital Potentiometer it will work but how does one control the Digital Potentiometer? Or is their another way to fake the circuit that needs the pot resistance into seeing the resistance that it needs along with the voltage?

I hope this makes sense.
 

OBW0549

Joined Mar 2, 2015
3,566
Yes, it makes sense now.

The first step in solving this, before we do anything else, is to try to get a handle on how the circuit is using that 4.7k pot-- specifically, what voltages are on the 3 terminals of the pot as you vary it in normal operation, from full CCW, through center, to full CW. If you can measure those voltages, we can tell whether you can even consider using a digital pot to replace the 4.7k device. The reason is that nearly all digital pots are designed to operate from a +5V supply, and for nearly all of them, all three pot terminals absolutely MUST be kept at voltages between 0V and +5V at all times to avoid damaging the pot. If you measure voltages outside this range on the 4.7k, replacing it with a digital pot is not an option.

So start there.
 

Thread Starter

Robert Gaskins

Joined Mar 9, 2017
5
It reads 0-5.04v. It is pretty smooth as you turn the pot in how it climbs and lowers the voltage. Around half way I do get 2.5v. I attached the circuit that I tried originally to get it to work with. I swapped the 12v in the original circuit with the voltage going to the pot. So I was using the 5v going into the pot so I would not have a floating ground somewhere. I also swapped out the 10k pot with a 4.7k pot. Am I missing something and it does not need to see the resistance and my original circuit is wrong?
 

Attachments

OBW0549

Joined Mar 2, 2015
3,566
It reads 0-5.04v. It is pretty smooth as you turn the pot in how it climbs and lowers the voltage. Around half way I do get 2.5v.
I take it that's the voltage you read on the pot's wiper? What about the voltages on the CW and CCW ends of the pot? What are they? What do they do as you rotate the pot?

I attached the circuit that I tried originally to get it to work with. I swapped the 12v in the original circuit with the voltage going to the pot. So I was using the 5v going into the pot so I would not have a floating ground somewhere. I also swapped out the 10k pot with a 4.7k pot.
I have no idea what you're talking about here in this confusing explanation.

Am I missing something and it does not need to see the resistance and my original circuit is wrong?
I haven't the foggiest idea. Not a clue.
 

OBW0549

Joined Mar 2, 2015
3,566
In order to find out whether you can use a digital pot, we need to know the voltage on each pot terminal relative to circuit ground. That's what matters, NOT the voltage from one pot terminal to another.

By the way, what is all this for? What are you trying to do? Do you have a schematic for the device containing the existing pot? If so, please post it.
 

Thread Starter

Robert Gaskins

Joined Mar 9, 2017
5
I am using the PWM to control a spindle. Normally you can hook out the circuit that I posted before and they run 0-10v. But this is a brush less motor and had a completely different speed control. The only place I can think for to adjust the speed is from the pot.Because that is how you do it manual.

I will go and check out the ground to each of the terminals.
 

Attachments

MrChips

Joined Oct 2, 2009
34,807
Digital pots typically are controlled using a CLOCK signal and a UP/DOWN control signal. This would be a headache to interface with a PWM signal.

Your best bet would be to use a digital pot that is compatible with SPI. For this you would need additional circuitry best implemented in a microcontroller that will read the PWM signal and output SPI to the digital pot.
 
Hi Robert,

Did you find a solution?
I have the same problem here. A spindle that is controlled with a manual pot and I want to control it with the pwm port of grbl.
 
I have a similar question re digital pots and PWM control.

Didi you ever get an answer to your question?

Many model tanks include a sound control board which provides simulated sounds for the various tank operating modes - start - shut down - moving - gun firing - etc
I am trying to control a model tank sound volume control using a digipot controlled by a radio control receiver.
Normally tank sound controller board volume is controlled by a potentiometer mounted in or on the tank model.
In order to change the volume you need to stop the tank, open a hatch,or worse case disassemble the tank, to access the potentiometer.
I initially thought "this sounds simple". OOPS

There should be a solution => starting from the digipot going backwards:
- digipot to speaker
- digipot input control signal (SPI? its been a while)
- code that ties it all together
- Arduino / ESP32 / Raspberry Pi (A/E/R) output to the digipot
- radio control receiver PWM output to the (A/E/R)
- radio transmitter potentiometer pwm signal to receiver

My poor dumb mechanical brain got lost in the PWN to SPI code and never finished.
Tom Anderson
twa3372809@yahool.com
 
Top