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

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

    日本語フォーラム
    2
    2
    771
    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
      SOMESOME
      last edited by

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

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

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

      W 1 Reply Last reply Reply Quote 0
      • W
        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
        • First post
          Last post