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

SDK 15.2: Reading Analog Sensor Data using ADC gives value out of range

Hi,

I need some help calibrating my moisture sensor analog readings using 3.3V regulated power source (VDD = 3.3). Here is my set up, borrowed from the proximity example.

#define ADC_REF_VOLTAGE_IN_MILLIVOLTS 600
#define ADC_PRE_SCALING_COMPENSATION 6 
#define DIODE_FWD_VOLT_DROP_MILLIVOLTS 270
#define ADC_RES_10BIT 1024 
#define ADC_RESULT_IN_MILLI_VOLTS(ADC_VALUE ((((ADC_VALUE) * ADC_REF_VOLTAGE_IN_MILLIVOLTS) / ADC_RES_10BIT) * ADC_PRE_SCALING_COMPENSATION)
the ADC_RESULT_IN_MILLI_VOLTS is in the 3500 mV range which is not accurate. While 3.3 / 1024 * adc_result (900) = 2.9V which is right on the money.
How can I calibrate my SAADC using the proximity example?
Thanks
Parents Reply
  • Ok, so you have nrf_saadc_channel_config_t config.gain = NRF_SAADC_GAIN1_6?

    If so, you should keep ADV_PRE_SCALING_COMPENSATION 6, but you should change ADC_REF_VOLTAGE_IN_MILLIVOLTS from 600, as this suggests that you have a higher VDD voltage. 

    If you need adc_result * 3.3 / 1024, and ADC_PRE_SCALING_COMPENSATION = 6, then ADC_REF_VOLTAGE_IN_MILLIVOLTS = 3300/6 = 550.

Children
No Data
Related