Maybe some edit in my post for better understanding:
This is how I am measuring the values of the battery (45V), and the value of 12V is with other battery. My concern is about having two grounds connected. Whit this way, using the 10 bit resolution of ADC of the Atmega2560, I got decent result.
So this was the question, how to separate them, for a little of security.