Post schematics, code....
Connecting "this to that" is not at all clear. How is the powering done?.....
Several questions not being answered in Your post.
There's no powering of the setup.
Showing GPIO 22 and GPIO 21 tells me nothing, not playing with ESP's. The physical pins don't tell. In schematics the logic designation of the pin has the information.
What's the message when 0x68 is not found?
Are You using a breadboard? A poor contact of Vcc, GND, SCL or SDA could be the reason.
What's the code You use for running the real application?
Due to the picture I'm uncertain about just anything but nothing looks totally wrong.
GPIO 22 and GPIO 21 are SCL and SDA pins respectively is esp32 wroom.
I have powered esp32 using a usb cable.
Here I have displayed the message that no device has been found.
I have used this code to check I2C connection.
Everything has been properly soldered.
I am building a drone with esp32 and mpu6050 and was tuning it. But suddenly mpu6050 connection breaks most of the time. If connection does not break than code works fine.
Okey.
You identify the address, 0x68 "several times". That's the correct address.
You also run the big project quite well except for intermittent trouble.
Does the rate of trouble increase supposing You start with well charged power supply? I use USB powering from phone power banks.
Do You use soldered connections all the way?
A guess.... Is there some kind of limit how often/quickly the 6050 can respond on the I2C? Is the calling frequency too high?
Yes, at starting I was able to properly use this sensor with minimum trouble. But now every time i2c connection is not detected. I have recently scanned i2c connection. I observed is that the address found is not fixed ( it should have been 0x68) sometimes two times I got 0x6E and other times not connection detected.
yes , I got every thing soldered from an expert.
The MPU-6050 supports I2C communications at up to 400kHz.
My MPU-6050 i2c connection is unstable. I do not think calling frequency is high. I am using standard library for pu 6050 with no changes. It work fine every where.
I am using MPU-6050 chinese sensor. (It might happen that something is wrong with my sensor, but it was working before)
You surely have something disturbing the I2C lines or just a cable broken and intermittent contact. Run the address scan and "rock" the cables, one at the time. I once got a stepper with a broken cable...
That's the frequency of the SCL. Not the rate You can call the 6050. Maybe I'm wrong and the 6050 is spitting out data..
Yes but the lib only connects You to the device. If You call the lib read/write function at a high rate I can imagine problems.
They know how to send up satellites and make nuclear bombs so....
One fear is they sell North Korean made rubbish....
Trial and failure is not my signum. Suggesting buy a genuine 6050 is the last idea on the road.
Let's see if any helper has experienced things like You.
Good. Surpriced that such a low value did the trick. I would have suggested 1 - 10 nF. In my opinion adding a second cap like a 10 - 100 microFarad bulk cap could increase the margins.
The Wifi transmitter can be an ugly device using high frequency transmitting that pulls "some" current.