Issue with digipot to set gain of op-amp

making a new post for cleanliness as the issue has changed.

Here is the link to the previous post: Digital potentiometer for adjustable op amp gain - #3 by noobmastha

So similar to as before if you saw my previous post I am using an ad5293 digipot to control the gain of an op-amp. I previously had a bias voltage for the op-amp to offset the signal. I removed this voltage and tried amplifying DC for a simpler test. However when I put 1V dc in I get 5V out even when I set the gain to 2 and have tried with different gain values and is still 5V on output

to calculate the gain I rearranged the gain formula for RF so RF = (G-1)*Rin where G is Gain RF is feedback resistor (digipot) and Rin is my input resistor (4.3K currently but designed for 2K).

After I have the RF value I use the formulas from the ad5293 datasheet and rearrange for D (the 10 bit spi code)

The rearranged I have as (-1024*RWA-1024)/RWB

So for example if I want to set the gain to 2

RWA / RF Calculation

RWA is equal to RF

Gain = 2

Rin = 4300

RWA = (2-1)*4300

RWA = 4300

SPI code calculation

(-1024*4300-1024)/20000 = -220

and then now i have the 10bit code you need to send 16 bit words. The first 2 bits are always 0 and then the control bits 0001.

So my binary that I send for this gain is 00 0001 0011011100

so overall I am unsure why this is at 5V as i no longer have the bias voltage for the offset so that is no longer being amplified. And I am just trying to amplify dc so the issues with sine wave clipping on negative due to single supply not being relevant.

Any help on this would be great.

Thanks,
Dean

It's an inverting amplifier, it won't work with +DC inputs.

Which "digipot" are you trying to use?
Some (many?) have one end at V_ss (GND).

sorry its the one above the opa184 the other 2 are for unrelated things

How is it inverting? isnt it exactly the same as this, as I have Rin connected to -in and RF (digitpot RH and RW) are connected the same as in the diagram and then I input my signal to the +in pin.

Any clarification would be great.

Edit: attached as file incase image isnt working cause cant see it from my end
non inv op amp

Thanks,
Dean

That's different from the schematic in your other post.
Is it the same opamp with a single 5V supply?

I see -- "No Caps", missed it.
AD5293. It's in the clear.
You've established your digipot foundation (placing the ohmmeter there, send data etc. for ohms up and ohms down)?

I think your math is wrong.
D = 1024-((Rwa/20K)*1024)

Same schematic with the 5V supply here is the image but unless I am being stupid I am sure this is a non inverting.
Only added the changes to reflect my bodge job, meaning no LV_Adj as i cut this track and the gnd on the otherside of the resistor.

Correct but you formula is wrong see post 8

yes I can control the digipot but hard to measure the resistance with DMM as its soldered to the circuit, and obvs when powered off there it doesnt keep the set resistance.

Do you have a derivation of this, cause I used an algebra solver so didnt think it would be wrong

It simple math

First look how single supply opamp amplifier should look, you need to bias inputs with half Vcc supply voltage (you could try only the opamp circuit first, with a trimer instead of digital pot and make sure it works as it should):
[Avoiding Op-Amp Instability Problems In Single-Supply Applications | Analog Devices]

1 Like

Also should add that I could see the voltage change when in potentiometer mode for the ones not relevant to the gain so I assume the hardware is correct, and atleast the code for potentiometer mode was correct

I think 99% of your problems is addressed by post #14

Rwa = 20K*(1024-D/1024)

Divide both sided by 20K:

(Rwa/20K) = (1024-D/1024)

Multiply both sides by 1024:

1024*(Rwa/20K) = 1024-D

Multiply both sides by -1:

-1024*(Rwa/20K) = -1024+D

Add 1024 to both sides:

1024-(1024*(Rwa/20K)) = D

I don't see any reason for starting this topic. You linked to the other and you should have worked it out there.

It's a non-inverting opamp circuit, no need for an offset.

1 Like

It'a a non-inverting opamp circuit, no need for an offset.