With this sketch:
void setup() {
for (int i = 2; i < 14; i++) pinMode(i, INPUT_PULLUP); // make all pins as input
pinMode(PIN_ENABLE_SENSORS_3V3, OUTPUT);
pinMode(PIN_ENABLE_I2C_PULLUP, OUTPUT);
digitalWrite(PIN_ENABLE_SENSORS_3V3, LOW); // turn off sensors
digitalWrite(PIN_ENABLE_I2C_PULLUP, LOW);
NRF_POWER->SYSTEMOFF = 1;
}
void loop() {}
I get 2.96 mA. Not sure why my number is different from yours. Perhaps it's the different voltage (I'm powering mine at 3.3 V. Anyway, we are reasonably close to the same results.
Next, I turn off the power LED:
void setup() {
digitalWrite(LED_PWR, LOW);
for (int i = 2; i < 14; i++) pinMode(i, INPUT_PULLUP); // make all pins as input
pinMode(PIN_ENABLE_SENSORS_3V3, OUTPUT);
pinMode(PIN_ENABLE_I2C_PULLUP, OUTPUT);
digitalWrite(PIN_ENABLE_SENSORS_3V3, LOW); // turn off sensors
digitalWrite(PIN_ENABLE_I2C_PULLUP, LOW);
NRF_POWER->SYSTEMOFF = 1;
}
void loop() {}
Now I'm at 0.29 mA. Getting better!
Next, I remove the code that sets the internal pull-up resistors:
void setup() {
digitalWrite(LED_PWR, LOW);
pinMode(PIN_ENABLE_SENSORS_3V3, OUTPUT);
pinMode(PIN_ENABLE_I2C_PULLUP, OUTPUT);
digitalWrite(PIN_ENABLE_SENSORS_3V3, LOW); // turn off sensors
digitalWrite(PIN_ENABLE_I2C_PULLUP, LOW);
NRF_POWER->SYSTEMOFF = 1;
}
void loop() {}
Now I'm down to the tens of microamps I quoted before. With the NRF_POWER->SYSTEMOFF = 1; in setup(), I don't think there is any benefit to using delay() or shutting down the USB, since the processor is powered off anyway. You might find those other things to be helpful in other usages though.