Connecting a GY-273 and ADXL345 together to get parallel input to Arduino UNO

Hi, I'm still a newbie in Arduino and have to build a device for my final year project at uni.

To begin with, I need to connect a GY-273 (HMC5883L) and ADXL345 sensors to get input to my Arduino UNO board. However, I do not know whether it is safe to simply connect the respective pins to the board. I've read about multiple sensor connections and learnt that there are methods called I2C and SPI for this purpose. Is it applicable for my sensors, or is there a a different approach?

I would be extremely grateful if you could help me with this question.

Thank You!

I2C is a bus, and is intended to be connected to several devices at the same time, each with a different I2C address. Understanding the I2C bus

Get each sensor working using the easy-to-find example programs before putting the two together.

Note: it is unlikely that you have the HMC5883L because it is no longer manufactured. Many of those (mislabeled) modules are actually the QMC5883L, which requires a different library.

I2C Bus address for HMC5883L is 0011110b (0x1E) and for ADXL345 is 0111101b (0x3D); therefore, they can be connected in parallel with the I2C Bus of Arduino UNO.