OK, now… The 12v source in the diagram is your battery. You’re going to use an LM7805 to regulate that down to 5v. In addition, you’ll have a wall wart with a 3.3v output (or you can use a 5v wall-wart and regulate down to 3.3v, but why not just use a 3.3v wart instead?) Good so far?
Now, the proper way of doing this would be to hook up the 12v side, let the Arduino come online, and then connect the 3.3v input to whatever input pin (I’m using D13 here.) As long as you do this, and the 12v battery never goes away, you’re fine. But, if you ever end up with the battery not being connected – either +12v or Gnd – you will potentially destroy at least the input pin, but possibly also the Arduino itself and the LM7805.
The reason why is because the Arduino will attempt to power itself through the input pin if the main power supply is not there. The pin’s current limits will likely be exceeded, and things will be damaged.
The diode from the 3.3v wart to the 5v power rail guarantees that if the 5v power supply ever goes away, power will flow through that diode to Vcc, and not backwards through the AVR itself.
Likewise, by placing the “backwards” diode around the LM7805, you ensure the regulator’s input is always higher than its output also. That way, if the 3.3v supply is powering the circuit (because the 12v battery is absent), current flows through the left diode and both sides of the LM7805 are roughly equal, making damage to the regulator far less likely.
A couple parts, that costs less than a quarter, and the whole thing is considerably more bullet-proof. One problem we haven’t covered yet is this: If the batteries are offline, and power is coming from the wall-wart, there’s nothing stopping it from going past the input of the regulator, and upstream to anything that might be there – like the charger or a critically depleted battery, or a short to ground. Well, the charger should be diode-isolated so no current should flow there. The flat battery would be essentially a short to ground, so make sure the wall-wart is protected against short-circuits or over-current and you’re good to go.
Going way back to my previous post… Since you’re using an existing battery/charging system: As I said, the charger will almost definitely have a diode in it to make sure power flows out of the charger and into the battery, and never the reverse. This would be helpful to you, because the charger’s output terminals will have voltage when the charger is on, but also when it’s off, because of the battery. You would need to tap from the charger before its output diode to sample the voltage without reading backflow from the battery.
However… there’s a good chance you won’t be able to tap the charger before the diode without tearing into its guts – which is probably not something you want to do. So, using an external power source (like the wall-wart) is probably your next best option. But you should use those two extra diodes to protect the circuit against faults.