I am working on the following device: It has the shape of a AA battery, but includes a small LiIon battery, an ESP8285, a MP2109 (dual DC-DC converter) that outputs 3.3V and 1.5V and some MOSFETS that control the power output. Basically, it should behave like a AA battery that has power on/off and PWM control over WiFi.
It should be used for small devices like LEDs or vibration motors that have an additional power switch.
As the ESP8285 consumes quite a lot of power with WiFi on, I'd like the whole device to turn off when the external power switch of the external device is powered off, and when the external switch is turned on, the 3.3V rail should power on, so the ESP8285 can control the power output on the 1.5V rail.
The MP2109 has enable pins for both power rails, that turn on when the voltage on the enable pins is high.
Is there a solution to do this?