Measure Battery Level on Vraw by comparing to the ATMega internal voltage. Possible?
-
I've been reading about measuring battery level on Vcc for battery powered setups that don't use any step-up converter by comparing it to the internal 1.1V reference. (examples: http://forum.mysensors.org/topic/186/new-library-to-read-arduino-vcc-supply-level-without-resistors-for-battery-powered-sensor-nodes-that-do-not-use-a-voltage-regulator-but-connect-directly-to-the-batteries ; http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/ )
My question. Is it possible to perform the same measurement to determine the voltage coming in on Vraw. I currently power my boards with 4AA's and use the onboard power regulator (http://forum.mysensors.org/topic/483/2-aa-batteries-with-step-up-converter-to-vcc-pin-vs-3-aa-batteries-to-raw-pin/23).
-
@hooraysimpsons said:
I've been reading about measuring battery level on Vcc for battery powered setups that don't use any step-up converter by comparing it to the internal 1.1V reference. (examples: http://forum.mysensors.org/topic/186/new-library-to-read-arduino-vcc-supply-level-without-resistors-for-battery-powered-sensor-nodes-that-do-not-use-a-voltage-regulator-but-connect-directly-to-the-batteries ; http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/ )
My question. Is it possible to perform the same measurement to determine the voltage coming in on Vraw. I currently power my boards with 4AA's and use the onboard power regulator (http://forum.mysensors.org/topic/483/2-aa-batteries-with-step-up-converter-to-vcc-pin-vs-3-aa-batteries-to-raw-pin/23).
No it's not possible. When using the "internal" vref measuring trick, the battery voltage needs to be connected directly to the supply pins on the atmega chip. This is because it measures the internal VRef against the chip supply voltage.
When you use the onboard voltage regulator (by using Vraw), you are providing the atmega with a regulated 5/3.3V supply (depending on which type of arduino you have). So it will never work without adding voltage divider resistors.
-
@tbowmo my arduino pro mini working fine in 2xAA and connect to Vcc. I can calculate my battery consumption with internal 1V1 voltage function. I dont use internal voltage regulator and battery directly supply to arduino pro mini and radio.
In the future, I wanna test battery connect to step up regulator then connect to radio and arduino pro mini
-
the original question was, if you could connect the supply to Vraw (using 3xAA batteries), and still use the internal Vref to calculate batteryvoltage. This is not possible
Your approach is connecting battery directly to VCC on the atmega (bypassing the onboard voltage regulator). In this case it will work.
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Sending offset to node
Development • 31 Jan 2025, 00:59 • bsl88k 4 Feb 2025, 12:14 -
Saving last known good state, but not in EEPROM
Development • 30 Jan 2024, 18:46 • OldSurferDude 15 Jan 2025, 08:51 -
Home Assistant/MySensors quirks
Development • 16 days ago • OldSurferDude 16 days ago -
MQTT-Help me understand about the MQTT Gateway.
Development • 2 Mar 2025, 01:44 • dpcons 20 days ago -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23