Deep Sleep Summary

  • Hi all,

    Edited 2017-08-06 with new Pysense data

    Just wanted to make sure I have a good understanding of the situation regarding deep sleep with the various boards.

    Battery life estimates are based on a 2500 mAh battery.

    • WiPy 2.0, LoPy 1.0 and SiPy 1.0, using expansion board, without Deep Sleep Shield
      • use machine.deepsleep()
      • wake on timer: Yes
      • wake on pin: Yes
      • pins: P2, P3, P4, P6, P8 to P10 and P13 to P23.
      • ESP32 powered during deep sleep (including ULP and RTC): Yes (in deep sleep mode)
      • deep sleep current: > 12 mA (bad) [±1 week?] due to DC-DC switching regulator (10 mA) and flash (2 mA)
      • -> Option 1: provide regulated 3.3V via 3V3 input -> lowers current to ±2 mA [±1 month]
      • -> Option 2: use Deep Sleep Shield
    • Using Deep Sleep Shield
      • use Deep Sleep library
      • wake on timer: Yes
      • wake on pin: Yes
      • pins: P10, P17, P18
      • ESP32 powered during deep sleep (including ULP and RTC): No
      • deep sleep current: ±7-10 µA (good) [years?]
    • Using Pysense
      • use Pysense library
      • wake on timer: Yes
      • wake on pin: No, waiting for library update
      • pins: only pins connected through PIC (EXT_IO0/4/5)?
      • ESP32 powered during deep sleep (including ULP and RTC): No
      • deep sleep current: ± 12 µA (good) [years?] ** with updated Pysense library**
    • Using Pytrack
      • use Pytrack library
      • wake on timer: Yes
      • wake on pin: No, waiting for library update
      • pins: ?
      • ESP32 powered during deep sleep (including ULP and RTC): No
      • deep sleep current: ± 20 µA (good) [years?]

    Is this approximately correct?

  • @jcaron Thank you.

    Yes, in the meanwhile I read dozens of posts. The question is why after reset I don't get the GPIO pin that triggered the wakeup?

    Do the deepsleep shield fixing this GPIO wake up cause bug?
    Actually, If the Lopy is working fine with this reset what else is enhancing the deepsleep shield?

  • @Colateral wake from deep sleep is actually similar to a reset: as the CPU and its RAM are not powered during deep sleep, you can't just resume at the next Python instruction, as it restarts from scratch.

    Differentiating a wake up from deep sleep from other reasons (regular power on, reset...) is still a bit difficult, the subject has already been discussed in other threads.

  • Hello,

    I'm using LopY with Expansion board. SW upgraded to ver 1.7.8.b1

    I tried deepsleep functionality simple as below.

    import machine
    machine.pin_deepsleep_wakeup(['P18', 'P15'],machine.WAKEUP_ALL_LOW, True)
    print("\n\n Wakeup",  machine.wake_reason())

    The board is going to sleep and indeed is waking up on P18 dumping the following output .

    rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    mode:DIO, clock div:1
    ho 0 tail 12 room 4
    entry 0x4009fd9c

    ** I don't understand why the LoPy was reset after this wakeup **

    In order to dump the reason, I also added in the following

    print("\n\n Wakeup main reason",  machine.wake_reason())

    and has no output

    Wakeup main reason (1, []) 

    ** I believe there is bug that no GPIO is mentioned in that list **

  • @PeterBaugh From the battery positive lead in series to the VIn of the expansion board

  • @iotmaker How are you measuring the current?

  • @iotmaker See this post for the correct orientation of the deep sleep schield

  • @iotmaker

    Well turns out that if you put it backwards like the Official documentation

    you will fry it..

    i put the other shield for my other sipy the correct way and now it works. 620uA

  • Still the current with the sipy is 89mA

    just doing this

    from deepsleep import DeepSleep
    import pycom
    ds = DeepSleep()
    while True:
        ds.go_to_sleep(60)  # go to sleep for 60 seconds
        print("Woke up")

  • Great summary. I agree with @RobTuDelft: many people and projects are waiting on this to settle so some definitive conclusion from pycom would be great. They're doing such a great job but we need to know what they've done or what they're working on.

  • @Emmanuel-Goudot
    The Pysense problem was fixed yesterday

  • For Pytrack, could include (if I am right)

    • GPS/Accel powered during deep sleep: No (explain low 20µA deep sleep current)

    For Pysense, something is obviously powerd which consume 2.5mA, but as electric schematics is not avail, it is difficult to say...

  • Hi There,

    How are you measuring the current in deep sleep? Also do you know of a way of keeping a PIN or PINs high when going into deepsleep, I dont think this is possible because of the board reseting when coming out of deep sleep.


  • Nice summary and this topic indeed deserves some clarification/overview.

    Without deep sleep shield I think the device will only run for a day or so. At least that is my experience. It also depends on the devices you connect of course, because they stay powered in deep sleep.

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.