<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to save battery with M5StickC]]></title><description><![CDATA[<p dir="auto">I want to make something that can be battery driven for a long time with M5StickC.<br />
As an operation, M5StickC is in Deep Sleep state → button is pressed → process is performed → Deep Sleep state is entered again.<br />
I tried the following code, but M5StickC runs out of battery in one day. Even if I press the button after one day, it doesn't return.</p>
<pre><code>#include &lt;Arduino.h&gt;
#include &lt;M5StickC.h&gt;
#include "driver/rtc_io.h"

RTC_DATA_ATTR int bootCount = 0;

void setup(){
  M5.begin();
  ++bootCount;
  M5.Lcd.println("Boot number: " + String(bootCount));

  rtc_gpio_pullup_en(GPIO_NUM_37);
  esp_sleep_enable_ext0_wakeup(GPIO_NUM_37,LOW);

  M5.Lcd.println("Going to sleep now");
  delay(1000);  
  M5.Axp.ScreenBreath(0);
  esp_deep_sleep_start();
}

void loop(){
}

</code></pre>
<p dir="auto">The information I got stated that it was consuming power because it was in a pull-up state. So I set it to pull-down during normal times so that it returns when it goes high. However, if I do so, it will return immediately after entering the DeepSleep state, and it will repeat indefinitely.</p>
]]></description><link>https://community.m5stack.com/topic/1461/how-to-save-battery-with-m5stickc</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 04:40:34 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1461.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Nov 2019 14:08:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to save battery with M5StickC on Thu, 09 Apr 2020 15:15:41 GMT]]></title><description><![CDATA[<p dir="auto">it also depends on the clock speed. sometimes speed is not needed. and it can save 50% of the power consumption on max CPU load<br />
<a href="https://www.savjee.be/2019/12/esp32-tips-to-increase-battery-life/" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.savjee.be/2019/12/esp32-tips-to-increase-battery-life/</a></p>
]]></description><link>https://community.m5stack.com/post/8083</link><guid isPermaLink="true">https://community.m5stack.com/post/8083</guid><dc:creator><![CDATA[Pepsi]]></dc:creator><pubDate>Thu, 09 Apr 2020 15:15:41 GMT</pubDate></item><item><title><![CDATA[Reply to How to save battery with M5StickC on Thu, 09 Apr 2020 13:45:49 GMT]]></title><description><![CDATA[<p dir="auto">The esp in sleep mode consumes almost no power at all, but all the rest can additionally draw a few mA.  In the link you have a discussion about what and how much electricity it draws additionally.</p>
<p dir="auto"><a href="http://community.m5stack.com/topic/1162/getting-longer-battery-run-time" target="_blank" rel="noopener noreferrer nofollow ugc">http://community.m5stack.com/topic/1162/getting-longer-battery-run-time</a></p>
]]></description><link>https://community.m5stack.com/post/8080</link><guid isPermaLink="true">https://community.m5stack.com/post/8080</guid><dc:creator><![CDATA[robalstona]]></dc:creator><pubDate>Thu, 09 Apr 2020 13:45:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to save battery with M5StickC on Thu, 09 Apr 2020 09:40:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/takanotume24" aria-label="Profile: takanotume24">@<bdi>takanotume24</bdi></a></p>
<p dir="auto"><a href="https://lastminuteengineers.com/esp32-deep-sleep-wakeup-sources/" target="_blank" rel="noopener noreferrer nofollow ugc">https://lastminuteengineers.com/esp32-deep-sleep-wakeup-sources/</a></p>
<p dir="auto">or</p>
<p dir="auto"><a href="https://randomnerdtutorials.com/esp32-deep-sleep-arduino-ide-wake-up-sources/" target="_blank" rel="noopener noreferrer nofollow ugc">https://randomnerdtutorials.com/esp32-deep-sleep-arduino-ide-wake-up-sources/</a></p>
<p dir="auto">As you see in the tutorial I referenced above the ESP32 has different sleep modes, according how much battery you want to preserve:</p>
<p dir="auto">Modem-sleep, Light-sleep, Deep-sleep, Hibernation and Power off.</p>
<p dir="auto">During the real deep sleep the RAM is shut off.  So your variable Bootcount will get lost after the deepSleep . You must write the values of all the variables you want to preserve into Eeprom (eg. of the RTC) before  going into deep-sleep and the retreive them after wake up !</p>
]]></description><link>https://community.m5stack.com/post/8078</link><guid isPermaLink="true">https://community.m5stack.com/post/8078</guid><dc:creator><![CDATA[crami25]]></dc:creator><pubDate>Thu, 09 Apr 2020 09:40:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to save battery with M5StickC on Thu, 09 Apr 2020 07:59:33 GMT]]></title><description><![CDATA[<p dir="auto">I only have limited expirience with sleep mode.<br />
But when a device comes out of Sleepmode it will not go in to the setup loop again. only during boot.</p>
<p dir="auto">And the second thing you could to it to reduce the CPU speed to 80 instead of the default 240. that also saves your battery</p>
]]></description><link>https://community.m5stack.com/post/8070</link><guid isPermaLink="true">https://community.m5stack.com/post/8070</guid><dc:creator><![CDATA[Pepsi]]></dc:creator><pubDate>Thu, 09 Apr 2020 07:59:33 GMT</pubDate></item></channel></rss>