ADC Averaging?

Thread Starter

spinnaker

Joined Oct 29, 2009
7,837
I built a bench supply with a PIC as a DMM.

I have included my schematic below.

I know I probably should use a voltage reference but I really don't want to get into that right now.

Everything is built on a perf board. With the exception of the voltage divider which is currently on a Proto Board.


My problem is that the voltage constantly jumps in a .03 volt range. What is the best but easy way to cure this problem?

Can I do software averaging? If so, can someone suggest a algorithm?


Will I see some stabilization once I move the divider to the perf board??
 

Attachments

bertus

Joined Apr 5, 2008
20,319
Hello,

What is the resolution (or step size) of the ADC?
The resolution is the reference voltage divided by the number of steps.

Greetings,
Bertus
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,837
Hello,

What is the resolution (or step size) of the ADC?
The resolution is the reference voltage divided by the number of steps.

Greetings,
Bertus
Sorry should have posted that. I am using all 12 bits.

The divider is calculated for 40VDC but I am really reading only about 35VDC. I wanted to give some "padding" to protect any possible over voltage.

I am reading anywhere from 1.2 VDC to the stated 35VDC.


Oh and I am not seeing a corresponding "jumping" on my regular multimeter so I think the supply is pretty stable.
 

eng1ne

Joined Dec 4, 2009
97
Just curious spinnaker, why shouldn't you divide on a PIC? I am not questioning your statement, just interested. I have a program written and debugged (but not proto'd) that is INTENTED to do a division.

The speed you can read the input is dependent on the highest frequency of your input voltage.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,837
Just curious spinnaker, why shouldn't you divide on a PIC? I am not questioning your statement, just interested. I have a program written and debugged (but not proto'd) that is INTENTED to do a division.

The speed you can read the input is dependent on the highest frequency of your input voltage.
Technically inefficient. Floating point operations take a lot of memory. But really wit the chip I have and the small little program I have. I could probably go ahead and do it.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,837
It will depend from your oscillator speed and the fosc setting. See the datasheet for the timing.

Poll the go done bit, as soon as it goes to zero you can use the data and repeat the reading.

Alberto

Thanks.

Maybe I misunderstood what I read but the way I understood it, it that the go done bit is just the time it takes for the ADC version to complete.

You still need to wait for your capacitor to charge again for the input to reach full voltage.
 

SRH

Joined Jan 30, 2010
4
Why not add 8 samples and shift right three locations to average 8 samples:

(s1 + s2 + ... + s8) >> 3 = (s1 + s2 + ... + s8) / 8


SRH
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,837
Why not add 8 samples and shift right three locations to average 8 samples:

(s1 + s2 + ... + s8) >> 3 = (s1 + s2 + ... + s8) / 8


SRH

I went with this method but I bumped it up to 16 samples. It is now rock solid. Thanks.
 
Top