Friday Teardown: ESP32 Power Circuit Troubleshooting Part 1

This week's teardown is a bit more complex than last weeks: today we will try to troubleshoot an ESP32's power circuit.

This week's teardown is a bit more complex than last weeks: today we will try to troubleshoot an ESP32's power circuit.

ESP32

The ESP32 is a microcontroller with built in Bluetooth and Wifi procduced by Espressif Systems. The ESP32 is a follow up to Espressif's extremely popular ESP8266. These boards are popular for automation and IoT (Internet of Things) projects in the hobbiest/maker community.

The reason these boards are so popular within these communities are twofold: price and support. Their low cost ($5 or less for the cheapest ESP8266/32 board) makes them a popular choice when picking a microcontroller platform. This low cost has also allowed a thriving community to grow around these boards. Software platforms like Arduino, NodeMCU and MicroPython are supported either officially or by the community, providing these boards access to a wealth of available libraries and components.

My Board

My board was purchased off Ebay from popular chinese eletronics ebay seller alice1101983 for $12. It is an ESP32 board with onboard OLED screen and a 18650 battery holder. The battery holder requirement was important to me when choosing an ESP32 board (of which there are many, many different boards) because I intend to use the board away from available external power sources.

The Problem

While putting the board through its paces, I noticed that the charger's status LEDs would not turn off after the board's power switch was flipped to the off position and external power was removed from the board. For a battery operated project, this is troublesome, as those LEDs will consume battery capacity and reduce the time between charges. Thus, beginning the rabbit hole that will become this blog post.

Charging Chip: TP5400

First we take a look at the board and determine how it charges. A quick glance at the board shows that a TP5400 chip is most likely the chip responsible for charging/power delivery on this board. So we have our component to begin our search with.

First we google "TP5400", this yields us a webpage in chinese. This webpage looks to be what we're looking for, and includes a typical application schematic diagram. So we're on the right track.

Next we throw it into Google Translate, which gives us a usable webpage. Now we can look at the details of the TP5400:

And we also find a link to the actual datasheet:

The datasheet is also in chinese, but thankfully by clicking on the pdf link in google translate, we can get it to also convert the pdf for us into english. Inside the datasheet, we find two important bits of information for us: LED status diagram and pin diagram:

Looking at the above picture, with the board powered on and USB unplugged, both status LEDs should not be lit. But the behavior we see is that after unplugging USB we see that the STDBY light remains lit, whether the board is switched on or off, and whether I flip between the two. Either way, when the board is on and USB unplugged, no LED should be lit, so our TP5400 is in a bad/unknown state.

Pictured above: The pin diagram is helpful for determining chip function and pcb layout. The overlayed text in the above pin diagram is an artifact of the pdf translation conversion process.

Pathfinder

Now we have a good amount of information to work with. Next, I work out a diagram of the traces on the board so I know what I'm probing. I take a picture of the board and in paint.net I determine the pcb layout. To get a full view of the board layout, I need to take off the battery holder on the bottom, which is hiding some traces.

Pictured: A binder clip protects the plastic battery holder from damage due to the heat from desoldering.

Above: With the battery holder off, we can now clearly see all the traces and vias on the bottom side of the board. I take some pictures of the board, then proceed to resolder the battery back on, taking care to make sure the positive and negative sides of the battery holder are oriented correctly.

Pictured above: my labelled ESP32 board. Orange = trace on top side of board, Blue = trace on bottom side of the board, green = connection to ground plane.

Some things to note in our traced board:

  • The USB input goes through a diode, resistor and eventually after snaking around and other side connects to pin 5 on the TP5400.
  • USB and pin 1 provide the 5v rail, which feeds into an AMS1117 linear voltage regulator. This voltage regulator outputs 3.3v which then feeds the actual ESP32 microcontroller, USB UART, and OLED screen.
  • The 5v rail remains energized even when the board is powered off. The power switch on the board disconnects the 5v rail from the AMS1117. This means that even when the board is "off", the TP5400 is still on and consuming power. It is not known if the TP5400 is able to detect a no-load situation and go into a power saving mode.
  • Presumably (because I cannot see it), the positive side of the battery connects through a via under the inductor to the inductor. The inductor is connected to pin 6.

Probing

Now that we have data on the TP5400 and an idea of the board layout, we can start probing. A small issue though. I do not currently have a multimeter.

Instead I improvise and use a battery tester...

I begin by attaching the negative probe to a ground on the board and setting the battery tester to 6v. Then I begin using the red probe to check for voltages. Some notable findings:

  • Pin 5 is getting 5v even when nothing is connected to USB port
  • When I connect my battery tester to ground and pin 5, tp5400 status lights turn off (the correct state that they should be in)
  • When USB connected and I do the above, lights function correctly
  • Resistor to ground and pin 5 also causes this behavior

Letting Out The Magic Smoke

While in the process of trying to figure out where Pin 5 is getting backfed from, I accidentally bridged pin 5 and 6 with my probe and let the magic smoke out. Now when USB is plugged in both status LEDs stay lit.

At this point, I assume that I had damaged the TP5400. Without a multimeter, I could not safely continue, as I would not be able to determine if the TP5400 was damaged in such a way that it might be dumping 5v into the lithium battery (BAD!).

To Be Continued

That's it for now. I expect this to be a 3 part saga, but time will tell. Next time I make a makeshift voltmeter and revive the TP5400. See you on the flipside.

Back To Top