Forums

ADC yet again

Started by merapcb February 3, 2009
I have read the posts regarding ADC, but still have some doubts. Hope
all don't mind my query.

I have a 0-5v signal which I need to measure. The signal is "slow"
(pressure in a vessel) and does change, but not rapidly (I would like
to sample the level at 1 minute intervals approximately). The sensor's
maximum current is 100mA.

My doubts are:

1. Is just a simple resistor divider really enough? (say 2x10K) Any
other form of signal conditioning required?

2. Do I need to have a separate AVcc/AVss or can I connect them to the
digital voltage?

Thanks for your help!

Beginning Microcontrollers with the MSP430

On Tue, 2009-02-03 at 15:43 +0000, merapcb wrote:
> I have read the posts regarding ADC, but still have some doubts. Hope
> all don't mind my query.
>
> I have a 0-5v signal which I need to measure. The signal is "slow"
> (pressure in a vessel) and does change, but not rapidly (I would like
> to sample the level at 1 minute intervals approximately). The sensor's
> maximum current is 100mA.
>
> My doubts are:
>
> 1. Is just a simple resistor divider really enough? (say 2x10K) Any
> other form of signal conditioning required?

It depends on what you are looking for and what you have.

Have you looked at the signal with an oscilloscope to see if it is
smooth and quiet? I would probably add a 0.1 uF capacitor on the ADC
line in any case. Take a number of samples in a row and see how the ADC
reads the signal. Then you can decide what more you may need, if any.

You can also do stuff in SW. If the noise is not bad you can take a
number of samples and average. If the noise is spiky you can take a
number of samples and use the median.

>
> 2. Do I need to have a separate AVcc/AVss or can I connect them to the
> digital voltage?

How noisy are your power rails? Again look at them with an oscilloscope.
If you are using a switching power supply you are probably going to need
something. If you are using a linear power supply you may not need
anything.

To be safe I put a pi network (Capacitor inductor capacitor) between VCC
and AVcc and between Vss and AVss. But I check it with an oscilloscope
again. I have been using a 0603 0.1 uf Capacitor, and a 100 uH 0805
inductor. It will also depend on your layout of the board.

>
> Thanks for your help!
>
>
You can use a simple resistor divisor given the sensor output impedance is low. Otherwise you will loose resolution. Even if using 1% resistors you shall need a calibration procedure to obtain the ADC values for a given input voltage and then proceed a calculation using the offset and scale for each value read from your sensor.
The value of the resistor divider will make some influence in the time to charge the ADC's internal capacitors. So, adjust the sample time accordingly. You can see this in the User's Guide for the MSP you are using.
You don't need separate VCC/VSS. You need a GND plane and connect both MSP's VSS to the GND. If you need the whole 12bit resolution then you have to take care about pickup noise, VCC noise, etc. The noise in the digital VCC is proportional to the switching of digital I/O pins and some from internal processing in the MSP. If you can go to sleep during ADC conversion this can almost kill all noise and then connecting both VCC won't be a problem. Sometimes even under a noise environment this connection may not be a problem in case you don't need the full 12 bit resolution.
Use a software filter to improve results. It is even more important when you have a very slow input. Capture 16 or more conversions and make a simple mean calculation. An improved filter software could detect the high dv/dt values and extract them from data. You can also implement a band-stop filter to avoid 50/60Hz pickup in the cable from sensor to your equipment. But with a very slow signal just a low pass filter would be enough.
-Augusto

De:m...

Para:m...

Cia:

Data:Tue, 03 Feb 2009 15:43:16 -0000

Assunto:[msp430] ADC yet again

I have read the posts regarding ADC, but still have some doubts. Hope
all don't mind my query.

I have a 0-5v signal which I need to measure. The signal is "slow"
(pressure in a vessel) and does change, but not rapidly (I would like
to sample the level at 1 minute intervals approximately). The sensor's
maximum current is 100mA.

My doubts are:

1. Is just a simple resistor divider really enough? (say 2x10K) Any
other form of signal conditioning required?

2. Do I need to have a separate AVcc/AVss or can I connect them to the
digital voltage?

Thanks for your help!


