Go Down

### Topic: Scaling ±5v to 0 - 5v for ADC input (Read 827 times)previous topic - next topic

#### pianomatt

##### Aug 29, 2019, 10:18 pm
I'm trying to build a voltage controllable digital oscillator. The control voltage will be around ±5v but I need to be able to scale that down to 0-5v or 0-3.3v or whatever the reference voltage of the ADC I end up using is.

I understand that I can use an inverting op-amp circuit to scale the voltage down to 2.5v, but I'm struggling from there. I have read a little about biasing, but I'm struggling to understand it.

Any help would be greatly appreciated.

#### Grumpy_Mike

#1
##### Aug 30, 2019, 12:39 am
Search for this application note it will tell you all you need to know:-

Application Report SLOA097 - February 2002
Designing Gain and Offset in Thirty Seconds

#### pianomatt

#2
##### Aug 31, 2019, 01:26 am
Thanks, I think I am beginning to understand it. Once I've given it a go I'll post my results.

#### pianomatt

#3
##### Aug 31, 2019, 02:33 am
I think I'm misunderstanding this.

Quote
Determining the type of function depends on the sign of two numbers: m (the gain of the stage) and b (the offset of the stage) - that are calculated now.
As I understand it, full scale and zero scale are the min and max voltages.

VoutFS = 5
VoutZS = 0

VinFS = 5
VinZS = -5

M = (5-0) / (5- -5) = 0.5
B = 0 - 0.5 x -5 = -2.5

Therefore, according to this sheet, I need the calculation for positive M and negative B.

Trying to calculate Rg gives me a negative number though, so I must be doing something wrong.

#### pianomatt

#4
##### Sep 01, 2019, 10:27 pm
I figured it out. The calculation at the top of the page is a bit misleading, or I don;t understand it fully. I have a negative gain and a positive offset and simulating that circuit based on the calculated values works fine. I've had to invert the input using an inverting buffer but, at least in the simulator, it works as expected.

Here's the circuit adapted for -10 to 10v on the input.

#### MarkT

#5
##### Sep 02, 2019, 02:33 pmLast Edit: Sep 02, 2019, 02:35 pm by MarkT
Scaling down can be done with just 3 resistors, its a voltage divider between the input and a fraction of the
supply voltage (itself done with a voltage divider).

Three resistors from the analog pin:
20k input resistor,
20k to ground,
10k to 5V.
Midpoint will be 5V when input is 10V, 2.5V when input is 0V, and 0V when input is -10V.

For a +/-5V input only 2 resistor values are needed 10k input resistor, 10k to 5V
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### pianomatt

#6
##### Sep 02, 2019, 08:23 pm
Thanks, that works too. I'm not sure if that's the right way to do it for my application though, since I'm told that I should use opamps for buffering. I suppose I could use a unity gain amp on the input.

Is there an advantage of doing it actively rather than passively?

#### Grumpy_Mike

#7
##### Sep 03, 2019, 07:15 am
Quote
Is there an advantage of doing it actively rather than passively?
With using an op-amp you get a higher input impedance and a lower output impedance.

Go Up