Close

Nanosleeper - Sub 100nA Deep Sleep Dev Board

A project log for MetaShunt: High Dynamic Range Current Measurement

A low-cost and accurate tool for analyzing the power consumption of ultra-low power and IoT devices with rapidly changing current usage

jake-wachlinJake Wachlin 01/28/2024 at 18:240 Comments

I used MetaShunt to test my new ultra-low power development board, called Nanosleeper. The goal with Nanosleeper was to achieve <100nA deep sleep current with the ability to wake up at a selected time. It was built in the Adafruit Feather form factor, but does not 100% match the Feather specification. It has support for controlling external power and I2C pullups for external devices so that very, VERY low power systems can be prototyped.

Debugging and testing a product like Nanosleeper is difficult without a tool like MetaShunt. The power used when on is over 8,000X times higher than when in deep sleep, so measuring current with a simple shunt is not likely to work. However, MetaShunt has no issues with this.

Pictures of an assembled Nanosleeper and it connected to MetaShunt are shown below. Nanosleeper is powered by the 3.3V supply from MetaShunt into the BAT input of Nanosleeper. Because Nanosleeper uses an extremely low power linear voltage regulator (1.8V logic level), this gives the same current results as it would if powered by a 3V coin cell battery.

The firmware used during this test is shown below. The two onboard LEDs are turned on for 5 seconds, then turned off. A 2 second busy wait then occurs. Next, the RTC is set up using I2C, and set to wake the system after 15 seconds. The wakeup pins are then configured and shutdown sleep mode is entered.

  // Toggle LED to indicate awake
  HAL_GPIO_WritePin(D12_GPIO_Port, D12_Pin, GPIO_PIN_SET);
  HAL_GPIO_WritePin(D13_GPIO_Port, D13_Pin, GPIO_PIN_SET);
  HAL_Delay(5000);
  HAL_GPIO_WritePin(D12_GPIO_Port, D12_Pin, GPIO_PIN_RESET);
  HAL_GPIO_WritePin(D13_GPIO_Port, D13_Pin, GPIO_PIN_RESET);
  HAL_Delay(2000);

  // Set up RTC, checking if it's already been set up
  bool is_initial_setup = true;
  uint32_t current_time_utc = 1705968815;
  bool rv_3028_setup_ok = init_rv_3028_c7(hi2c1, current_time_utc, is_initial_setup);


  // Go to shutdown mode, with pin wakeup.
  HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);


  /* Enable wakeup pin WKUP1 */
  HAL_PWREx_EnableGPIOPullDown(PWR_GPIO_C, PWR_GPIO_BIT_14);
  HAL_PWREx_EnableGPIOPullDown(PWR_GPIO_C, PWR_GPIO_BIT_15);
  HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_0);
  HAL_PWREx_EnablePullUpPullDownConfig();
  HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_LOW);
  HAL_PWREx_DisableInternalWakeUpLine();

  /* enter shutdown */
  __HAL_RCC_PWR_CLK_ENABLE();
  __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF1);
  HAL_PWREx_EnterSHUTDOWNMode();

Each of those sections of the firmware are very clear in the power profile below. The system starts up (the current spike off the chart is due to plugging in Nanosleeper to power) and with both LEDs on the current is steady at about  800uA. With the LEDs off, the current drops to about 600uA. There is a current spike to about 1.15mA during the I2C communication with the RTC, and then the system goes into deep sleep. After 15 seconds, the system starts up again and turns on the LEDs.

The deep sleep current is shown in higher detail below, and is steady just under 95nA.


This example shows MetaShunt's performance for an ultra-low power design, with ~8,000X variation in power consumption during operation.

Discussions