0
\$\begingroup\$

I need to read DC voltages between -2.5 V and 2.5 V with Arduino. I have read that an op-amp in inverting configuration (below) can be used to add a DC component. Therefore, I have thought about using this circuit to add 2.5 V and be able to read with Arduino, since the voltage would remain between 0 and 5 V. Is this option feasible or are there better alternatives?

Thank you enter image description here

\$\endgroup\$
2
  • 1
    \$\begingroup\$ That would work fine, as long as you use a rail-to-rail op amp and make sure you use an appropriate value for V1 (the 1 V you marked there won't work, regardless of resistor values). Be aware that your signal voltage will be inverted; a 2.5 V signal will give a 0 V output and a -2.5 V signal will give a 5 V output. This can be corrected easily enough in software though. \$\endgroup\$
    – Hearth
    May 22, 2022 at 17:31
  • \$\begingroup\$ Is your input voltage source grounded? If it is floating, there is a simple 2-resistor solution... \$\endgroup\$ May 24, 2022 at 7:01

2 Answers 2

3
\$\begingroup\$

It depends what the output impedance, aka drive strength, of your voltage source is. However, in the circuit you've illustrated, you've used an inverting configuration, which has a finite input impedance of R1 anyway, so my configuration may be no worse.

At its simplest, if you can drive the resistors, all you need is this

schematic

simulate this circuit – Schematic created using CircuitLab

Reference the ADC from 3.3 V for full range. However, for the simplicity, and not needing an op-amp, it may be worth the small sacrifice in range if you use 5 V for the reference. IIRC, Arduino does have an internal 1.1 V reference, which can be used to give full scale if you change the R values, and add an extra shunt resistor from the output to ground. Ask a separate question if it's not obvious how to do this.

The input impedance is 30 kΩ, the output impedance to the Arduino ADC is 6.7 kΩ, which is IIRC within its input impedance tolerance. I think it can tolerate higher resistors if you have a C to ground to source the ADC current spikes.

\$\endgroup\$
3
  • \$\begingroup\$ I thought of mapping as you say, ie using a voltage divider with a shunt resistor. But, after calculations, I found that the shunt resistance had to be negative. In fact, when the input voltage is 2.5V we want the output to be 5V, so we have opposite currents circulating through the same branch. I don't know if I am explaining myself... In other words, it seems necessary that Vcc be less than the maximum value of the input voltage \$\endgroup\$
    – Sharik_97
    May 22, 2022 at 20:58
  • \$\begingroup\$ @Sharik_97 I was suggesting that you don't have the output range all the way to 5 V. Do the sums on the values I've shown. It may be worth it for not having to use an opamp. \$\endgroup\$
    – Neil_UK
    May 23, 2022 at 4:06
  • \$\begingroup\$ Sorry, I don't know what values ​​you are referring to. What I said is that I tried to do the mapping using a resistor between the output and ground, as you said, and I came to the conclusion that that method is valid only when the maximum input voltage is greater than the supply (Vcc). I think I'll ask another question later to make my doubt clearer \$\endgroup\$
    – Sharik_97
    May 27, 2022 at 17:00
2
\$\begingroup\$

So you want to map the voltage range (-2.5V to 2.5V) to (0V to 5V)?

To do this, you need to know what gain and offset will fulfill this mapping. This is easy to determine, you have 2 equations with 2 unknowns: -

$$a \cdot (-2.5\text{V})+b=0\text{V} \tag1$$ $$a \cdot 2.5\text{V} +b = 5\text{V} \tag2 $$

Solving these yields the gain \$a=1 \$ and the offset \$b=2.5\text{V} \$. So you need a circuit with this exact gain and offset. This can easily be realised, for example with a summing amplifier topology like this: -

enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ Another suggestion: You can replace Voff and R2 by a 2 x 2 k voltage divider supplied by V+. \$\endgroup\$ May 24, 2022 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.