This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS1015: Getting values under/over 4v

Part Number: ADS1015

Hi Everyone,
I am trying to integrate the ADS1015 which is connected to a simple line encoder.
This line encoder outputs up to 5v (depends on how much it's stretched out).

The physical rage of the encoder is 0-40cm.

The problem is, that I can only get values up to 4v.

I tried setting the config register FSR = +-6.144v but that didn't help. After playing around a bit with the config register, I was able to get two seperate configurations:
1. 0xF00E - binary: 1111000000001110 - Which allows me to receive values up to ~4v (about 30cm).

2. 0xD00E - binary: 1101000000001110 - Which allows me to receive values from ~4v + (30-40).

I tried enabling the window comparator but without success (I have no experience with it).

Any help would be highly appreciated!

Thank you in advance.

  • Hello!

    It looks like you are configuring the ADS1015 to read single-ended data from 1) AIN3 or 2) AIN1. Which input is the voltage you are trying to measure actually connected to?

    I can't diagnose much about how the registers should be configured without more information about how you are trying to use the part. Are you trying to take a single-ended measurement? How is the encoder output connected to the ADS1015 input pins?

    I tried enabling the window comparator but without success (I have no experience with it).

    The best place to get started understanding the comparator functions is the datasheet sections on the comparator. Also read through the register map descriptions for information on how the comparator is configured. If you have any specific questions you would like answered after reading these things, I would be happy to help you.

    Let me know if you have any more questions,

    Levi DeVries

  • Hi  Levi,
    Thanks for the reply!

    Following is the design of the adc board. I am trying to use a device connected to AIN3.

    I went through the datasheet again, where I read the following:

    "The comparator is implemented as a digital comparator; therefore, the values in these registers must be updated whenever the PGA settings are changed."
     
    I then tried to change the high threshold accordingly(which didn't help either):

       // Set the desired voltage thresholds
    double highThresholdVoltage = 9.0;  // I tried playing around with this value
    
    // Calculate the corresponding ADC values based on the PGA setting
    int16_t highThresholdADC = static_cast<int16_t>((highThresholdVoltage / 6.144) * 2047);
    
    // Set the high and low threshold values for the comparator
    uint8_t highThresholdBuf[3] = {ADS1015_REG_HIGH_THRESHOLD, static_cast<uint8_t>(highThresholdADC >> 8), static_cast<uint8_t>(highThresholdADC & 0xFF)};
    
    write(i2c_fd, highThresholdBuf, sizeof(highThresholdBuf));
    

  • Hello,

    The Analog inputs of the ADS1015 must be kept below VDD, so if you are using a 3.3V power supply the highest value you could input into AIN1 or AIN3 will be 3.3V. Anything above 3.6V risks damaging the part. I'm frankly surprised the ADS1015 still operated for you up to ~4V.

    In a similar manner, the high threshold for the ADC comparator can't be above the full scale range, so in your code example the input voltage must be below 6.144. Additionally, the bottom 4 bits of the threshold registers can't be used as the ADS1015 is only a 12 bit part, so you should be multiplying the divided value by 32,767. Also keep in mind that the code you have here won't work for negative values should you ever wish to set a negative threshold.

    If you would like a guide on the basic anatomy of a datasheet we have made a 15 minute video specifically for current sense amplifiers: https://www.ti.com/video/6149107217001?keyMatch=HOW%20TO%20READ%20DATASHEETS Some of what is discussed in this video will be irrelevant to the ADS1015 datasheet but a lot of the general advice about how to use datasheets will still apply.

    Let me know if you have any more questions,

    Levi DeVries

  • Wow, thanks a lot for your support!
    Unfortunately I have little experience in the mechanical Engineering field(I do mainly software) -  so I still have much to learn.

    Best regards and thanks again, You are the best!