Best or any way to get battery before regulator
-
As I understand after some failed attempt to do a soil moisture sensor with battery check included I can't use any analog pins when using this method described in Battery Powered sensors.
My sensor looks like this:

And this does it impossible to use the VCC library since I have a regulator.
Any other way to get the batterylevel in my setup?
-
As I understand after some failed attempt to do a soil moisture sensor with battery check included I can't use any analog pins when using this method described in Battery Powered sensors.
My sensor looks like this:

And this does it impossible to use the VCC library since I have a regulator.
Any other way to get the batterylevel in my setup?
@Martin-Tellblom why can't you use analog pins? You need one of these to measure. As your battery voltage is lower than the Arduino vcc you do not need a voltage divider. Just connect the battery (+) to an analog pin.
-
If I use this code:
#if defined(__AVR_ATmega2560__) analogReference(INTERNAL1V1); #else analogReference(INTERNAL); #endifAnd try to use the analog pins for this soil moisture sensor the values I get from the other analog pins goes all crazy with its values
-
If I use this code:
#if defined(__AVR_ATmega2560__) analogReference(INTERNAL1V1); #else analogReference(INTERNAL); #endifAnd try to use the analog pins for this soil moisture sensor the values I get from the other analog pins goes all crazy with its values
@Martin-Tellblom don't use the internal reference, stick to the external (default)
-
@AWI How do I do that? This is my first battery node tryout :)
-
@AWI How do I do that? This is my first battery node tryout :)
@Martin-Tellblom Try to comment out the
//analogReference(INTERNAL1V1); -
@AWI So that should be enought? I'll try that
-
@AWI So that should be enought? I'll try that
analogReference(DEFAULT);is the alternative for using a 5v (vcc) reference. -
@AWI But that is always 5V until the end of the battery since I use a step-up or am I thinking completely wrong here
-
@AWI But that is always 5V until the end of the battery since I use a step-up or am I thinking completely wrong here
@Martin-Tellblom The 5 volt is the reference... the analog pin is where you measure with respect to the reference. Try reading this article
-
@Martin-Tellblom The 5 volt is the reference... the analog pin is where you measure with respect to the reference. Try reading this article