Nano33 ble - how should I go about reducing current draw

Hi all,

I am new to the forum and I have a question that I am really struggling with, I hope that someone can shine some light on this topic.

As the title states I am trying to reduce to the current draw of my nano33 ble. I am using a Ruideng to check how much power the nano33 is consuming and I can see that even with an empty sketch it draws about 0.018a or 18 mah.

That seems like a lot to me considering its an empty sketch doing nothing. From tutorials I have found that you can decrease the current draw by removing LEDs. But I am wondering if there is any way to, through the arduino IDE, make the nano33 go into some sort of sleep mode.

Apparently the board should go into sleep modes by itself when it has nothing to do, but the empty sketch kinda shows me that that is not the case. Others have had this problem but an update of the ArduinoBLE library (which I have) should have fixed this issue. It does however state in that thread that powering it via the solder jumper on the underside of the board should cut power consumption down further. But im unsure how to go about doing this. Or if its even wise to do so.

This thread talks a little bit about it but im confused as it is 4 years old and although it talks about nordic boards it is not the nRF52840. I have tried to follow the guidance there already to no avail.

This thread at Adafruit starts to guide me to overwrite the main.cpp in order to resolve this, which seems wrong but wanted to ask here.

This all to say that I have tried to take a look around on these forums as well as elsewhere to see if I can find a way of going about dealing with this issue but im a bit lost. and would be greatful for a point in the right direction.

TL:DR

Is there an example sketch for putting the nano33 ble into a sleep mode? and if not is this because we are expected to overwrite .cpp code or similar?

Steen_Petersen:
you can decrease the current draw by removing LEDs.

There were more IO pins on the nRF52840 than needed for the Nano form factor, so the Nano 33 BLE designers put the "ON" LED on a dedicated IO pin (LED_PWR). So if you want to save the power that the "ON" LED uses, no need to remove it, just do this in the setup() function of your sketch:

digitalWrite(LED_PWR, LOW);

The "L" LED is on pin 13. If you don't use pin 13, then that LED will do no harm. However, it might be that you need all the IO pins or are using the SPI bus (the led is on the SCK pin). In that case, you might want to remove the "L" LED.

Steen_Petersen:
Apparently the board should go into sleep modes by itself when it has nothing to do, but the empty sketch kinda shows me that that is not the case.

I think the way it works is it sleeps while delay() is running. See the "reference sketch" at cordio: lower power polling with timeout by sandeepmistry · Pull Request #15 · arduino-libraries/ArduinoBLE · GitHub

Steen_Petersen:
Others have had this problem but an update of the ArduinoBLE library (which I have) should have fixed this issue.

That is about power consumption while using BLE. That information doesn't apply when you're running an empty sketch.

Note this statement on the linked pull request:

I discovered the device all the time in the smartphone apps like the device doesn't go to sleep at all. Am I missing anything?

This is the intended behaviour there is no sleep, the power consumption is just lower between radio events.

Steen_Petersen:
It does however state in that thread that powering it via the solder jumper on the underside of the board should cut power consumption down further.

The DC/DC converter that converts the 5 V from the USB to the 3.3 V the nRF52840 runs at is using a lot of current. If you cut the jumper, then you can cut the DC/DC converter out of the circuit and power the nRF52840 from a 3.3 V supply directly via the 3.3V pin.

Steen_Petersen:
But im unsure how to go about doing this.

There is a small trace connecting the two larger solder jumper pads on the bottom of the board that are marked "3.3V". With a utility knife, repeatedly cut through that small trace until you are certain you have broken the connection. After doing this, the USB cable will no longer power the Nano 33 BLE, so you will need to provide a 3.3 V power supply to the board via the 3.3 V pin.

Steen_Petersen:
Or if its even wise to do so.

You do need to be careful when powering the nRF52840 directly. When powering via the USB cable, there's not much you can do wrong. But when powering from the 3.3 V pin, you could kill the chip by using too high a voltage or reversing the polarity. If you later decide you want to go back to powering the board via the USB cable, you can use a blob of solder to replace the connection between the solder jumper pads.

Steen_Petersen:
Is there an example sketch for putting the nano33 ble into a sleep mode?

Sure, it's here:

void setup() {
}

void loop() {
  // Sleep for one minute
  delay(60 * 1000);
}

Here are my findings:

BareMinimum sketch:

void setup() {}
void loop() {}

with USB power: 17.4 mA

BareMinimum sketch with 3.3 V jumper cut, powered via the 3.3 V pin: 9.49 mA

"ON" LED turned off:

void setup() {
  digitalWrite(LED_PWR, LOW);
}
void loop() {}

7.6 mA

1 minute sleep per loop:

void setup() {
  digitalWrite(LED_PWR, LOW);
}
void loop() {
  delay(60 * 1000);
}

