Page 1 of 1

Lolin D32 v1.0.0 can't get I2C working

Posted: Sun Mar 30, 2025 3:27 am
by Blitz54
Hello! Been a while. I'm currently working on an alarm clock, and I'm at my wits' end now.

Originally I was using a board that registered as Node32s in Arduino IDE. Like this one
https://www.aliexpress.com/item/1005005 ... 1802p25W0k

Everything worked, I had a screen going with Bodmers TFT-Espi and a DS3231 RTC. But when removing the headers to solder wires directly to the board (very cramped) I pulled two traces off. Rather than screw around trying to repair it I just got a replacement board, as I wanted to add a battery backup anyway. So, I got the Lolin D32 v1.0.0
https://www.aliexpress.com/item/1005005 ... 1802fmqpHJ

No matter what I try, I can't get I2C to work on this board. I got 2 of them, after soldering everything on and realizing it didn't work, I grabbed the second one to connect only the DS3231. Still nothing. I was originally connected to the labelled pins for SDA and SCL, pins 21 and 22. I grabbed the old board with the broken traces, and that one can read the I2C. So the DS3231 didn't die randomly. I even tried a second RTC just in case, still nothing.

So I tried setting different pins as the I2C pins. Still doesn't work. Okay, the RTC has resistors on it already so it's easy to wire up, but some people said to add external pull up resistors anyway. Tried that with the suggested 4.7k, still nothing. I figured, because it works without those on the original board, but tried anyway.

So now, I am at a loss. I do not know WHY it refuses to work. The only real difference between the boards is that the Lolin D32 has a battery port. I don't believe that would affect this, especially with the battery disconnected, but I just have no idea. Anyone else experience this, or have any suggestions? At this point I'm ready to drop the battery and fix up the old board, or at least get a replacement of the old one.

Thanks all.

Re: Lolin D32 v1.0.0 can't get I2C working

Posted: Sun Mar 30, 2025 3:06 pm
by ahsrabrifat
Try to run an I2C scanner code on the Lolin D32 to see if any devices are detected.

Code: Select all

#include <Wire.h>

void setup() {
  Serial.begin(115200);
  while (!Serial);
  Serial.println("\nI2C Scanner");

  Wire.begin(21, 22); // Explicitly setting SDA and SCL
}

void loop() {
  byte error, address;
  int nDevices = 0;

  Serial.println("Scanning...");

  for(address = 1; address < 127; address++ ) {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      Serial.println(address, HEX);
      nDevices++;
    }
  }

  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("Done\n");

  delay(5000);
}
You can also check the DS3231 separately with some other platforms.

https://www.theengineeringprojects.com/ ... s3231.html.

Re: Lolin D32 v1.0.0 can't get I2C working

Posted: Sun Mar 30, 2025 8:03 pm
by Blitz54
Hey there, thanks for the reply. I've ran a few versions of a scanner now, including yours. Still can't read the I2C on the Lolin, but my other ESP32 works fine.

If I set the pins 21/22 to low/high every other second in their own code, they do correctly change, so it's not a misconfiguration of pins. I have a breakout board so all the resistors should be taken care of already on it, otherwise it shouldn't work at all with my old board. I don't have logic analyzer or oscilloscope, but I have a cheapo logic probe and when a looping scanner code was running, it would flash the low LED and make an audible noise as it did. But I can't be certain if it actually went low enough.

My only remaining thought is if it was firmware related, but I found nothing online about I2C issues where I looked. Might be worth updating it anyway, but I feel it's likely not the issue.

EDIT: Also, came across a small thread about this same board where the person claimed the ground pin by the mounting point was not connected. Not sure on that exactly, they figured it was supposed to be connected with the mounting hole, and while mine isn't connected to the mounting hole either, the two ground pins DO have continuity. And I have full 3.3v at my RTC using either ground pin.

Re: Lolin D32 v1.0.0 can't get I2C working

Posted: Thu Jul 24, 2025 8:29 pm
by Blitz54
Just to "update". Still no luck, didn't touch it for months (sitting on my desk the whole time lol) and tried today with a fresh mindset, no change. My only thought left is maybe the charging circuit on the board is screwing with the I2C. But I have no interest in looking into that. Need to find a use for these that don't require I2C I guess, which kinda sucks.

Re: Lolin D32 v1.0.0 can't get I2C working

Posted: Thu Jul 24, 2025 10:12 pm
by lbernstone
Did you try other pins? There's nothing locking I2C to 21/22, but maybe there's a problem with those connections on the board.

Re: Lolin D32 v1.0.0 can't get I2C working

Posted: Fri Jul 25, 2025 9:48 pm
by Blitz54
Did you try other pins? There's nothing locking I2C to 21/22, but maybe there's a problem with those connections on the board.
I did months ago, and confirmed the code worked as the changed pins worked on a diff board. Just didn't work on these two.