5V rail connected to 12V via 10K resistor ok?

But when G is grounded, it's okay, correct?

Yes but that gets you no where. As soon as you do not ground it you fry your pin.