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.