This may be a stupid question but i'm new to arduino and very lost. For an assignment I'm doing I have to connect both a GY-521 gyroscope module and a DS1307 rtc module to the sda and scl pins on my arduino uno r3, however afaik there's only 1 of each pin and I have 2 modules to connect to both. Are there any other pins on the arduino uno r3 that do the same function as the sda and scl pins for these modules?
I2C is a shared bus. It's literally designed to have one controller talk with multiple peripherals. That's where the addresses come into play; each peripheral has its own address it listens for. Connect up all your SDAs together, and all your SCLs together and go to town.
The one thing to watch out for is mixing 3.3V signal levels with 5V signal levels. You might get away with that for some length of time, but you could also let the magic smoke out (literally or figuratively) at any moment.
And while it won't likely be an issue with only 2 peripherals, watch out for modules that include their own pullup resistors. With a lot of peripherals doing that, the decreased resistance can become a problem. One set of pullups (usually ~3.3K to 4.7K) is a good place to start.
If you are using a breadboard, the easiest way to connect multiple I2C devices is to bring out the SDA & SCK lines to the breadboard, then use jumpers to connect them to the modules. If you're not using a breadboard, then you can make "Y" jumpers by cutting and splicing.
Oh I can just connect both to the breadboard and connect them that way? Thank you i assumed that i had to physically connect them straight from the modules to the arduino
Which Arduino? An Arduino Uno R3 has two sets of pins that carry the same I2C signals. The one set is also labeled A4/A5 and the second set is diagonally opposite.
This can save you a breadboard.
There are other boards that have two fully separate I2C interfaces.
It will not be a problem because the gyro and the RTC have different I2C addresses. Just use a breadboard. Create two lines for SCL and SDA from the Arduino to the breadboard with two male to male jumper wires. Then connect all SCL and SDAs with the two SCL and SDA points of your breadboard.