sparkfun / OpenLog_Artemis

The OpenLog Artemis is an open source datalogger the comes preprogrammed to automatically log IMU, GPS, serial data, and various pressure, humidity, and distance sensors. All without writing a single line of code!
https://www.sparkfun.com/products/15846
Other
88 stars 47 forks source link

Add support for ADS1115 ADC #141

Closed ksya closed 1 year ago

ksya commented 1 year ago

Support for the ADS1115 using the library from https://github.com/RobTillaart/ADS1X15 This should make adding support for ADS1015 and derivatives easier as well.

PaulZC commented 1 year ago

Hi @ksya ,

Thank you for submitting this Pull Request.

Unfortunately we cannot merge it as there will be a conflict with the TMP117. Rob's library only does a very simple isConnected test, which will return true if any device is detected on that address. I.e. a TMP117 will appear as an ADS1115.

Detecting the TMP117 before the ADS1115 may work, but we would need you to prove that with a hardware test. Also, the TMP117 test may alter the way the ADS1115 is configured.... It would need to be tested.

It is possible to perform a better isConnected for the ADS1115 by doing a read-modify-write-restore on (e.g.) one of the comparator threshold registers. Maybe you could add that?

I will leave this pull request open. Please come back to us with modified code and we will see what we can do.

Best wishes, Paul

ksya commented 1 year ago

Thank you, good point. I will look into that!

PaulZC commented 1 year ago

Closing... Please submit a new Pull Request if you resolve the TMP117 conflict.

PaulZC commented 1 year ago

Hi @ksya ,

I have added support for the ADS1015 in v2.5. You can log all four channels and/or all four differential channels. You can configure the gain too. I hope it meets your needs.

Best wishes, Paul