logo elektroda
logo elektroda
X
logo elektroda

ESP32 - LiPo Battery Power and Multifunction uSwitch for ON/OFF and Modes

ftomkiel 1386 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19364321
    ftomkiel
    Level 4  
    Hi,
    I would like to ask for the expertise of someone firmly on the subject of esp32 based devices (although pretty much any battery powered device).

    I am prototyping a device that is powered by LiPo cells and would ultimately like to have a single uSwitch responsible for controlling it. The schematic of the ON/OFF/Multifunction button would look like this

    Hold - ON/OFF
    Short press - switching between operating modes, in this case the instruction to the ESP which then controls the 0%/50%/100%/STROBO output

    From my research, I could use the Deep Sleep mode and have the device wake up (ON/OFF) and in this case the button would serve as a multifunction because the ESP would be able to verify the current state and duration of the button press by the user and on this basis control not only ON/OFF but also switching between modes.

    A second, more optimal way under battery conditions is i.e. a latching circuit that completely cuts off power to the circuit. But in this case, there is no need to use the button as a multifunction or at least to switch off the device by holding it down; such a solution is better in terms of battery life, but would probably require adding another button responsible for the rest of the functionality to the design.

    Please show me the way, because as far as I know almost every battery powered device from a torch to a phone uses ON/OFF functions via uSwitch and if I want to use ESP32 is it best to use Deep Sleep mode as the off mode of the device? Such a mode will draw according to the datasheet 15uA + loss on the LDO still running. Is this how it is done? Is this how every manufacturer of a device based on a microchip and activated from the uSwitch does it?
  • ADVERTISEMENT
  • #2 19364504
    khoam
    Level 42  
    ftomkiel wrote:
    From my research it appears that I could use the Deep Sleep mode and have the ability to wake up (ON/OFF) the device and in this case a given button would serve as a multifunction as the ESP would be able to verify the current state and duration of the button press by the user and on this basis control not only ON/OFF but also switching between modes.
    .
    Yes, you can use the same button (and the same GPIO) both to wake up the ESP from deep-sleep and as a function button in normal operation. Of course, you must remember to reprogram the selected GPIO before entering deep-sleep mode.

    ftomkiel wrote:
    But in that case, it would be a waste to use the button as a multifunction or at least to shut down the device by holding it down, such a solution is better in terms of battery life but would probably require adding another button responsible for the rest of the functionality to the design.
    .
    Yes, it requires an additional button.

    ftomkiel wrote:
    If I want to use ESP32 would it be best to use Deep Sleep mode as a disabled mode? Such a mode will consume according to the datasheet 15uA + losses on the still running LDO. Is this the way to do it?
    .
    It's difficult for me to say whether this would be the 'best' solution. It all depends on how critical the battery backup time is. Some LDOs can also be put into sleep mode, which will extend this time more. I think a better solution would be to use a buck-boost converter instead of an LDO, making better use of the battery. An example of such a solution is here: Link .
  • ADVERTISEMENT
  • #3 19365096
    ftomkiel
    Level 4  
    khoam wrote:
    I think a better solution would be to use a buck-boost converter instead of an LDO, making better use of the battery. An example of such a solution is here: Link
    .
    Why do you think so? An LDO like the MCP1703 will draw about 2.0µA at idle while the solution you gave me draws about 70µA. Admittedly, the LDO I mentioned only puts out a max of 250mA, but it should be enough for tasks requiring low computing power.
  • ADVERTISEMENT
  • #4 19365103
    khoam
    Level 42  
    The LDO requires a certain input voltage in relation to the output voltage. With battery power, the input voltage for the LDO will decrease and the LDO will stop operating sooner than if a buck-boost converter is used.

    ftomkiel wrote:
    It is true that the LDO I mentioned only outputs a maximum of 250mA, but it should be sufficient for low-power tasks.
    .
    The WiFi transceiver chip alone in the ESP32 at "peak" can consume 240mA.
  • #5 19365409
    ftomkiel
    Level 4  
    khoam wrote:
    The WiFi transceiver chip alone in the ESP32 at "peak" can consume 240 mA.
    .
    I will be using an ESP with one processor core and the only additional function is BLE. Shucks in that case I don't know what to do but a consumption of about 100uA in "off" mode of the device is pretty poor.
ADVERTISEMENT