I am starting to learn how to use the PIC16F818 and I would like to build a battery tester. I figured this would be a relatively easy project that I can use. Powering the PIC itself I understand. What I'm not sure will work is the A/D converter.
The batteries I have to test have 9V when fully charged (Measured with Multimeter). However, from what I understand, only a maximum voltage can be applied to any of the PIC pins. I was planning on hooking up the test points to a voltage divider so if a fully charged 9V battery is tested, only 4.5V are applied to the A/D converter of the PIC. Then I would compensate for this difference of 4.5 from the reference voltage of 5V from within the code Then depending on the actually voltage of the test battery certain LEDs would light up. Would this be viable way of doing this circuit?
I can attach a picture of the circuit I drew out if it would help. Any feedback would be appreciated.