Mastering ESP32 Deep Sleep: Timers, GPIOs & Touch Sensors Explained

Поделиться
HTML-код
  • Опубликовано: 22 июл 2024
  • We're doing a deep dive into deep sleep! Thanks to PCB Way for sponsoring the videos - www.PCBWay.com/?from=atomic
    The ESP32 e-Paper weather display lasted exactly 2 months on its 1000mAh battery. It achieves this by spending most of its time in deep sleep, only waking up every 30 minutes to get a fresh forecast and update the display.
    We're going to look at:
    [0:00] Intro
    [1:33] How to get into deep sleep
    [1:42] Waking up by using a timer
    [2:56] Waking up by GPIO pins (single and multiple)
    [5:26] Waking up with the touch sensors
    [6:13] How to know why you were woken up?
    [7:37] How to persist state during deep sleep?
    [8:24] How much current do we use in deep sleep?
    It's pretty interesting stuff and opens up some great possibilities.
    Sample code for this video is here: github.com/atomic14/esp32_dee...
    Here's a link to one of ‪@AndreasSpiess‬ videos (the guy with the Swiss accent) • #387 Test of Battery o... he's got a bunch more videos measuring different ESP32 boards - definitely worth having a watch.
    ----
    Patreon: / atomic14
    ko-fi: ko-fi.com/atomic14
  • НаукаНаука

