Author Topic: Offset and scaling in single supply design  (Read 1466 times)

0 Members and 1 Guest are viewing this topic.

Offline DigitalDesignerTopic starter

  • Contributor
  • Posts: 49
  • Country: ie
Offset and scaling in single supply design
« on: June 09, 2025, 09:00:12 pm »
Hi,
not great at analog and op-amp design... and I am trying to measure a voltage that varies continuously from 10V to 24V from the ADC in a micro that only runs at 3V3.

Is there a way to map the input voltage range of 10V to 24V output to an output voltage of 0V–3.2V using only a single supply op-amp that runs only from the 3V3 rail?

In other words then the input voltage is 10V the output is 0V and when the input voltage is 24V the output is 3.2V.

Thank you
« Last Edit: June 09, 2025, 09:04:08 pm by DigitalDesigner »
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 11901
  • Country: us
  • Retired, now restoring antique test equipment
Re: Offset and scaling in single supply design
« Reply #1 on: June 09, 2025, 09:10:22 pm »
A very simple voltage divider would shift [+10 to +24 V] to [+1.33 to +3.20 V]:  would that be good enough for your application?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 22419
  • Country: gb
  • 0999
Re: Offset and scaling in single supply design
« Reply #2 on: June 09, 2025, 09:33:21 pm »
An op-amp can be used. The x-axis of the simulation is the input voltage V1, which is swept from 10V to 24V and y-axis is the output.


I used the website linked below to help me design it.
https://earmark.net/gesr/opamp/gain_offset.htm
 

Offline DigitalDesignerTopic starter

  • Contributor
  • Posts: 49
  • Country: ie
Re: Offset and scaling in single supply design
« Reply #3 on: June 09, 2025, 10:07:16 pm »
Thank you both!

@Zero999 that schematic is exactly what I was looking for. Thank you. What simulation tool did you use?

@TimFox a voltage divider would not work because of the ADC resolution.

Thank you
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 11901
  • Country: us
  • Retired, now restoring antique test equipment
Re: Offset and scaling in single supply design
« Reply #4 on: June 09, 2025, 10:18:28 pm »
Yes, with the simple solution (no applied offset) you would lose about 40% of the digital output range of the ADC.  For some applications, that might be OK for a cheap solution.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 22419
  • Country: gb
  • 0999
Re: Offset and scaling in single supply design
« Reply #5 on: June 10, 2025, 08:43:57 am »
Thank you both!

@Zero999 that schematic is exactly what I was looking for. Thank you. What simulation tool did you use?

@TimFox a voltage divider would not work because of the ADC resolution.

Thank you
I used LTSpice to simulate the circuit. It's freely available.

If you're concerned about accuracy, then use a proper voltage reference, such as the TL431, rather than the supply voltage for the reference.
https://www.ti.com/lit/ds/symlink/tl431.pdf

Just use 2.495V or whatever for Vref in the calculator. It's the ratio of the resistors which matter, rather than the values. I multiplied them all by 1000, because the low values it generates would use a lot of power.
https://earmark.net/gesr/opamp/case8.htm
 

Offline mtwieg

  • Super Contributor
  • ***
  • Posts: 1789
  • Country: us
Re: Offset and scaling in single supply design
« Reply #6 on: June 10, 2025, 11:30:18 am »
To add to what Zero999 posted above, it's recommended that you use the reference voltage for the ADC to create the offset voltage. For example in that circuit if the 3.3V 'ref' net is the reference for the ADC, then all is good. But if the ADC actually uses another reference voltage, then any drift between the two references will show up as measurement error. It's even possible for you to end up with worse accuracy/precision than a simple voltage divider with no offset.

If you tell us specifically what MCU you are using we can give more specific guidance.
« Last Edit: June 10, 2025, 11:33:24 am by mtwieg »
 

Offline DigitalDesignerTopic starter

  • Contributor
  • Posts: 49
  • Country: ie
Re: Offset and scaling in single supply design
« Reply #7 on: June 10, 2025, 05:17:56 pm »
Thank you both for the additional very useful information!  :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf