Arduino UNO board does not work on I2C mode anymore

Hello All,

I was able to use my UNO with MPU6050 till last night without any pullup resistors with the attched code.

#include <Wire.h>
#include <MPU6050.h>

MPU6050 mpu;

void setup()
{
  Serial.begin(115200);

  //  Serial.println("Initialize MPU6050");
  //
  while(!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))
  {
  //    Serial.println("Could not find a valid MPU6050 sensor, check wiring!");
 delay(500);
 }

  // If you want, you can set accelerometer offsets
  mpu.setAccelOffsetX(-18);
  mpu.setAccelOffsetY(-2354);
  mpu.setAccelOffsetZ(1022);

  checkSettings();
}

void checkSettings()
{
  //  Serial.println();
  //
  //  Serial.print(" * Sleep Mode:            ");
  //  Serial.println(mpu.getSleepEnabled() ? "Enabled" : "Disabled");
  //
  //  Serial.print(" * Clock Source:          ");
  switch (mpu.getClockSource())
  {
    case MPU6050_CLOCK_KEEP_RESET:     /*Serial.println("Stops the clock and keeps the timing generator in reset");*/ break;
    case MPU6050_CLOCK_EXTERNAL_19MHZ: /*Serial.println("PLL with external 19.2MHz reference");*/ break;
    case MPU6050_CLOCK_EXTERNAL_32KHZ: /*Serial.println("PLL with external 32.768kHz reference");*/ break;
    case MPU6050_CLOCK_PLL_ZGYRO:      /*Serial.println("PLL with Z axis gyroscope reference");*/ break;
    case MPU6050_CLOCK_PLL_YGYRO:      /*Serial.println("PLL with Y axis gyroscope reference");*/ break;
    case MPU6050_CLOCK_PLL_XGYRO:      /*Serial.println("PLL with X axis gyroscope reference");*/ break;
    case MPU6050_CLOCK_INTERNAL_8MHZ:  /*Serial.println("Internal 8MHz oscillator");*/ break;
  }

  //  Serial.print(" * Accelerometer:         ");
  switch (mpu.getRange())
  {
    case MPU6050_RANGE_16G:             /*Serial.println("+/- 16 g");*/ break;
    case MPU6050_RANGE_8G:             /* Serial.println("+/- 8 g");*/ break;
    case MPU6050_RANGE_4G:              /*Serial.println("+/- 4 g");*/ break;
    case MPU6050_RANGE_2G:              /*Serial.println("+/- 2 g"); */break;
  }

  //  Serial.print(" * Accelerometer offsets: ");
  //  Serial.print(mpu.getAccelOffsetX());
  //  Serial.print(" / ");
  //  Serial.print(mpu.getAccelOffsetY());
  //  Serial.print(" / ");
  //  Serial.println(mpu.getAccelOffsetZ());
  //
  //  Serial.println();
}

void loop()
{
  Vector rawAccel = mpu.readRawAccel();
  Vector normAccel = mpu.readNormalizeAccel();
  float temp = mpu.readTemperature();

  //  Serial.print(" Temp = ");
  //  Serial.print(temp);
  //  Serial.println(" *C");


  //  Serial.print(" Xraw = ");
  //  Serial.print(rawAccel.XAxis);
  //  Serial.print(" Yraw = ");
  //  Serial.print(rawAccel.YAxis);
  //  Serial.print(" Zraw = ");
  //
  //  Serial.println(rawAccel.ZAxis);
  //  Serial.print(" Xnorm = ");
  //  Serial.print(normAccel.XAxis);
  //  Serial.print(" Ynorm = ");
  //  Serial.print(normAccel.YAxis);
  //  Serial.print(" Znorm = ");
  //  Serial.println(normAccel.ZAxis);


  Serial.println(String(normAccel.YAxis));
  //+"\t"+ String(normAccel.YAxis));
  
  //+"\t"+ String(normAccel.ZAxis) +"\t"+ String(temp));
 
}

But all of the sudden it stopped working(the TX light stopped and only pin 13 and green LED was on).

I tried connecting the resistors(5K as i didn’t have 4.7ones, ) the solder is prett bad as I am not experienced in this. Please see attached picture.

The orange wire is SCL-A5
Violet wire is SDA-A4

connected following schematic.

Now still the board won’t work in I2C mode. Although I tried the blink sketch and it works right.

What could be the problem and how do i solve it.

It looks like shortage between orange and violet.
The value 4k7 is not critical, 5k is OK.

Hello Budvar10,

Thank you for your response.

By shortage do you mean the wire might been touching near A4,A5, because that is not the case, they aren't touching.

And I2C wasn't working before adding the resistors as well.

here the schematic i used for adding resistors.

PUR.png

Is there any way to fix it?

By shortage do you mean the wire might been touching near A4,A5, because that is not the case, they aren't touching.

Yes.

Here is a picture:

Anyway, you can desolder it and try to use breadboard.
I suppose black wire is GND but what is gray wire?

Hello Budvar10,

I understood what you are saying, got it.

The grey wire is VCC from 3.3 V, to which the resistors are connected to. Is it supposed to be like that? I mean soldering in such a way?

Is there any reference on how to solder them properly?

Thanks

And the rest of your circuit? MPU6050 module? It can have on-board regulator, in such case 3V3 power is insufficient.
Also it can have on-board I2C pull-up resistors and in such case you need not additional pair on same bus, just wires.
However, MPU works with 3V3 while Arduino with 5V, so SCL and SDA should not to be connected directly.
Read this:

You definitely should switch to the breadboard, not soldering. That is why there are pin headers on Arduino board and it is much easier to modify the circuit.

Here is some seems to be working example:

Budvar10:
And the rest of your circuit? MPU6050 module? It can have on-board regulator, in such case 3V3 power is insufficient.

yes I think it does. But I am connecting it with 5v.

Budvar10:
You definitely should switch to the breadboard, not soldering. That is why there are pin headers on Arduino board and it is much easier to modify the circuit.

I am using the bread board, but it still doesn’t work.
I have also brought in a new UNO but same results.

Budvar10:
Here is some seems to be working example:
MPU6050 Interfacing With Arduino UNO | Arduino

Yes I am using the same code.

Can you please look into the image and tell me if its done right?