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

    Core Ink: recognize if USB or battery powered

    Scheduled Pinned Locked Moved Cores
    5 Posts 3 Posters 5.1k Views 2 Watching
    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.
    • D Offline
      davincino
      last edited by

      Hello,

      I bought the Core Ink for quick prototyping. I am very satisfied with the quality and the possibilities. What I'm missing: How can I tell if the device is USB or battery powered?
      My firmware should provide an access point with a web interface, but only if the device is not running on battery power.

      Current idea: I could use the battery voltage trend to determine whether the battery is charging or discharging. For this I have to check how accurate the internal measurement is. In any case, this implementation would be very cumbersome.

      Maybe there are simpler options?

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

        Please search the forum as this has been discussed and possible solutions created by users.

        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!

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

          @ajb2k3
          Thanks for the hint. Found a 3 years old thread. It is not possible to detect if it is powered from USB or battery...

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

            I checked again electronic circuit:
            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...

            I 1 Reply Last reply Reply Quote 3
            • I Offline
              IsoEek @davincino
              last edited by

              @davincino Thanks for posting your findings.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post