ab33t
Are you sure about the master switch?
On most light aircraft the master switch connects the battery to the electrical system via the battery contactor, usualy the appication of ground power automaticly pulls in the ground power contactor to apply ground power to the aircraft systems, this keeps the aircraft battery disconected from the aircraft electrical system.
I could be wrong in the case of the C172 but if so it has an unusual electrical system.