Hi
H1 is intended to be a UART connector, for programming the ESP8266 in the absence of a CP210x, etc. The idea is that the battery would be switced off at SW1, the module would then take 3V3, GND, TX/RX through that connector - only during programming. The diode at D1 is there to prevent power from H1 going back into U8 (AMS1117-3.3).
I see. If you have the space, then I recommend to add all for uploading necessary signals to the connector (RESET, EN, BOOT ...)
Mind the ESD protection. If you connect the programming cable, and here is an ESD damage, then this does not necessarily means an immediate fail. ESD problems can cause a fail in the field even after months.
1N4148 is rated for 200mA only and it has a voltage drop of 1V @200mA ... remaining just 2.3V .. what should be 3.3V.
I smell some trouble...
Check if the AM1117 has a problem at all when the output is driven with 3.3V.
That is fine re: charging only when SW1 is on - designed as a safety to disconnect the battery/turn off the module.
Two points to consider:
* even if the switch is OFF then device won´t be OFF when charger is powered.
* how does the charger output behave when there is no battery? Low voltage, high voltage, pulsing????
No need for testing, no need for guessing. Just read the datasheets and check whether the voltage levels are in a valid region with the expected current.
A functional test wil not give any reliability. It may vary with the part, time, temperature, supply voltage...
--> if it´works on one situation .. there is no guarantee that it works in either situation.
If test, then a "worst case test" (lowest supply voltage, various temperatures, good margin...)
I believe D1 & D2 have a rating of 500mA
For me speaking: "I believe" is a no-go for reliable designs. I have to be sure, thus a read a lot of datasheets.
As already written: "200 mA". And you have to consider all situations. During programming, during boot, during transmitting, all LEDs ON, lowest expectable supply voltage... --> worst case.
2.3V instead of 3.3V ... Are you sure?
Capacitors:
Not only the pure uF value is of interest, but also their ESR over frequency. (besides voltage ...)
IC manufacturers provide information in the datsheets and application notes. I recommend to read them.
Are you saying that unused pins should be tied to ground?
No. The must not left floating.
* they may be pulled internally
* they may have a "keeper" internally
* thay may be pulled externally with (or without) resistors
* port pins may be programmed not to float
* maybe other methods
Floating pins a prone to pick up noise (sporadic misfunction), may oscillate, may cause increased supply current...
***
I2C pullup:
Does not (primarily) depend on supply current. They are installed for proper function of I2C communication. As long as the I2C is not active they don´t draw current anyways. I´d use 10k as the upper limit.
Indeed the total supply current may be less with installed pullup because it prevents from flaoting pin, which may cause crowbar current in the input stage.
***
ESD protection:
Used dedicated ESD diodes. I recommend on each signal that enters/leaves the PCB.
*****
I know it might be boring / annoying when I refer to datasheets and application notes. But I see it as the only way to prevent from "bad surprise". I do it every day. many many pages.
Klaus