why my adc doesn't register 50mv when  it has a resolution of 317uV  - Page 1
Forum section: electronics / beginners

author: amateur_25
author_rank: Regular Contributor
timestamp: May 13, 2014, 11:46:06 pm
content: HiI'm using mcp 3402 adc to measure very small voltages within the mv range. The problem is the adc won't register it as a value. However works perfectly fine at full deflection. Before I lowered the reference voltage I tried various voltages with a 5.03v reference from my psu, they all seem to register and only slightly out when compared to my cheap dmm.So I lowed the reference to 1.3v using lm317. I fed 25mv from my current monitor but got zero as a reading via the ADC.Correct me if am wrong, 1.3/4096 = 0.0003173828125 = roughly 317uv resolution hence the smallest voltage it can measure is 317uv.If so why can't it detect 50mv which is quite alot bigger. I have buffered the voltage before giving it to the ADC using tlc272 btw.

author: Skimask
author_rank: Super Contributor
timestamp: May 14, 2014, 12:11:53 am
content: How low does the tlc242 go?

author: amateur_25
author_rank: Regular Contributor
timestamp: May 14, 2014, 12:52:17 am
content: Quote from: Skimask on May 14, 2014, 12:11:53 amSorry forgive me for me lack of knowledge. What exactly am I looking for within the datasheet?One particular attribute stuck out like a sore thumb. It's called "common mode input voltage range". Its was a guess. Through research I have come to understand the common mode input voltage range is basically the min and max voltage for the inputs right? Guess what the tlc272 it's minimum is 0.2v! Doh!! Double face palm. Bloody sods law gets me everytime. "Devil in the details!!"

author: ve7xen
author_rank: Super Contributor
timestamp: May 14, 2014, 07:58:46 am
content: There are quite a few factors in play. Assuming you are using the opamp in a single-supply situation (ie. V- is 0V and V+ is some positive voltage), among others, you need to consider:Common mode input range. Defining common mode input range properly takes some words, but your assumption is basically correct for simple topologies. For this opamp (or some variants of it, anyway), this extends below the V- rail (-100mV), so you shouldn't be violating it in your setup.Input offset. This is an unknown voltage added to the input differential voltage. As a result, it will be amplified by the feedback loop (if there is gain). Depending on the TLC272 variant you are using it could be up to 10mVInput bias current. This is an unknown current source/sink in the inputs that may cause a voltage drop for high-impedance sources. On this opamp it's probably not a factor as it is very low.Output range. This is specified as VOL and VOH for low and high respectively, and are the minimum and maximum outputs the output stage can deliver. In this case VOL(max) is 50mV.Noise. Your opamp will have input and output noise, which may disturb your measurements.I assume you mean MCP3204 as MCP3402 doesn't appear to exist. This device is also imperfect and can cause "incorrect" readings by:Offset error - up to 3LSB in this device. This is an offset error consistent across the DAC's range.Gain error - up to 5LSB in this device. This is a scaling error (linear) consistent across the DAC's range.INL/DNL - up to total 2LSB in this device. These are nonlinear errors that may be difficult to specify / unspecified.So in an absolute worst case scenario you could have to up 10LSB of error, or about 3mV, due to DAC error. This DAC appears to be pretty decent as long as you're not running it at very low voltage though, so probably the opamp circuit is the problem.I'm sure I'm missing things.Do you have a multimeter good enough to measure the output of the opamp circuit? This should give you an idea if the DAC output is sensible.

author: lewis
author_rank: Frequent Contributor
timestamp: May 14, 2014, 08:39:16 am
content: ^^ What ve7xen said (except he means ADC not DAC). Using low reference voltages and low inputs is generally not a good idea on a cheap ADC, the specs generally get worse at low references levels, and the internal conversion noise of the ADC begins to swamp out the LSBs.You'd get more accuracy and linearity if you use a 4.096V or 5V reference. They are available off the shelf and are very accurate and ow noise, better than a 317. You could use a 2.048V or 2.5V ref too which are available more easily.Since you already have an op-amp in circuit, use it to add gain to the input voltage, as much as possible. You'll need a rail-to-rail input and output op-amp to measure near ground with a singe supply, or whack on a -1V rail for a cheaper op-amp (you'll need a resistor between the op-amp and the ADC to prevent a negative going voltage from damaging the ADC's input). It's advisable to put an RC filter between the op-amp and the ADC anyway, depending on your application.With a normal op-amp the input offset voltage can be significant. This gets multiplied by the gain to give an output offset. This also drifts slowly with temperature and age. To counteract offset to some degree, take an ADC sample with a known zero input. Any voltage at the ADC 'must' be offset, so subtract this from subsequent readings. Take a zero-reading regularly to counteract drift. If this is not possible in your application, you'll need a precision op-amp. They are slightly more expensive and less common, but there are still loads to choose from.Another thing to remember is the internal acquisition noise of the ADC. Even with a perfectly stable input voltage the LSBs will still be wobbling about on successive samples. Using averaging will counteract this (the acquisition noise actually becomes advantageous). The bandwidth is reduced, but resolution is actually increased. Here's a very useful algorithm:http://electronics.stackexchange.com/questions/30370/fast-and-memory-efficient-moving-average-calculation

author: amateur_25
author_rank: Regular Contributor
timestamp: May 14, 2014, 10:38:33 am
content: ah.I see it's a little more involved then just stick in and don't worry about it approach.Thanks for the lengthy explanation. I have been struggling to build this psu. The more I tinker the more I findthere is fair amount engineering to be done in a psu. I could just shove one of those ebay panel meters but figured give it a go.

author: lewis
author_rank: Frequent Contributor
timestamp: May 14, 2014, 07:30:42 pm
content: Quote from: amateur_25 on May 14, 2014, 10:38:33 amDefinitely give it a go! That's the best way to learn.

author: amateur_25
author_rank: Regular Contributor
timestamp: May 15, 2014, 09:49:18 am
content: Yeah thanks for the encouragement lewis. I refuse to be defeated by a piece of silicon is my motto.I've got INA 826 opamp. I'm going to power it with 15v dual supply so the output goes below gnd which is excellent.If this doesn't do it then I'll ask my mentor to help me.