scaling +/- voltage to adc

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
lyft
 
Posts: 10
Joined: Fri Jan 10, 2014 9:59 pm

scaling +/- voltage to adc

Post by lyft »

Hello
I want to feed a -10v to +10v signal to one of the arduino 5v analog pins. I am pretty sure I can do this with an op amp but I am having trouble trying to figure out the resistors that will give me the proper gain and slope. Any help would be great!

Thank you

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: scaling +/- voltage to adc

Post by adafruit_support_mike »

You don't need an op amp.. a plain old voltage divider will work:
divider.jpg
divider.jpg (20.79 KiB) Viewed 1681 times
A 3:1 voltage divider with one end tied to 3.33v will convert +/-10v input to 0-5v output.

That sounds abstract, but you can build the whole thing from four 10k resistors:
thevenin.jpg
thevenin.jpg (17.08 KiB) Viewed 1681 times
3.33v is 2/3 of 5v, so a 2:1 voltage divider will give you 3.33v.

Putting two 10k resistors in parallel will give you the equivalent of a 5k resistor. Putting that above a 10k will give you 3.33v from a 5v supply.

The center of any voltage divider has an effective resistance equal to the upper and lower resistors in parallel, which in this case works out as 3.33k. That's exactly 1/3 of a 10k resistor, so connecting a 10k resistor to the input will give us the 3:1 voltage divider necessary to convert the +/-10v input to 0-5v.

User avatar
lyft
 
Posts: 10
Joined: Fri Jan 10, 2014 9:59 pm

Re: scaling +/- voltage to adc

Post by lyft »

Awesome thanks!

User avatar
aaronmeyers
 
Posts: 1
Joined: Thu Dec 22, 2016 6:35 pm

Re: scaling +/- voltage to adc

Post by aaronmeyers »

Hi... I was looking for information on getting a +/- 5v signal to a 0-5v range and I came across this great circuit!

I was wondering if you could advise on how the resistors would change for my range of -5v to +5v.

Thanks!

-Aaron

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: scaling +/- voltage to adc

Post by zener »

Mike answers that question fairly often... Here is his latest:

viewtopic.php?f=25&t=107645&p=538491&hi ... er#p538491

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”