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. General Discussion
  3. Read voltage VCC, strange measurement[solved]

Read voltage VCC, strange measurement[solved]

Scheduled Pinned Locked Moved General Discussion
6 Posts 3 Posters 2.0k Views 3 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.
  • F Offline
    F Offline
    flopp
    wrote on last edited by flopp
    #1

    I am using readVCC to read my battery node.
    ATMega328P-PU, like this , home made PCB, Fuses(BOD) is set to 1.8 V

    long readVcc() {
      
      // Read 1.1V reference against AVcc
      ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
      gw.wait(2); // Wait for Vref to settle
      ADCSRA |= _BV(ADSC); // Convert
      while (bit_is_set(ADCSRA,ADSC));
      result = ADCL;
      result |= ADCH<<8;
      result = 1126400L / result; // Back-calculate AVcc in mV
      //return result;
      batteryPcnt = (result - 3300) * 0.111111;
      batteryVolt = result/1000.000;
    }
    

    it is working perfect on many of my nodes but one node have low battery compared to other nodes. They all have same battery type CR123A, 3 volt battery.
    On this node the volt level is 2.4 V. It was not new when I start to use it. It was starting at 2.5V.
    Last month it gives noise/jumping measurement. Going from 2.4 down to 1.9 see below. There are no measurements between 2.4 and 1.9.
    0_1483534070436_chart.png
    From start
    0_1483534137756_chart (1).png

    Anyone seen this before or know what it can be?

    mfalkviddM 1 Reply Last reply
    0
    • F flopp

      I am using readVCC to read my battery node.
      ATMega328P-PU, like this , home made PCB, Fuses(BOD) is set to 1.8 V

      long readVcc() {
        
        // Read 1.1V reference against AVcc
        ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
        gw.wait(2); // Wait for Vref to settle
        ADCSRA |= _BV(ADSC); // Convert
        while (bit_is_set(ADCSRA,ADSC));
        result = ADCL;
        result |= ADCH<<8;
        result = 1126400L / result; // Back-calculate AVcc in mV
        //return result;
        batteryPcnt = (result - 3300) * 0.111111;
        batteryVolt = result/1000.000;
      }
      

      it is working perfect on many of my nodes but one node have low battery compared to other nodes. They all have same battery type CR123A, 3 volt battery.
      On this node the volt level is 2.4 V. It was not new when I start to use it. It was starting at 2.5V.
      Last month it gives noise/jumping measurement. Going from 2.4 down to 1.9 see below. There are no measurements between 2.4 and 1.9.
      0_1483534070436_chart.png
      From start
      0_1483534137756_chart (1).png

      Anyone seen this before or know what it can be?

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @flopp coincells can drain very quickly if too much power is used or if they have low capacity left.

      Is the power consumption of the node approximately the same all the time or does the node sleep?

      If it does sleep, the answer is probably that the chemistry in the battery is able to recover after a while, but the battery does not have much power left.

      F 1 Reply Last reply
      0
      • mfalkviddM mfalkvidd

        @flopp coincells can drain very quickly if too much power is used or if they have low capacity left.

        Is the power consumption of the node approximately the same all the time or does the node sleep?

        If it does sleep, the answer is probably that the chemistry in the battery is able to recover after a while, but the battery does not have much power left.

        F Offline
        F Offline
        flopp
        wrote on last edited by
        #3

        @mfalkvidd said:

        Is the power consumption of the node approximately the same all the time or does the node sleep?

        Thanks
        It is sleeping for 30 minutes. So it can be on the end of the battery life as you say.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          flopp
          wrote on last edited by
          #4

          @mfalkvidd

          you where right.

          This graph will talk for itself :)
          0_1483777894484_chart (2).png

          YveauxY 1 Reply Last reply
          0
          • F flopp

            @mfalkvidd

            you where right.

            This graph will talk for itself :)
            0_1483777894484_chart (2).png

            YveauxY Offline
            YveauxY Offline
            Yveaux
            Mod
            wrote on last edited by
            #5

            @flopp thanks for the feedback!
            Just wondering, how long did it take to get from full to this jumpy state?

            http://yveaux.blogspot.nl

            F 1 Reply Last reply
            0
            • YveauxY Yveaux

              @flopp thanks for the feedback!
              Just wondering, how long did it take to get from full to this jumpy state?

              F Offline
              F Offline
              flopp
              wrote on last edited by flopp
              #6

              @Yveaux
              I don't know because the battery was old when I started to use it.
              Home made pcb. Report every 30 minutes. No cap on battery.
              Take a look at this graph. This may be a new battery, don't remember. Has been running since 1/4 2016
              0_1483800257269_IMG_3616.PNG

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


              20

              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