Arduino MEGA Multiple SCL and SDA pins needed

Hello! I got both a general I2C LCD for Arduino and a DS3231 clock module. As far as I found, both wiring schematics go to the SCL and SDA pins of the mega. The problem is, there is one single pair! And there are 2 needed, if not more since I was thinking of adding more modules.

How can I connect both the LCD and the DS sensor at the same time to the Arduino? Does it really matter if it's SCL+SDA or not? Asking since I tried wiring one of the modules to an analog and digital pair of pins, but none worked ( I checked it with an I2C scan, and only the one connected to the SCL/SDA pair appeared).

Is there a way to create multiple SCL/SDA pins?


You only need one pair.

I2C is a bus system which means that you connect multiple devices to it and the correct device interacts with data on the bus because each device has a different device ID which you use to send/receive data from it

Use an I2C scanner sketch to determine the addresses of each device connected to the SDA and SCL pins and use those in your sketch

And the Mega only has one I2C bus.

The DUE, same form factor, does have two I2C busses.

Easy enough to connect multiple I2C devices to the same I2C bus, its how its designed to work.

I2C devices generally are addressable . May stack over in the same connector

I2C is a bus system. You can connect up to 127 devices to the same I2C pins, as long as each device has a different address.

There is a duplicate I2C pair next to the Aref pin.
Google "Arduino Mega pinout" and go to images.
Leo..

2 Likes

Yep, I just tried connecting both components to the same pins and it worked! Thanks for the help! :+1:t2:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.