• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 power requirement in deepsleep (battery/solar)

Q&A Forum › Category: ESP32 › ESP32 power requirement in deepsleep (battery/solar)
0 Vote Up Vote Down
David Flory asked 2 years ago

Hi
 Not a question, but though some folks may be interested in these test results.
3 years ago I followed this thread regarding deep sleep power consumption of the ESP32
https://rntlab.com/question/measure-deep-sleep-current/
 
I was recently approached by a friend who works for a company producing remote test equipment for pipelines, and they are interested in using solar powered ESP32s for recording the data.
 
This has led to me conducting some tests on how viable that system would be, and the first test has been how long can we run on a very small solar panel.
It seemed a sensible approach to opt for a real time test rather than try to measure power consumption and calculate longevity of the battery. So I wrote a test program and hooked up the ESP to an almost new, fully charged 3.7 volt 1000mA LiPo battery, which plugs directly into the battery plug of an ESP32 Huzzah Feather.
 
Briefly, the program does this:
On first boot, it connects to wifi, setsRTC with NPT time, uploads status to a cloud based DB.
Deepsleep for 10 minutes.
Wake up and write some dummy readings to an internal text file [one line of text]
Go back to deep sleep.
Every 3 wakeups, [every 30 minutes] it connects to wifi, updates RTC and writes each line of the text file to a cloud based DB, verifies, then deletes the text file and goes back to deep sleep.
 
In a real world application, the writing a log line would involve powering up sensors and taking real readings, but also it would only do that once every hour, or maybe 2, and would only upload the data once a day. Also, the battery would be charged by the solar panel on good days.
 
In this test, the ESP32 ran for 5 days and 10 hours on a 1000mAh LiPo battery
It wrote 762 lines to an internal log
It connected to wifi and uploaded 3 lines and deleted the log 254 times
 Average current draw 2.134uA/second.
My math might be slightly out, I uses 3.3V for the calculations, as the internal regulator steps down the battery voltage from the battery’s 3.7. If I use 3.7v, increasing the mW rating of the battery to 3700, the average draw is 2.4uA/second

Question Tags: Power consumption
5 Answers
0 Vote Up Vote Down
William Lucid answered 2 years ago

Good Morning David,

Interesting approach and results.

Any optimizing of the board?

Could you describe the current measring technique in more detail; how was the current  metered?  Were there any modules attached to the board?

Thank you for following my post of three years ago.  Presently have three boards I am interested in testing: ESP32 ThingPulse,  ESP32 BPI PicoW S-3, and ESP32 Pico Kit v4.1.

simple calculator for estimating a (LiPo) battery’s life

Calculation of total run time of 130 Hours shows 7.692 mAH used per Hour for a 1000 mAH battery.  Seconds in 1 Hour equals 3600 seconds.  7.692 mAH available in 1 Hour divided by 3600 Seconds equals 2.136 mAH/Second.

Regards,
William

0 Vote Up Vote Down
David Flory answered 2 years ago

Hi William
The board is a bog standard Huzzah Feather from Expressif. There was absolutely nothing attached to it, ie modules or sensors. The data lines were just a simulation, each one was just an identical string with a current timestamp added, formatted as a PHP query string, eg ?voltage=1&current=2&resistance=3&timestamp=17-4-2023%2210:57
See my original post for exactly what the code did, but basically I ended up with a web based database with 762 lines in it, each one showing the dummy measurements, time it was written in the ESP32, and the database timestamp of when it was uploaded. The database has the added advantage in that I can see when it started, and during the test, see it is still running without interfering with the device in any way, ie measuring batt voltage.
I don’t quite agree with your calculations above. 7.692 mA per hour is good, but divided by 3600 = 0.002136752 mA per second, which is 2.136uA/second
I made some assumption with the readings because I wanted a ball park figure of the actual deepsleep current draw. 
The device did 3 things, slept, logged, uploaded data.
I assumed the following power requirements:  Sleeping 5%, Logging 10%, Uploading 85% and used an excel spreadsheet to record progress. The basis for the assumptions is for logging it has to reboot, do something then sleep, for upload it has to essentially do what logging does but establish a wifi connection first, and maintain it for the duration. I calculated this information in the spreadsheet with the number of logging events and upload events, which used more power than sleeping, which is why my final deepsleep figure is a little lower at 2.136uA
Regards
David

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi David.
Very interesting and thank you so much for sharing your results.
This will certainly be useful for our readers.
Regards,
Sara

0 Vote Up Vote Down
William Lucid answered 2 years ago

Good Morning David,

My apologies; my math was wrong, thank you for the correction.

Interesting article on the Feather Huzzah32:  Low Power Usege

Regards,

William

0 Vote Up Vote Down
David Flory answered 2 years ago

Hi William
Thanks for confirming that, was beginning to second guess myself 🙂
In my last answer, though I said there was nothing connected to the board, I forgot there was a charger module, similar to the one used in the solar power article

Power ESP32/ESP8266 with Solar Panels (includes battery level monitoring)


It is not on, but there just to shut off the battery when it gets too low.
I’ve set up a new test now, for higher power consumption, in which I hope to gain an insight into the current drawn per second when processing with WiFi connected.
Interesting article, beginning to wonder why I am showing such a low result. Do you think it possible that the battery is providing more than the rated 1000mA? For my purposes it really is a moot point, as the end project will involve a solar panel, so theoretically the battery will never be exhausted, but I do like to get my data as accurate as possible without a lot of specialist equipment.
I may try the test again running on 3 x 1.2v Li-Ion batteries from the pound shop. They should be sufficiently sub standard to make the test a little shorter 🙂
Regards
David
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.