1.747 mA

PIN_ENABLE_SENSORS_3V3 set to LOW:

void setup() {
  digitalWrite(LED_PWR, LOW);
  digitalWrite(PIN_ENABLE_SENSORS_3V3, LOW);
}
void loop() {
  delay(60 * 1000);
}

1.741 mA

PIN_ENABLE_I2C_PULLUP set to LOW:

void setup() {
 digitalWrite(LED_PWR, LOW);
 digitalWrite(PIN_ENABLE_SENSORS_3V3, LOW);
 digitalWrite(PIN_ENABLE_I2C_PULLUP, LOW);
}

void loop() {
 delay(60 * 1000);
}

1.738 mA

Unplug USB cable: 1.240 mA

Power cycle the board with USB cable unplugged: 0.906 mA

2 Likes

Hi Pert,

Thank you so much for a thorough post, I am currently trying to follow your advice. I have cut the trace and can see that the USB cable no longer powers the device.

Just to be clear, I said "3.3 V" above, but the NINA B-306 module is rated for a 1.7-3.6 V supply range. You should be fine supplying it with any voltage in that range via the 3.3 V pin.

2 Likes

Pert - thank you so much for your time at looking at my question. Although it has been some time since you answered this I have been playing around trying to get my 'Arduino Nano 33 ble' to consume as little power as possible when it is not moving. And then to wake up when it starts to move around.

There is something I am fundamentally not understanding here.

I have been able to reproduce your results almost exactly but 0.9 ma is still way too much for the project so I needed to bring it even further down. I have done this by putting the board into

NRF_POWER->SYSTEMOFF = 1;

While in this state I have been able to see the board get as low as +-30 µa which is way more in line with what I would expect when the system is off.

So here comes the hard part - When I now want to have my nano come back to life when it is moved I have come to realize that I somehow have to let it know where to expect, and to expect, an interrupt call.

I have found that should look something like this:

nrf_gpio_cfg_sense_input(accPin, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_HIGH); // accPin = Accelerometer pin

But I'm not quite sure how to tell it to listen to 1) the sensor moving, 2) the sensor moving over a certain amount, etc. Really having a hard time finding any information on this.

I'm rather confused about the setup of all of this. I'm starting to understand that I need to tell the NRF to sleep and that there are certain pins that it can be told to listen to while in SYSTEMOFF. From the documentation:

5.3.3 System OFF mode
System OFF is the deepest power saving mode the system can enter. In this mode, the system’s core functionality is powered down and all ongoing tasks are terminated. The device can be put into System OFF mode using the register SYSTEMOFF on page 76. When in System OFF mode, the device can be woken up through one of the following signals:

  1. The DETECT signal, optionally generated by the GPIO peripheral.
  2. The ANADETECT signal, optionally generated by the LPCOMP module.
  3. The SENSE signal, optionally generated by the NFC module to wake-on-field.
  4. Detecting a valid USB voltage on the VBUS pin (VBUS, DETECT).
    5.A reset.
    The system is reset when it wakes up from the System OFF mode.

I understand that as being able to use GPIO (general purpose input/output) as an interrupt. Can I not use the accelerometer as a GPIO? and if so? how? Due to me being an amateur, I tried to figure out which pin corresponded to the accelerometer, then set that to be the accPin variable. That doesn't seem to work. No matter what I try to put there as a pin, it wakes up the nano from sleep immediately, I am therefore having a hard time testing my way through this.

If you have some sage advice or a point in the right direction, I would greatly appreciate it.

Here is the relevant part of my code:

accPin = ? // My understanding is that I could just find the accelerometer Pin
void Sleep()
{
  digitalWrite(LED_PWR, LOW); // turn off power LED
  digitalWrite(PIN_ENABLE_I2C_PULLUP, LOW); // turn off I²C pullup
  digitalWrite(PIN_ENABLE_SENSORS_3V3, LOW); // turn sensor OFF

  pinMode(PIN_A6, OUTPUT);
  digitalWrite(PIN_A6, LOW);

  //nrf_gpio_cfg_sense_input(accPin, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_HIGH);

  NRF_POWER->SYSTEMOFF = 1;
}

void setup() {
  delay(5000); // For easier testing with the multimeter 
  Sleep();
}

void loop()
{
}

Hey Steen,

have you tried adjusting the wake up detection threshold with:

/**
 * @brief Function for configuring sense level for the given GPIO.
 *
 * @param pin_number   Specifies the pin number of gpio pin numbers to be configured (allowed values 0-30).
 * @param sense_config Sense configuration.
 *
 */
__STATIC_INLINE void nrf_gpio_cfg_sense_set(uint32_t pin_number, nrf_gpio_pin_sense_t sense_config);

Also this thread might help you a bit:

Best Regards
Andre