As a picture often speaks better than words, here is what I'm looking for (the yellow circuit on this picture):
a circuit that converts 3.7 V to 5 V when a 18650 battery (3.7V) is connected
and that both outputs 5 V and charges the battery if a phone charger is connected
Optionnally, it would be great if the circuit could send a "low battery" trigger to some other chip.
Such circuit is probably quite common (in many everyday-use devices that can run in battery or with adapter), do you know where to find one? (either the schematics or even ready-to-use circuits)