Question about voltage measurement and ADC 's

Thread Starter

hunterage2000

Joined May 2, 2010
487
Hi, I was wondering how a measured voltage is converted by an ADC. Say you have 2 probes. On the positive probe you 5V and on the negative you have 2V. The drop is 3V. If you have an ADC that has a 5V ref+ and 0V ref-. What value is taken to the Ain input? If your measuring range was between -100V and +100V and you scaled and shifted it down to a 0-5V range you could use a differential amp with the output going to AIN. But then I thought what if the difference is -5V. I thought a way around this would be to take a direct measurement of 0V at AIN1 and 5V at AIN2 and subtract them in software.

Can anyone give me a better alternative?
 

ErnieM

Joined Apr 24, 2011
8,415
Say you have one probe. THAT is what you put into an A2D since it only has one input and reads that voltage relative to ground, though you can change that reference in extreme cases. I suggest you leave it grounded.

The input range when running off a 5V supply can be 0-5 volts. So everything you want to read has to be squeezed into that range.

You can use a differential amplifier to change two floating points into a single point and ground reference. Then you can scale that to That 5V range.

For -100 to +100 volts I would scale this so -100 in reads as zero to the A2D, zero in reads as 2.5, and +100 reads at 5v to the A2D.

Then you can do some math to get back what the actual voltage out there is.

My next question would be is how many bits is your A2D and what kind of resolution do you want?
 

Thread Starter

hunterage2000

Joined May 2, 2010
487
The adc is 10 bit and not too sure about the res. This is going to be a basic PC serial multimeter using Teraterm. If the neg probe is grounded wouldnt measuring across the 5V supply to the output of a 10k 10k pot divider just measure 5V and not 2.5V?
 

ErnieM

Joined Apr 24, 2011
8,415
First you need to convert a differential signal to something referenced to ground.

Just what are you trying to measure? -100 to +100 or 5 V?
 

Reloadron

Joined Jan 15, 2015
7,892
With a focus on ADC and only ADC. You mention a 10 bit ADC which generally means your ADC has a Vref (Voltage Reference). If for example I have a Vref of 5 Volts with a 10 bit ADC there will be 2^10 quantization levels between 0 and 5 Volts. 2^10 = 1024 quantization levels. That was for what is called a single ended input. If I want to measure for example -5 to 5 Volts that would be -1024 to 1024 bits. Your ADC will output a bit count. You use your software to convert the bit count to engineering units, for example Volts. Here is an example of reading a single ended input of 5 volts.

Analog In 2.png

Channel 1 reflects the bit count at 5 Volts and channel 2 reflects the bit count converted to Volts. The conversion code for this looks like the following image:

Analog In 2A.png

The example happens to be using an Arduino ADC but how it is done is pretty common. You started a thread on this subject before and never returned to that thread.

You are not likely to find a basic ADC with the ranges you mentioned like -100 Volts to 100 Volts which means you will need to make a voltage divider to input to your ADC and again if you want to read negative voltages you need what is commonly called a Bi Polar input or Differential Input ADC.

Ron
 

Thread Starter

hunterage2000

Joined May 2, 2010
487
Ernie - The -100V is for when you have an unknown voltage drop and its polarity so you measure an unknown voltage and it could be say both -95 or +95V. The display will reflect this.

Ron - I've limited the -100V to 100V to a 0-5V range using a high valued series resistor going into a pot divider with a 5V rail on it.

I want to use an instrumentation amplifier without needing a negative rail. I'm not sure if I need to raise the offset voltage so -5V on the inputs will output 0V while +5V will give 10V then scale these down again to 0 to 5V.
 

Reloadron

Joined Jan 15, 2015
7,892
Depending on the number of needed channels There are simple to use "Starter Kits" like this one for doing basic data acquisition. That offers the differential inputs I mentioned and is a -10 to 10 Volt input per channel. The linked unit is also a 12 bit unit giving a higher resolution. There are also many other ADC Starter Kits to choose from.

I want to use an instrumentation amplifier without needing a negative rail. I'm not sure if I need to raise the offset voltage so -5V on the inputs will output 0V while +5V will give 10V then scale these down again to 0 to 5V.
There is no need for an IA or shifting voltages. Define exactly what you want to measure and choose an ADC.

Ron
 

ErnieM

Joined Apr 24, 2011
8,415
So you have a SINGLE input pair that ranges from -100 to +100 volts, and you want to convert this to a range of 0 to 5V to read it on an A2D.

How much can you load the voltage you measure? That will determine what the divider can be.

I know instrument amps exist that can work with +/- 250 volts of common mode voltage, but the one I found needs that pesky negative supply. I suspect newer models exist but cannot search one for you ATM.

Oh, and expecting numbers of -1024 to +1024 out of a 10 bit converter is asking too much. You need more bits to capture that range.

Reading -100 to +100 volts out of a 10 bit converter gives you a resolution of 200/1024 or about .2 volts. That's not accuracy, it is resolution.
 

Thread Starter

hunterage2000

Joined May 2, 2010
487
Yeah I think I might have to look at other alternatives like an external adc with more bits, maybe 16 or more. I think a resolution of 10'smV's will be fine. Never really thought about a differential input adc but I'll do some more research on this. Thanks a lot everyone. :)
 

Reloadron

Joined Jan 15, 2015
7,892
Yeah I think I might have to look at other alternatives like an external adc with more bits, maybe 16 or more. I think a resolution of 10'smV's will be fine. Never really thought about a differential input adc but I'll do some more research on this. Thanks a lot everyone. :)
You may want to give that some thought. The resolution of a n-bit analog-to-digital Converter (ADC) is a function of how many parts the maximum signal can be divided into. The formula to calculate resolution is 2^n. For example, a 10 bit ADC has a resolution of 2^10 = 1,024. Therefore, our best resolution is 1 part out of 1,024, or 0.09766% of the full scale. If Vreference is for example 5.000 volts and we have 1024 quantification levels we get 5 / 1024 = .0048828 or about 4.8 mV resolution. Resolution limits the precision of a measurement. The higher the resolution (number of bits), the more precise the measurement. An 8-bit ADC divides the vertical range of the input amplifier into 256 discrete levels. With a vertical range of 10 V, the 8-bit ADC cannot ideally resolve voltage differences smaller than 39 mV. In comparison, a 14-bit ADC with 16,384 discrete levels can ideally resolve voltage differences as small as 610 µV. Finally the quantification process itself has some error to it and noise in the process. When it comes to ADC I believe you will find the higher the bit count (2^N) the higher the cost. There is also ADC Oversampling which you may want to read about.

Ron
 
Top