Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Variable gain through a microcontroller

Status
Not open for further replies.

doncarlosalbatros

Full Member level 2
Joined
Nov 26, 2016
Messages
143
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
1,758
I have a sine signal Vsignal below which is AC coupled and will be buffered by an LT1490 to the line input of a MOSFET power amplifier.

Untitled.png


I'm able to control the frequency of the Vsignal through Arduino. But I also need to control the gain through Arduino.

What approaches is possible for a variable gain? Is there any dedicated IC for such purpose? I need a variable output between 0.25Vrms to 3Vrms for instance. I have no experience on such topic. Input to LT1490 will be fixed 500mV amplitude i.e 1Vpk-pk.


How about changing Rp with a 10k digital pot as below like a MCP41010? Does anybody have experience with such use? Would that be fine if I replace MCP41010 with Rp?

jqIdp.png

- - - Updated - - -

My freq. of interest if from 0.1Hz to 20Hz only.
 
Last edited:

The problem I see is that you are supplying the opamp with +/- 15 volt, such that its output swing will get close to those values. How close, depends on the opamp itself.

However, all the digipots I've seen can only accept a signal not larger than +/-5 volts.
Not used them for over a decade, so there may be devices which could accept a larger voltage swing.

Do you require that your second stage to be inverting? If not, tie the 1K resistor to ground and the input signal to the non-inverting input with the digipot in the middle configured as a normal potentiometer.
 

I can supply the digital pot by the Arduino 5V o4 3.3V pin. Wouldnt that be fine? I can use non inverting as well. In that case I just need to decrease the input b6 a voltage divider since input voltage is fixed ar 1Vpk pk. And I need a varying output between 0.25Vrms upto 4Vrms. Can you provide a diagram how you suggest for the digital pot connection?


The problem I see is that you are supplying the opamp with +/- 15 volt, such that its output swing will get close to those values. How close, depends on the opamp itself.

However, all the digipots I've seen can only accept a signal not larger than +/-5 volts.
Not used them for over a decade, so there may be devices which could accept a larger voltage swing.

Do you require that your second stage to be inverting? If not, tie the 1K resistor to ground and the input signal to the non-inverting input with the digipot in the middle configured as a normal potentiometer.
 

For lower frequencies (sub-MHz) you might find that a divider
ladder, and an analog mux to tap one point, offers you freedom
to set 2^N (probably 4, 8 or 16 for practicality) feedback
ratios. Using the mux to select, rather than in the network,
relieves you of the on-resistance concern (variability) though
you may still care about the distributed C, etc.

I expect it's also possible to find digitally controlled analog gain
blocks (believe I've seen intrumentation amps with logic controlled
gain points, although these may or may not be where you wanted).
 

For lower frequencies (sub-MHz) you might find that a divider
ladder, and an analog mux to tap one point, offers you freedom
to set 2^N (probably 4, 8 or 16 for practicality) feedback
ratios. Using the mux to select, rather than in the network,
relieves you of the on-resistance concern (variability) though
you may still care about the distributed C, etc.

I expect it's also possible to find digitally controlled analog gain
blocks (believe I've seen intrumentation amps with logic controlled
gain points, although these may or may not be where you wanted).

Would be great I need at least 100 steps of gain; my only limitation is the chips have to be DIP package.
 

I'm not sure I get the whole picture (where the signal is coming from) but in general:

1) Arduino drives a dac to generate the signal - can drive any amplitude it wants (if possible)
2) ADC -> Arduino -> DAC (full flexibility but adds delay/bandwidth/precision issues)
3) "Multiplying Dac" is really a programmable attenuator
4) Digital potentiometer
5) Programmable gain amplifier (PGA) - good for accuracy but won't have 100 steps

3 or 4 might be your best options. Multiplying dacs will typically be higher performance, digital pots will be cheaper.
 

I'm not sure I get the whole picture (where the signal is coming from) but in general:

1) Arduino drives a dac to generate the signal - can drive any amplitude it wants (if possible)
2) ADC -> Arduino -> DAC (full flexibility but adds delay/bandwidth/precision issues)
3) "Multiplying Dac" is really a programmable attenuator
4) Digital potentiometer
5) Programmable gain amplifier (PGA) - good for accuracy but won't have 100 steps

3 or 4 might be your best options. Multiplying dacs will typically be higher performance, digital pots will be cheaper.

Thanks. Can you show a topology how I can use a digital potentiometer for non-inverting input? Im stuck with that part since never used before a digital pot.
 

Help with connecting a digital potentiometer to a non-inverting dual supply opamp

