I am using the TMP112 I2C temperature sensor and noticed that you can choose between 4 slave addresses by connecting the A0 pin to V+, GND, SCL, or SDA.

How does the sensor tell between SCL, SDA, and V+?

It makes sense that V+ and GND can set the LSB of the slave address, but I am curious as to how the other two connections work.

Here's the link to the datasheet: http://www.ti.com/lit/ds/symlink/tmp112.pdf

I am using this sensor in an undergraduate senior project and am just curious about how this works. The answer won't affect my use of the sensor; I am just curious.


Side note: this is my first question on StackExchange so any feedback on improving my questions is appreciated.

  • \$\begingroup\$ I can see only two possible addresses in the datasheet. Selectable by connecting to either Vcc or GND. Where have you seen four? \$\endgroup\$
    – Eugene Sh.
    Jun 1 '16 at 21:52
  • \$\begingroup\$ @EugeneSh. - FYI, see section on page 12 of the datasheet. It claims that the A0 pin can be connected to the 4 choices given by the OP, to select different I2C addresses. That's different to section 5 on page 3, were it only lists the 2 options which you mention. [Section 8.2.1 on page 25 also lists the 4 address options.] \$\endgroup\$
    – SamGibson
    Jun 1 '16 at 21:57
  • \$\begingroup\$ Hm. Interesting. Doesn't make sense, though... \$\endgroup\$
    – Eugene Sh.
    Jun 1 '16 at 22:01
  • \$\begingroup\$ Well, I guess it could configure itself on startup by sending some special sequence on these pins. Or doing it on runtime by comparing A0 with SCL and SDA \$\endgroup\$
    – Eugene Sh.
    Jun 1 '16 at 22:07
  • \$\begingroup\$ @DavidG25 - Re feedback, as you asked: (a) If you mention any device/component, provide links to their datasheets (if you don't have enough rep. for multiple links, then add them as text and ask someone with enough rep. to edit them into your posting); (b) explain the context of your question i.e. why are you asking a question? How exactly do you plan to use the answers? Lack of a clear reason & context for a question often leads to wasted effort by readers trying to clarify it, and so can deter them from wanting to reply. In short: Make it easy for readers to help you :-) Good luck! \$\endgroup\$
    – SamGibson
    Jun 1 '16 at 23:13

I think that the sensor can differentiate between hard Vcc and ground, as opposed to SCL and SDA, which only have pullups to Vcc. During power up, the device can test A0 sending test data through SDL, then through SDA. If A0 is always zero no matter what the test data, it is connected to GND. If it is always one, it is connected to Vcc. If it follows the status of any of those outputs, the device can know what pin A0 is connected to (SDL or SCA).

  • \$\begingroup\$ That makes sense. That is probably incorporated into some power up time during which the sensor isn't available. Thanks for your response. \$\endgroup\$
    – DavidG25
    Jun 1 '16 at 23:40
  • \$\begingroup\$ It is pretty simple. The temp sensor part has internal circuits that can check if there is low current level continuity between the A0 pin and either of SDA or SCL. \$\endgroup\$ Jun 2 '16 at 2:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.