Author Topic: Scaling 0 to +5V input into -9V to +9V  (Read 679 times)

0 Members and 1 Guest are viewing this topic.

Offline level6Topic starter

  • Regular Contributor
  • *
  • Posts: 88
  • Country: us
Scaling 0 to +5V input into -9V to +9V
« on: Yesterday at 02:32:40 am »
I'm trying to find a solution where I have an input range into a circuit of 0 to +5V DC and I need to scale that to a -9V to +9V range. I'm certain opamps are involved, but how can I essentially expand the output scale to include negative voltage values?
 

Offline jbb

  • Super Contributor
  • ***
  • Posts: 1210
  • Country: nz
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #1 on: Yesterday at 02:42:32 am »
Well, first up you’ll need a +9-and-a-bit V supply and a -9-and-a-bit supply. It’s common for opamps to need some ‘headroom’ between the power supply and the desired output. This could be somewhere around 1V for a standard opamp, or some 0.05V for a ‘rail-to-rail output’ device.

For the signal scaling itself, a circuit you could use is a difference amplifier. You’d need to configure it (ie select resistor values) for a gain of 5V change in input -> 18V change in output, ie 18/5=3.6x. You will also need a 2.5V (ie the middle of your 0V - 5V input) or 5.0V reference from somewhere.
 

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1661
  • Country: ca
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #2 on: Yesterday at 03:48:01 am »
Do you need linear or on/off logic?
For logic level, you could simply use an MAX232 IC to scale a 0-5V logic signal to -9V to +9V levels.
For linear, like the output of a 0-5V DAC, use op-amps like jbb mentioned.
 

Online Andy Chee

  • Frequent Contributor
  • **
  • Posts: 978
  • Country: au
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #3 on: Yesterday at 03:49:02 am »
I assume this is to take a PWM output from a microcontroller, to convert it to bipolar for an audio amplifier or analog needle meter?

Or is this digital logic 0-5V to convert into RS232 -9V & +9V?

Please elaborate on your bigger picture project.
 

Offline mianos

  • Regular Contributor
  • *
  • Posts: 56
  • Country: au
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #4 on: Yesterday at 04:08:21 am »
I use this thingy to calculate it: https://earmark.net/gesr/opamp/gain_offset.htm
 
The following users thanked this post: PCB.Wiz, RAPo, youngda9, Phil1977

Offline level6Topic starter

  • Regular Contributor
  • *
  • Posts: 88
  • Country: us
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #5 on: Yesterday at 04:34:43 am »
I assume this is to take a PWM output from a microcontroller, to convert it to bipolar for an audio amplifier or analog needle meter?

Or is this digital logic 0-5V to convert into RS232 -9V & +9V?

Please elaborate on your bigger picture project.

It's to convert a linear DC voltage input, used to control an audio low pass filter.
 

Offline level6Topic starter

  • Regular Contributor
  • *
  • Posts: 88
  • Country: us
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #6 on: Yesterday at 04:42:08 am »
I use this thingy to calculate it: https://earmark.net/gesr/opamp/gain_offset.htm

Thanks! The site is a keeper.
 
The following users thanked this post: ledtester

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1787
  • Country: au
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #7 on: Yesterday at 05:42:33 am »
I'm trying to find a solution where I have an input range into a circuit of 0 to +5V DC and I need to scale that to a -9V to +9V range. I'm certain opamps are involved, but how can I essentially expand the output scale to include negative voltage values?

You can also get a quick indication by working on span first, then offset.
5V to 18 swing, is simple : a gain of 3.6
You will likely bias the positive opamp pin from the 5V as that is likely more stable than the other rails.
- the positive Opamp pin needs to be somewhere under 2.5V, such that a 2.5V level on IN, gives 0V on output. (2.5V-B)*3.6 = B
 (2.5*3.6)/(1+3.6) = 1.956521739V, divided from 5V

Spice can be used to confirm this.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19841
  • Country: gb
  • 0999
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #8 on: Yesterday at 11:15:54 am »
The gain is 3.6, but the offset needs to be applied to the inverting pin, so when the input voltage is 0V, the output is -9V. The inverting gain is equal to the non-invering gain -1, giving 2.6V.

