How to calculate voltage from A0 pin
The analog input pins are 0V-5V strictly. If you need to measure a 9V input, you need to scale the voltage to test so that it is within a 0V-5V range. Often this is done with a voltage divider circuit.

In the example below, the 9V test voltage is divided in half, so the scale is 0V-4.5V, which is within range of the input pin.

Then your algorithm is

vol = sens * (2.0) * ( 5.0 / 1024.0);








simulate this circuit &ndash; Schematic created using CircuitLab