🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How recognize if CoreInk runs on battery?

    Cores
    4
    4
    5.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Martin8bity
      last edited by

      Is it possible to recognize if CoreInk runs on battery or on USB-C power? Is there detailed schematic anywhere?

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @Martin8bity

        from what I can tell you can't, at least not directly. You can read the battery voltage (GPIO35) so you could poll it a couple of times and if the battery voltage goes up or is steady over time, USB-C power is most likely present. If the battery voltage goes down over time M5CoreInk most likely running from battery.

        In M5CoreInk USB-C power goes through TP4057 (charger) into the battery, from the battery the power goes though a MOSFET (on/off switch) into SY7088 (boost to 5 volts) and then into SY8089 (regulator 3.3 volts) into ESP32 etc.. All three ICs are preconfigured and not on I2C or something, meaning they cannot be queried about their state. For instance to know whether USB-C power is present the LED (red) of TP4057 would need to be queried, but I don't think it is hooked up to a GPIO.

        But then again, I only had my M5CoreInk for a couple for hours so I might very well be missing something.

        Cheers
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • ajb2k3A
          ajb2k3
          last edited by

          Core Ink runs on both battery and USB.

          UIFlow, so easy an adult can learn it!
          If I don't know it, be patient!
          I've ether not learned it or am too drunk to remember it!
          Author of the WIP UIFlow Handbook!
          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

          1 Reply Last reply Reply Quote 0
          • D
            davincino
            last edited by

            This topic is old, but I will reply if it is found through search functions:

            I found a solution, what can be applied with small external hardware modifications. It is possible to take some measurements on HAT interface's pin "5VIN".

            Measured voltages:

            If powered by USB:
            ~4.7V

            Powered by battery and switched off:
            ~0.7V

            Powered by battery and switched on:
            ~2.4V

            Using voltage divider with two same resistors, we get usable logic values for HIGH and LOW ( ~2.3V and ~1.2V). The measured values are not inside garanteed logic range but as a workaround: it works well. Maybe it helps someone else...

            1 Reply Last reply Reply Quote 2
            • First post
              Last post