DS3231 on Arduino Uno WiFi Rev2

Hello, I'm trying to connect a DS3231 RTC to my Arduino Uno WiFi Rev2 but I seem to be unable to make it work.

When I execute the function rtc.begin on any piece of code it just doesn't work (I've tried even with library examples).

I'm using the library RTClib by Adafruit.

image
This is how the wiring is made between the arduino and the rtc

I've also tried scanning the I2C devices connected and only get one connected at address 0x60 but nothing more.

I'm unsure what could be the issue here, is it the RTC that's broken? The power light does light up when I connect it to the powered board

To what pins on the Arduino board is the RTC connected? Schematic, please.

It's specified in the image, to analogic pins A4 (for SDA) and A5 (SCL) and then directly to 5V and GND

That would be the on board EEPROM (small 8 pin IC).

If the scan detects only that, and not the RTC, you may have a defective RTC board.

Repeat to be sure. Post the serial output of the I2C scanner here.

Is the RTC red power LED on? Please show images of your wiring, if you can't post a schematic.

The RTC red power LED is indeed on when I connect it to the Arduino

This is what I get from running the scan:
image

This is the code for the scan:

#include <Wire.h>
 
 
void setup()
{
  Wire.begin();
 
  Serial.begin(9600);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}
 
 
void loop()
{
  byte error, address;
  int nDevices;
 
  Serial.println("Scanning...");
 
  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
 
    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");
 
      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknown error at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");
 
  delay(5000);           // wait 5 seconds for next scan
}

Do you have any more RTC? 0x60 is probably the EEPROM. You can tell by putting a solder short across an address jumper, e.g. "A0" on the board, it should change the EEPROM address to 0x61.

1 Like

So apparently, my wiring was wrong because this board has specific pins for SCL and SDA that I completely missed and the DS3231 works now. Still I think it's good to make this since a lot of online tutorials still specify it should be wired to the analog pins.

Never trust online tutorials 100%. Always consult original source documentation.

1 Like

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