This is an old revision of the document!
When people need to communicate with each other, we use language. If two people speak the same language, they can talk all they want about all sorts of topics. If they don't speak the same language, communication is difficult. Likewise, electronic parts need to communicate - and they also have their own languages. There are a few common languages that are spoken. The most popular ones are TTL Serial, SPI, I2C, I2S, 1-Wire, and Parallel (such as 8080 or 6800). Of these, Parallel and SPI can 'share a bus' using a select line - mulitple devices can share the pins as long as they have a single pin that can be used to indicate who is permitted to speak at one time. 1-Wire and I2C are true shared-bus protocols - you can have 100+ components all talking at once using the same 2 wires (for I2C) or 1 -wire (for the aptly-named 1-wire). 1-Wire is much slower than I2C and is a strongly-patented protocol owned by Maxim so you won't see a lot of devices out there other than Maxim/Dallas parts that use 1-wire.
I2C is incredibly popular beccause it uses only 2 wires, and like we said, multiple devices can share those wires, making it a great way to connect tons of sensors, drivers, expanders, without using all the microcontroller pins. The only bad news about I2C is that each I2C device must have a unique address - and the addresses only range from 0 to 127 (0 to 0x3F hex). One thing this means is that if you have two accelerometers (lets say) and they both have address 0x22 you cannot have both of them on the same I2C lines. There are a few work-arounds. One is you might be able to power down or 'de-select' one sensor or another at a time. Another is that some boards have an address-select line or jumper or other configuration. If you can set one to a different address you're good to go.
Since we deal with so many I2C devices we thought it would be handy to have a table with all the most common sensors and modules we encounter, and their I2C address!
These addresses are in 7-bit notation (which is what the Arduino uses). Some systems want 8-bit notation, in which case you should multiply the address by 2.
If multiple address are supported, all of them will be indcated
Type | Part # | Address | Address | Address | Address | Address | Address | Address | Address |
---|---|---|---|---|---|---|---|---|---|
OLED | SSD1306 | 0x3C | 0x3D | ||||||
NFC/RFID | PN53248 | 0x24 | |||||||
Sensor | TSL2561 | 0x39 |