Matching sensor output impedance to an ADC - Page 1
Forum section: electronics / projects

author: andyturk
author_rank: Frequent Contributor
timestamp: October 04, 2012, 09:08:16 pm
content: I'm messing around with some of Freescale's pressure sensors (e.g., MPXV6115VC6U) which I plan to read via an ADC. I've hooked things up naively and they seem to work, but I'd like to understand how to match the impedance of the sensor to the impedance of the ADC.The problem, as I understand it, is that the sensor's output voltage varies directly with pressure, but can only supply a limited amount of current. The ADC needs "enough" current to charge capacitors in the sampling circuit. The ADC can be programmed to measure its input for a variable amount of time, but shorter sampling times require lower impedance on the input. If the ADC input impedance isn't high enough, it'll overdrive the sensor and screw up the reading.The relevant parts of the pressure sensor's data sheet seem to be:1) Full scale output voltage (Vfso = 4.6)2) Output Source Current at Full Scale Output (0.1 mA)A quick glance at the Ohm's Law slide rule says that's an impedance of 46K Ohms.On the ADC side, the data sheet (STM32F103) has a gnarly looking formula that relates the input impedance to sampling time, desired precision and internal measurement circuit values. They grind through the math and include a table which shows that with a sample time of about 4 uS the required input impedance is 50K.So if I just hook the sensor directly up to the ADC, I just need to make sure that the sample time is greater than 4 uS. Have I got that right?Unfortunately, things aren't quite that simple. The sensor I need to use is a 5V part while the ADC tops out at 3.3V. Thus I have to limit the output voltage of the sensor, probably with a voltage divider.Since the output impedance of the sensor is 46K, I'm pretty sure I don't want to go any lower than that on the sum of the resistors in the divider. Suppose I go for that 46K directly and build a divider out of a 13K and a 33K resistor. That'll bring the maximum Vout down to 3.3 (assuming a max Vin of 4.6), which is fine.But what does that divider do to the impedance seen by the ADC? Is it the same as before? Or is it half because I have two 46K impedances hooked up in parallel?

author: free_electron
author_rank: Super Contributor
timestamp: October 04, 2012, 09:19:15 pm
content: That sensor just gives off a voltage. As long as you don't draw more than 0.1mA you are good.The ADC will have a spike current during the sampling event.Simply put an opamp in unity gain between the sensor output and the adc input. put yourvoltage divider after the opamp.problem solved.

author: andyturk
author_rank: Frequent Contributor
timestamp: October 04, 2012, 09:42:15 pm
content: Thanks for the quick reply!I haven't worked with op-amps yet, so I'll take a look at what's involved. If this is something I could cure with a longer sampling time (i.e., fixing the problem in software), I'd prefer that to adding stuff to the circuit.Any idea how big that sampling current spike will be? I'm only sampling at 10KHz so a slow ADC clock and long sample times are a possibility. If the sample time is long enough, then the sensor output will stabilize after the initial current spike, right?

author: poorchava
author_rank: Super Contributor
timestamp: October 05, 2012, 10:13:18 am
content: If you're looking at sensopic application I'd use some amplifier with FET input (high input Z, allows for pretty much any arbitrary load impedance to be connected between sensor output and gnd), low offset (or trimmable if ultra low offset is not available). If data changes rapidly you'd need an opamp with like 100-200kHZ of flat gain bandwidth in order to catch at least some of the higher frequency components of the signal. If timing is critical you may want to check the phase delay vs frequency plot and adjust measurements/software accordingly.Opamp of course has to be configured as voltage follower, so non-inverting input to sensot output, and feedback straight from output to inverting input. You can also buy integrated voltage followers which are intended for buffer applications

author: andyturk
author_rank: Frequent Contributor
timestamp: October 05, 2012, 06:16:25 pm
content: I went out to Rat Shack and picked up a LM324 to play with. My first attempt--banging it onto a breadboard didn't work very well. I've got a 555 timer producing a square wave which is connected to a simple non-inverting buffer circuit. V- goes directly to Vout and V+ goes to the input signal. That's it.Two problems appear immediately on the scope. The first is that the op-amp's output doesn't swing all the way to Vcc (the input signal does). The second issue is that there's noticeable delay and the output slew rate seems to be very low. The 555 spits out a square wave, but the op-amp takes more than 13usec to swing from low to high.The voltage swing perhaps is explained by the V_ICR (common mode input voltage range) which is from 0 to Vcc - 1.5V. Maybe the '324 just doesn't like the input signal to swing from ground to Vcc.The time delay and slew rate seems more puzzling though. In the attached scope images, the yellow trace is the op-amp's output and the blue trace is the input.

author: DarkPrince
author_rank: Regular Contributor
timestamp: October 05, 2012, 09:34:07 pm
content: Congrats on being introduced to the non-ideal characteristics of operational amplifiers. Unfortunately that device is a very generic op-amp and has a lot of characteristics with a significant hit on circuit operation.Example for slew rate (used ST datasheet):SR = 0.4 V/uS => 4V / (0.4V/uS) = 10uS to go from 0 to 4 volts, so sounds viable as it is only a typical figureSecond, unless you get a rail-to-rail op-amp (which even those aren't perfect) you will have a margin between the possible output vs supply voltages (usually a rule of thumb of 1.5 to 2 volts).So... it all makes sense. Need to become familiar with the characteristics of op-amps. Just need to choose the right one which suites the application which has characteristics which are acceptable.When you start to amplify signals things get even more interesting with input offset voltage, bias currents, and offset current.

author: andyturk
author_rank: Frequent Contributor
timestamp: October 05, 2012, 11:05:52 pm
content: Quote from: DarkPrince on October 05, 2012, 09:34:07 pmYep, I should've read the datasheet more carefully before posting.I'm looking at the info for the MCP6L04 op amp now, which is maybe a little better suited to my project. It says it's designed for rail-to-rail input and output, 6V single-ended operation, and the datasheet was even written this century (the '324 datasheet goes back to 1975!). The specified slew rate isn't all that much different, however: 0.6V/uS.In actual operation, these pressure sensors are good for maybe 500Hz, so maybe worrying about slew rate isn't super important. What threw me is that the talk about unity gain bandwidth of 1+MHz. I assumed that my little 2kHz test signal (square wave) would come out unscathed. Probably a bad assumption.The MCP6L04 specs say that the output can get to within about 30mV of either rail. That'll work just fine since the pressure sensor output will be well within those limits.You mentioned a bunch of other configuration issues: input offset voltage, bias currents, etc. If I'm just building a voltage follower, will I have to deal with that stuff too? I'm hoping that the trivial circuit I've got now will do the trick (perhaps with a decoupling cap thrown in for good measure).

author: DarkPrince
author_rank: Regular Contributor
timestamp: October 06, 2012, 02:54:20 am
content: QuoteQuoteSlew rate should not be a factor which a slow reacting sensor as that. Don't hold any money against that, but doubt it. Also note you fed the op-amp a square wave, rather than a sine wave. One approach is to see it as the square wave's slew rate which is significantly faster (ideally it would be infinite) than the op-amps, and thus the op-amp ramps upward at its maximum slew rate. Or consider that the square wave is made out of an infinite number of sine waves (Fourier series) than the upper frequencies are attenuated and your waveform becomes distorted. So the input wave shape plays an important factor.QuoteNo, those attributes really are not going to be in any significant play in this setup. The only attribute which will be on the output is the offset voltage (2mV for the 324) so it may just be +-2mV offset from the input signal (since unity gain, the error won't be amplified).

author: jeremy
author_rank: Super Contributor
timestamp: October 06, 2012, 08:18:43 am
content: This is one of a family of very common problems. There is a whole class of ICs dedicated to solving it:http://www.analog.com/en/content/over_adc_drivers/fca.html

author: Rerouter
author_rank: Super Contributor
timestamp: October 06, 2012, 08:21:50 am
content: yes but generally those op amps are for differential adc's and are not really neccesary for such a simple low speed task,

author: jeremy
author_rank: Super Contributor
timestamp: October 06, 2012, 08:24:03 am
content: Although I agree in principle, the featured circuit on the front page of that website solves this exact problem!

author: ejeffrey
author_rank: Super Contributor
timestamp: October 06, 2012, 08:27:39 am
content: Quote from: andyturk on October 05, 2012, 11:05:52 pmLooks like a good choice. For a 500 Hz bandwidth sensor, the slew rate won't be a factor. The slew rate contributes to a parameter known as "full power bandwidth". This is the maximum sine wave frequency which can be reproduced at maximum amplitude. The formula for full power bandwidth is:FPB = SR / (pi * Vpp)For your example of 5 volt pk-pk an 0.6 V/us, that gives 38 kHz. That is plenty of bandwidth for your application, but an important cautionary tale about op amp specs. Especially micropower and rail-to-rail opamps are often seriously slew-rate constrained which can make using their full bandwidth difficult. The full power bandwidth is gain independent, so if you used these amplifiers with a gain of 25 or more, the slew rate wouldn't be a limitation.QuoteThe only other thing I can think of is offset voltage. This gives a voltage error relative to the input. Since you are using these in unity gain, the 1 mV typ. / 5 mV max offset voltage will give you the same error in the output. I suspect your pressure sensors have more temperature drift than that, and as I understand you aren't using a high resolution ADC. If you do need better than a couple mV accuracy, you will need to do more work.

author: andyturk
author_rank: Frequent Contributor
timestamp: October 06, 2012, 01:32:42 pm
content: Quote from: ejeffrey on October 06, 2012, 08:27:39 amThat's great info. Thanks! It's weird to think that in these days of gigahertz everything, a pure silicon device can be limited to 38 kHz. Fortunately, it's more than enough for this application.QuoteThe sensors are linear with temperature (for 0C to 80C, at least), so that won't be much of a problem. As I understand it (from reading 11.3.1 of "Op Amps for Everyone"), V_IO is a dc thing which means I can read what the "zero" is during initialization and back that out for calculations that require an absolute reading. Mostly what I'm interested in are changes in pressure (i.e., changes in sensor output voltage).This is all being read by a 12-bit ADC, which probably doesn't count as "high resolution" these days. One LSB is about 0.8mV at the ADC and about 1.2mV at the sensor. So a couple of mV error in amplification shouldn't matter much in the overall scheme.

author: T4P
author_rank: Super Contributor
timestamp: October 07, 2012, 08:49:18 pm
content: Huh? I suppose you come from the "modern" and "forsake everything" camp?GHz everything? No problem. Pay hundreds of dollars, no doped silicon is "pure" It's nowhere near pure12bit is plenty of resolution i'll tell ya