This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

saadc oversampling

HI, 

I'm developing it using NRF52832.

I'm updating the remaining battery capacity using saadc. However, the battery value is not stable because the value obtained from saadc is not constant. 

Can I stabilize the saadc value using oversampling?

Is there anything I missed when setting up the code for oversampling?

I'll attach the code.

<nrfx_saadc.h>

<sdk_config.h>

<main.c>

Parents Reply Children
  • Values fluctuate within a single digit range.BUT There are times when the value fluctuates significantly.

    I also tried to derive the remaining battery capacity through the average value by setting the buffer to 1.However, the remaining battery capacity is not constant due to the large splashing values.

    Should we process additional signals?

  • sabsari said:
    Values fluctuate within a single digit range

    measured in mV this is a good result. 


    sabsari said:
    BUT There are times when the value fluctuates significantly.

    how much is significantly ? 


    If the value fluctuation that is significant occurs as the same time that the CPU, Radio or some peripheral is doing something then there will be peaks and valleys on the VDD. So you will have to figure out if something else is going on during those significant fluctuations periods. 


    In addition you will also have to use the discharge curve of the battery that you are using. We only have it for CR2032.

    You can also average with oversampling, by having buffer size 1 and oversampling 16, then only one value will be written to the buffer anyways. 

    Regards,
    Jonathan