Close

Hardware Testing - IT WORKS!

A project log for Nanosleeper - Sub 100nA Sleep Dev Board

A "feather-ish" development board achieving <100nA deep sleep current with real time clock wake-up

jake-wachlinJake Wachlin 01/27/2024 at 21:120 Comments

The PCBs have arrived assembled from JLCPCB and look great! I added the headers and started programming. My goal was to simply demonstrate the ability to achieve <100nA deep sleep while waking up after a certain time. I used my Metashunt power measurement tool to test it.


The code used for this test is simple, and shown below.

  // 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();

 At the start, I turn on both LEDs for 5 seconds, then turn them off with a busy wait for 2 seconds. I then call the init_rv_3028_c7 function, which sets the time on the RTC and configures it to send an interrupt to the WKUP1 pin on the microcontroller after 15 seconds. And the short version of it is - IT WORKS! We get <100nA deep sleep while waking up later based on RTC time. The RTC can wake the device with the periodic timer up to a limit of 4095 minutes (~2.8 days). The image below shows a full single cycle. With both LEDs on, the system requires about 800uA from the 3.3V I provided to the BAT input on Nanosleeper. With the LEDs off, but busy waiting at 4MHz, the system takes about 600uA. There is a spike in current at ~12s when the microcontroller communicates with the RTC over I2C, and then the system enters the deep sleep mode. 15 seconds later, it wakes again!

If we zoom way in to the deep sleep section, we see the current is consistently below 95nA, as shown by the images below!


In summary, IT WORKS! Nanosleeper achieves a deep sleep with timed wakeup at up to 4095 minute periods while consuming <95nA!

Discussions