12V battery meter with Arduino MEGA

Ow, one thing I forgot, add a cap (100nF ceramic will do) to the output of the voltage divider. Arduino doesn't like to measure high impedance (top of my head >50k). Cap will add impedance without draining the battery.