I am not an electrical engineer but I noticed that many Powerbanks are designed to fail because they allow deep discharging the battery below 3V and then do not charge anymore.
I came up with the idea to build a charging/discharging circuit with a relais and maybe an Arduino. Charging should be done by 5V over USB which seems easy as I just need to scale the voltage down to 4.2V. The deep discharging problem should be solved by measuring the voltage of the battery.
However, I am currently not sure how the manufacturers of such power banks implements simultaneous discharging over the same connector (which is used for charging the battery) e.g. if a smartphone is connected. Because over the same connector the voltage must be also up-regulated to 5V.
Does anyone have an idea how to solve this as a amateur in electronics.