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?


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.

  • 2
    The maximum charge voltage is specified here as 3.65 Volt.
    – sid_com
    Oct 6 '20 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 '20 at 14:29
  • 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 '20 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 '20 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 '20 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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