Here is a recipe for a simple yet good filter.
Let say you need 10 aquisitions per second, then to filter the 50 or 60Hz noise pickup you make your ADC to acquire at above Niquist frequency (above 120Hz). In this case, to make it simple, adjust to 160 aquisitions per second. Then fill a 16 word circular buffer with the ADC result, inserting a new value when the ADC completes the conversion.
On every rollover of the buffer you calculate the mean value of the whole 16 stored words. This will happen once each 0.1 seconds. If needed apply the offset and scale corrections (in case you have a calibration procedure).
The mean result is your data nicelly filtered with a sample rate of 10Hz.
A different buffer size can be used and a interrupt driven mean calculation can give you different sample rates.
In this system you have a data collection machine that must acquire data in a rate at least double of the highest noise frequency. Then the data must be stored in a volume compatible with the desired system sample rate. The buffer size times the ADC sample period must be equal or greater than the system sample period.
A 16 position buffer is nice for a 12 bit ADC because it allows a quite fast mean calculation. Bigger buffer demands lower resolution or use of double-word data calculation.

-Augusto

De:m...

Para:"msp430" m...

Cia:

Data:Tue, 3 Feb 2009 14:28:46 -0200

Assunto:Re:[msp430] ADC yet again

You can use a simple resistor divisor given the sensor output impedance is low. Otherwise you will loose resolution. Even if using 1% resistors you shall need a calibration procedure to obtain the ADC values for a given input voltage and then proceed a calculation using the offset and scale for each value read from your sensor.
The value of the resistor divider will make some influence in the time to charge the ADC's internal capacitors. So, adjust the sample time accordingly. You can see this in the User's Guide for the MSP you are using.
You don't need separate VCC/VSS. You need a GND plane and connect both MSP's VSS to the GND. If you need the whole 12bit resolution then you have to take care about pickup noise, VCC noise, etc. The noise in the digital VCC is proportional to the switching of digital I/O pins and some from internal processing in the MSP. If you can go to sleep during ADC conversion this can almost kill all noise and then connecting both VCC won't be a problem. Sometimes even under a noise environment this connection may not be a problem in case you don't need the full 12 bit resolution.
Use a software filter to improve results. It is even more important when you have a very slow input. Capture 16 or more conversions and make a simple mean calculation. An improved filter software could detect the high dv/dt values and extract them from data. You can also implement a band-stop filter to avoid 50/60Hz pickup in the cable from sensor to your equipment. But with a very slow signal just a low pass filter would be enough.
-Augusto

De:m...

Para:m...

Cia:

Data:Tue, 03 Feb 2009 15:43:16 -0000

Assunto:[msp430] ADC yet again

I have read the posts regarding ADC, but still have some doubts. Hope
all don't mind my query.

I have a 0-5v signal which I need to measure. The signal is "slow"
(pressure in a vessel) and does change, but not rapidly (I would like
to sample the level at 1 minute intervals approximately). The sensor's
maximum current is 100mA.

My doubts are:

1. Is just a simple resistor divider really enough? (say 2x10K) Any
other form of signal conditioning required?

2. Do I need to have a separate AVcc/AVss or can I connect them to the
digital voltage?

Thanks for your help!




Augusto Einsfeldt wrote:
> You can use a simple resistor divisor given the sensor output impedance is low. Otherwise you will loose resolution. Even if using 1% resistors you shall need a calibration procedure to obtain the ADC values for a given input voltage and then proceed a calculation using the offset and scale for each value read from your sensor.
> The value of the resistor divider will make some influence in the time to charge the ADC's internal capacitors. So, adjust the sample time accordingly. You can see this in the User's Guide for the MSP you are using.
> You don't need separate VCC/VSS. You need a GND plane and connect both MSP's VSS to the GND. ...
Yes, that is usually best. Splitting grounds can cause all kinds of
grief because it can make the whole circuit sensitive to external noise.
Cell phones, radio transmitters, nearby thunderstorms, large current
spikes in power lines and such.

[...]

Augusto, the line breaks in your posts don't seem to work. No idea why.
I am reading this group via the gmane server, maybe something is
incompatible.

[...]

--
Regards, Joerg

http://www.analogconsultants.com/