I am trying to monitor the CR2032 battery voltage so that I can switch a red LED on when voltage is going under 2.98V
I thought that trying to read the VIN would be the best way, but there is maybe a better one ?
I made a previous search on the subject on the forum before posting, and all I find is the advice to use a voltage divider, but I do not understand how to implement it.
I am not sure any schematic would help here since there is none.
I am just asking if there is any code line which would allow to read the voltage coming into an arduino ?
Any newcomer that takes the time to understand the forum protocols, and follows in particular the aspect that sufficient information should be provided in the beginning, will maintain my good will. I'm even comfortable with waiving that for a while in a thread, while things get sorted out. But you've been here long enough already to learn how to do that, and you still aren't. So you might get patronizing or bullying-seeming replies when people get frustrated with you. But I will be happy to block you. Done.
That type battery is sold with the understanding that it has a 10 year shelf life. They have a self discharge rate of about 1% per year. So if you do not apply an external load to the battery, it will take a long, long time to discharge and light the LED.
In the end, for me after making many voltage dividers and current measurement things to read the battery's thingies, with the idea being to extend as much as possible battery life, I find the current consumption of those things to be far to limiting to prolonged battery life to include them in working projects; like a weather station or a hexapod.
Point is, the OPdoes appear to be more interested in some form of "political correctness" than providing information essential to the provision of meaningful answers.
Appreciate your straight forward answer, thank you Runaway
You just made me realize that actually most signals coming into Arduinos are plain voltage readings... That is what I am talking about when mentioning a steep learning curve