If I want to connect a LiFePO4 battery (as the power supply) directly to an esp32 - would this be the correct way: the plus of the battery to the 3.3 volt pin and the minus to a ground pin?

2 Answers 2


No. Absolutely not.

A LiFePO4 battery is 4.2V when fully charged. The absolute maximum voltage of an ESP32 is 3.6V.

You will kill the ESP32.

Instead you need to have a voltage regulator with a very low dropout. Ideally a switching ("buck") regulator with a zero-dropout "pass" mode to give the maximum life from your battery.

Even better is a "buck/boost" battery regulator that will boost the voltage up to a stable 3.3V once the battery voltage drops too low.

If all this is beyond you then you're better off using a powerbank to do the regulation to 5V for you then convert that back down to 3.3V with a simple buck regulator.

  • 4
    The maximum charge voltage is specified here as 3.65 Volt.
    – sid_com
    Oct 6, 2020 at 14:27
  • @sid_com That's the recommended maximum. They can go up to 4.2V if you want about 1% extra capacity. 3.65 is still above the absolute maximum of an ESP32 anyway.
    – Majenko
    Oct 6, 2020 at 14:29
  • 1
    4.2v is typical of lithium chemistries other than lithium IRON phosphate batteries. One can use a radio control type battery charger and set a maximum charge level to lower than the max for the ESP32. Some capacity may be lost in so doing, but with care, it could be accomplished.
    – fred_dot_u
    Oct 6, 2020 at 15:15
  • 1
    from that page: In the case of LiFePO4 chemistry, the absolute maximum is 4.2V per cell, though it is recommended that you charge to 3.5-3.6V per cell, there is less than 1% extra capacity between 3.5V and 4.2V.
    – fred_dot_u
    Oct 6, 2020 at 15:48
  • 2
    Exactly. Up to 4.2V. If you have that you will fry the ESP32. You really really should have a battery controller on there to keep it at a regulated 3.3V regardless of the battery voltage (above the lower cutoff voltage of course).
    – Majenko
    Oct 6, 2020 at 15:49

I know this question is two years old but it still pops up on research. I just wanted to add something from my experience with this: If you take an Enerpower HTCFR18650 for example datasheet you see that the maximum voltage isn't 4.2V but 3.65V +/- 0.05V. While this technically is a little bit above the absolute maximum rating of the ESP32 (3.6V), in a non critical environment you can absolutely use the battery without voltage regulator. Just keep in mind that you also will not have any undervoltage protection in this case.

I'm not a fan of this negativity ("you will fry", "you kill you ESP", "Everyone will die"). An ESP32 costs $1. Just try it and if it works its great (it does) and if it doesn't, don't blame me ;)


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.