Shop OBEX P1 Docs P2 Docs Learn Events
Voltage scaling for ADC input — Parallax Forums

Voltage scaling for ADC input

Scott4Scott4 Posts: 45
edited 2014-01-27 13:03 in Accessories
I am looking for an OpAmp circuit to scale the output of a pressure sensor.·The sensor voltage range of interest·is 2.6v to 4.2v. I would like to expand that·to a range of 0.2v to 4.8v to get better resolution from the ADC.

Any help would be appreciated. -Scott

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-03-18 15:42
    You might also consider a higher resolution adc, say 12 or 16 bits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Scott4Scott4 Posts: 45
    edited 2010-03-18 17:45
    I have a 12 bit ADC and the altitude resolution is +/-7 ft per count. Just sitting on the bench the ADC count was jumping around 2-3 counts (~+/-21 ft) between successive reads. I plan to do either some hardware integrating or software averaging to get it to calm down but if I could get the resolution·a bit finer I think it would be more acceptable.··-Scott
    719 x 823 - 122K
  • dredre Posts: 106
    edited 2010-03-18 20:18
    Scott,

    Does this [noparse][[/noparse]attachment file] help?· Maybe someone can give better values for the resistor voltage dividers.

    cheers, David
    218 x 271 - 9K
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2010-03-18 20:24
    Scott4,

    If you are just looking to scale the voltage using an Op-Amp, then you'll need two stages. First You need a difference amplifier with a voltage reference of 2.5V on the inverting input (V1)...

    www.play-hookey.com/analog/difference_amplifier.html

    ...in the schematic above all resistors should be the same (100K), the Op-Amp should be powered with 5V-0V so that the Gnd connection is actually 0V and not Vdd/2.

    This should bring the voltage on the output of the Op-Amp in the range of 100mV to 1.7V from a 2.6V to 4.2V input.

    The next Op-Amp that you need should be a NON-Inverting amplifier.

    www.play-hookey.com/analog/non-inverting_amplifier.html

    ...in this schematic Rz can be omitted and this input can be tied to the previous Op-Amp's output.

    Gain = 1 + (Rf / Rin)

    you basically want your gain to be 2.875 (4.6V(<--Desired Output Delta) divided by 1.6V(<--output Delta from first Op-Amp) = 2.875)

    So...

    2.875 = 1 + (Rf / Rin)
    1.875 = Rf / Rin

    If Rin = 100K ...

    Rf = 187.5K


    Now, the output of the Second Op-Amp should have the range you are looking for. You should still consider calibrating your readings with known input values.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 3/18/2010 8:30:39 PM GMT
  • Scott4Scott4 Posts: 45
    edited 2010-03-19 19:01
    Thanks Beau,

    I am a "cookbook engineer" when it comes to EE design. Will you take a look at the attached circuit and see if I have accurately captured your intent?

    Should the 2.5v reference be an IC?

    -Scott
    1205 x 479 - 51K
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2010-03-19 19:57
    Scott4,

    Nope, that's about it... the 2.5V reference could be taken from two 1K resistors forming a voltage divider from the 5V supply powering the dual Op-Amp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • dredre Posts: 106
    edited 2010-03-20 19:03
    Scott,

    Another thought. How about using an instrumentation amplifier? My favorite is the INA125; although I have not used it for an application such as yours.

    The INA 125 has built-in voltage references, the 2.5 volts which could be used on the (-) input to set the minimum.

    It also uses only one resistor for gain.

    cheers, David
  • Scott4Scott4 Posts: 45
    edited 2010-03-21 19:37
    Thanks David, the device in my circuit was just the first dual op amp I came across in my schematic program. Thanks for the recommendation. -Scott
  • dredre Posts: 106
    edited 2010-03-22 18:36
    You're entirely welcome Scott. The acknowledgment is appreciated.

    Plus, I am very interested in your application as I have been planning to do something similar. In this regard here are a couple of links which might also be of interest:

    I like the TLC2543, 12 bit ADC, for the simple reasons that it is multichannel and that Dr. Tracy Allen has an extensive article on it's application to the Stamp:

    http://www.emesystems.com/OL2tlc2543.htm

    [noparse][[/noparse] I think Dr. Allen's articles should be required perusing prior to asking questions on the forum. :-) ]

    Although the following should be placed under a new thread I would like to take this opportunity to offer a link in regard to your concern about noise. Software reduction of noise is covered under Dr. Allen's discussion regarding data smoothing:

    http://www.emesystems.com/BS2math5.htm

    Finally, although I have yet to tackle this problem, I wonder how you are going to convert barometric pressure to altitude? My thought is to divide the relationship curve into linear segments and use the lookup command for the slopes and intercepts. Any ideas?

    cheers, David







  • Scott4Scott4 Posts: 45
    edited 2010-03-22 19:39
    Thanks again for the references, David. I had gotten help from Dr Allen's site before. Not sure why I didn't think to look there first.

    Regarding the math, I am using the Micromega uM-FPU V3 ($20) 32 bit floating point processor. I'm using it to compute:
    -Altitude
    -Air Speed
    -Water temperature (reading a thermistor sensor and computing temperature using the Steinhart-Hart equation)
    -GPS (NMEA sentence parsing)
    -Elapsed time calculation
    -Distance between GPS waypoints (great-circle method)
    -etc.

    Given all it does, $20 seems like a bargan to me.

    For the altitude, I gathered my equations and made a spreadsheet (screen shot in post above). This is how I discovered that one ADC count would give a resolution of ~7ft. I have not gotten to debug the FPU code yet as I am still struggling with the LCD. -Scott
  • KhrushchevKhrushchev Posts: 7
    edited 2012-09-19 08:59
    Beau, on 3/18/2010 you posted a very useful message on the thread "Voltage scaling for ADC input". Unfortunately the links you provided are now broken


    www.play-hookey.com/analog/difference_amplifier.html

    www.play-hookey.com/analog/non-inverting_amplifier.html

    Could you re-post new links?

    TIA,

    Rob
  • nmz787nmz787 Posts: 24
    edited 2014-01-27 13:03
    I have a question regarding linearity... are op-amps calibrated to be linear, would an instrumentation amplifier (IA) be more linear? I know about the resistors being identical internally in IAs. Also would either of these be more linear than a bipolar audio transistor? (I'm working on getting data from an analog CCD, which needs scaling and offsetting).
Sign In or Register to comment.