Комментарии • 43

  • @atomic14
    @atomic14  2 года назад +2

    Follow up video on the ULP is here: ruclips.net/video/KQS_xDDWfLw/видео.html

  • @nischal_poudel
    @nischal_poudel 10 месяцев назад +1

    wow, this video turned out to be super super useful. especially the part to configure multiple buttons to wake up the Esp 32. That info was super rate to find but you explained it soo simply

  • @wjn777
    @wjn777 2 года назад

    Great video , very thorough. I am looking forward to your next video on the ULP

  • @NotMarkKnopfler
    @NotMarkKnopfler 2 года назад +6

    This is brilliant - so concise. Thank you very much - this has inspired me to resurrect an ESP32 project that I have allowed to languish. I'm very grateful to you.

    • @atomic14
      @atomic14  2 года назад +3

      That's great - though if you're anything like me you'll have boxes full of half finished projects...

  • @cyo_corner
    @cyo_corner 2 года назад

    Thank you atomic! I can use this information for a small project of mine!

  • @purplePR0DUCTI0NS
    @purplePR0DUCTI0NS 2 года назад +3

    Another awesome video about the ESP32! Thank you so much. Looking forward to the video on the ULP co-processor!

    • @atomic14
      @atomic14  2 года назад +1

      I'm pretty excited about it - you can do some really clever things.

  • @nischal_poudel
    @nischal_poudel 10 месяцев назад +1

    and the guy with the swiss ascent part was really funny😁

  • @bendtherules0
    @bendtherules0 Год назад

    Wow, great video. To the point and detailed.

  • @albertroswell
    @albertroswell 2 года назад +1

    great video I had no idea about tpuch pads, thanks

  • @Bianchi77
    @Bianchi77 2 года назад

    Cool video, thanks :)

  • @cabletie
    @cabletie 2 года назад

    This is great and very timely thanks! I'm looking for a way to speed up the connection to wifi after a deep sleep - I hope you cover something like that in the next vid...

    • @atomic14
      @atomic14  2 года назад +1

      That's a great one to investigate as I'm having problems myself in this area. I do know that giving your device a fixed IP so you don't need to do DHCP speeds things up.

  • @nicecode6408
    @nicecode6408 2 года назад

    Hello
    I need use the deep sleep mode with a sensor, but it is run just one time for the void loop in each wake up, i need to stay almost 1 minute in the void loop to take a good measure, can you help me?

  • @dhavalshukla6615
    @dhavalshukla6615 2 года назад

    Hi, in a project of mine, I am trying to get my ESP32 to wake up from deep sleep mode and to wake it up I have assigned several GPIOs, the issue is I am trying to connect the bluetooth through a function which I do it by assigning it to a GPIO pin 36 that if HIGH it should go inside and execute the Bluetooth function, but it just simply brushes past it and rather without connecting tries to again go into the deep sleep. What would be the best way for me to utilise the digitalRead HIGH to go into Bluetooth or any other function which then should only execute after they have been completed? Or is it not my fault? I have tried to look at good examples but can't seem to find a solid rock.

  • @darlanrocha6726
    @darlanrocha6726 2 года назад

    Thank you very much for this precious video. Can u show us how to configure multiple touchpins to wakeup? Tks in adv.

    • @atomic14
      @atomic14  2 года назад +1

      Hi Darlan, just repeat this code: touchAttachInterrupt(T9, touch_isr_handler, 50); changing the T9 to the other touch pins you want to monitor.

    • @darlanrocha6726
      @darlanrocha6726 2 года назад

      @@atomic14 thank you very much. You realy saved one of my projects. Chears from Brazil.

  • @localixdots9698
    @localixdots9698 2 года назад

    Great

  • @5VoltChannel
    @5VoltChannel 2 года назад

    Great 👍👍

  • @edgull_tlt
    @edgull_tlt 2 года назад +1

    Спасибо

  • @syaduinotech3681
    @syaduinotech3681 2 года назад

    Good sharing sir. Mind if I ask the link to the complete sketch for timer example that update every certain time. Really appreciate the sharing..if already being shared, let me know, will browse it accordingly. One quick question, is the project/ ideas can work with all type of esp32?

    • @atomic14
      @atomic14  2 года назад +1

      Definitely, I'll push the code up later today. And yes, it should work on all devices.

    • @atomic14
      @atomic14  2 года назад +1

      Here you go: github.com/atomic14/esp32_deep_sleep

    • @syaduinotech3681
      @syaduinotech3681 2 года назад

      @@atomic14 thanks for the sharing sir

  • @andymouse
    @andymouse 2 года назад +3

    Showing your age with those Eighties tracks ! when you continue on your Kicad journey I hope you record them....cheers.

    • @TheEmbeddedHobbyist
      @TheEmbeddedHobbyist 2 года назад +1

      Eighties, seventies does it for me ;-(

    • @atomic14
      @atomic14  2 года назад

      I definitely will, I'll probably give KiCad version 6 a go to see what's new. Somewhat embarrassingly, The Lion Sleeps tonight was the first single I bought...

    • @atomic14
      @atomic14  2 года назад +1

      No one knows how old you are on the internet - until you type something :)

    • @andymouse
      @andymouse 2 года назад

      @@atomic14 We will keep that between us ! and I'm sure you mean 82 not the original in 1939 !!...great video...cheers.

    • @atomic14
      @atomic14  2 года назад +1

      @andymouse123 1939 would be pushing it :) though 82 feels like a long time ago!

  • @saikalyanmishra21
    @saikalyanmishra21 2 года назад

    Is there any way to control ac appliances through 16 relays modules. Esp 32 / 8266 has 9 pins available & with mega2560 no wifi available through.
    How to combine 16 relays+ arduino + wifi control/ web server. A detailed information would be appreciated. Lots of RUclips videos explaining upto 8 relays. If 16 there is no switch option. And so on. No videos with code are available for this simple project. Please make a video. Thanks

    • @leeqa02
      @leeqa02 3 месяца назад

      Use shift register.

  • @TheEmbeddedHobbyist
    @TheEmbeddedHobbyist 2 года назад

    What! Sorry must have fallen into a deep sleep, but a digit wake up from the wife got me going again, with a middle finger reset to the side of the head. ;-)

    • @atomic14
      @atomic14  2 года назад +1

      The question is, did you store what you were doing in RTC memory, or have you forgotten what you were doing before you went to sleep :)

    • @TheEmbeddedHobbyist
      @TheEmbeddedHobbyist 2 года назад

      @@atomic14 RTC memory wear limit was passed years ago ;-)