Hi Jay (@summetj ),
Oh boy. This is a challenge…
Both the TMP102 and ADS1015 are made by TI. Both support the same four I2C addresses. Both have four 16-bit registers: Conversion, Config, Lo Thresh, Hi Thresh. It makes me think that they’re using almost the same silicon, except the TMP102 includes a temperature-to-voltage component.
Is it possible to disambiguate the two? Maybe…?
Configuration register reset values are different: 0x60A0 for the TMP102, and 0x8583 for the ADS1015. From a power-on cold start, you could use that to disambiguate. But once the register has been configured, all bets are off… You would need to power cycle the OLA and sensor to ensure reliable detection.
The two read-only converter resolution bits R1/R0 are always 1 on the TMP102. On the ADS1015, they are read-write and are two of the three MUX bits. It may be possible to disambiguate by writing 0’s to those bits, then re-read the register. If they’re still 1, you have a TMP102. Remember to restore the bits afterwards for the ADS1015. The ADS1015 library has public readRegister and writeRegister methods you can use.
When the TMP102 is put into 13-bit mode, the LSB of the conversion register is 1. 0 for 12-bit. On the ADS1015, that bit is always 0. Could you use that to disambiguate? Maybe. But it’s messy. You would need to: put the chip into EM mode, force a conversion, read the raw conversion result, check the LSB, restore the mode.
I think there’s a solution in there, with the R1/R0 vs MUX bits. But you would need to double check that R1/R0 really are read-only and always 1.
If you submit a Pull Request, we’ll happily merge it - thank you. I’ll leave it to you to decide how many menu options you want to add: temperature in C vs F, THIGH and TLOW support, Extended Mode, etc…
Best wishes,
Paul