Groking the output table of i2cdetect

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
roder
 
Posts: 5
Joined: Sat Sep 20, 2014 12:02 am

Groking the output table of i2cdetect

Post by roder »

First of all, I'm a complete n00b with regards to all things RaspberryPi and hardware; however I do have a programming background.

I'm trying to grok i2c and the bus table, but I don't get it (yet, hopefully).

I've connected the AM2315 enclosed Humidity and Temperature sensor to my Raspberry Pi Model B+. When i do

Code: Select all

 sudo i2cdetect -y 1 
I get the following output:

Code: Select all

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- 5c -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --  
From all of the instructions that I've seen, my expectation is for this sensor's address to be 0x5c. It's not clear to me if this the bus table indicates that the sensor is at 0x5c.

Can someone explain to me how to read this table? I've tried to RTFM (manpage, google, etc), but can't find a good explanation on how to read the table.

User avatar
egutting
 
Posts: 297
Joined: Wed Nov 14, 2012 12:57 am

Re: Groking the output table of i2cdetect

Post by egutting »

The 5c listed means that it detects a sensor at 0x5C (the "0x" at the beginning means that it's displaying in HEX). Your Pi is seeing the sensor. You should move forward to the next step.

User avatar
roder
 
Posts: 5
Joined: Sat Sep 20, 2014 12:02 am

Re: Groking the output table of i2cdetect

Post by roder »

That's great. Thanks for the confirmation. Also great to understand that 0x is an indication of hex.

Any chance you can explain the axises of the table to me?

User avatar
egutting
 
Posts: 297
Joined: Wed Nov 14, 2012 12:57 am

Re: Groking the output table of i2cdetect

Post by egutting »

There's going to be 2 digits in hex, we'll call them the 10's place and the 1's place. The vertical column shows the 10's place whereas the horizontal show's the 1's place. Hex uses a base 16. So for example, say you had another sensor, the BMP180 (a barometric pressure sensor), it uses the address 0x77. You would find it in the row marked: "70" and the column marked "7." Another example is the TMP007 (a IR temp sensor), it uses the address 0x40. You would find it in the row marked "40" and the column marked "0". (When I say finding it, it will say the address in those two spots as the AM2315 shows "5c" in the corresponding spot.)

Check out Collin's lab video on decimal vs hex vs binary, it's very informative.

https://learn.adafruit.com/collins-lab- ... -hex/video

User avatar
roder
 
Posts: 5
Joined: Sat Sep 20, 2014 12:02 am

Re: Groking the output table of i2cdetect

Post by roder »

Brilliant thank you!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”