If I recall correctly, both the DS3231 and MPU6050 use I2C address 0x68. The 0x57 is from the EEPROM on the RTC module. You'll need to change the address on the MPU6050.
Thanks @van_der_decken -- I think this is on the right track!
I googled how to do this and found this Stack Overflow Forum that led me to connect the AD0 and VCC pins of the MPU6050.
Rerunning my sample RTC code
#include <Wire.h>
#include <RTClib.h>
RTC_DS3231 rtc;
void setup() {
Serial.begin(9600);
while (!Serial); // Wait for serial port to be available
if (!rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}
// Uncomment the following line to set the date and time
//rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
// Or set it manually like this:
rtc.adjust(DateTime(2024, 7, 4, 12, 0, 0)); // Year, Month, Day, Hour, Minute, Second
}
void loop() {
DateTime now = rtc.now();
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(" ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
delay(5000); // Wait for 5 seconds
}
I get Couldn't find RTC
How should I modify it to work with the new address?
Edit: I just realized the power light on my RTC is now super dim as well
Is your Nano a 5V board? And did you connect the AD0 pin to the Vcc pin on the breakout board? And is your Vcc pin hooked up to 5V on your Nano? If so, your non 5V tolerant MPU6050 (I checked the datasheet) may be history.
You were likely getting away with the high value internal pullups enabled by the Wire library on the SDA and SCL pins, and may have even gotten away with the 4.7K pullups on the RTC module but a direct connection to 5V on one of the MPU6050s inputs was likely more than it could take.
And if you had a CR3032 battery installed on the RTC module, did you defang the charging circuit beforehand?
The SD card module has a level shifter. That is good. It translates the 5V signals from the Nano to 3.3V signal for the SD card.
The MPU-6050 is a 3.3V chip. You may not connect its AD0 pin to 5V. The MPU-6050 chip might be damaged. That module has a counterfeit MPU-6050 which is not reliable. That module has a voltage converter and there is no level shifter for the I2C bus.
Solution: Buy a good module from Adafruit that works with a 5V Nano board.
The DS3231 chip itself can run at 3.3V and 5V, but that module is not reliable. If you put a battery in it (rechargeable or not), then it gets overcharged at 5V. The DS3231 on that module is a counterfeit or a factory reject.
Solution: remove the diode and use a normal battery. Or buy a DS3231 module from Adafruit.
While I was writing this, van_der_decken already wrote the same.
With your board and your modules, you have a 5V Arduino board with a 5V I2C bus.
The Adafruit DS3231 is just the DS3231 chip which works at 3.3V and 5V. Apply 5V from the Arduino to VIN (as you wrote). Everything is okay.
The MMA8451 Adafruit module has a voltage regulator and I2C level shifters on the board.
Apply 5V from the Arduino board to VIN ("VIN" stands for Voltage INput). If you apply 5V to the 3Vo pin, then the sensor is damaged Don't use the 3Vo pin.
The I2C address of the MMA8451 is 0x1D or 0x1C. There is no conflict with others.
The "I1" and "I2" are interrupt outputs from the sensor. Don't use them, because those pins are directly connected to a 3.3V sensor.
If you add more things, such as a OLED to the I2C bus, then all the trouble might start again. Only Adafruit makes OLED modules that are compatible with a 5V system.
If you have enough of all this 5V and 3.3V business and buy a Raspberry Pi Pico and make a 3.3V system, then the voltage regulators and the I2C level shifters on the Adafruit modules makes the signals of the I2C bus weaker.
But some manufacturer's show the I2C address as 8-bits, and some as shifted 7-bits.
Some of us happen to know that the MPU-6050 has 0x68 and 0x69 and the DS3231 has 0x68. If you don't know, then you have to check that for every module. The easiest way is to ask us