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. How to wire for battery level measure?

How to wire for battery level measure?

Scheduled Pinned Locked Moved Troubleshooting
8 Posts 5 Posters 2.7k Views 2 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.
  • M Offline
    M Offline
    msebbe
    wrote on last edited by
    #1

    I dont understand how to wire if I want to measure battery level at A0 pin.. I have 1MΩ (R1) and 470KΩ (R2) resistor. But how do I connect this?

    AWIA 1 Reply Last reply
    0
    • M msebbe

      I dont understand how to wire if I want to measure battery level at A0 pin.. I have 1MΩ (R1) and 470KΩ (R2) resistor. But how do I connect this?

      AWIA Offline
      AWIA Offline
      AWI
      Hero Member
      wrote on last edited by AWI
      #2

      @msebbe put the two resistors in series between Vcc (Vin) and Gnd and connect the middle ( Vout) to the A0 pin. If you connect the 1 MOhm (R2) to ground, the voltage on the A0 pin is then two third (2/3) times Vcc. This is called a voltage divider.

      upload-bd638a77-6e7f-4f89-b083-8e7ce3c24856

      M 1 Reply Last reply
      1
      • AWIA AWI

        @msebbe put the two resistors in series between Vcc (Vin) and Gnd and connect the middle ( Vout) to the A0 pin. If you connect the 1 MOhm (R2) to ground, the voltage on the A0 pin is then two third (2/3) times Vcc. This is called a voltage divider.

        upload-bd638a77-6e7f-4f89-b083-8e7ce3c24856

        M Offline
        M Offline
        msebbe
        wrote on last edited by msebbe
        #3

        @AWI said:

        @msebbe put the two resistors in series between Vcc (Vin) and Gnd and connect the middle ( Vout) to the A0 pin. If you connect the 1 MOhm (R2) to ground, the voltage on the A0 pin is then two third (2/3) times Vcc. This is called a voltage divider.

        upload-bd638a77-6e7f-4f89-b083-8e7ce3c24856

        1M to grund? In example from mysensors picture says 1M to vcc.

        Also, could I wire so both resistors meet at A0 or how do you do it?

        SparkmanS 1 Reply Last reply
        0
        • m26872M Offline
          m26872M Offline
          m26872
          Hardware Contributor
          wrote on last edited by
          #4

          Vin = Vbat
          Vout = A0
          R1= 1M
          R2 = 470k

          1 Reply Last reply
          1
          • M msebbe

            @AWI said:

            @msebbe put the two resistors in series between Vcc (Vin) and Gnd and connect the middle ( Vout) to the A0 pin. If you connect the 1 MOhm (R2) to ground, the voltage on the A0 pin is then two third (2/3) times Vcc. This is called a voltage divider.

            upload-bd638a77-6e7f-4f89-b083-8e7ce3c24856

            1M to grund? In example from mysensors picture says 1M to vcc.

            Also, could I wire so both resistors meet at A0 or how do you do it?

            SparkmanS Offline
            SparkmanS Offline
            Sparkman
            Hero Member
            wrote on last edited by
            #5

            @msebbe said:

            Also, could I wire so both resistors meet at A0?

            Yes, that is fine.

            Cheers
            Al

            1 Reply Last reply
            1
            • M Offline
              M Offline
              msebbe
              wrote on last edited by
              #6

              Ok, thank you guys, will try this tomorrow when I have a whole day free :D

              1 Reply Last reply
              0
              • Cliff KarlssonC Offline
                Cliff KarlssonC Offline
                Cliff Karlsson
                wrote on last edited by
                #7

                @AWI said:

                resistors in series between Vcc (Vin) and Gnd and con

                Trying to figure out the same thing. Did I understand correctly that I could solder 1M Resistor from VCC to A0 and 470k Resistor from GND to A0 ?

                AWIA 1 Reply Last reply
                0
                • Cliff KarlssonC Cliff Karlsson

                  @AWI said:

                  resistors in series between Vcc (Vin) and Gnd and con

                  Trying to figure out the same thing. Did I understand correctly that I could solder 1M Resistor from VCC to A0 and 470k Resistor from GND to A0 ?

                  AWIA Offline
                  AWIA Offline
                  AWI
                  Hero Member
                  wrote on last edited by
                  #8

                  @Cliff-Karlsson You could do just that. The voltage on the A0 pin will be around 1/3th of Vcc. If you swap the resistors 2/3th of Vcc.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  17

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.1k

                  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