DS1307 RTC not powered on when connected to battery (XIAO BLE Sense)

I understand this could be a bit silly of a doubt. I am using the DS1307 RTC with XIAO BLE Sense nRF52840 to print timestamp. Below is my code-

// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include "RTClib.h"
#include "String.h"
RTC_DS1307 rtc;

void setup () {
  pinMode(LEDR, OUTPUT);
  pinMode(LEDG, OUTPUT);
  pinMode(LEDB, OUTPUT);
  setLedRGB(true, true, true);
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while(1) { 
      setLedRGB(true, false, false);
      setLedRGB(false, false, true); 
  // rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); //device already setup

void loop () {
  DateTime now = rtc.now();
  if((String(now.year()) == "2000") || (!now.isValid())){
    Serial.println("Check RTC!");

void setLedRGB(bool red, bool green, bool blue) {
  if (!blue) { digitalWrite(LEDB, HIGH); } else { digitalWrite(LEDB, LOW); }
  if (!green) { digitalWrite(LEDG, HIGH); } else { digitalWrite(LEDG, LOW); }
  if (!red) { digitalWrite(LEDR, HIGH); } else { digitalWrite(LEDR, LOW); }

The RTC is connected to 5V/GND of XIAO BLE Sense.
When voltage is measured at VCC/GND, it is 5V with laptop and 1.1 V with battery. (The RTC also has a 3V battery for timekeeping)
I tried connecting 3V, 6V, 9V and 12V battery, but of no difference.

Is there a mistake in my hardware setup?

Edit: I stacked up 7 coin cells to reach 20V, and only then the RTC’s power LED is flowing faintly- but why would it require so much power when the rated power supply is 3.7V around?

Hi there,
What Kind of RTC ? Is it SPI or I2C ?
I don’t see any SPI.h if so?
I think your missing some stuff?
GL :slight_smile: PJ

The RTC is connected to 5V/GND of XIAO BLE Sense.

XIAO’s 5V pin is connected to USB 5V and not to the battery. In other words, the 5V pin does not supply current to the RTC when XIAO is running on battery power.