Noise ADC readings.
Moderator: Benj
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Noise ADC readings.
Hi all,
I have some trouble with measuring the voltage output of my current sensor ACS756.
I read the voltage using my ADC MCP3208, when I read back the values it jumps from 2473 to 2481...
It's all over the place this is when no current flows, when I apply current to the circuit (2A) the the readings are even worse.
I have applied average technic where I take 10 sample, add them all together and divide this by the number of samples.
This methods works very we'll but even then, it jumps to much.
I have read about other noise filtering technics like median filter and such, but because this somewhat new for me I would like the have some assistance with this problem.
If somebody could explain ore perhaps advice some other methods of filtering I would like to here from you.
Regards Jordy
I have some trouble with measuring the voltage output of my current sensor ACS756.
I read the voltage using my ADC MCP3208, when I read back the values it jumps from 2473 to 2481...
It's all over the place this is when no current flows, when I apply current to the circuit (2A) the the readings are even worse.
I have applied average technic where I take 10 sample, add them all together and divide this by the number of samples.
This methods works very we'll but even then, it jumps to much.
I have read about other noise filtering technics like median filter and such, but because this somewhat new for me I would like the have some assistance with this problem.
If somebody could explain ore perhaps advice some other methods of filtering I would like to here from you.
Regards Jordy
Last edited by Jordy101091 on Wed Jan 29, 2014 5:23 am, edited 1 time in total.
the will to learn, should not be stopped by any price
-
- Posts: 528
- Joined: Sat Dec 01, 2012 1:23 pm
- Location: Sweden
- Has thanked: 49 times
- Been thanked: 101 times
- Contact:
Re: Noise ADC readings.
Have you tried using the ADC RAW average component macro?
First enable ADC RAW
Then use the RAW AverageINT or AverageBYTE and put for example 16 samples with a 1000us interval time
Try that. I get much more stable results with this method. You probably have a small value capacitor between GND and the ADC line. Otherwise put one 100nF ceramic cap there as well.
First enable ADC RAW
Then use the RAW AverageINT or AverageBYTE and put for example 16 samples with a 1000us interval time
Try that. I get much more stable results with this method. You probably have a small value capacitor between GND and the ADC line. Otherwise put one 100nF ceramic cap there as well.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Noise ADC readings.
hyperion007 has made a very good point therehyperion007 wrote:You probably have a small value capacitor between GND and the ADC line. Otherwise put one 100nF ceramic cap there as well.
With my circuit I had even increased to 47uF before my reading was nice and stable. It also depends of the source resistance.
The higher the resistance, the more unstable readings will be.
Martin
Martin
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Re: Noise ADC readings.
Thanks for your comment ,hyperion007 wrote:Have you tried using the ADC RAW average component macro?
First enable ADC RAW
Then use the RAW AverageINT or AverageBYTE and put for example 16 samples with a 1000us interval time
Try that. I get much more stable results with this method. You probably have a small value capacitor between GND and the ADC line. Otherwise put one 100nF ceramic cap there as well.
But as I explained above I do average my readings I only use RawSampleInt for this.
the will to learn, should not be stopped by any price
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Re: Noise ADC readings.
What do you mean by source resistance, is this the resistance between the voltage output of the ACS756 and my ADC input.medelec35 wrote:hyperion007 has made a very good point therehyperion007 wrote:You probably have a small value capacitor between GND and the ADC line. Otherwise put one 100nF ceramic cap there as well.
With my circuit I had even increased to 47uF before my reading was nice and stable. It also depends of the source resistance.
The higher the resistance, the more unstable readings will be.
Martin
the will to learn, should not be stopped by any price
-
- Posts: 528
- Joined: Sat Dec 01, 2012 1:23 pm
- Location: Sweden
- Has thanked: 49 times
- Been thanked: 101 times
- Contact:
Re: Noise ADC readings.
Sure, I got that you did averaging and while it is good that you used the RAWsampleINT I would still suggest trying the RAWAverageINT macro. It's easy enough to do. Maybe you it won't make a difference but there's a chance that it does. The reason for that is (if I am correct) that if you just do a sample, another sample, etc and add them together and divide by N then it might be to quick for the ADC to be able to get a stable reading.
I am not sure exactly what the RAW function does but I have read a bit about how to get stable and accurate ADC readings and one way to do it was to "put the PIC to sleep" while sampling the ADC and I think that might be what the RAW function does. I got much more accurate results when I started using the RAW average functions but it was still not stable enough. I had misread the label on the properties for interval time and thought it was in ms and not us so I had put 16 samples with an interval time of 100us. When I changed it to 1000us the problem just went away.
Mind you there is still quite a bit of effort that goes into designing a PCB when using high resolution ADC:s and on my PCB I have put a copper pour around the trace from the input pin to the input where I connect the source to be measured. Then stitching vias to the mirroring copper pour on layer two which is connected to the rest of the ground plane in a single place. I also have a couple of different value capacitors between the ADC input and GND.
I am not sure exactly what the RAW function does but I have read a bit about how to get stable and accurate ADC readings and one way to do it was to "put the PIC to sleep" while sampling the ADC and I think that might be what the RAW function does. I got much more accurate results when I started using the RAW average functions but it was still not stable enough. I had misread the label on the properties for interval time and thought it was in ms and not us so I had put 16 samples with an interval time of 100us. When I changed it to 1000us the problem just went away.
Mind you there is still quite a bit of effort that goes into designing a PCB when using high resolution ADC:s and on my PCB I have put a copper pour around the trace from the input pin to the input where I connect the source to be measured. Then stitching vias to the mirroring copper pour on layer two which is connected to the rest of the ground plane in a single place. I also have a couple of different value capacitors between the ADC input and GND.
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: Noise ADC readings.
Hi Jordy
As martin says fit some small capacitors
Have a look at the circuit diagram of the current sensor i made
http://www.matrixmultimedia.com/mmforum ... =2&t=14124
C1 = 100nf , C2, C3 are 47nf
Steve
As martin says fit some small capacitors
Have a look at the circuit diagram of the current sensor i made
http://www.matrixmultimedia.com/mmforum ... =2&t=14124
C1 = 100nf , C2, C3 are 47nf
Steve
Success always occurs in private and failure in full view.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Noise ADC readings.
Since the input resistance of ADC is very high, the value of resistor between i/p ADC and voltage output should not affect readings too much.Its more the load resistance i.e the resistance between +supply and transducer.Jordy101091 wrote: What do you mean by source resistance, is this the resistance between the voltage output of the ACS756 and my ADC input.
Do you have a circuit diagram?
The higher the resistance that the voltage is developed across(that will be reading across ADC Pin), then the more the reading will be unstable
Trouble with averaging, if the samples are too erratic, then on each final update, the average will still change although it would take a bit longer.
If PSU supping MCU 5V is steady and there is ay least 100uF across VDD and VSS. then I would concentrate more on smoothing the variations than averaging (or even use both methods).
Its a trade off since if cap is to high in value, then the DC reading will be steady, but may take longer than necessary to reach desired values.
Martin
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Re: Noise ADC readings.
Perhaps I did not tell you but I don't use the internal ADC.
I use a 12bit external ADC the MCP3208 with a 4.096 voltage reference.
So I cannot fuse the raw ADC functions of the ADC component
Regards jordy
I use a 12bit external ADC the MCP3208 with a 4.096 voltage reference.
So I cannot fuse the raw ADC functions of the ADC component
Regards jordy
the will to learn, should not be stopped by any price
-
- Posts: 528
- Joined: Sat Dec 01, 2012 1:23 pm
- Location: Sweden
- Has thanked: 49 times
- Been thanked: 101 times
- Contact: