IMU takes 6mA instead of 1,6mA (RAK12034)

Hi there,

I use a RAK19007 WisBlock Base Board 2nd Gen with a ESP in the CPU slot ( RAK11200 WisBlock WiFi Module). In Slot C is the Bosch IMU (RAK12034). I measured the power consumption of the different components when the ESP is in deep sleep. The IMU takes 6mA (at 3,3V VDD). This page says it draws about 1,6 mA in high performance mode ( RAK12034 WisBlock 9-Axis Accelerometer Module Datasheet | RAKwireless Documentation Center -Features → second point)

I use PlatformIO with arduino framework on a mac.

Is there any setting that I can choose from to set it into 1,5mA “power” consumption?

Sorry for the formating, I don’t get it. The Code starts here:

EDIT BY STUFF<< use ``` before and after the code part

#define HIGH_G_INT 0x07
#define HIGH_G_THRESHOLD 0x80 * 15.63

bool initIMU() {
    
bmx160.wakeUp(); // enable the imuGyroscope and accelerometer sensor
    uint8_t PMU_Status = 0;
    bmx160.readReg(0x03, &PMU_Status, 1);
    Serial.printf("[I] [initIMU]: PMU_Status = %x\r\n", PMU_Status);
    
bmx160.InterruptConfig(HIGH_G_INT,
                           HIGH_G_THRESHOLD); // Not sure if this is correct, InterruptConfig() takes uint8_t -> overflow?
    
bmx160.ODR_Config(BMX160_ACCEL_ODR_200HZ, BMX160_GYRO_ODR_200HZ); // set output data rate

    float OrdBuf[2] = {0};
    bmx160.get_ORD_Config(&OrdBuf[0], &OrdBuf[1]);
    Serial.printf("[I] [initIMU]: OrdBuf[0]= %f, OrdBuf[1]= %f\r\n", OrdBuf[0], OrdBuf[1]);

    /**
       enum{eGyroRange_2000DPS,
             eGyroRange_1000DPS,
             eGyroRange_500DPS,
             eGyroRange_250DPS,
             eGyroRange_125DPS
             }eGyroRange_t;
     **/
    bmx160.setGyroRange(eGyroRange_500DPS);
     /**
    enum{eAccelRange_2G,
         eAccelRange_4G,
         eAccelRange_8G,
         eAccelRange_16G
         }eAccelRange_t;**/
     bmx160.setAccelRange(eAccelRange_4G);

    if (enableIMUInterrupt) {
        Serial.println("[I] [initIMU]: Enable wakeup by Interrupt");
        pinMode(WB_IO3, INPUT_PULLDOWN);
        attachInterrupt(digitalPinToInterrupt(WB_IO3), IMU_InterruptHandler, RISING);
    } else {
        Serial.println("Interrupt disabled");
    }

    delay(100);

    getIMU(); // something like: bmx160.getAllData(&imuMagnitude, &imuGyroscope, &imuAccceleration);

    // bmx160.setLowPower();   //disable the imuGyroscope and accelerometer sensor
    return true;}

Oh, and there are strong neodym magnets close to the sensor.

Welcome to the forum @MaxIhme

How do you setup the LoRa transceiver.
If using LoRaWAN, the 6mA points towards that Class C is setup, which keeps the LoRa transceiver in RX mode.
If using LoRa P2P, the 6mA points towards that you have the LoRa Transceiver in RX mode.
If using Meshtastic, the 6mA is “normal” consumption.

Hi Bernd,
thanks for the hint for including code.

There is an external modem for LoRa, connected with UART. So for measuring the current consumtion of the components I cut that one of. With and without IMU the difference of current consumtion in (esp32) deep sleep is 6 mA.
Do you mean the consumption of the IMU Sensor could come from the LoRa setup?

Unfortunately I cannot tell you. I didn’t work much with the RAK12034 IMU yet. There might be some settings to keep it in low power mode, but I don’t know them (yet).

okay, thanks.

I only know there is

bmx160.setLowPower();

but as I read it only disables the sensors. In current draw you can see that the IMU takes then about nothing.