Close

Initial part selections

A project log for LiFePO4wered/ESP32

ESP32 IoT core board with flexible power and flexible communications

Patrick Van OosterwijckPatrick Van Oosterwijck 08/22/2019 at 17:270 Comments

ESP32

I'm using the ESP32-WROVER-I with external antenna for this project to take advantage of the PSRAM.  Downsides are large physical size and losing two GPIO.

Ethernet PHY

The LAN8720A works well on the #wESP32, is well supported by the ESP32 tools and is readily available at low cost in the Chinese market so I'm sticking to it for this project as well.

I have been considering moving to one of the PHY clocking modes where the ESP32 outputs the PHY clock instead of using an external crystal oscillator.  Firmware support for this seems to be improving.  But the most common way to do this is by using GPIO16 or GPIO17, which are not available on the ESP32-WROVER module because they are in use for the PSRAM.

Another option is using GPIO0 for clock output instead of input, but that seems to be less well supported, as can be seen in the MicroPython patch lined above, where it is disabled.  Alas, I think I'll keep the oscillator for now.

PoE chip

Same for the PoE power chip, I'm sticking with the SI3404A used in the wESP32.  I've been looking at the TPS23755 as a possible replacement that does away with the need for an opto-coupler, but considering this is a new part that I haven't tested yet and that is not as common in distribution, and considering there's enough to figure out and plenty of risk on the charger side of this project, I have decided to pick my battles and go with a proven solution for this part. :)

Charge / system controller

In the custom design that is the inspiration for this part of the project, I was using the NXP MK02FN64VLF10.  This is a pretty powerful Cortex-M4F running at 100 MHz and probably overkill, but a good safe core with plenty of margin for developing something new.

The excellent voltage reference and 16-bit ADC with several differential inputs were the most important features I was after.  I had added optional current sense amplifiers to make sure I would be able to measure the minute voltages across the 0.001 ohm and 0.02 ohm current sense resistors accurately enough, but it turns out they aren't needed--the ADC by itself does the job just fine!

It also has a great supply voltage range of 1.71 V to 3.6 V, which perfectly matches what we get from a LiFePO4 or LTO cell.  When I designed in the part, I also assumed it would give me 100 MHz PWM clock, but the devil is in the details.  What in the PWM peripheral's documentation was called the "system clock" turned out to be the controller's "bus clock", which is half the actual 100 MHz system clock.  Thanks for the confusing docs, NXP.  Still, the charger worked just fine at 50 MHz and I didn't need the extreme PWM accuracy I had been aiming for.

For the LiFePO4wered/ESP32, I'm scaling down this part to the lower cost MKL17Z32VFM4, a 48 MHz Cortex-M0+.  It shaves about half a dollar off the 10K cost, is still plenty powerful for what I need, seems to have more low-power optimizations (it's an "L" part), has a similarly great ADC peripheral, and is in the same family so I can re-use a bunch of the code I have.

The biggest downside seems to be that the PWM signals for driving the buck converter MOSFETs will have lower resolution (PWM clock of 24 MHz), giving less accuracy in maintaining maximum power point.  But I think it will still be sufficient.

Buck/boost converter

To generate the regulated 3.3 V for the ESP32 and external customer circuitry, I need a buck-boost converter to generate this voltage from a possible input range of ~2 V to 3.6 V.  Looking at current requirements, part cost and availability in China, the TPS63020 seems to be a good option.  It should be able to deliver 1 A from even the lowest expected input voltage of ~2 V, while offering decent efficiency across the whole range.

Discussions