ADS1231: data conversion noise

joeyd999

Joined Jun 6, 2011
6,279
And my first -- and final answer -- is 61 sums.

If you do this as a "boxcar" filter, you can maintain 80 sps. You can then decimate the output to as many readings you want per second.
 

joeyd999

Joined Jun 6, 2011
6,279
And 32.8125Hz noise has been attenuated by 60db. Not bad!

Edit: The random noise floor has also been dropped from about 10 counts to 1 count and less depending on frequency (20dB+).
 
Last edited:

joeyd999

Joined Jun 6, 2011
6,279
Here's the raw and boxcarred data:

Selection_024.png

Edit: remember that the boxcar data is, in reality, delayed by 61 sample times (0.7625 seconds). I aligned the outputs to make reading the graph easier.

Also, the boxcar outputs are 61x greater than the inputs. Again, I scaled the output by 1/61 in order to easily compare boxcar data out with raw data in.
 
Last edited:

Thread Starter

kevinnas

Joined Jul 31, 2017
77
Thank you, looks good. I have just been working on trying to figure out the source of the noise first by cleaning up my setup & I have managed to reduce the noise codes from 3000 to about 600-700 codes. I will share the data when I get access to my computer, probably first thing tomorrow. I still have a few improvements to make & If I cannot get this peak to go then I will pursue the method you suggested above. It is the first time I have heard about the boxcar filter so I will need to look it up first as it does seem a bit involved & not sure how I could do this in my code.
 

joeyd999

Joined Jun 6, 2011
6,279
It is the first time I have heard about the boxcar filter so I will need to look it up first as it does seem a bit involved & not sure how I could do this in my code.
Not hard at all. In fact, it's one of the easiest of digital filters to implement aside from straight summation.

You will need an array of 61 stored elements. These represent each of the last 61 samples, and are updated in a "round-robin" fashion. Each sample time, the output of the filter is the sum of the 61 elements. To save time, one would not normally scale the output -- just account for the x61 factor when converting from counts to volts (or whatever unit a count represents).

Also, it is not really necessary to compute 61 sums each sample period. Just maintain an accumulator variable and zero everything out prior to the first run of the filter (the array and the accumulator).

Each sample period, subtract the oldest stored value (which will be zero for the first 61 sample times) in the array from the accumulator, and add back the new sample (to the accumulator). Then, replace the oldest stored value with the new sample and increment (modulo 61) your array pointer. The accumulator will always have the most up-to-date sum of the previous 61 samples.

Very fast and easy.

Then, you'll probably want to decimate the output of the boxcar. There are a couple of different ways to do that. We can discuss this if necessary.
 
Last edited:

joeyd999

Joined Jun 6, 2011
6,279
And don't be tempted to fall back to 10sps from the converter. I'd rather have lots of noisy data with a better spectral response. There is far more you can do with it. You've got a fast CPU...use it!
 

Thread Starter

kevinnas

Joined Jul 31, 2017
77
Hello.
I have gone back to basics a little bit and tried to get the noise without using a bridge sensor, but instead I used a voltage divider and connected the input to mid avdd. avdd = dvdd=vdd = 5V. I did this so that I can get the best possible results that I should be able to achieve. the filter resistors and cap are not connected for these results (a,b&c) (vdd and dvdd are connected to the same 5V as the excitation Vrefp and AVDD so ignore the 3v on this drawing). Please let me know what you think.
upload_2017-10-6_12-24-50.png
upload_2017-10-6_12-25-59.png
 

Attachments

joeyd999

Joined Jun 6, 2011
6,279
You need 0.1uF caps in parallel with the 1uF caps on the power pins, as close as possible to the 1231.

Aside from that, you still have injected noise. But at a different frequency. Odd.
 

Thread Starter

kevinnas

Joined Jul 31, 2017
77
But with this set up am I not quite close to the full 17.4 bits noise free at 10 sps and 15.9 noise free bits @80 sps.
(I get p-p 303 codes and 114 codes which are 17.16 and 15.76 noise free bits). Does that mean most of the noise is coming from the bridge sensor? since that is the only thing I have replaced ?
 

joeyd999

Joined Jun 6, 2011
6,279
But with this set up am I not quite close to the full 17.4 bits noise free at 10 sps and 15.9 noise free bits @80 sps.
(I get p-p 303 codes and 114 codes which are 17.16 and 15.76 noise free bits). Does that mean most of the noise is coming from the bridge sensor? since that is the only thing I have replaced ?
When I eyeball your graphs, I see spurs. So you still have noise injection somewhere -- therefore the data is not as good as it could be -- but it may be good enough for you. You decide. Post the data and let me look at it.

The load cell sensor (for which you've provided no details) is likely purely resistive. Therefore, the only noise it should be capable of generating (on its own) is Johnson noise, which has a "white" spectrum. This would not produce any frequency peaks. You can also get noise from the interconnects, but this will also have a spectrum, not a peak.

The load cell -- and the cable to which it's attached -- can pick up radiated energy. This would likely have specific peaks depending upon where it comes from. Have you tried grounding the load cell body and using shielded cable like I suggested? Two-pair twisted pair shielded cable would work even better -- use one twisted pair for excitation, and the other for signal -- with the shield grounded, of course.

Finally, you still have not posted a photo of your construction. I'd like to see that.

Edit: don't discount the fact that the load cell noise could also be generated mechanically.
 

Thread Starter

kevinnas

Joined Jul 31, 2017
77
Hi. Thanks for all your help, I really appreciate it. I have had to leave this due to time restrictions. I did however get close to the data sheet readings (by adding resistors and a cap at the analogue inputs & testing at Mid-AVDD like what is in the data sheet, my results are very similar to what is in the data sheet so I am happy with that. It probably means that the noise is coming from the load cell cables or load cell interfacing (but I will not have the time to check this this month) I cannot share my setup because the environment I am, I am not allowed unfortunately.
I am not working on something which is much simpler, sort of like the one below, but I will be modelling on a breadboard. If you have any recommendations of how the circuit/schematic might need to look like or what types of pots and transistors to use (I think BCX 08C is one of them it would be very welcome:
http://www.mantracourt.com/products...conditioners/miniature-strain-gauge-amplifier
 

joeyd999

Joined Jun 6, 2011
6,279
If you have any recommendations of how the circuit/schematic might need to look like or what types of pots and transistors to use...
I haven't used pots and transistors in a decade. I prefer the integrated digital approach. There are others here who enjoy dabbling in such novelties. They'll show up if you post the right questions.
 
Top