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

Strange values from ADC

Hello,

I am using simple_adc__pca10028 from 8.0.0 SDK to read values from my sensor, its a kind of tensometer. My configurations are:

  • NRF_ADC_CONFIG_RES_10BIT, --- 10 bits of resolution

  • NRF_ADC_CONFIG_SCALING_INPUT_ONE_THIRD,--- 1/3 of supply value

  • NRF_ADC_CONFIG_REF_SUPPLY_ONE_HALF --- Am I thinking right, is it 3V/2 = 1,5V?

I suppose my reference voltage should be now 1,5V*3 = 4,5V, right?

I am sending readings to PC through UART, and my Termite shows values ranging from 175 to 680. I can understand that 680 = (3V/4.5V)*1023, but why 175? Why the lowest values aren't equal to zero? I mean lowest, when the current isn't flowing through my sensor.

Reading the GND values gives me 0, but unplugged wire still 175. please help

best regard, tchitchi

  • "Unplugged wire"? What does that mean? Just a floating input with no reference? A floating wire is going to have any random kind of voltage on it, why would you expect zero? What voltage do you measure on your connected sensor with a voltmeter when it's at the low point? Are you using a common ground for the nRF chip and the sensor?

  • Yes, exactly floating input. You are saying that it should measure a random voltage, but the values are ranging from 173 to 176, for me it's not really random.

    When my sensor is on it's low, it is behaving like an open circuit, so the voltage equals to the floating wire.

    My sensor doesn't require connecting directly to ground, as I said it's a kind of tensometer. Imagine a thermistor, I connected one side to VCC (3V), and the other side to ADC input. Along with applying tension, the resistance of my sensor varies, so do the voltage.


    Maybe I understood something wrong - choosing 1/3 of supply value in config doesn't require connecting power to ADC Refference pin, am I right?

  • If you don't connect anything to the pin then you aren't going to measure anything except the voltage that input pin actually floats to. That appears from your example to be about 0.7v, but it could be anything. You need to supply an externally generated, relative to the same ground, voltage to measure, ie connect your measuring device between +V and GND in some way and then attach it to the ADC pin. The ADC pin doesn't power your device, it just measures (with fairly high input impedance) the voltage which is on that pin. The 1/3 supply voltage is just saying what the internal reference measurement is.

    You need to connect your sensor between 3v and GND in some way, probably with a load resistor and then measure the voltage at the junction, just connecting it between the pin and VCC isn't really doing much.

Related