Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Measuring and Reporting Battery Level

Measuring and Reporting Battery Level

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 2 Posters 2.4k Views 1 Watching
  • 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.
  • E Offline
    E Offline
    esawyja
    wrote on last edited by esawyja
    #1

    Measuring and Reporting Battery Level

    Use a 1MΩ (R1) and 470KΩ (R2) resistor in series, connected to the positive terminal on the battery and ground and then connected the tap point to the A0 input on the CPU.

    The tap point could be bypassed with a 0.1 uF capacitor to keep the noise level low, at this otherwise high impedance point.

    The ADC is set to use the internal reference value of 1.1V - so Vmax at ADCmax = 1.1*(16+4703)/4703 = 3.44V

    The battery power value must be converted to a percentage compatable with your Controller.

    See the following example on how to measure battery level on A0 and report it to the Controller.

    I get different values from one Pro-Mini to the others, the resistors are all the same values and tolerances, "The tap point could be bypassed with a 0.1 uF capacitor to keep the noise level low, at this otherwise high impedance point." How would you connect this capacitor?

    I got mine like this below, is this correct please?
    0_1493623393326_upload-a700c19a-040d-4ce8-9f06-45d7871cd5b0

    S 1 Reply Last reply
    0
    • E esawyja

      Measuring and Reporting Battery Level

      Use a 1MΩ (R1) and 470KΩ (R2) resistor in series, connected to the positive terminal on the battery and ground and then connected the tap point to the A0 input on the CPU.

      The tap point could be bypassed with a 0.1 uF capacitor to keep the noise level low, at this otherwise high impedance point.

      The ADC is set to use the internal reference value of 1.1V - so Vmax at ADCmax = 1.1*(16+4703)/4703 = 3.44V

      The battery power value must be converted to a percentage compatable with your Controller.

      See the following example on how to measure battery level on A0 and report it to the Controller.

      I get different values from one Pro-Mini to the others, the resistors are all the same values and tolerances, "The tap point could be bypassed with a 0.1 uF capacitor to keep the noise level low, at this otherwise high impedance point." How would you connect this capacitor?

      I got mine like this below, is this correct please?
      0_1493623393326_upload-a700c19a-040d-4ce8-9f06-45d7871cd5b0

      S Offline
      S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by sundberg84
      #2

      @esawyja - No, not in series with the analog pin.
      Bypass the point so connect it between R1 and R2 and then go ground.

      Have a look at my EasyPCB schematics:
      https://www.openhardware.io/uploads/568ed84b60aa3f8965fbf095/image/Rev9 Schem.jpg

      This is to smooth the value out/remove noice.
      Another method to do this is to take mulitiple readings and make an average.

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

      1 Reply Last reply
      0
      • E Offline
        E Offline
        esawyja
        wrote on last edited by
        #3

        @sundberg84 aaah ok so across R2, thanks so much!

        1 Reply Last reply
        1

        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
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        64

        Online

        12.0k

        Users

        11.2k

        Topics

        113.4k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular