+/- voltage to ADC

Discussion in 'General Electronics Discussion' started by jason birdsall, Sep 10, 2014.

1. jason birdsall

2
0
Sep 10, 2014
Hello all
I am trying to feed a -10v to +10v dc signal into the 5v ADC on an arduino. From what I have read I can do this with an op amp but I am having trouble figuring out the resistor setup to get the gain and slope right. Any help would be great!

Thanks

J

2. Daniel Robertson

24
12
Sep 1, 2014
Are you trying to convert the -10 to +10 volt signal to a 0 - 5 volt signal IE: -10v = 0v and +10v = 5v?

You cannot send a -ve voltage into the ADC. You would have to use an OP amp as level shifter.

You could first reduce the voltage to give you -2.5v to +2.5v, and then use an OP amp as the level shifter. This would give you a 0 to +5 volt signal.

Daniel.

3. jason birdsall

2
0
Sep 10, 2014
Thanks for the quick response. Yes you are correct that is what i am trying to do. Would i use a voltage divider reduce the voltage before the OP amp? How would I wire the OP amp as a level shifter to go from ±2.5v to 0-5v?

Thanks again!

4. Daniel Robertson

24
12
Sep 1, 2014
Hi again.

Yes, use a couple of resistors or a pre-set (even better, as you then have adjustment for amplitude) as a potential divider.

It would then be a good idea to follow that with an OP amp connected as a buffer and then the second Op amp as the offset level shifter. Something like an LM358 (dual OP amp) should do the trick.

I will post a circuit for you on here. I may not be able to do it until tomorrow evening.

Daniel.

5. KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
You may be able to avoid op-amps altogether.

V1 represents your source signal (±10V). V2 is your 5V power supply. R1~R3 do the rescaling and offsetting so that the full input range is mapped to 0~5V. You can change the resistor values as long as you keep them in the same proportions.

ADCs generally have a fairly high input impedance but they can back-feed transitions as the capacitors are switched during the conversion process, and this can cause inaccuracy and inconsistency. This can be avoided by connecting a capacitor from the ADC input to 0V, i.e. across R3. Typically 0.1 µF is fine but this will have an effect on the frequency response. If you're only converting slow signals there's no problem.

Here's the simulation result showing how the voltage at CIRCUITIN maps to the voltage at ADCIN.

Edit: Obviously, this circuit loads the signal source. This is unavoidable, even with op-amps, unless you have supply rails of ±10V or more. You need to know the internal resistance of your source and adjust the resistor values if necessary to ensure adequate accuracy.

6. Daniel Robertson

24
12
Sep 1, 2014
Great, I was going to suggest this. As KrisBlueNZ stated. With OP amps you would require a dual supply.

Cheers Kris.

Daniel.