I am confused on how I2C works. So I have two sensors I would like to hook up. Well ones a Si7021 Temp & Humidity Sensor and one is an I2C OLED screen. I know how to get a single I2C device working, but not multiple simultaneously. Are these supposed to be connected to the same SDA and SCL pins, am I able to have them both have separate SDA and SCL pins? (That is what I'm hoping for)
I should also note I'm actually using an ESP8266 for this specific project, but I'm more so looking for overall details on I2C
I2C is a bus, and can theoretically have up to 127 devices (with different addresses) connected to the same two pins. The processor uses that address when it wants to talk to a specific device.
You usually don't have to worry about anything, apart from making sure the two devices you're using have different addresses. The Si7021 I once used was (0x40).
Here is an I2C tutorial. One of many that can be seen with a search for "arduino I2C".
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.