I2C LCD and sensor both together on arduino nano


I have issue with connecting I2C LCD and carbon dioxide sensor to Arduino nano.

Arduino nano have a SCL and a SDA pin. The problem comes when I try to connect both LCD and sensor to Arduino nano. Board haven't two SCL and SDA pins.

What would be the best solution for this?


It doesn't need to. You can connect SCL of the Nano, the LCD and the sensor and the SDA of all three devices as well. Since the LCD and the sensor will have different I2C addresses, the Nano can address each one separately over the same pair of wires. That's the whole idea of I2C.

Perhaps do some reading & googling on how I2C works. See e.g. here: https://howtomechatronics.com/tutorials/arduino/how-i2c-communication-works-and-how-to-use-it-with-arduino/
But many other resources are available.


Thank you very much for the answer! That opened up the I2c world to me :hugs: