kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.03k stars 471 forks source link

Unable to configure sleep mode #162

Open SreeCA opened 7 years ago

SreeCA commented 7 years ago

Hi, I am using MPU9250-SPI for my project, and i want to put it on sleep mode for a while during the execution , in order to reduce the power draw. The issue is i am not able to configure power management register 1 to configure it to sleep mode. I even tried to disable both gyro and accel on pwr_mgmt_2 , no progress. by the way i am not using magnetometer and temperature sensor. I am able to configure MPU9250 initially as per the requirements to read and update data, further configuration to enable sleep mode is unsuccessful. I tried reading back the pwr_mgmt registers, right after the configuration of sleep mode, which always read.. PWR_MGMT_1 = 0x01 and PWR_MGMT_2 = 0x00.

    {MPUREG_PWR_MGMT_1,         0x80, 100}, // reset
    {MPUREG_PWR_MGMT_1,         0x48, 100}, // sleep mode and temp disable
    {MPUREG_PWR_MGMT_2,         0x3F, 100}, // disable both gyro and accel 
SreeCA commented 7 years ago

I will appreciate your help, Thanks in advance

kriswiner commented 7 years ago

Not sure what your problem is.

You cannot write to the register?

Or when you set sleep bit to 1 nothing happens?

If you want to save power just disable the gyro and set the sample rate of the accel to a low value. The accel takes very little power. But do not set bit 0 in power management 1 to 0, the PLL clock source needs to stay on and active.

On Fri, Jul 14, 2017 at 12:32 PM, SreeCA notifications@github.com wrote:

I will appreciate your help, Thanks in advance

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/162#issuecomment-315447904, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qvxluZrlr7VguKJ556xf9vNdC9xgks5sN8JMgaJpZM4OYpf5 .

SreeCA commented 7 years ago

Hi kris, Thank you so much for the quick reply!!!! I guess i am not able to write to the register, i tried just disabling temp sensor with no other configuration on PWR_MGMT_1 , but when i read it back it is always 0x01. i tried setting of low sample rate for accel and disable gyro as you suggested still it draws same current as before (4 mA). My goal is to make it less than 1mA, since the current drawn during sleep mode is just 8uA as per the document.

Full Chip Idle Mode Supply Current 8 μA

Thanks Sree

kriswiner commented 7 years ago

Not sure what to tell you. If you can;t write to the register there is something wrong with your I2C bus, your MCU or your sensor.

I can put my MPU9250 to sleep just by setting the sleep bit to 1, or I can disable the gyro and drop the power by several mA, etc.

Maybe you need a better breakout? MCU? Don;t know...

On Mon, Jul 17, 2017 at 6:20 AM, SreeCA notifications@github.com wrote:

Hi kris, Thank you so much for the quick reply!!!! I guess i am not able to write to the register, i tried just disabling temp sensor with no other configuration on PWR_MGMT_1 , but when i read it back it is always 0x01. i tried setting of low sample rate for accel and disable gyro as you suggested still it draws same current as before (4 mA). My goal is to make it less than 1mA, since the current drawn during sleep mode is just 8uA as per the document.

Full Chip Idle Mode Supply Current 8 μA

Thanks Sree

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/162#issuecomment-315753359, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qgFi4tSmEc7vCvDPWxMAh3Vm_VPhks5sO1-hgaJpZM4OYpf5 .

SreeCA commented 7 years ago

I forgot to mention that i am using SPI interface not I2C. i am able to write other registers like accel config, gyro config etc.., and successfully configure to enable and read both accel and gyro. The problems are with two power management register configuration. may be bad chip????

Thank you Sree

kriswiner commented 7 years ago

No idea...

On Mon, Jul 17, 2017 at 11:17 AM, SreeCA notifications@github.com wrote:

I forgot to mention that i am using SPI interface not I2C. i am able to write other registers like accel config, gyro config etc.., and successfully configure to enable and read both accel and gyro. The problems are with two power management register configuration. may be bad chip????

Thank you Sree

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/162#issuecomment-315837630, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qrv9CPFei_iDSzVQ675RToSlQs5Dks5sO6VOgaJpZM4OYpf5 .

peter64 commented 6 years ago

Hey SreeCA,

Not to drag up an old issue (that isn't really an issue with this code anyways) but I'm running into the same problem. Did you figure it out? I've tried everything and the sensor just appears to keep cycling away even in sleep mode. It seems to cycle at different speeds depending on whether I use sleep mode or not so I know calling sleep mode is doing something. But it doesn't appear to be fully putting the sensor to sleep.

When I don't call sleep The current is 1.6mA The duty cycle of the pulses is 1851.85 Hz

When I do call sleep The current is 0.456 mA The duty cycle of the pulses is 263.15 Hz

Does anyone know why even when I set the SLEEP mode bit in PWR_MGMT_1 it is still cycling away like this. Any idea which part of the chip is doing this.

In the datasheet on page 21 it shows an LDO, could this be the source? https://www.invensense.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf

I'm having difficulty understanding how I could ever get this chip down to the 8.4 uA described on page 11 of the datasheet under 1 Hz Low Power Accelerometer, when even in sleep mode it's using 144 uA. I need to look at my breakout board more but I already removed the voltage regulator which wasn't necessary as I'm running 3.3V and the large 10uF capacitor. It should now be basically connected in a pretty minimal fashion.

http://www.ebay.ca/itm/SPI-IIC-MPU-9250-9-Axis-Attitude-Gyro-Accelerator-Magnetometer-Sensor-Module-/131185485892?

Any idea why it might be like this. I have 6 boards and they all do the exact same thing, so I don't think it's a flaky chip. I also tried turning off the compass by sending it it's own sleep mode command separately after enabling I2C slave bypass. It didn't have any effect.

Sleep mode mA current current_when_sleeping

UPDATE On page 11 at the top it says. VDD = 2.5V, VDDIO = 2.5V, TA=25°C

I'm running 3.3V

Could running at 3.3V and requiring the LDO regulator realistically cause the 8uA full chip idle sleep mode current to go up to 456uA

If I can establish that the poor sleep performance is the result of running at 3.3V instead of 2.5V and the in IC LDO regulator I may be able to put an external regulator like this one that may be more optimal at ultra low currents (not sure if it really does). http://ww1.microchip.com/downloads/en/DeviceDoc/mic5232.pdf

kriswiner commented 6 years ago

You likely need to disable the gyro as well as the mag. Sleep just affects the analog circuitry but the sensors will keep using power (especially the gyro) unless you disable it.

On Fri, Oct 13, 2017 at 1:20 AM, peter64 notifications@github.com wrote:

Hey SreeCA,

Not to drag up an old issue (that isn't really an issue with this code anyways) but I'm running into the same problem. Did you figure it out? I've tried everything and the sensor just appears to keep cycling away even in sleep mode. It seems to cycle at different speeds depending on whether I use sleep mode or not so I know calling sleep mode is doing something. But it doesn't appear to be fully putting the sensor to sleep.

When I don't call sleep The current is 1.6mA The duty cycle of the 2.4mA currents is 1851.85 Hz

When I do call sleep The current is 0.144 mA The duty cycle of the 2.4mA currents is 263.15 Hz

Does anyone know why even when I set the SLEEP mode bit in PWR_MGMT_1 it is still cycling away like this. Any idea which part of the chip is doing this.

In the datasheet on page 21 it shows an LDO, could this be the source? https://www.invensense.com/wp-content/uploads/2015/02/PS- MPU-9250A-01-v1.1.pdf

I'm having difficulty understanding how I could ever get this chip down to the 8.4 uA described on page 11 of the datasheet under 1 Hz Low Power Accelerometer, when even in sleep mode it's using 144 uA. I need to look at my breakout board more but I already removed the voltage regulator which wasn't necessary as I'm running 3.3V and the large 10uF capacitor. It should now be basically connected in a pretty minimal fashion.

http://www.ebay.ca/itm/SPI-IIC-MPU-9250-9-Axis-Attitude- Gyro-Accelerator-Magnetometer-Sensor-Module-/131185485892?

Any idea why it might be like this. I have 6 boards and they all do the exact same thing, so I don't think it's a flaky chip. I also tried turning off the compass by sending it it's own sleep mode command separately after enabling I2C slave bypass. It didn't have any effect.

[image: current_when_awake] https://user-images.githubusercontent.com/225789/31536745-b204b448-b03a-11e7-9894-4733f0c90519.PNG [image: current_when_awake_average] https://user-images.githubusercontent.com/225789/31536746-b228f1d2-b03a-11e7-9715-487be4b7942f.PNG [image: current_when_sleeping] https://user-images.githubusercontent.com/225789/31536747-b24c443e-b03a-11e7-90de-caff3f878b3f.PNG [image: current_when_sleeping_average] https://user-images.githubusercontent.com/225789/31536749-b283256c-b03a-11e7-9c91-b6f7a40fc6d7.PNG

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/162#issuecomment-336384341, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qiB-qcwsdjsoyrhTZA70jkei0uSjks5srx1DgaJpZM4OYpf5 .

peter64 commented 6 years ago

Hey Kris, Thanks for the suggestion. I ran some more tests with different orderings of the commands to disable the sensors themselves.

{MPUREG_PWR_MGMT_1,         0x80, 100}, // reset

delay(100); {MPUREG_PWR_MGMT_2, 0x3F, 100}, // disable both gyro and accel
delay(100); {MPUREG_PWR_MGMT_1, 0x48, 100}, // sleep mode and temp disable

Nothing seemed to make any difference it seems to still draw around 144uA to 200uA. I'll keep digging.

kriswiner commented 6 years ago

The 200 uA might just be your MCU, etc . In other words, the other components besides the MPU9250. We manage to get the total sleep current (MPU9250, STM32L432, BMA280, SPI flash, LDO) to 55 uA this same way.

What else is on the circuit?

On Fri, Oct 13, 2017 at 3:23 PM, peter64 notifications@github.com wrote:

Hey Kris, Thanks for the suggestion. I ran some more tests with different orderings of the commands to disable the sensors themselves.

{MPUREG_PWR_MGMT_1, 0x80, 100}, // reset

delay(100); {MPUREG_PWR_MGMT_2, 0x3F, 100}, // disable both gyro and accel delay(100); {MPUREG_PWR_MGMT_1, 0x48, 100}, // sleep mode and temp disable

Nothing seemed to make any difference it seems to still draw around 144uA to 200uA. I'll keep digging.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/162#issuecomment-336581457, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qtzO2s-_Laek1lWlvvWxyGjpnutSks5sr-LUgaJpZM4OYpf5 .

peter64 commented 6 years ago

Yeah I'm using a whispernode avr lora, and I've measured the sleep current of the rest of the system down at 4.4uA. https://bitbucket.org/talk2/whisper-node-avr-lora I'll keep fiddling and see if I can figure out whats causing it. Just to make sure, what voltage and logic levels are you running your STM32L432 and MPU9250 at?

kriswiner commented 6 years ago

3V3

On Fri, Oct 13, 2017 at 4:03 PM, peter64 notifications@github.com wrote:

Yeah I'm using a whispernode avr lora, and I've measured the sleep current of the rest of the system down at 4.4uA. https://bitbucket.org/talk2/whisper-node-avr-lora I'll keep fiddling and see if I can figure out whats causing it. Just to make sure, what voltage and logic levels are you running your STM32L432 and MPU9250 at?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/162#issuecomment-336586989, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qk911qdjCspOwkbj4yT_o1HQOR1Uks5sr-w6gaJpZM4OYpf5 .

peter64 commented 6 years ago

Thanks again Kris,

Just to correct myself. I just realized I was measuring using uCurrent range but the pulses from the battery were 15mA in height so I wasn't getting the full average power right. What I'm actually getting when I take into account the 15mA pulses instead of 2.4 mA is as follows. I'll try to figure out why.

with sensor awake 1.666 mA with sensor asleep (and gyro's and accelerometers off) 0.45685 mA with no sensor 0.00676 mA

And 450mA matches up suspiciously with the following power usage from the spec. 3-Axis Accelerometer, 4kHz ODR (no DMP) 450 µA I'll see if I can figure out if that's what's causing it. Seems that the 0x3F is being set correctly in MPUREG_PWR_MGMT_2. So the accelerometer should definitely be power off. Not sure any more really...

kriswiner commented 6 years ago

Definitely something wrong then. These are my "sleep" functions:

void MPU9250::gyromagSleep() { uint8_t temp = 0; temp = readByte(AK8963_ADDRESS, AK8963_CNTL); writeByte(AK8963_ADDRESS, AK8963_CNTL, temp & ~(0x0F) ); // Clear bits 0

void MPU9250::gyromagWake() { uint8_t temp = 0; temp = readByte(AK8963_ADDRESS, AK8963_CNTL); writeByte(AK8963_ADDRESS, AK8963_CNTL, temp | _Mmode ); // Reset normal mode for magnetometer temp = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, 0x01); // return gyro and accel normal mode delay(10); // Wait for all registers to reset }

and

void MPU9250::MPU9250wake() { // Clear sleep bit to wake MPU9250 uint8_t c = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, c & ~(0x40) ); // Clear sleep mode bit (6), enable all sensors delay(100); // Wait for all registers to reset }

void MPU9250::MPU9250sleep() { // Put the device to sleep uint8_t c = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, c | 0x40); // Set sleep mode bit (6), disable all sensors delay(100); // Wait for all registers to reset }

when I invoke these:

MPU9250.MPU9250sleep(); // start with MPU9250 asleep MPU9250.gyromagSleep(); // start with MPU9250 gyro and mag off

in the main code my current usage in << 100 uA.

On Fri, Oct 13, 2017 at 5:06 PM, peter64 notifications@github.com wrote:

Thanks again Kris,

Just to correct myself. I just realized I was measuring using uCurrent range but the pulses from the battery were 15mA in height so I wasn't getting the full average power right. What I'm actually getting when I take into account the 15mA pulses instead of 2.4 mA is as follows. I'll try to figure out why.

with sensor awake 1.666 mA with sensor asleep (and gyro's and accelerometers off) 0.45685 mA with no sensor 0.00676 mA

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/162#issuecomment-336593913, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qi0nlSGmZAojQN8MybaFiLPFH5Z4ks5sr_rqgaJpZM4OYpf5 .

peter64 commented 6 years ago

Hey Kris,

Thanks again I think I've tracked down the issue after fully mapping out the breakout board. I'm pretty sure the issue is the breakout board pull-ups. I missed one pull-up related to ADO. Which I need to set to VCC to get the second I2C address. That's sinking 330 mA which probably makes up the difference. I'm going to de-solder it tomorrow and see if that fixes things. I should have checked the simple stuff before diving into the more complicated stuff. Thanks again for all your tips.

kriswiner commented 6 years ago

I will be surprisedif this is the problem, usually pullups on gpios don;t sink a lot of current. Let me know if this fixes the problem.

On Sat, Oct 14, 2017 at 7:42 AM, peter64 notifications@github.com wrote:

Hey Kris,

Thanks again I think I've tracked down the issue after fully mapping out the breakout board. I'm pretty sure the issue is the breakout board pull-ups. I missed one pull-up related to ADO. Which I need to set to VCC to get the second I2C address. That's sinking 330 mA which probably makes up the difference. I'm going to de-solder it tomorrow and see if that fixes things. I should have checked the simple stuff before diving into the more complicated stuff. Thanks again for all your tips.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/162#issuecomment-336639182, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qugd_MV5qZMoSdOi0VeHkIn5WazZks5ssMg5gaJpZM4OYpf5 .

peter64 commented 6 years ago

Yeah it fixed the problem. It was actually a pull-down on ADO and the issue was I needed to have ADO set to vcc to change the I2C address. I didn't have any io pins left to just toggle ADO when I needed to do I2C so I had to hook it to 3.3V this was constantly sinking 330 mA. I hadn't realized they didn't leave ADO floating on the breakout board. Anyways the whole system is now running at about ~15 uA when sleeping with wake on motion and 4 hz ODR.

I also tested the sensor independently of the MCU and it seemed to perform with the following currents

on reset h6b h80 3061 uA then power down gyro and accel h6c h3f 196.8 uA then power down ptat h6b h08 186.5 uA then power down clock h6b h07 36.8 uA then sleep h6b h40 10 uA

on reset h6b h80 3061 uA after disabling gyros h6c h07 418.2 uA after config accel lowpassfilt h1d h08 418.2 uA after config int latch h37 h22 418.2 uA after config int wom h38 h40 418.2 uA after config motion detection h69 hc0 418.6 uA after config wom threshold h1f h08 418.5 uA after config detect freq 3.91hz h1e h04 418.5 uA after config power cycle h6b h20 ~11.6 uA (peaks to 15.7 every 2 seconds) after config detect freq 0.24hz h1e h00 ~11.5 uA (peaks to 18.7 every 8 seconds) after config detect freq 0.49hz h1e h01 ~11.5 uA (peaks to 18.7 every 6 seconds) after config detect freq 0.98hz h1e h02 ~11.5 uA (peaks to 15.4 every 4 seconds) after config detect freq 1.95hz h1e h03 ~11.6 uA (peaks to 15.4 every 3 seconds) after config detect freq 3.91hz h1e h04 ~11.6 uA (peaks to 15.7 every 2 seconds) after config detect freq 7.81hz h1e h05 ~12.5 uA (peaks to 15.3 every second) after config detect freq 15.63hz h1e h06 ~16.2 uA (peaks to 18.1 every second) after config detect freq 31.25hz h1e h07 22.2 uA after config detect freq 62.5hz h1e h08 32.4 uA

Also you were correct in your original assertion that calling sleep is sufficient to get the current usage to 10uA. Based on my testing you didn't need to power down the sensors separately. Infact in one test calling sleep 0x40 after turning off the clock actually turned it back on instead of going to sleep :).

Thanks for all your help.

ezechiele2517 commented 4 years ago

Hi everyone, I want to know the data rate and BW when the MPU9250 is configurated in SLEEP MODE by PWR_MGMT_1 register. In the previous comments of this post I read: When I do call sleep The current is 0.456 mA The duty cycle of the pulses is 263.15 Hz

Kingwulin commented 1 year ago

Definitely something wrong then. These are my "sleep" functions: void MPU9250::gyromagSleep() { uint8_t temp = 0; temp = readByte(AK8963_ADDRESS, AK8963_CNTL); writeByte(AK8963_ADDRESS, AK8963_CNTL, temp & ~(0x0F) ); // Clear bits 0 - 3 to power down magnetometer temp = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, temp | 0x10); // Write bit 4 to enable gyro standby delay(10); // Wait for all registers to reset } void MPU9250::gyromagWake() { uint8_t temp = 0; temp = readByte(AK8963_ADDRESS, AK8963_CNTL); writeByte(AK8963_ADDRESS, AK8963_CNTL, temp | _Mmode ); // Reset normal mode for magnetometer temp = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, 0x01); // return gyro and accel normal mode delay(10); // Wait for all registers to reset } and void MPU9250::MPU9250wake() { // Clear sleep bit to wake MPU9250 uint8_t c = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, c & ~(0x40) ); // Clear sleep mode bit (6), enable all sensors delay(100); // Wait for all registers to reset } void MPU9250::MPU9250sleep() { // Put the device to sleep uint8_t c = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, c | 0x40); // Set sleep mode bit (6), disable all sensors delay(100); // Wait for all registers to reset } when I invoke these: MPU9250.MPU9250sleep(); // start with MPU9250 asleep MPU9250.gyromagSleep(); // start with MPU9250 gyro and mag off in the main code my current usage in << 100 uA. On Fri, Oct 13, 2017 at 5:06 PM, peter64 @.***> wrote: Thanks again Kris, Just to correct myself. I just realized I was measuring using uCurrent range but the pulses from the battery were 15mA in height so I wasn't getting the full average power right. What I'm actually getting when I take into account the 15mA pulses instead of 2.4 mA is as follows. I'll try to figure out why. with sensor awake 1.666 mA with sensor asleep (and gyro's and accelerometers off) 0.45685 mA with no sensor 0.00676 mA — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#162 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qi0nlSGmZAojQN8MybaFiLPFH5Z4ks5sr_rqgaJpZM4OYpf5 .

Hi,Kris Winer,I found it is fail to read the gyro, accel and mag data from reg after I set the module to sleep mode and then call the wake up as you suggested

kriswiner commented 1 year ago

"it don't work for me" is not enough information, sorry.

I have no idea what MCU you are using, whether the MPU9250 otherwise works, and how you are sleeping/waking the MPU9250 so I can't offer any advice beyond "look at the sketch where this has been successfully implemented...."

Can you get the MPU9250 to work at all?

Can you get the MPU9250 to enter sleep mode with only the accel working?

How are you putting the MPU9250 to sleep? How waking up? How do you know it is asleep/not waking up?

On Wed, Nov 30, 2022 at 5:38 PM Kingwulin @.***> wrote:

Definitely something wrong then. These are my "sleep" functions: void MPU9250::gyromagSleep() { uint8_t temp = 0; temp = readByte(AK8963_ADDRESS, AK8963_CNTL); writeByte(AK8963_ADDRESS, AK8963_CNTL, temp & ~(0x0F) ); // Clear bits 0 - 3 to power down magnetometer temp = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, temp | 0x10); // Write bit 4 to enable gyro standby delay(10); // Wait for all registers to reset } void MPU9250::gyromagWake() { uint8_t temp = 0; temp = readByte(AK8963_ADDRESS, AK8963_CNTL); writeByte(AK8963_ADDRESS, AK8963_CNTL, temp | _Mmode ); // Reset normal mode for magnetometer temp = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, 0x01); // return gyro and accel normal mode delay(10); // Wait for all registers to reset } and void MPU9250::MPU9250wake() { // Clear sleep bit to wake MPU9250 uint8_t c = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT_1, c & ~(0x40) ); // Clear sleep mode bit (6), enable all sensors delay(100); // Wait for all registers to reset } void MPU9250::MPU9250sleep() { // Put the device to sleep uint8_t c = readByte(MPU9250_ADDRESS, PWR_MGMT_1); writeByte(MPU9250_ADDRESS, PWR_MGMT1, c | 0x40); // Set sleep mode bit (6), disable all sensors delay(100); // Wait for all registers to reset } when I invoke these: MPU9250.MPU9250sleep(); // start with MPU9250 asleep MPU9250.gyromagSleep(); // start with MPU9250 gyro and mag off in the main code my current usage in << 100 uA. … <#m-5314023329919433934_> On Fri, Oct 13, 2017 at 5:06 PM, peter64 @.***> wrote: Thanks again Kris, Just to correct myself. I just realized I was measuring using uCurrent range but the pulses from the battery were 15mA in height so I wasn't getting the full average power right. What I'm actually getting when I take into account the 15mA pulses instead of 2.4 mA is as follows. I'll try to figure out why. with sensor awake 1.666 mA with sensor asleep (and gyro's and accelerometers off) 0.45685 mA with no sensor 0.00676 mA — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#162 (comment) https://github.com/kriswiner/MPU9250/issues/162#issuecomment-336593913>, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qi0nlSGmZAojQN8MybaFiLPFH5Z4ks5sr_rqgaJpZM4OYpf5 .

Hi,Kris Winer,I found it is fail to read the gyro, accel and mag data from reg after I set the module to sleep mode and then call the wake up as you suggested

— Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/162#issuecomment-1333025764, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKSKNWKA5ZZTYSJQR5TWK76QJANCNFSM4DTCS74Q . You are receiving this because you commented.Message ID: @.***>