Pages: [1]   Go Down
Author Topic: Trying to find the address of an I2C device  (Read 518 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I recently raised the question of how to find the address of an I2C device and was told that one should be able to find it in the data sheet or in some cases to assign it oneself.

I have searched the data sheet of the DTH11 temp and humidity sensor and I cant find any reference to an address.  Is it possible to quiz the device and get the address that way or am I just too dim to see it on the datasheet?   Or if I have to assign it could someone point me to where the process is explained?  I have searched numerous websites and not found any reference to assigning an address for an I2C device.

I have just watched Jeremy Blum Arduino Tutorial 7 which covers I2C and he uses address 72 for his particular device but does not mention where he found it or how he assigned that number.

As always, any help will be really appreciated.

Laurence
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 65
Posts: 2446
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cut and past the code from here http://playground.arduino.cc/Main/I2cScanner and upload it to your arduino with the DTH11 plugged in.
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you - that looks like just the thing I need.
Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 108
Posts: 4018
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the DHT11 an I2C device ?
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the DHT11 an I2C device ?
i dont think so here is what i found

5. Communication Process: Serial Interface (Single-Wire Two-Way)
Single-bus data format is used for communication and synchronization between MCU and DHT11 sensor. One communication process is about 4ms.
Data consists of decimal and integral parts. A complete data transmission is 40bit, and the sensor sends higher data bit first.
Data format: 8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data + 8bit check sum. If the data transmission is right, the check-sum should be the last 8bit of "8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data".
Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 108
Posts: 4018
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good luck Laurence !
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Norfolk UK
Offline Offline
Edison Member
*
Karma: 65
Posts: 2446
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Grab a suitable library from this tutorial http://learn.adafruit.com/dht
Works on my DHT22 okay.
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you folks.  I'm not sure now why I came to believe that the DHT11 is an I2C device.   I ran the I2C scanner program on it and got an address back but it changed each time I ran the scanner.   However, I do have a couple of I2C devices and all this is part of the learning curve, I guess.  Tonight I am not going to stop until I get a temperatue and RH value .......

I am always amazed at teh speed of response on this forum and peoples readiness to give freely of their time and expertise.  I, and many others I suspect, would have consigned their Arduinos to the bottom drawer without this extraordinary technical resource.
Logged

Pages: [1]   Go Up
Jump to: