DS3231 RTC feather wing alarm interrupt not firing

I'm trying to create a highly accurate, self-setting clock based on an Adafruit Huzzah32 (esp32), a GPS (with a PPS) and a DS3231 RTC. I got the GPS working, I'm able to parse the NMEA sentences and see the interrupts every second. However, I'm not able to get the DS3231 interrupts working properly. I am able to set and read the time from the DS3231 but the per-second interrupts don't seem to trigger. I've verified the interrupts are never triggering on my oscilloscope.

I have directly connected the SQW/INT breakout on the DS3231 Feather Wing to A2/GPI #34 breakout spot on the Feather Wing. I choose that "pin" because it was the closest to the SQW/INT spot on the Feather Wing. I have the following code, but the "rtcHandler()" function never gets called:

#include <RTClib.h>

RTC_DS3231 rtc;

const byte RTC_pin = 34;

bool rtcHandlerCalled = false;

void rtcHandler() {
    rtcHandlerCalled = true;

void setAlarm() {

    pinMode(RTC_pin, INPUT_PULLUP);
    attachInterrupt(digitalPinToInterrupt(RTC_pin), rtcHandler, FALLING);


    if (!rtc.setAlarm1(rtc.now(), DS3231_A1_PerSecond)) {
        Serial.println("Couldn't set alarm");
    } else {
        Serial.println("Alarm set");

void setup() {

    if (!rtc.begin()) {
        Serial.println("Couldn't find RTC");
    if (rtc.lostPower()) {
        Serial.println("RTC lost power, let's set the time!");
        rtc.adjust(DateTime(2020, 12, 29, 3, 0, 0));

void loop() {
    if (rtcHandlerCalled) {
        rtcHandlerCalled = false;
        Serial.println("RTC Handler called");

I see "Alarm set" on the serial console, but nothing after that. What am I missing?

So you are probing the INT/SQW pin on the RTC shield, and it reads high, and never goes low?

I could see how it might get stuck low - because you never clear the alarm in the loop. But it seems it ought to trigger at least once. Does the alarm example in the library run ok (adjusted for your interrupt pin choice)? If so, see if it will also run if you change the alarm mode to per_second.

That is a very weird way to command a PPS from a DS3231. You should just disable alarms and configure the PPS to free run at 1 Hz.

I'm embarrassed that I didn't realize I could just use the 1Hz square wave. Thank you. The interrupts are working now.