I am designing a system focused on the uC ATmega328p and I am feeding it directly with a 3.7V LiPo battery. I also have a 3.3V LDO feeding several sensors in the system.
My question is the next, If I want to read the battery voltage [full charge = 4V, discharged = 3V (approx.)] How should I configure the Vcc, AVcc and AREF pins of ATmega in order to achieve that result?
At the moment I feed the ATmega328p (with internal crystal 8MHz) to the battery voltage and I was thinking of connecting Vcc with AVCC and with the 3.3V that the LDO gives me to connect them to AREF and put the voltage of the battery with a voltage divider to an analog arduino input.
What do you think? Any better solution?
PS: I would not like to add any extra components to the system.
Thank you.