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

    16340リチウムバッテリー残量の取得

    Scheduled Pinned Locked Moved 日本語フォーラム
    2 Posts 2 Posters 2.0k Views
    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.
    • S Offline
      SOMESOME
      last edited by

      「M5StampS3 Grove Breakout」 で16340リチウムバッテリーで動かしているのですが、16340リチウムバッテリー電池のバッテリー残量を取得するには、どうすればよいでしょうか?

      たぶん、全然間違ってると思いますが、M5.Power.getBatteryLevel() だと -2 が返ってきてダメでした。

      よろしくお願いいたします。

      W 1 Reply Last reply Reply Quote 0
      • W Offline
        wat_nor @SOMESOME
        last edited by

        @SOMESOME

        GPIOの8から、ADCを通した電圧がとれるようです。
        analogRead(8);

        当方では取れた値と計算値で以下のような値が取れてます。

        実測値
        4.16 V ADC 2440 満充電
        3.80 V ADC 2325
        3.71 V ADC 2222
        3.50 V ADC 2100
        3.00 V ADC 1800
        計算値
        3.4 V(警告) ≒ ADC 2036
        3.2 V(機能制限) ≒ ADC 1916
        3.0 V(強制停止) ≒ ADC 1796

        ざっくり実装でよければ
        100% 4.150V
        90& 4.035V
        80% 3.920V
        70% 3.805V
        60% 3.690V
        50% 3.575V
        40% 3.460V
        30% 3.345V
        20% 3.230V
        10% 3.115V

        くらいを見積もればよいのでは、と思われます。

        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