Interfacing bipolar DC signals to Arduino ADC
To safely and accurately interface a bipolar DC signal to
the Arduino ADC, you need to shift (bias) and scale the signal so that it fits
entirely within the ADC's input range.
One possible solution is described below.
The circuit (fig.1) is a non-inverting amplifier with a level-shifting network (R3-R4) to convert a bipolar input signal into a unipolar output.
Here's the explanation of how the circuit works:
2.
DC
Bias Calculation: The DC bias at the non-inverting input is the sum of V1
and V2, where V1 = 5V x R3 / (R3 + R4) and V2 = 0.2V x R4 / (R3 + R4). With R3
= 1 kΩ and R4 = 9 kΩ, V1 = 5V x (1k / 10k) = 0.5V and V2 = 0.2V x (9k / 10k) =
0.18V. Thus, the total DC bias is V1 + V2 = 0.5V + 0.18V = 0.68V.
3.
Input Signal: As the input signal Vin, a
100 Hz sinusoidal signal with a 0.2V DC offset and 0.3V amplitude was used.
This is added to the 0.68V bias, so the signal at the non-inverting input
ranges from 0.68V - 0.3V = 0.38V to 0.68V + 0.3V = 0.98V.
4.
Amplification: The op-amp amplifies the
input signal with a gain of 3. The AC amplitude becomes 3 x 0.3V = 0.9V, and
the DC offset is 3 x 0.68V = 2.04V. The output Vout would ideally range from
2.04V - 0.9V = 1.14V to 2.04V + 0.9V = 2.94V.
5.
Output Signal Vout: Since the op-amp is
powered by a +5V supply, and the calculated output stays within this limit,
Vout will be a unipolar signal that changes between approximately 1.14V and
2.94V. The final output
across a load will be an AC signal with a 0.9V peak-to-peak amplitude, centered
around 0.68V x 3 = 2.04V. A capacitor C1 connected to the power rail of the
op-amp—a practice known as "power supply decoupling" or
"bypass"—will filter out noise and stabilize the voltage
supplied to the op-amp.
In this circuit, we can usenumerous single-supply IORR op-amps (LM358, MCP601, MCP6021, AD8541, etc.).