Read battery voltage without resistors.
-
What voltage levels would be acceptable on Aref in that case? Suppose I have a board that has a 12V supply which is regulated to 3.3V.
I have designed a solution so that measurement is cpu triggered. That way, when not measuring, voltage divider is disconnected. -
Sounds no good then. It would not even survive a 5V regulation to 3.3V. Or at least not support it.
-
You can read the battery voltage on arduino without any voltage dividers using a trick. It is described here:
http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/
The trick is to read the value of the internal 1.1V reference against the battery voltage. This is not supported by theanalogRead();command -
@Yveaux just at the function implemented in the MySensors library, your library requires that the sensor is powered directly from battery, not trough the regulator. The discussion started there but has partly moved towards being able to measure Arduinos powered through the regulator.
-
@mfalkvidd said:
The discussion started there but has partly moved towards being able to measure Arduinos powered through the regulator.
Yeah, that's why I also referred to the original thread of vcc measurement. The same thing happened over there and it could be interesting for you guys to read.
-
Not to be pedantic but strictly speaking, the post topic says nothing about this not allowing regulators (and if I recall the other post did not as well, but topic changed during the course of discussion :)). Since the technical level of forum members vary, it is also important to emphasize limitations in a design. It does not necessarily mean the design is bad. I use this feature myself. And I do apologize if my earlier post seemed dismissive of the solution. It is excellent for situations where the arduino is directly battery powered.
-
Yes. There also exist a function for it in development branch in the MyHwxxx implementations. But it does not seem to be available for use so I am guessing it is a feature in developing stages. I think the SenseBender sketch also makes use of it since the SenseBender is a hw that can capitalize on such a feature. I also have it in my sketch for my MySensorsNode board but I have not published a finished sketch. But on the openhardware.io entry for it, there is a codebender sketch that can be examined (very much work in progress).