ADC device tree settings for nRF9160

Hi,

I am using custom board (nRF9160) and zephyr V2.6 and I would like to make sure that I understand the ADC settings correctly in the device tree:

channel@1 {
reg = <1>;
zephyr,gain = "ADC_GAIN_1_4";
zephyr,reference = "ADC_REF_VDD_1_4";
zephyr,vref-mv = <845>;
zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 3)>;
zephyr,input-positive = <NRF_SAADC_AIN3>; /* P0.16 */
zephyr,resolution = <14>;
zephyr,oversampling = <8>;
};
1-  "ADC_REF_VDD_1_4"; means I am using the board power supply as a ref ? it is 3.38V
2- vref-mv is 3.38 / 4
3- oversampling = <8>; is this the sampling rate ? so every time I execute adc_read_dt function, 256 samples will be collected ?
4- I am measuring the voltage every 100ms once, is ADC_ACQ_TIME_MICROSECONDS, 3 considered suitable ?
5- when the voltage is 33mV the ADC reads it as 23mV, I measured the physical pin and it is 33mV, why such difference ?
Parents
  • Hello,

    Measurements at such low voltage will be affected by noise. Need to use oversampling to average out noise to get consistent measurements

    It seems like the voltage deviation could come from DC errors like offset, gain, differential non linearity (DNL) and integral non linearity (INL). AC error could be one fo the causes for this deviation. But for battery measurement, The DC error are most noticeable. 

    The ADC has a temperature dependent offset. If the ADC is to operate over a large temperature range, we recommend running CALIBRATEOFFSET at regular intervals. The CALIBRATEDONE event will be fired when the calibration has been completed. Note that the DONE and RESULTDONE events will also be generated.

Reply
  • Hello,

    Measurements at such low voltage will be affected by noise. Need to use oversampling to average out noise to get consistent measurements

    It seems like the voltage deviation could come from DC errors like offset, gain, differential non linearity (DNL) and integral non linearity (INL). AC error could be one fo the causes for this deviation. But for battery measurement, The DC error are most noticeable. 

    The ADC has a temperature dependent offset. If the ADC is to operate over a large temperature range, we recommend running CALIBRATEOFFSET at regular intervals. The CALIBRATEDONE event will be fired when the calibration has been completed. Note that the DONE and RESULTDONE events will also be generated.

Children
No Data
Related