Hello Guys,
I am using ADS1115 with a raspberry pi. For testing purpose, I am using a three legs potentimeter. This ADS uses 15 bits in single end mode. So in principle it must give 0 and 32767 on extreme rotations of potentimeter. But I am getting 1 and 26342 on extreme positions. I had tested some exra module but the same result.
Note: I am using 3.3V for potentio and for ADS1115
ADS1115 with Raspberry pi
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88098
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADS1115 with Raspberry pi
Not necessarily. It depends on what gain setting you are using and what voltage is supplied at the high leg of the pot.So in principle it must give 0 and 32767 on extreme rotations of potentimeter.
If you are supplying 3.3v and using the 4.096v gain setting, 26399 would be the expected raw counts from a single-ended reading.
- AsifSaeed
- Posts: 10
- Joined: Wed Mar 24, 2021 6:48 am
Re: ADS1115 with Raspberry pi
@adafruit_support_bill
Thank you very much.
Yes i am supplying 3.3V to the adc chip and potentimeter. i am using gain= 1 , it means 4.096V
So my question is, what formula i will use to convert the adc value back into voltage at the end
1. voltage = adc values * (3.3/26399)
or
2. voltage = adc values * (4.096/32767)
Thank you very much.
Yes i am supplying 3.3V to the adc chip and potentimeter. i am using gain= 1 , it means 4.096V
So my question is, what formula i will use to convert the adc value back into voltage at the end
1. voltage = adc values * (3.3/26399)
or
2. voltage = adc values * (4.096/32767)
- adafruit_support_bill
- Posts: 88098
- Joined: Sat Feb 07, 2009 10:11 am
Re: ADS1115 with Raspberry pi
The calculations are pretty much equivalent.
4.096V and 32767 are the theoretical full scale voltage and raw range for that gain setting.
3.3v and 26399 (actually 26399.1943359375) are the practical full scale and raw range achievable with your configuration.
Using the rounded off value of 26399, the mathematical difference is still quite small:
(3.3/26399) = 1.2500473502784196371074661919012e-4
(4.096/32767) = 1.2500381481368449964903714102603e-4
In theory, using all the digits to the right of the decimal point you would get identical results:
(3.3/26399.1943359375) = 1.2500381481368449964903714102603e-4
But you would start running into floating point representation errors, so for best accuracy, i'd use the 4.096/32767.
4.096V and 32767 are the theoretical full scale voltage and raw range for that gain setting.
3.3v and 26399 (actually 26399.1943359375) are the practical full scale and raw range achievable with your configuration.
Using the rounded off value of 26399, the mathematical difference is still quite small:
(3.3/26399) = 1.2500473502784196371074661919012e-4
(4.096/32767) = 1.2500381481368449964903714102603e-4
In theory, using all the digits to the right of the decimal point you would get identical results:
(3.3/26399.1943359375) = 1.2500381481368449964903714102603e-4
But you would start running into floating point representation errors, so for best accuracy, i'd use the 4.096/32767.
Please be positive and constructive with your questions and comments.