The inverting input must be connected to a 9/2.6 = 3.4615V source, via a resistor of RF/2.6.

Here's an example, using a 12V regulated power supply to give the offset voltage. R2 & 3 from a potential divider to get the reference voltage. The output resistance of the potential divider is equal to the values of the resistors in parallel, which is (1k1-1+2k7-1)-1 = 781.6R, R5||R6 = 14k21, which is near enough 15k and 39k/15k = 2.6, for a non-inverting gain of 3.6.

The circuit has a gain accuracy of 0.4% and offset of 33mV.

I can explain my working in more detail, later if required.


* 0 to 5V to +-9V.asc (1.42 kB - downloaded 7 times.)

EDIT:
Here's my working out.

* 0 to 5V to +-9V working.asc (1.07 kB - downloaded 3 times.)
« Last Edit: Yesterday at 09:38:31 pm by Zero999 »
 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: sc
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #9 on: Yesterday at 02:16:13 pm »
Here's an example...

You'll have significantly better luck at getting lower total error by tweaking the divider resistors instead of series gain resistor, and if you want to tweak the gain you might as well tweak R1 directly instead of doing R4+R5.

Anyway, beat this! (well, you can always use moar resistorz)
2373371-0
« Last Edit: Yesterday at 02:19:01 pm by ArdWar »
 
The following users thanked this post: Zero999

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1787
  • Country: au
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #10 on: Yesterday at 08:26:36 pm »
The inverting input must be connected to a 9/2.6 = 3.4615V source, via a resistor of RF/2.6.

More usual is to derive the opamp offset bias from the same 5V that creates the DAC swing.
That removes two power supply variations from the setup, and makes it ratio metric.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19841
  • Country: gb
  • 0999
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #11 on: Yesterday at 09:31:20 pm »
The inverting input must be connected to a 9/2.6 = 3.4615V source, via a resistor of RF/2.6.

More usual is to derive the opamp offset bias from the same 5V that creates the DAC swing.
That removes two power supply variations from the setup, and makes it ratio metric.
I didn't bother optimising it. I just used a couple of online calculators to work out the gain, potential divider and put a couple of parallel resistors in series to make up the output impedance.

How accurate is the supply voltage? Probably not much better than 5%. In which case, just three resistors will be fine.

* 0 to 5V to +-9V 3 resistors.asc (1.07 kB - downloaded 2 times.)

If closer tolerance is required, then use the TL431.


* 0 to 5V to +-9V TL431.asc (2.03 kB - downloaded 2 times.)

The inverting input must be connected to a 9/2.6 = 3.4615V source, via a resistor of RF/2.6.

More usual is to derive the opamp offset bias from the same 5V that creates the DAC swing.
That removes two power supply variations from the setup, and makes it ratio metric.
It doesn't work like that though. See what happens both inputs are  swept from 0V to 5V.


In this case, a higher voltage is still required for the 12V supply, but it really doesn't matter what the reference voltage is. It just needs to be 3.4315V or significantly higher, so a potential divider can be used to generate it.
« Last Edit: Yesterday at 09:33:21 pm by Zero999 »
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1787
  • Country: au
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #12 on: Yesterday at 10:13:42 pm »
It doesn't work like that though. See what happens both inputs are  swept from 0V to 5V.
?
A single supply must always have fewer variations and noise sources, than using two supplies.

Yes, the simple gain of this system means the absolute value of the 5V, sets the absolute value of the span.
However at the usually more important mid point, the bridge nature of the circuit reduces the error of the zero output point.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3222
  • Country: us
Re: Scaling 0 to +5V input into -9V to +9V
« Reply #13 on: Today at 02:23:32 am »
I use this thingy to calculate it: https://earmark.net/gesr/opamp/gain_offset.htm

Thanks! The site is a keeper.

Another oft cited reference:

Designing Gain and Offset in Thirty Seconds
https://www.ti.com/lit/an/sloa097/sloa097.pdf
 
The following users thanked this post: PCB.Wiz


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf