This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Selective sampling of ADC channels at run time

I am using a 52810 custom board and the SAADC module.

It is used for sampling one analog input through AIN2 and the battery voltage directly by setting the pin to VDD

As per the documentation, since more than one channel is configured/enabled, it goes into scan mode.

i need to measure the analog input at AIN2 for 15 seconds.

However, i do not need to measure the battery voltage in every scan. I only want to measure it once every 5 seconds to check for voltage drop.

Is this possible ?

Regards

Chary BS

Parents
  • Thank you Einar for the update. This new API V2, does it have any dependency with the soft device version ? 

    I am using SDK17.0.0_9d13099, S112...

    Regards

    Chary BS

  • Hello Einar,

    I have implemented the saadc_init(0 and saadc_uninit() sequence to switch between AIN2 and VDD as and when required.

    It is working fine, thank you !

    Only one observation is that the VDD measurement seems to be off by about 0.3V. And also, it is taking three measurements to get a stable value - I am taking 10 samples in each measurement and averaging them. The averaged reading  starts with a little lower value and keeps rising towards the actual value, after three successive readings it gives a consistent value of Vdd - 0.3V. Any ideas as to how to improve the accuracy ? For a CR2032 battery @3.0V, a deviation of 0.3V makes a big difference when estimating the battery level.....

    My settings are :12bit, internal reference with 1/6 gain and channel input set to VDD.

    For the help regarding calendar implementation using app_timer i have raised a separate ticket.. as it is a different topic and i felt i should not mix the two issues.

    Regards

    Chary BS

Reply
  • Hello Einar,

    I have implemented the saadc_init(0 and saadc_uninit() sequence to switch between AIN2 and VDD as and when required.

    It is working fine, thank you !

    Only one observation is that the VDD measurement seems to be off by about 0.3V. And also, it is taking three measurements to get a stable value - I am taking 10 samples in each measurement and averaging them. The averaged reading  starts with a little lower value and keeps rising towards the actual value, after three successive readings it gives a consistent value of Vdd - 0.3V. Any ideas as to how to improve the accuracy ? For a CR2032 battery @3.0V, a deviation of 0.3V makes a big difference when estimating the battery level.....

    My settings are :12bit, internal reference with 1/6 gain and channel input set to VDD.

    For the help regarding calendar implementation using app_timer i have raised a separate ticket.. as it is a different topic and i felt i should not mix the two issues.

    Regards

    Chary BS

Children
  • Hi Chary,

    SChary said:
    Only one observation is that the VDD measurement seems to be off by about 0.3V.

    Using the internal reference you should definitely not see an offset of 0.3 V. Perhaps the issue is related to the nRF drawing more current while sampling, and that it affects the measurement results? Can you check with an oscilloscope probing on the VDD pins on the chip to see if that is the case? How stable is the plot you get on the oscilloscope in this case?

    SChary said:
    For the help regarding calendar implementation using app_timer i have raised a separate ticket.. as it is a different topic and i felt i should not mix the two issues.

    That makes a lot of sense, so thank you for that.

    Einar

  • Hello Einar,

    i haven't yet gotten around to making the measurement you suggested. Will revert to you shortly, once i am out of the problem that is currently bothering me.

    Thanks

    Chary BS

Related