i have my esp32 module in deep sleep and i use it with a couple of buttons using a wake up that detect the button pressed now i'd like to have a battery level to send to a server right before going back to deep sleep. How can i do it? and what cheap rgb led do you suggest using?

  • what cheap rgb led do you suggest using? ... use for what?
    – jsotola
    Commented Sep 21, 2018 at 2:28
  • for usage in combination with low power device drived by an esp32 Commented Sep 21, 2018 at 14:53

1 Answer 1


Using "battery level" (voltage) is poor way to monitor its useful life. Battery discharge characteristic varies with its technology. On the other hand many electronics devices are very tolerable as far as "supply level " AKA voltage.

RGB LED light intensity can be made to monitor different voltage, however, I fail to see how you propose to send the LED intensity level /state to other device.


As I pointed out - the battery useful life depends on technology. You mentioned AAA , hence I assume alkaline battery. Then I would suggest software solution. Let the server monitor the actual running time of your device.Then measure or calculate the load your device is drawing from the battery. Then determine or calculate the discharge curve of your battery and let the server "output" the battery life / discharged level in relation to time. Perhaps I misunderstood and you actually wanted the RGB LED to be connected to the server. Then you can display green LED up to 80% of battery life and so on ...Keep in mind that the discharge curve is pretty abrupt at the end of battery useful life,

  • i need the esp32 to know the battery level, and power source will always be 2 aaa battery, so it can send to a server the estimated battery lifer remaining Commented Sep 21, 2018 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.