About
In signal condition domain, a critical functional block is a VGA or Variable Gain Amplifier. It is used in measurement devices like: the oscilloscope, spectral analyzer, network analyzer and so on.
A simple VGA consists of a few resistors with different values, an operational amplifier and components that switch between these resistors. It can be a solenoid switch or an IC electronic switch. In this case, a SN74HC4066 is a suitable device. It have 4 switches with individual control. A good feature for use with the Arduino board.
So, by making a big voltage divider and choosing between nodes, we can modify the gain equation.
Gain Coefficient
RF stands for resistor feedback. If S1 is close and the rest are open according to OP, the operation gain coefficient will be:
G1 = 1 + RF/(R1+R2+R3+R4)
For S2 closed and the rest open:
G2 = 1 +(RF+R1)/(R2+R3+R4)
And so on:
G3 = 1 +(RF+R1+R2)/(R3+R4)
G4 = 1 +(RF+R1+R2+R3)/(R4)
Therefore, we can obtain 4 gain coefficients. But you may wonder if we can make combinations between gain in order to achieve other equations. Yes, we can and there is more detailed information are here.
So, with this concept in mind, we can make connections between the Arduino board, resistors, IC switch and OP AMP like in the bottom schematic. Pins 2/3/4/5 are connected to Arduino digital pin 2/3/4/5.
Arduino code is very easy because it contains digitalWrite commands and a serial communication to modify gain from the serial monitor.
EXPANDED TECHNICAL DETAILS
Analog Signal Conditioning
This project provides a professional-grade Variable Gain Amplifier (VGA) circuit, essential for normalizing weak sensor signals or audio inputs.
- Digital Potentiometer Control: The Arduino interfaces with an MCP4131 or AD5241 digital pot via the SPI or I2C bus. By changing the pot's resistance in the feedback loop of an Op-Amp (like the LM358), the Arduino can precisely dial in the gain from 1x to 100x.
- Dynamic Range Optimization: Includes a software "Auto-Ranging" mode. If the output signal is too low, the Arduino automatically increments the gain until the signal reaches the optimal ADC range.
Precision
- DC Offset Nulling: The firmware includes a calibration routine to remove internal DC offsets, ensuring that only the AC signal is amplified for cleaner audio or sensor readings.