I need to use a digital potentiometer with a non-inverting amplifier. I want to ground one side of the digital poti. But I have no experience with that. The poti is MCP41010 it will be supplied by a 5V supply. And the opamp is LT1007 which uses +/-15V dual supply.

I cannot find any example how to connect this digital poti to such an opmap in non-inverting with dual supply rails.

I would be very glad if anybody has experience with that and provide a diagram.
 

Well one topology uses the pot for rp/r3. Though be careful of bandwidth - digital pots don't have a ton (1mhz comes to mind) and that creates loop stability concerns when its positioned in the feedback.

Another topology might position the pot to divide down the output of U1 and then add a second voltage follower opamp to buffer the pot output (which you need because the inverting u2 stage is a low impedance input). Or change the u2 stage so it's non-inverting and thus high impedance - then the pot output can drive it directly with no extra buffer needed.
 

Well one topology uses the pot for rp/r3. Though be careful of bandwidth - digital pots don't have a ton (1mhz comes to mind) and that creates loop stability concerns when its positioned in the feedback.

Another topology might position the pot to divide down the output of U1 and then add a second voltage follower opamp to buffer the pot output (which you need because the inverting u2 stage is a low impedance input). Or change the u2 stage so it's non-inverting and thus high impedance - then the pot output can drive it directly with no extra buffer needed.

Thanks a lot. I tried to draw the diagram of what you suggested below. I also indicated the pins of the digital potentiometer(The digital pot should not exceed 5V according to the datasheet of MCP41010 and U1 output is +-500mV I hope it is fine(?)). The opmap can also be LT1007 since I want low offset as possible.

What do you think about the below diagram? Is that what you meant?:
cuntitled.png

- - - Updated - - -

Well one topology uses the pot for rp/r3. Though be careful of bandwidth - digital pots don't have a ton (1mhz comes to mind) and that creates loop stability concerns when its positioned in the feedback.

Another topology might position the pot to divide down the output of U1 and then add a second voltage follower opamp to buffer the pot output (which you need because the inverting u2 stage is a low impedance input). Or change the u2 stage so it's non-inverting and thus high impedance - then the pot output can drive it directly with no extra buffer needed.

I have noticed that MCP41010 Vss min zero volt and AC should not go below. I have read it here

Actually my sine source already biased and always positive 1Vpk-pk swinging from zero to 1V. How about this instead?

cuntitled3.png
 
Last edited:

Yes I'd forgotten about the negative voltage issue and the unlikelihood of finding a digital pot that supports that.

If your signal is low enough impedance to handle the loading of the 10k pot then your second drawing looks like a good solution for that.
 

Hi,

After a quick view...it should work.
The drawback of the ciruit is, than there is DC at the POT and this DC signal is influenced by the pot.
Thus with every pot_move will cause a DC_step.
In "audio" one would hear a "plop" with every pot move.

The better way:
Generate the bias voltage on your own.
Feed it with a resistor to the right side of the decoupling capacitor has to be added at the input side of the pot) and feed the same voltage to the lower end of the pot.
Thus the output (wiper) of the pot has continously the same DC level. Only the AC will be attenuated.
The second decoupling capacitor at the right side of the pot does not see "moving DC". (No audible "plop")

Klaus
 

Hi,

After a quick view...it should work.
The drawback of the ciruit is, than there is DC at the POT and this DC signal is influenced by the pot.
Thus with every pot_move will cause a DC_step.
In "audio" one would hear a "plop" with every pot move.

The better way:
Generate the bias voltage on your own.
Feed it with a resistor to the right side of the decoupling capacitor has to be added at the input side of the pot) and feed the same voltage to the lower end of the pot.
Thus the output (wiper) of the pot has continously the same DC level. Only the AC will be attenuated.
The second decoupling capacitor at the right side of the pot does not see "moving DC". (No audible "plop")

Klaus

Hi,

Thank you. I couldn't be able to draw what you mean in your sentences. Im not biasing the signal, it is originally biased like 500mV bias with 500mV amplitude i.e 1Vpk-pk. from zero to one volt. That is how it is generated.

Another thing The frequency will be between 0.1Hz up to 16Hz. Im not sure there will be any sound hearable to human for that range.

Can you draw a sketch of what you mentioned considering my signal already naturally have the bias? Im going to use
 

Hi,

Can you draw a sketch of what you mentioned considering my signal already naturally have the bias?
As said: My solution only works with the bias voltage genertaed on your own.

Another thing The frequency will be between 0.1Hz up to 16Hz. Im not sure there will be any sound hearable to human for that range.
You won´t hear a sound caused by the initail frequency.
You will hear a sound every time you change the volume. (idependent of any AC voltage)

But maybe this is no problem for you .. then give the above circuit a try.

Klaus
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top