SOLVED: MPU6050 sleep mode confirmed working

I've been working with the MPU6050 using this chip for different projects for a couple of years now and though I knew everything I needed to know about how it works. Yesterday it prooved me wrong and I'm seeking advice if anyone knows an alternative way.

Problem description: I try to put the MPU6050 into sleep mode. However I see from the current consumption that the device is definitely not in sleep mode, as it consumes ~3-4mA.
A bit more detail: I used this chip in previous designs, but always with a power switch, cutting power to the device in sleep mode. Now in my new design I wanted to rely on the device's own sleep mode to save power. The MPU does start upon power up in sleep mode. Therefore I can confirm with measurements that if the MPU is never initialized, it stays in sleep mode and the current consumed is negligible (in the uA range). However once the sketch starts working with the MPU, it is not possible to send it to sleep mode again. Only a complete power cycle (i.e. removing power from the application) will make the MPU sleep again, which is obviously a nogo in a battery powered application.

I use 2 proven libraries to interact with the MPU:

Both sets the Sleep enable in the same way, setting the PWR_MGMT_1 bit 6 to 1 (sleep enable), which is described in

Afterwards the MPU is supposed to enter sleep mode. However it is proven with measurement on several boards that it does not do that. I tried a few other combinations of this register, for instance activating the cyclic wake, no luck.

Does anyone have experience with this feature?

Thanks in advance: Protonerd

Do you just set the sleep bit? Post your code!

pylon:
Do you just set the sleep bit? Post your code!

Thanks pylon for getting back to me about this topic. I made a deeper analysis and found a piece of code in my reference sketch coming from the Nordic Snippets, which should have configured the I2C interface, however since it already gets configured in the Adafruit bootloader, this piece of code caused the I2C not to work properly. After removing the offending code, I could see the acceleration and gyro values and still upon entering sleep mode the current went back to the expected level.

The problem still persists in my other, target sketch, however there now I suspect that it is not the MPU drawing excess current but something else I still need to locate. It was just a somewhat unlucky coincidence that the extra current in my target sketch was the same as the average consumption of the MPU.

Therefore I now rewoke my earlier statement about sleep mode not working, changed also the topic to reflect it.