Arduino controlled adjustable gain amplifier

Hello everyone.

What do I have:
An arduino board that generates a sine via Direct Digital Synthesis.
The frequency of the sine wave is varied between 50Hz and 2kHz.
This is first filtered through a low pass to get a real sine wave and then over a high pass to get a symmetrical bias of -2.5V to + 2.5V.

What do I need:
Then I would like to provide the signal with an adjustable gain, which can be adjusted via the Arduino, so it is from min. +/- 2.5V to max. Can be up-regulated +/- 5V.

What do I have for solution approaches:
The first thing that comes to my mind is a non-inverting operational amplifier with a remote controlled potentiometer, so that the overall circuit would look something like in the attachment.

What are my problems:
First I do not know how to find the right op amp for my purpose.
Furthermore, I do not know what the best solution for the adjustable potentiometer is.
There are 3 possibilities:
1.) A voltage-dependent resistor that is controlled via an analog output of the Arduino.
2.) A digitally controlled potentiometer, which is controlled via the I2C interface of the Arduino.
3.) A digitally controlled potentiometer, which is controlled via the SPI interface of the Arduino.

What are my questions:
Which parameters should I pay attention to when choosing the operational amplifier?
Which of the 3 options for the controlled potentiometer would you prefer and why?

Best regards Rabobsel

Rabobsel:
Hello everyone.

What do I have:
An arduino board that generates a sine via Direct Digital Synthesis.
The frequency of the sine wave is varied between 50Hz and 2kHz.
This is first filtered through a low pass to get a real sine wave and then over a high pass to get a symmetrical bias of -2.5V to + 2.5V.

First things first, where is the code? Where is the circuit diagram (full with all the filter details please)?
What PWM frequency are you using? Phase correct PWM?

What do I need:
Then I would like to provide the signal with an adjustable gain, which can be adjusted via the Arduino, so it is from min. +/- 2.5V to max. Can be up-regulated +/- 5V.

Do you mean you want its amplitude (peak) to be variable from 2.5 to 5V?

What do I have for solution approaches:
The first thing that comes to my mind is a non-inverting operational amplifier with a remote controlled potentiometer, so that the overall circuit would look something like in the attachment.

You mean a non-inverting amplifier using an opamp? "remote controlled potentiometer" meaning a
digital potentiometer?

What are my problems:
First I do not know how to find the right op amp for my purpose.
Furthermore, I do not know what the best solution for the adjustable potentiometer is.
There are 3 possibilities:
1.) A voltage-dependent resistor that is controlled via an analog output of the Arduino.

No, thats a component for protecting from lightning strikes!!

2.) A digitally controlled potentiometer, which is controlled via the I2C interface of the Arduino.
3.) A digitally controlled potentiometer, which is controlled via the SPI interface of the Arduino.

Those are the same thing, just differences in the details.

You neglect the possibility of varying the amplitude of the signal going to the PWM hardware,
much the simplest, no variable gain amp is then needed.

What are my questions:
Which parameters should I pay attention to when choosing the operational amplifier?

output voltage range, input voltage range, supply voltage range, gain bandwidth product,
output current drive level for a start, but your application is only likely to be demanding
for voltage ranges (ie need rail-to-rail).

Which of the 3 options for the controlled potentiometer would you prefer and why?

None are needed if you modulate the amplitude directly when you generate the PWM - what
precision do you need in setting the output amplitude?

Best regards Rabobsel

MarkT:
First things first, where is the code?

I sent you the code via pn because I would not like to upload it here, it is not complete yet.

MarkT:
Where is the circuit diagram (full with all the filter details please)?

I added an additional attachment with the filter and it's values.

MarkT:
What PWM frequency are you using?

31373 Hz

MarkT:
Phase correct PWM?

Yes.

MarkT:
Do you mean you want its amplitude (peak) to be variable from 2.5 to 5V?

Yes.

MarkT:
You mean a non-inverting amplifier using an opamp?

Yes.

MarkT:
"remote controlled potentiometer" meaning a digital potentiometer?

Yes.

MarkT:
You neglect the possibility of varying the amplitude of the signal going to the PWM hardware, much the simplest, no variable gain amp is then needed.
None are needed if you modulate the amplitude directly when you generate the PWM - what precision do you need in setting the output amplitude?

Could you explain that a bit more please?
I thought you can not change the amplitude of the pwm, since it can only be high (5V) or low (0V) and pwm-outputs are digital outputs.
I know how to change phase and frequency in the generation of the pwm, but not the amplitude.
I know that you can vary the amplitude by changing the duty-cycle of the PWM if you use it to create a DC-voltage, when you use serialPrint(0-255, variable) but you don't use serial print in the PWM-Modes to generate the Sine-Wave.