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
Related