Oscillation in ADC measurement of DC value

Thread Starter

ssonel1

Joined Feb 24, 2020
16
Hi everyone. I am trying to measure the voltage of each battery connected in series to other. I am measuring voltages over voltage divider to reduce voltage below Vdda. When I measure the voltage of node with multi-meter there is no oscillation seen. But the ADC values oscillates with about 10-20mV. I plotted the voltages that I am reading with ADC. You can see the oscillation from there. As far as I understand from multi-meter measurement(which is not oscillating) the reason for oscillation is something related with ADC. Is it true? If yes what should I do to prevent that? If no what is the reason for that oscillation and again what should I do to prevent? (ADC resolution is 12 bit, grounds are common everywhere and there is no current draining except for voltage dividers.) I don't know if it could be related to this problem but just in case I wan't to say that I am going in sleep mode for pre-determined time after measuring voltages and sending them over UART and then waking up and then it goes on like that. Thanks in advance, I hope I have explained it clearly.

The circuit that I used to measure voltages.(I used AA battery instead)
circuit.JPG

Graphs I plotted.

graphs.JPG
 

AlbertHall

Joined Jun 4, 2014
12,625
When you switch ADC channels you need to allow time for the sampling capacitor in the ADC to fully charge especially as you have a fairly high resistance feeding the inputs.
That high impedance may also allow interference to be picked up and so a filter capacitor across the ADC input or on each divider output may be necessary. If you put the capacitor on the divider output that will also reduce the time needed for the sampling capacitor voltage to settle.
 

Thread Starter

ssonel1

Joined Feb 24, 2020
16
When you switch ADC channels you need to allow time for the sampling capacitor in the ADC to fully charge especially as you have a fairly high resistance feeding the inputs.
That high impedance may also allow interference to be picked up and so a filter capacitor across the ADC input or on each divider output may be necessary. If you put the capacitor on the divider output that will also reduce the time needed for the sampling capacitor voltage to settle.
Thank you for answer. Is there any source I can look for determine the capacitor value. And another thing I want to ask is; Is using buffer circuits before every channel is helps too?
 

DickCappels

Joined Aug 21, 2008
10,661
Seeing that some of the glitches show up on more than one channel suggests that there may be a problem with grounding, power supply, or other noise pickup means.

What Check the reference voltage for the ADC, the cleanliness of the power supply.

What kind of ADC is it?

Have you tried stopping or sleeping the other circuitry while the conversion takes place? For example, some controllers have the ability to sleep until a conversion is completed.

hank you for answer. Is there any source I can look for determine the capacitor value. And another thing I want to ask is; Is using buffer circuits before every channel is helps too?
The ADC datasheet is the place I've seen that information.
 

Thread Starter

ssonel1

Joined Feb 24, 2020
16
Seeing that some of the glitches show up on more than one channel suggests that there may be a problem with grounding, power supply, or other noise pickup means.

What Check the reference voltage for the ADC, the cleanliness of the power supply.

What kind of ADC is it?

Have you tried stopping or sleeping the other circuitry while the conversion takes place? For example, some controllers have the ability to sleep until a conversion is completed.



The ADC datasheet is the place I've seen that information.
Thank you for your answer sir.
I am using STM32F407vgt's ADC and for power supply I bought cheap switching DC-DC converter. I am entering the total battery voltage to this converter and getting 3.3 voltage from outside of that which I used to supply uC. When I measured that outside voltage of converter with multi-meter it looked stable.

I am not entering the uC to sleep mode unless conversion completed and datas sent to interface.
 

DickCappels

Joined Aug 21, 2008
10,661
Did you read section 5.3.20 of the datasheet, 12 bit ADC characteristics? If not, you should take a look at Equation 1 in that section and make sure the impedance of your (mux output?) does not exceed the maximum. Power supply and reference bypassing is also discussed.

Are all inputs to the chip connected to something "solid" like ground, have been turned into outputs?

During the conversion are any of the chips inputs or output changing?

Your noise problem looks sever so this method may be work for you, but sometimes when analog inputs are noisy taking a lot of measurements, adding them together, and dividing by the quantity of samples (averaging) can average out the noise. Random noise integrated of a long period tends toward zero.

Something is changing between measurements. The best troubleshooting technique would be to start turning things off until the problem goes away and then turn the last thing back on to confirm that it is the cause.

One other thought: The spikes shown in your chart might actually be much narrower where they are measured, so a DVM might not show them. Make sure your power supplies are clean, and check them and the reference bypass with a scope if you have access to one.
 

MrChips

Joined Oct 2, 2009
34,807
There are a number of possible reasons for the glitches.

1) Is this a STM DISCO board or a board you or someone on your team created?
Are the VDDA and VSSA power pins properly filtered?
Does the PCB have proper split analog and digital ground planes?

2) Is there proper shielding on input wires to the ADC?

3) Switching power supply is not a good idea with mixed signal applications.

If you cannot overcome PCB and physical issues you can try performing signal averaging.
 

Thread Starter

ssonel1

Joined Feb 24, 2020
16
There are a number of possible reasons for the glitches.

1) Is this a STM DISCO board or a board you or someone on your team created?
Are the VDDA and VSSA power pins properly filtered?
Does the PCB have proper split analog and digital ground planes?

2) Is there proper shielding on input wires to the ADC?

3) Switching power supply is not a good idea with mixed signal applications.

If you cannot overcome PCB and physical issues you can try performing signal averaging.
My circuit is below. I will get rid of that cable mess and use smaller resistances for voltage dividers. Then I hope result will be smoother.
20200516_024828.jpg
 
Top