{"id":5041,"date":"2022-12-26T00:21:29","date_gmt":"2022-12-26T05:21:29","guid":{"rendered":"https:\/\/www.paleotechnologist.net\/?p=5041"},"modified":"2022-12-26T00:21:29","modified_gmt":"2022-12-26T05:21:29","slug":"ttgo-t-display-deep-sleep","status":"publish","type":"post","link":"https:\/\/www.paleotechnologist.net\/?p=5041","title":{"rendered":"TTGO T-Display Deep Sleep"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Ten milliamps doesn&#8217;t sound like a lot &#8212; but for sleep\/standby mode, it is. A recent project was intended for occasional use as a desk toy, and would spend most of its time sleeping. Running the recommended<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>esp32_deep_sleep_start();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">took the current from ~70mA with the system running at full speed with the display on, to ~10mA. That&#8217;s over an 80% savings, but would still drain the gadget&#8217;s 1000mAh battery in just a few days.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Trying various different cures recommended by various sites including Espressif&#8217;s own had little effect, until I stumbled across a <a rel=\"noreferrer noopener\" href=\"https:\/\/www.reddit.com\/r\/esp32\/comments\/movnp3\/sleeping_screen_on_ttgo_tdisplay\/hlad7wh\/\" target=\"_blank\">Reddit post<\/a> by [infuriatingPixels]. The following four lines of code took the project&#8217;s power consumption from ~10mA to ~380uA in standby &#8212; a more than 20x additional savings. And it can still do wake-on-touch.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pinMode(4,OUTPUT); \r\n\rdigitalWrite(4,LOW); \/\/ Should force backlight off\r\n\rtft.writecommand(ST7789_DISPOFF);\/\/ Switch off the display\r\n\rtft.writecommand(ST7789_SLPIN);\/\/ Sleep the display driver<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/xkcd.com\/979\/\" target=\"_blank\" rel=\"noreferrer noopener\">Thanks, Random Internet Person<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>10mA isn&#8217;t an acceptable sleep current. Here&#8217;s how to put the TTGO to sleep. <a href=\"https:\/\/www.paleotechnologist.net\/?p=5041\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"footnotes":""},"categories":[267,249,216,210,226,254],"tags":[],"class_list":["post-5041","post","type-post","status-publish","format-standard","hentry","category-arduino","category-c","category-coding","category-digital","category-how-to","category-power"],"_links":{"self":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts\/5041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5041"}],"version-history":[{"count":1,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts\/5041\/revisions"}],"predecessor-version":[{"id":5042,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts\/5041\/revisions\/5042"}],"wp:attachment":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}