Detecting the voltage input to the arduino.

So something like this with the positive also going to the main power supply?