Shop OBEX P1 Docs P2 Docs Learn Events
ADC offset, sensor, op-amp help? — Parallax Forums

ADC offset, sensor, op-amp help?

Zap-oZap-o Posts: 452
edited 2011-08-23 06:37 in General Discussion
I am working on a device that requires a ADC to read a temperature sensor. My issue is that the voltage from the sensor is such that I am not getting the maximum potential out of my ADC (need better resolution). I am sure I need an op-amp to accomplish this task but I am not sure what type of circuit I will need. Below is a plot of what is happening. The X axis is the voltage and the Y axis is the temperature. The red line is the reading I am obtaining from my ADC as you can see I am only using a little under 1/2 of what the ADC can provide. In other words, at -40 degrees C the reading is around 2 volts. I would like to offset this so that at -40 degrees C the voltage is .5Volts.

So I was thinking of offsetting the input signal so that it looks like the blue line. Is this possible? If so what is it called?
slope.jpg
777 x 437 - 16K

Comments

  • ercoerco Posts: 20,259
    edited 2011-08-22 10:27
    Many ADCs have a built-in offset feature. Which one are you using?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-22 10:34
    Which temperature sensor are you using? Does your ADC have an external reference input? If so, you might consider switching to a TMP36.

    -Phil
  • Zap-oZap-o Posts: 452
    edited 2011-08-22 10:39
    I am using a reference voltage of 5volts and my ADC will allow an offset voltage from 500mV to Vref (or 5 volts in my case) What will this accomplish?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-22 11:00
    Which ADC is that?

    -Phil
  • Zap-oZap-o Posts: 452
    edited 2011-08-22 11:03
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-22 11:06
    Okay, that's not an offset input, but a reference input that sets the high end of ADC range. That ADC in combination with the TMP36 sensor I mentioned will give you the spread that you're looking for. You will have to set the Vref input to 2V to get that benefit. But with the TMP36's +/-1-deg C accuracy, the extra precision is probably not worth the effort. Which temperature sensor are you using now?

    -Phil
  • Zap-oZap-o Posts: 452
    edited 2011-08-22 11:09
    Thanks Phil but I can not substitute the temperature sensor. Any other ideas? Cant I use an differential op-amp circuit of some type to change the slope of my line (in the picture)?
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2011-08-22 11:17
    Or an even cheaper sensor: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MCP9700A-E/TO-ND
    I use the SOT-23 version of that one (here), with an MCP3008 and a 2.5V reference, it's been flawless.

    Most temperature sensor expect the ADC to have an accurate reference (not your general-purpose 5V or 3.3V power), because without a reference, it can't be consistently accurate (no matter how many bits you are measuring with). You will probably need a 4.096V or 2.5V reference depending on the temperature IC.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-22 11:20
    Well, I guess that takes care of the easy solutions. Here's a page that will help you design your opamp circuit:

    -Phil
  • Zap-oZap-o Posts: 452
    edited 2011-08-22 11:25
    Bobb Fwed wrote: »
    Or an even cheaper sensor: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MCP9700A-E/TO-ND
    I use the SOT-23 version of that one (here), with an MCP3008 and a 2.5V reference, it's been flawless.

    Most temperature sensor expect the ADC to have an accurate reference (not your general-purpose 5V or 3.3V power), because without a reference, it can't be consistently accurate (no matter how many bits you are measuring with). You will probably need a 4.096V or 2.5V reference depending on the temperature IC.

    Yes I am using a .01% Voltage reference regulator and the temperature sensor in my honest opinion is not even remotely an issue. Its either the ADC / the offset / resolution.

    Phil thanks again ill read this over.
  • ercoerco Posts: 20,259
    edited 2011-08-22 13:34
    Which processor are you using?

    That's a 16 bit ADC you're using. Quite a bit of resolution even without any offset. Do you really require that much resolution? Is it a very low noise environment?
  • tdlivingstdlivings Posts: 437
    edited 2011-08-22 13:57
    What does the temp sensor output look like on it's own.
    Is it one of those that puts out a current as a function of temp and would need a current to voltage convertor interfaced to it.
    Then you could plot that output as a function of temp and then design the op amp interface to get 0 to 5 v as an input to your A/D
    Can you use the sensor's data sheet to get a plot of volts out vs temp.

    Tom
  • Zap-oZap-o Posts: 452
    edited 2011-08-22 19:56
    @ erco...
    Indeed its a good ADC but I still wish to use all the resolution. My micro is the propeller.

    @ tdlivings...
    The temp sensor is doing as expected and after some circuits it runs linear. Its voltage is then proportional to the temperature.

    @ Phil and others...
    If I am on the right path and do this correctly I think I could design a differential op-amp circuit to offset the voltage, then take that value and run it into a small gain op-amp circuit to finally input in to my ADC. Will this do the trick? I have no idea but I am going to give her a try unless someone thinks its entirely the wrong way to do this. Any other ideas?
  • frank freedmanfrank freedman Posts: 1,983
    edited 2011-08-22 22:57
    @Zap-o

    To use full range, consider op amp to scale and if needed filter the input signal. Diff input to cancel noise, and there are ways to scale the input both linearly and logarithmically using active devices in the fedback loop.

    Check for another TI PDF pub, OP Amps for Everyone. More detail than can be imagined. a seriously good read. Also, TI has a Spice based Simulator called TINA-TI, looks interesting, not had time to play with it though. TI focus membership is good also for other tools and easy way to get hold of samples.

    Frank
  • Zap-oZap-o Posts: 452
    edited 2011-08-23 06:37
    @Frank
    Oh hell, I read your post this morning while reading the exact PDF and got a little spooked. still looking for the hidden camera that you are watching me from. In all seriousness thanks and wish me luck.
Sign In or Register to comment.