This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using ADS1115 in differential mode
#7
(2017-05-10, 11:20 PM)e-sailing Wrote:
Code:
[ADS1115_4]
differential=1 # impossible as there are only two inputs in differential mode.

No it isn't impossible. There are 4 differential modes!!!
# 0 = Channel 0 minus channel 1        [ADS1115_1]
# 1 = Channel 0 minus channel 3        [ADS1115_2]
# 2 = Channel 1 minus channel 3        [ADS1115_3]
# 3 = Channel 2 minus channel 3        [ADS1115_4]

(you can measure up to 3 differentials not only 2!)


[quote pid='1612' dateline='1494447747']
I have used linear regression and supply an offset (added to the value from ads1115) and an intercept and a offset. The adjust_points  and adjust cover this as is, the only suggestion is that adjust_points might make polynomial or spline function to interpolate (maybe this a overkill ?).

Well if you use adjust_points, you don't need the offset.
The gui input of the adjust_points is only done for mcp3008 under the tab SPI. It can show you a graph of your adjust_points.
You can enter the adjust_points there and copy the line adjust_points = [...] from openplotter.conf to openplotter_analog.conf

In future we should add "differential=1" to the conf file. Thanks.
[/quote]


It's correct that both offset and adjust are essential the same, it's just that the linear regression produce a constant term even after trying to set the ADC count to zero for zero signal. Only one of them are needed, the offset can incorporate any offset in the ADS count. I'm still thinking about times when a linear fit would not be enough, a polynomial fit or a spline function. The adjust_points = [[100.0,0.0],[5000.0,90.0],[9000.0,100.0]] array is an easy way to provide input to a spline function that uses an x and y array and provide a function y=f(x) for any x in the given interval regardless of linearity or not for the x,y values. I'll be happy to write the spline function code.

Using the ADS in differential mode provides only two inputs, I review the documentation today.

https://cdn-shop.adafruit.com/datasheets/ads1115.pdf
Under features the datasheet states : "FOUR SINGLE-ENDED OR TWO DIFFERENTIAL INPUTS (ADS1115)" .

https://learn.adafruit.com/adafruit-4-ch...onnections
"Differential Connections:
Differential measurements use a pair of input pins, either A0&A1 or A2&A3." 

The comments in the source code above is misleading as it can be read as it is possible to have 4 differential inputs.

Should the differential code be merged into the classes in tools or as I have it now as a separate file ? The latter is already working and very simple to include, but not very elegant. It's the same chip just different ways of electrical connections and usage. I can supply the differential_ads1115.py file is needed.

I plan to set up several ADS1115s so addressing the individual chips in the config file as proposed is a good plan.


Ole
Reply


Messages In This Thread
Using ADS1115 in differential mode - by olewsaa - 2017-04-30, 08:41 PM
RE: Using ADS1115 in differential mode - by olewsaa - 2017-05-11, 07:18 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)