Trying getting a functional ESP32-Charging-USB module

Hey guys,
Would you mind having a quick look at my circuit? I tried to add different modules that I found on the net to my original circuit, especially the "USB" and the "Charging" parts, and my PC is not able to connect to the ESP32. Do you see anything wrong?



Thanks in advance for your help

Great job on the Schematic. Overall it looks OK but I would consider some high frequency bypass on the voltage regulators. I always put them on both in and out.

Thanks a lot @gilshultz . Can you give me more details on that. What would be the values for these capacitors?

Ok so would you suggest to add a 100 nF on the IN side?

1 Like

popon777 has it, 100nF but I do them on both in and out. Leave the bulk caps you have they will help.

1 Like

Hey,
I finally received my PCB. Problem solved with the USB part. However, I realized my current consumption is now 6.6mA in deep sleep mode while it was about 20uA before.
Between the two circuits, I added:

  • the USB part
  • the Charging part
  • and in the Battery Converter part, I changed the HT7833 for a MIC5219-3.3YM5.

Can someone help me to understand what's going on?
With the Ohm's law, I should have a resistor of about 500 ohm somewhere (3.3 V / 0.0066 A). I removed them all three 470R but still consum 6.6 mA!

Thank you :slight_smile:

Check the current requirement of the parts you have connected, I think they will come close to what you are seeing.

Sorry, I'm learning every day and far from being an expert. I don't get what you mean. Can you give me more details of what you're saying? How do I check that?

It should be on the data sheet, probably labeled quiescent current. How did you measure your current before and what is different now?

I check them all and they all are in the uA range.
I measure current using a multimeter right after the Lithium battery. I ran it for a day and clearly decrease a lot faster compared to the previous version (without the charging and the USB parts).

What was the voltage drop across the meter when making these measurements. What was the target voltage? When a current measurement is made with a multi-meter it is actually measuring the voltage drop across a known resistance.

In terms of current, I'm excepting to be in the uA range in the deep sleep mode of course! I have about 6.7mA now. In the normal mode, It jumps to about 100-150mA for 3-4 sec which is normal.
When I measure the voltage around the Li-battery, I have 3.97mV. I start the program and it goes down to about 3.94mV for 1-2 sec and goes back to 3.97mV. Not sure if I answered your question :sweat_smile:
So you don't see anything wrong in my circuit (post #6) that could cause the jump from 20uA to 6.7mA in deep-sleep mode?

It sounds like the part is not being put to sleep properly. Double check all of the I/O to be certain they are correct.

Interesting... I was talking about that to a guy yesterday and he told me pretty much the same thing. I can't chech that today but the only thing I can think of is the GPIO0 where the USB is connected. Should I turn it off with pinMode(0, INPUT); and then I put it to LOW?

1 Like

Is the USB keeping it awake? Setting it as an input should be all you need to do.

Too tired to continue... I did add this line

pinMode(0, INPUT);

And then put it to LOW for fun... Still 6.7mA...
Will continue tomorrow.
Any new ideas would be appreciated.
Thanks guys

Sorry again, I tried everything possible, but definitely not the right thing.
How can I do that (the circuit is on my first posts).

I'm getting frustated :sweat_smile:
This is my last step to finalize my project.
Please Arduinists. Help me

Can't you cut power to part(s) of the circuit by cutting a trace and inserting a DMM (set to current).
I would try to split in two sections. Then split the section that draws 6.7mA again in half.
Don't be surprised if one of the regulators is oscillating because of the wrong type of caps.
Leo..

1 Like

It is really possible to do that?! So you mean using a small scalpel to cut traces directly on the PCB circuit board? If I suspect for exemple the USB part, I should cut traces connecting the USB module, the CP2104, the 2 transistors and resistors, right? I prefer to ask, I have limited amount of this board.
Thanks @Wawa

Hey @Wawa and @gilshultz ,
Thanks for your patience and hope you're still around and remember me :slight_smile:
I (finally!) did what you told me Leo. I suspected the USB part so I focussed on this one. I cut traces one by one (see orange circles in the picture below) and hurray! when I cut the no4, current dropped to 100uA. Not super low but a lot better (compared to 6.8mA).

So I guess I shouldn't power the USB all the time? Should I:

  • just remove the traces no4, but then I won't be able to run my program when connected to the USB plug since the ESP32 won't be powered... unless if the battery is connected, or if I connect the VBUS to the VDD of the ESP32??
  • control the power going to the USB by adding a diode or something??
  • control the power by connecting it to a GPIO so I can turn it off??
  • something else ??

Thanks for your suggestions.
Laurent