Settled on final tuning values for my solar setup
Improved the sketch with a different circuit

The voltage dividers now use a potentiometer for fine tuning, the software
based tuning method was too cumbersome. With the new resistor values, the
SolarMeter is now suitable for a voltage range from 0 to 25 volts.
In addition, the internal 1.1V reference voltage is now used for the ADC,
making the readings a little more precise.