ESP32 not able to find I2C devices (Yes, I have pull-up resistors)

I am trying my hand at building a smart watch from scratch. I just got the latest PCBs delivered and upon soldering everything I found that the TTGO micro -32, essentially an ESP32, cannot detect any of the sensors over I2C. (The linked datasheet is the most detailed one I can find). I currently have 4.7 kΩ pull-up resistors tying SCL and SDA to 3.3 V which is also the operating voltage of the TTGO. However, I initially tried 1 kΩ pull-up resistors with no success either. I also tried removing the pull-up resistors completely because I figured the TTGO probably had internal pull-ups like the ESP32, but that did not work.

The sensors I am using are the BME680, MCP79402T-I/MS (RTC), and ADXL345BCCZ-RL7 (Accelerometer).

Below is the schematic for the design:

I found the TTGO cannot detect the sensors by running this I2C scanner code within the Arduino compiler:

#include <Arduino.h>
#include <Wire.h>

void setup()
{
  Wire.begin(21, 22);
  Serial.begin(115200);
  while (!Serial);             
  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
}

Here is where it gets confusing though. Before I designed this board, I created a breakout board for the TTGO micro-32 and wired a 128x64 OLED module to it via I2C.

I ran the same code on the breakout board to find the I2C address of the screen and it worked. For reference, on the breakout I did not use any pull-up resistor because from the best I can tell the screen has 4.7 kΩ pull-ups on it already. I have no idea what the problem could be since from the best I can tell my schematic matches the datasheets and it isn't a software issue.

How do you power all that?
Do you have a scope or logic analyzer? (A must for each PCB designer)

I am just powering it through USB as I do not have that equipment. However, i dont see how it could be power related?

USB has 5V, so there must be a voltage regulator for 3.3V. That regulator may be incapable of powering all modules.

Yes, I am using a voltage regulator that outputs 700mA but im pretty USB is cappped at 500mA anyway. For the sake of testing I disconnected 2 of the sensors and just kept the BME680 which should be using around only 1uA as it is in standby.

That's more than 1W. For that current the regulator needs a heat sink. How hot does it become?

If pins 21 and 22 are the default, why do you pass them in:

Wire.begin(21, 22);

In the example they just use Wire.begin()

Sorry, I wasnt clear. The voltage regulator is capable of 700mA it is not actually outputting that. It stays pretty cool.

I was just trying that to see if it made a difference from just using Wire.begin(), but it made no difference.

Custom boards?

Did you disconnect everything, add in one I2C device and see if the I2C scanner detects it? Just one. Make is simple.

Why does an ESP32 need a RTC when the ESP32 has one built in already?

Can you please, add a LED with 1K series resistor with SCL pin and operate it as a gpio line to blink the LED at 1-sec interval. Do the similar thing for the SDA line. This is to verify that the lines are not stuck at LOW or HIGH.

Yeah, I disconnected every other sensor except for the BME680 and it still cannot detect it. Also I hear the RTC on the ESP32 isn't the most accurate.

Show an image of the BME680 connected to your ESP32.

I use the internal RTC for 13 ESP32's they all keep time quite well.

Do you want a picture of the physical PCB because the schematic is shown in the original question?

Yes, an actual image of the project wired to the BME680.

I was not able to connect an LED, so I just wrote a simple sketch to toggle pins 21 and 22 (SDA and SCL, respectively) . Upon measuring it with a multimeter, I realized that pin 21 (SDA) is not getting pulled high it is staying at logic level 0.

@Idahowalker
@JBBOP
@DrDiettrich
@GolamMostafa


Gerber_PCB_SmartWatch-v4 (1).zip (68.0 KB)

Find out if it's a short on your PCB or a defunct controller.

Have you soldered this SMD devices manually by using soldering paste? If yes, then you have unintentionally shorted many pins together or some of the pins are not soldered with respective pads.

I mean I used a stencil. How else are you supposed to do it?
@GolamMostafa